Skip to main content

Overview

This endpoint returns the current status of an async chat request. Use it to poll until the answer is ready. The endpoint is read-only and safe to call frequently. Typical completion time is 5-30 seconds; most requests complete within the first 10 seconds.

Authentication

Requires API key in the X-API-Key header:

Path parameters

string
required
The site ID.
string
required
The request ID from the async chat submission response.

Request example

Response schema

string
The session identifier for this conversation.
string
The request ID.
string
One of: pending, completed, failed.
  • pending: The request is still processing.
  • completed: The answer is ready (see answer field).
  • failed: The request failed (see error field).
string
The assistant’s response. Only present when status is completed.
string
Error description if the request failed. Only present when status is failed.Examples: "failed to call rag service", "site not found".

Response examples

Pending

Completed

Failed

Error responses

400 Bad Request

Invalid path parameters (e.g., malformed request ID).

401 Unauthorized

API key is missing, invalid, expired, or revoked.

403 Forbidden

The API key’s plan does not include M2M API access.

404 Not Found

The site or request does not exist.
Common causes:
  • Wrong site ID
  • Wrong request ID
  • Request has expired or been deleted
  • Request belongs to a different site

500 Internal Server Error

An unexpected error occurred.

Implementation tips

Polling loop pattern

Optimal polling interval

  • First poll: Wait 1-2 seconds (processing takes time)
  • Subsequent polls: 1-2 second intervals
  • Max attempts: 120-300 (2-5 minutes)
Most requests complete in 5-30 seconds. Waiting longer helps avoid thundering herd and reduces API load.

Handling partial failures

If the status endpoint returns 5xx errors, implement exponential backoff:

Tracking in a database

Store the request ID and check status later: