Skip to content
AskTable

Documentation feedback

Current pageREST API/en/integrations/openapi

0 / 5,000

Your feedback will be sent to the maintenance team.

Go to console
Go to console
AskTable
Go to console

Integrations and development

Connect question answering to business systems with the REST API

Use the REST API to choose an agent, create a conversation, send questions, and read results.

The REST API suits connecting question answering to business systems, portals, or automation. The flow is: choose an agent → create a conversation → send a question → read the result. For all endpoints and fields, see the API documentation: api.asktable.com/v1/redoc for Cloud, and the table below for private deployments.

API addresses

The API address differs from the website address:

DeploymentWebsite exampleAPI rootAPI documentation
AskTable Cloudhttps://cloud.asktable.comhttps://api.asktable.com/v1https://api.asktable.com/v1/redoc
Private deployment (all-in-one image)https://asktable.example.comhttps://asktable.example.com/api/v1https://asktable.example.com/api/v1/redoc
  • The all-in-one image forwards requests to the backend through /api/. Requesting https://asktable.example.com/v1 directly returns a web page, not the API.
  • When deployed under a subpath, include it, such as https://example.com/asktable/api/v1.
  • When the backend is deployed separately with its own API domain, follow the actual gateway configuration.
  • The same location also has Swagger UI (/v1/docs) and the OpenAPI description file (https://api.asktable.com/openapi.json for Cloud, /api/openapi.json for the all-in-one image).
  • “Connection info” on the “Agent integrations” page lets you copy the current instance's service address and project ID.

The examples below use $API for the API root.

Authentication

Authorization: Bearer YOUR_API_KEY
X-Project-Id: YOUR_PROJECT_ID

Create API keys in “Agent integrations”. The full value is shown only once at creation, and you can set an expiry.

KeyManaged byRuns as
Personal keyCreated and revoked by the user; administrators cannot see other people's personal keysThe user's current project permissions, agent access, and data role; cannot be overridden by request parameters
System integration key (asker)Project owners or administratorsCan call all agents in the project; the trusted server specifies the data role and variables
System integration key (admin)Project owners or administratorsCan also manage project infrastructure such as data sources and semantic configuration; cannot read or write personal agents, skills, documents, channels, or scheduled task configuration

Each project can have up to 10 personal keys (all members combined) and 20 system integration keys; expired but unrevoked keys also count. See Quotas and limits.

Ask a question

List agents

curl "$API/data-agents" \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'X-Project-Id: YOUR_PROJECT_ID'

Create a conversation

Create a conversation with an agent ID; success returns HTTP 201 and the conversation id. Creating a conversation does not send a question.

curl -X POST "$API/conversations" \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'X-Project-Id: YOUR_PROJECT_ID' \
  -H 'Content-Type: application/json' \
  -d '{"data_agent_id":"00000000-0000-0000-0000-000000000000"}'

When a system integration key needs to specify a data identity, add role_id and role_variables when creating the conversation:

{
  "data_agent_id": "00000000-0000-0000-0000-000000000000",
  "role_id": "role_xxxxxxxx",
  "role_variables": { "dept_id": "D001" }
}

A system integration key without a role applies no role filtering. Roles and variables must be decided by your server; do not accept values passed directly by visitors.

Send a question

Returns HTTP 202 and {"status":"accepted"}, meaning execution has started, not that an answer exists. question can be up to 4096 characters.

curl -X POST "$API/conversations/YOUR_CONVERSATION_ID/messages" \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'X-Project-Id: YOUR_PROJECT_ID' \
  -H 'Content-Type: application/json' \
  -d '{"question":"Analyze the orders from yesterday and list the main changes"}'

Read the result

GET $API/conversations/YOUR_CONVERSATION_ID and check status, messages, and error_detail:

  • pending, streaming: still running; poll at intervals with an overall timeout. To show the process live, use the SSE endpoint in the API documentation.
  • clarifying: the agent is waiting for clarification; submit an answer per the API documentation, or have the user handle it in the web app.
  • The answer is in the assistant message's content array, as text blocks.

To follow up, send another message to the same conversation's /messages.

API migration (from 4.2.68)

Organization, project, member, and sharing endpoints have been unified, and the old addresses no longer work. Integrators that call the API directly must update:

Old address or parameterNew address or parameter
/auth/projects and subpaths/v1/projects and the corresponding subpaths
/v1/project, /v1/user/projects/v1/projects/current
Current project member endpoints/v1/members
/v1/member-data-roles/v1/members/data-roles; for one member, /v1/members/{user_id}/data-role
/auth/organizations and old current-organization paths/v1/organizations, /v1/organizations/{org_id}
Conversation and dashboard .../share.../share-link
Agent .../access.../people-access
scope=all for agents, skills, and scheduled tasksscope=managed (passing all fails parameter validation)
POST /v1/integration/queryRemoved; use the agent conversation flow above

Member candidate endpoints (/v1/members/candidates, /v1/projects/{project_id}/member-candidates) now return paginated responses; read members from items and fetch page by page when you need the full list.

Separately deployed CLI, AskTable Skill, and MCP must be upgraded to versions matching the server. See CLI and MCP.

Before going live

  1. Use a separate key for each application or environment, granting only the needed capabilities.
  2. Keep keys only on trusted servers or in controlled client configuration, never in web pages, iframes, or code repositories.
  3. Set timeouts and retry limits, and distinguish authentication failures, permission denials, parameter errors, and execution failures.
  4. Log the project, time, duration, HTTP status, and conversation ID, not complete sensitive questions and answers.

Common errors

HTTP statusError codeCauseAction
HTML page returned—The address lacks the /api prefixUse the correct API root above
401AUTH_ERRORMissing, malformed, expired, or revoked keyCheck the Bearer format and key status
403PERMISSION_DENIEDProject role, agent access, or resource ownership does not allow itFor personal keys, check your permissions; for system operations, check the key type
403MEMBER_ROLE_VARIABLES_MISSINGThe member's data role is missing variablesAn administrator completes them; see Data permissions
403RESOURCE_QUOTA_EXCEEDEDCreating keys or other resources exceeds the limitRevoke unused resources
404—A removed old endpoint was calledUpdate per the migration table
422VALIDATION_ERRORMissing or wrongly typed parameters, such as no data_agent_id or scope=allFix the fields named in message

When there is still no answer long after a 202, check the conversation's status and error_detail; do not create the conversation again. For more error codes, see Error codes.