Skip to main content

REST API

Dialog analysis is a long-running operation. Submit a request and poll for the result. Output is retained for 24 hours after completion.

Authentication

Supply your API key in the X-Api-Key header.

curl -X POST https://api.example.com/v2/dialog_analyses \
-H "Content-Type: application/json" \
-H "X-Api-Key: YOUR_API_KEY" \
-d '{"input": {...}}'

Requesting Analysis

Request

POST /v2/dialog_analyses
{
"input": {
"messages": [...],
"language": "English",
"current_profile": {...},
"profile_schema": {...},
"feedback_schema": {...},
"prompt_extra_text": "..."
}
}

Response

{
"id": "/v2/dialog_analyses/123",
"state": "in-progress",
"created_at": "2024-12-06T15:30:00.000Z"
}

Checking Status

Request

GET /v2/dialog_analyses/{id}

Response (Completed)

{
"id": "/v2/dialog_analyses/123",
"state": "completed",
"created_at": "2024-12-06T15:30:00.000Z",
"server_runtime": 12,
"output": {
"profile": {...},
"feedback": {...}
}
}

Possible States

StateDescription
in-progressAnalysis is being processed. Poll again later.
completedAnalysis finished successfully. The output field contains results.
failedAnalysis failed after all retry attempts.

Error Responses

Validation Error (422)

Returned when the request payload is invalid.

{
"message": "The given data was invalid.",
"errors": {
"input.profile_schema.age.type": ["The type must be string."]
}
}

Input Size Exceeded (422)

Returned when the total payload exceeds the maximum allowed size.

{
"message": "The given data was invalid.",
"errors": {
"input": ["Total payload size (150000 characters) exceeds maximum allowed (100000 characters)."]
}
}

Rate Limited (429)

Returned when rate limits are exceeded.

{
"message": "Too Many Attempts."
}