Job analysis API
Job analysis API
Use the job analysis API to analyze a job's recording and transcript. The endpoint supports the built-in quality analysis and custom analysis with a prompt and JSON Schema.
The API stores each analysis request and its result. By default, repeated requests reuse an existing queued, processing, or completed analysis for the same job, prompt, and schema. Use force=true to create a new analysis.
Authentication
Use regular Dasha customer authentication:
Authorization: Bearer <DASHA_API_KEY>
The token's customer must own the job. The account must also have job analysis enabled.
Start analysis
POST /api/v1/jobs/{jobId}/analyze
Query parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
force | boolean | false | Create a new analysis instead of reusing an existing queued, processing, or completed analysis for the same inputs. |
sync | boolean | false | Keep the HTTP request open while the service polls for a terminal result. |
syncTimeoutSeconds | integer | 60 | Maximum wait time when sync=true. Accepted range: 1 to 120. |
The request body is optional. Omit it, or send {}, to run the built-in quality analysis:
curl -X POST "$DASHA_API_BASE_URL/api/v1/jobs/$JOB_ID/analyze" \ -H "Authorization: Bearer $DASHA_API_KEY" \ -H "Content-Type: application/json" \ -d '{}'
Send both prompt and schema to run a custom analysis:
curl -X POST "$DASHA_API_BASE_URL/api/v1/jobs/$JOB_ID/analyze?sync=true&syncTimeoutSeconds=90" \ -H "Authorization: Bearer $DASHA_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "prompt": "Analyze the conversation. Return an NPS score from 0 to 10. Also report whether the agent greeted the customer and asked if it was a good time to talk.", "schema": { "type": "object", "properties": { "nps": { "type": "integer", "minimum": 0, "maximum": 10 }, "scorecard": { "type": "object", "properties": { "greetedCustomer": { "type": "boolean" }, "askedGoodTimeToTalk": { "type": "boolean" } }, "required": ["greetedCustomer", "askedGoodTimeToTalk"] } }, "required": ["nps", "scorecard"] } }'
Custom analysis requests must meet these rules:
- Provide
promptandschematogether. - Keep
promptat 8000 characters or fewer. - Keep serialized
schemaat 32000 characters or fewer. - Use
objectas the root schema type. - Use only these schema keywords:
type,properties,required,items,enum,description,additionalProperties,minItems,maxItems,minLength,maxLength,minimum, andmaximum.
Response
POST returns 202 Accepted while analysis is queued or processing. It returns 200 OK when it can return a terminal result, including a cached completed result or a sync request that finishes before the timeout.
{ "analysisId": "0b716598-3d3a-4fd9-8b8c-4a6b27710f3a", "jobId": "019df6cf-6526-7277-b742-cb19ba6fdfec", "analysisType": "custom", "status": "completed", "createdAt": "2026-05-25T08:10:11.123456+00:00", "updatedAt": "2026-05-25T08:10:35.123456+00:00", "result": { "nps": 7, "scorecard": { "greetedCustomer": true, "askedGoodTimeToTalk": false } }, "error": null }
Response fields:
| Field | Type | Description |
|---|---|---|
analysisId | string | Unique analysis request ID. |
jobId | string | Job ID from the URL. |
analysisType | string | quality for built-in analysis or custom for prompt/schema analysis. |
status | string | queued, processing, completed, or failed. |
createdAt | string | Analysis creation timestamp. |
updatedAt | string | Last analysis update timestamp. |
result | object or null | JSON result when status is completed; otherwise null. |
error | object or null | Error details when status is failed; otherwise null. |
Error response codes:
| Status | Meaning |
|---|---|
400 Bad Request | The request body, schema, or sync timeout is invalid. |
403 Forbidden | The token is not authorized, or the account cannot use job analysis. |
404 Not Found | The job or analysis does not exist for the authenticated customer. |
Retrieve analyses
List all stored analyses for a job:
curl "$DASHA_API_BASE_URL/api/v1/jobs/$JOB_ID/analyze" \ -H "Authorization: Bearer $DASHA_API_KEY"
Response:
{ "items": [ { "analysisId": "0b716598-3d3a-4fd9-8b8c-4a6b27710f3a", "jobId": "019df6cf-6526-7277-b742-cb19ba6fdfec", "analysisType": "custom", "status": "completed", "createdAt": "2026-05-25T08:10:11.123456+00:00", "updatedAt": "2026-05-25T08:10:35.123456+00:00", "result": { "nps": 7, "scorecard": { "greetedCustomer": true, "askedGoodTimeToTalk": false } }, "error": null } ] }
Get one analysis by ID:
curl "$DASHA_API_BASE_URL/api/v1/jobs/$JOB_ID/analyze/$ANALYSIS_ID" \ -H "Authorization: Bearer $DASHA_API_KEY"
Delete all stored analyses for a job:
curl -X DELETE "$DASHA_API_BASE_URL/api/v1/jobs/$JOB_ID/analyze" \ -H "Authorization: Bearer $DASHA_API_KEY"
DELETE returns 204 No Content.