Skip to main content
A
Docs

API conventions

Base addresses, authentication, request and response formats, errors and health checks that all Anar product APIs share.

Base addresses

Each product has its own API address. Anar gives you the addresses during deployment. In these docs, https://chat.example.gov and similar names stand for those addresses.

All product API paths start with /api/v1. The Gateway uses the OpenAI paths under /v1.

Authentication

Send a bearer token in the Authorization header of each request:

curl https://chat.example.gov/api/v1/chat/conversations \
  -H "Authorization: Bearer $TOKEN"

Read Sign-in and roles for tokens and roles.

Requests and responses

  • Request and response bodies are JSON, unless the endpoint uploads or downloads a file.
  • File uploads use multipart/form-data with a field named file.
  • Dates and times use ISO 8601 in UTC, for example 2026-11-18T09:30:00Z.
  • Identifiers are strings.
  • Text fields accept Arabic and English.

Long tasks

Some tasks take time, such as a transcription or a workflow run. For these tasks, the API returns at once with an identifier and a status. Get the status again later, or follow the stream where the API reference gives one.

Streaming

Endpoints that stream use server-sent events. Read each event as it arrives. Close the connection when the stream ends.

Errors

Product APIs return errors in this format:

{"detail": "Meeting not found"}

A request body that fails validation returns 422 with a list of the fields in error. Read Error codes.

Health

Each product answers a health check without a token. The API reference of each product gives the path. Use it for monitoring.