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:
| Deployment | Website example | API root | API documentation |
|---|---|---|---|
| AskTable Cloud | https://cloud.asktable.com | https://api.asktable.com/v1 | https://api.asktable.com/v1/redoc |
| Private deployment (all-in-one image) | https://asktable.example.com | https://asktable.example.com/api/v1 | https://asktable.example.com/api/v1/redoc |
- The all-in-one image forwards requests to the backend through
/api/. Requestinghttps://asktable.example.com/v1directly 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.jsonfor Cloud,/api/openapi.jsonfor 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_IDCreate API keys in “Agent integrations”. The full value is shown only once at creation, and you can set an expiry.
| Key | Managed by | Runs as |
|---|---|---|
| Personal key | Created and revoked by the user; administrators cannot see other people's personal keys | The user's current project permissions, agent access, and data role; cannot be overridden by request parameters |
System integration key (asker) | Project owners or administrators | Can call all agents in the project; the trusted server specifies the data role and variables |
System integration key (admin) | Project owners or administrators | Can 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
contentarray, astextblocks.
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 parameter | New 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 tasks | scope=managed (passing all fails parameter validation) |
POST /v1/integration/query | Removed; 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
- Use a separate key for each application or environment, granting only the needed capabilities.
- Keep keys only on trusted servers or in controlled client configuration, never in web pages, iframes, or code repositories.
- Set timeouts and retry limits, and distinguish authentication failures, permission denials, parameter errors, and execution failures.
- Log the project, time, duration, HTTP status, and conversation ID, not complete sensitive questions and answers.
Common errors
| HTTP status | Error code | Cause | Action |
|---|---|---|---|
| HTML page returned | — | The address lacks the /api prefix | Use the correct API root above |
| 401 | AUTH_ERROR | Missing, malformed, expired, or revoked key | Check the Bearer format and key status |
| 403 | PERMISSION_DENIED | Project role, agent access, or resource ownership does not allow it | For personal keys, check your permissions; for system operations, check the key type |
| 403 | MEMBER_ROLE_VARIABLES_MISSING | The member's data role is missing variables | An administrator completes them; see Data permissions |
| 403 | RESOURCE_QUOTA_EXCEEDED | Creating keys or other resources exceeds the limit | Revoke unused resources |
| 404 | — | A removed old endpoint was called | Update per the migration table |
| 422 | VALIDATION_ERROR | Missing or wrongly typed parameters, such as no data_agent_id or scope=all | Fix 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.