Ask a Question

POST https://app.resemble.ai/api/v2/detects/{uuid}/intelligence

Submit a natural-language question about a completed detection report. The API responds immediately with a question UUID while the answer is generated in the background.

Path Parameters

ParameterTypeRequiredDescription
uuidstringYesUUID of the completed detection report.

Request Body

FieldTypeRequiredDescription
querystringYesThe natural-language question to ask about the detection.

Example

$curl --request POST 'https://app.resemble.ai/api/v2/detects/550e8400-e29b-41d4-a716-446655440000/intelligence' \
> -H 'Authorization: Bearer YOUR_API_TOKEN' \
> -H 'Content-Type: application/json' \
> --data '{"query": "Summarize the detection results in plain language."}'

Response (202 Accepted)

1{
2 "success": true,
3 "item": {
4 "uuid": "650e8400-e29b-41d4-a716-446655440001",
5 "detect_uuid": "550e8400-e29b-41d4-a716-446655440000",
6 "query": "Summarize the detection results in plain language.",
7 "answer": null,
8 "status": "pending",
9 "error_message": null,
10 "created_at": "2024-01-15T10:35:00Z",
11 "updated_at": "2024-01-15T10:35:00Z"
12 }
13}

Use the returned uuid to poll the Get Answer endpoint until the answer is ready.

Error Responses

StatusConditionExample
400Missing query{"success": false, "message": "query is required"}
404Detection not found{"success": false, "message": "Detect not found"}
422Detection not completed{"success": false, "message": "Detection must be completed before asking questions"}