API reference
Generated from the API’s OpenAPI document when the docs are built, so it always matches the
API. Send every request with Authorization: Bearer tero_YOUR_API_KEY; see
API keys.
Base URL https://platform.teroatlas.ai/v1 · OpenAPI 3.1.0 document: /v1/openapi.json · API version 1.0.0
Account
Who this credential acts as
GET/me
The credential's type and scopes, the user it acts as, and its organization. The organization always comes from the credential.
Requires the usage:read scope: read the organization's usage and quota. Rate limit: 60 requests a minute per credential.
curl "https://platform.teroatlas.ai/v1/me" \
-H "Authorization: Bearer tero_YOUR_API_KEY"Response 200
The credential, user and organization. Content type: application/json.
| Field | Type |
|---|---|
credentialrequired | object |
credential.typerequired | "api_key" | "oauth" |
credential.idrequired | string |
credential.scopesrequired | "data:read" | "data:query" | "conversations:read" | "conversations:write" | "usage:read"[] |
userrequired | object |
user.user_idrequired | string |
user.emailrequired | string | null |
user.namerequired | string | null |
organizationrequired | object |
organization.org_idrequired | string |
organization.namerequired | string | null |
organization.planrequired | string | null |
Example response
{
"credential": {
"type": "api_key",
"id": "key_01",
"scopes": [
"data:read",
"data:query",
"usage:read"
]
},
"user": {
"user_id": "user_01",
"email": "[email protected]",
"name": "Dev Example"
},
"organization": {
"org_id": "org_01",
"name": "Example Corp",
"plan": "team"
}
}Errors
401Missing, unknown, expired or revoked credential. Codes: invalid_credentials.403API access is off for the organization, the credential lacks the scope, the user's access expired, the dataset belongs to a product the organization does not have, or the product does not offer the feature (maps for Site Selection). Codes: api_access_disabled, insufficient_scope, access_expired, feature_disabled, product_not_entitled.429Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.500Unexpected error. Quoterequest_idto support. Codes: internal_error.
Token usage and quota
GET/usage
Tokens the organization has used this period, its monthly limit, and when it resets, plus every limit that applies (limits): the week (resets Tuesday 07:00 America/New_York), the month, the credential's user this week on plans with a member limit, a trial's allowance, and Site Selection analyses. The public API stops at the first limit used up.
Requires the usage:read scope: read the organization's usage and quota. Rate limit: 60 requests a minute per credential.
curl "https://platform.teroatlas.ai/v1/usage" \
-H "Authorization: Bearer tero_YOUR_API_KEY"Response 200
Usage this period. Content type: application/json.
| Field | Type | Description |
|---|---|---|
tokens_usedrequired | integer | |
token_limitrequired | integer | |
percent_usedrequired | number | |
resets_atrequired | string | null | When the quota next resets, at 00:00 UTC. Null when it does not reset on a schedule, as during a trial. |
planrequired | string | null | |
limitsrequired | object[] | Every limit that applies to the organization. A request is refused with token_limit_exceeded when any token limit is used up. |
limits[].scoperequired | "member_week" | "week" | "month" | "trial" | "runs" | What the limit counts: tokens this week (week), this usage month (month), the credential's user this week (member_week), a trial's whole allowance (trial), or Site Selection analyses (runs). |
limits[].usedrequired | integer | |
limits[].limitrequired | integer | |
limits[].resets_atrequired | string | null | When the counter next resets. Weeks start Tuesday 07:00 America/New_York. Null when it does not reset, as during a trial. |
limits[].ends_at | string | null | Trial only: when the trial ends. |
Example response
{
"tokens_used": 9000000,
"token_limit": 50000000,
"percent_used": 18,
"resets_at": "2026-12-01T00:00:00.000Z",
"plan": "team",
"limits": [
{
"scope": "week",
"used": 3100000,
"limit": 12500000,
"resets_at": "2026-12-01T12:00:00.000Z"
},
{
"scope": "month",
"used": 9000000,
"limit": 50000000,
"resets_at": "2026-12-01T00:00:00.000Z"
},
{
"scope": "member_week",
"used": 1200000,
"limit": 5000000,
"resets_at": "2026-12-01T12:00:00.000Z"
}
]
}Errors
401Missing, unknown, expired or revoked credential. Codes: invalid_credentials.403API access is off for the organization, the credential lacks the scope, the user's access expired, the dataset belongs to a product the organization does not have, or the product does not offer the feature (maps for Site Selection). Codes: api_access_disabled, insufficient_scope, access_expired, feature_disabled, product_not_entitled.429Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.500Unexpected error. Quoterequest_idto support. Codes: internal_error.
This document
GET/openapi.json
The OpenAPI 3.1 description of this API. Public: no credential needed.
curl "https://platform.teroatlas.ai/v1/openapi.json" \
-H "Authorization: Bearer tero_YOUR_API_KEY"Response 200
The OpenAPI document. Content type: application/json.
None.
Questions
List datasets
GET/schemas
The datasets the organization's products cover. Pass a name as schema when starting a conversation.
Requires the data:read scope: list the available datasets. Rate limit: 60 requests a minute per credential.
curl "https://platform.teroatlas.ai/v1/schemas" \
-H "Authorization: Bearer tero_YOUR_API_KEY"Response 200
The datasets. Content type: application/json.
| Field | Type |
|---|---|
schemasrequired | object[] |
schemas[].namerequired | string |
schemas[].table_countrequired | integer | null |
schemas[].column_countrequired | integer | null |
Example response
{
"schemas": [
{
"name": "congressional_districts",
"table_count": 4,
"column_count": 61
}
]
}Errors
401Missing, unknown, expired or revoked credential. Codes: invalid_credentials.402The organization's billing is not active. Codes: billing_inactive.403API access is off for the organization, the credential lacks the scope, the user's access expired, the dataset belongs to a product the organization does not have, or the product does not offer the feature (maps for Site Selection). Codes: api_access_disabled, insufficient_scope, access_expired, feature_disabled, product_not_entitled.429Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.500Unexpected error. Quoterequest_idto support. Codes: internal_error.503The analysis service failed or did not answer in time.upstream_timeoutis sent with aRetry-Afterheader. Codes: upstream_unavailable, upstream_timeout.
Ask a data question
POST/questions
Asks a question in plain language and returns the answer, the SQL that produced it, and up to 1000 result rows. Omit conversation_id to start a conversation; pass it to ask a follow-up, up to 10 questions per conversation. Answers can take a while: by default the call waits up to 90 seconds and then fails with upstream_timeout. With stream: true the response is a text/event-stream that sends a comment every 15 seconds and ends with one result event, carrying this response body, or one error event, carrying the error envelope. Spends tokens from the organization's quota.
Requires the data:query scope: ask questions and generate charts, maps, reports and SQL explanations. Rate limit: 10 requests a minute per credential.
curl -X POST "https://platform.teroatlas.ai/v1/questions" \
-H "Authorization: Bearer tero_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"question":"<question>"}'Request body
| Field | Type | Description |
|---|---|---|
questionrequired | string | 1 to 4000 characters. |
conversation_id | string | |
schema | string | The dataset to ask, by name from GET /v1/schemas, for a new conversation. Omit it to use the organization's default. A follow-up always uses its conversation's dataset; naming another fails with schema_mismatch. A dataset of a product the organization does not have fails with product_not_entitled. |
mode | "standard" | "analysis" | |
stream | boolean | |
include | "geometries"[] |
Response 200
The answer, or an event stream when stream is true. Content type: application/json, text/event-stream.
| Field | Type | Description |
|---|---|---|
message_idrequired | string | |
conversation_idrequired | string | |
answerrequired | string | |
sqlrequired | string | null | |
rowsrequired | object[] | |
row_countrequired | integer | |
rows_truncatedrequired | boolean | |
geography_idsrequired | string[] | |
execution_time_msrequired | number | null | |
tokensrequired | object | |
tokens.inputrequired | integer | |
tokens.outputrequired | integer | |
tokens.totalrequired | integer | |
usagerequired | object | |
usage.tokens_usedrequired | integer | |
usage.token_limitrequired | integer | |
usage.percent_usedrequired | number | |
usage.resets_atrequired | string | null | When the quota next resets, at 00:00 UTC. Null when it does not reset on a schedule, as during a trial. |
geometries | any |
Example response
{
"message_id": "m7b2c4d6-1a3e-4f5a-8b9c-0d1e2f3a4b5c",
"conversation_id": "c3a1f0d2-6c55-4b8e-9d0a-1f2e3d4c5b6a",
"answer": "Texas has 38 congressional districts.",
"sql": "SELECT COUNT(*) AS districts FROM congressional_districts WHERE state = 'TX'",
"rows": [
{
"districts": 38
}
],
"row_count": 1,
"rows_truncated": false,
"geography_ids": [],
"execution_time_ms": 1830,
"tokens": {
"input": 1200,
"output": 300,
"total": 1500
},
"usage": {
"tokens_used": 121500,
"token_limit": 2500000,
"percent_used": 4.9,
"resets_at": "2026-11-01T00:00:00.000Z"
}
}Errors
400The request is not valid.details.issueslists the fields. Codes: invalid_request.401Missing, unknown, expired or revoked credential. Codes: invalid_credentials.402The organization's billing is not active. Codes: billing_inactive.403API access is off for the organization, the credential lacks the scope, the user's access expired, the dataset belongs to a product the organization does not have, or the product does not offer the feature (maps for Site Selection). Codes: api_access_disabled, insufficient_scope, access_expired, feature_disabled, product_not_entitled.404Not found, or owned by another user or organization. Codes: not_found.409The conversation reached its 10-question limit, or a follow-up names a dataset other than its conversation's. Codes: conversation_limit_reached, schema_mismatch.413The request body is over 1 MB. Codes: payload_too_large.429Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.500Unexpected error. Quoterequest_idto support. Codes: internal_error.503The analysis service failed or did not answer in time.upstream_timeoutis sent with aRetry-Afterheader. Codes: upstream_unavailable, upstream_timeout.
Conversations
List conversations
GET/conversations
The credential user's conversations in this organization, most recently updated first. By default only conversations started through the API or an MCP client; pass source=app or source=all to include those started in the TeroAI web app.
Requires the conversations:read scope: read conversations, answers and result rows. Rate limit: 60 requests a minute per credential.
curl "https://platform.teroatlas.ai/v1/conversations" \
-H "Authorization: Bearer tero_YOUR_API_KEY"Parameters
| Field | Type | Description |
|---|---|---|
limit | integer · query | 1 to 100, default 20. |
offset | integer | null · query | default 0. |
source | "api" | "mcp" | "app" | "all" · query | Which conversations to list: api, mcp, app (started in the TeroAI web app), or all. Without it, conversations from the API and MCP clients only. |
Response 200
A page of conversations. Content type: application/json.
| Field | Type | Description |
|---|---|---|
conversationsrequired | object[] | |
conversations[].conversation_idrequired | string | |
conversations[].titlerequired | string | null | |
conversations[].schemarequired | string | null | |
conversations[].message_countrequired | integer | |
conversations[].branched_fromrequired | string | null | |
conversations[].sourcerequired | "app" | "api" | "mcp" | Where the conversation started: the TeroAI web app, the REST API, or an MCP client. |
conversations[].created_atrequired | string | |
conversations[].updated_atrequired | string | |
totalrequired | integer | |
limitrequired | integer | |
offsetrequired | integer |
Example response
{
"conversations": [
{
"conversation_id": "c3a1f0d2-6c55-4b8e-9d0a-1f2e3d4c5b6a",
"title": "How many congressional districts are in Texas?",
"schema": "congressional_districts",
"message_count": 2,
"branched_from": null,
"source": "api",
"created_at": "2026-10-27T14:00:00.000Z",
"updated_at": "2026-10-27T14:00:12.000Z"
}
],
"total": 1,
"limit": 20,
"offset": 0
}Errors
400The request is not valid.details.issueslists the fields. Codes: invalid_request.401Missing, unknown, expired or revoked credential. Codes: invalid_credentials.403API access is off for the organization, the credential lacks the scope, the user's access expired, the dataset belongs to a product the organization does not have, or the product does not offer the feature (maps for Site Selection). Codes: api_access_disabled, insufficient_scope, access_expired, feature_disabled, product_not_entitled.429Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.500Unexpected error. Quoterequest_idto support. Codes: internal_error.
Get a conversation
GET/conversations/{id}
A conversation and its first messages, without result rows.
Requires the conversations:read scope: read conversations, answers and result rows. Rate limit: 60 requests a minute per credential.
curl "https://platform.teroatlas.ai/v1/conversations/<id>" \
-H "Authorization: Bearer tero_YOUR_API_KEY"Parameters
| Field | Type | Description |
|---|---|---|
idrequired | string · path | |
message_limit | integer · query | 1 to 100, default 50. |
Response 200
The conversation. Content type: application/json.
| Field | Type | Description |
|---|---|---|
conversation_idrequired | string | |
titlerequired | string | null | |
schemarequired | string | null | |
message_countrequired | integer | |
branched_fromrequired | string | null | |
sourcerequired | "app" | "api" | "mcp" | Where the conversation started: the TeroAI web app, the REST API, or an MCP client. |
created_atrequired | string | |
updated_atrequired | string | |
messagesrequired | object[] | |
messages[].message_idrequired | string | |
messages[].rolerequired | "user" | "assistant" | "system" | |
messages[].contentrequired | string | |
messages[].sqlrequired | string | null | |
messages[].row_countrequired | integer | null | |
messages[].feedbackrequired | "up" | "down" | |
messages[].created_atrequired | string | |
messages_totalrequired | integer |
Example response
{
"conversation_id": "c3a1f0d2-6c55-4b8e-9d0a-1f2e3d4c5b6a",
"title": "How many congressional districts are in Texas?",
"schema": "congressional_districts",
"message_count": 2,
"branched_from": null,
"source": "api",
"created_at": "2026-10-27T14:00:00.000Z",
"updated_at": "2026-10-27T14:00:12.000Z",
"messages": [],
"messages_total": 2
}Errors
400The request is not valid.details.issueslists the fields. Codes: invalid_request.401Missing, unknown, expired or revoked credential. Codes: invalid_credentials.403API access is off for the organization, the credential lacks the scope, the user's access expired, the dataset belongs to a product the organization does not have, or the product does not offer the feature (maps for Site Selection). Codes: api_access_disabled, insufficient_scope, access_expired, feature_disabled, product_not_entitled.404Not found, or owned by another user or organization. Codes: not_found.429Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.500Unexpected error. Quoterequest_idto support. Codes: internal_error.
Rename a conversation
PATCH/conversations/{id}
Sets the conversation's title.
Requires the conversations:write scope: rename, delete and branch conversations, and rate answers. Rate limit: 60 requests a minute per credential.
curl -X PATCH "https://platform.teroatlas.ai/v1/conversations/<id>" \
-H "Authorization: Bearer tero_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"title":"<title>"}'Parameters
| Field | Type |
|---|---|
idrequired | string · path |
Request body
| Field | Type | Description |
|---|---|---|
titlerequired | string | 1 to 200 characters. |
Response 200
The renamed conversation. Content type: application/json.
| Field | Type | Description |
|---|---|---|
conversation_idrequired | string | |
titlerequired | string | null | |
schemarequired | string | null | |
message_countrequired | integer | |
branched_fromrequired | string | null | |
sourcerequired | "app" | "api" | "mcp" | Where the conversation started: the TeroAI web app, the REST API, or an MCP client. |
created_atrequired | string | |
updated_atrequired | string |
Example response
{
"conversation_id": "c3a1f0d2-6c55-4b8e-9d0a-1f2e3d4c5b6a",
"title": "Texas districts",
"schema": "congressional_districts",
"message_count": 2,
"branched_from": null,
"source": "api",
"created_at": "2026-10-27T14:00:00.000Z",
"updated_at": "2026-10-27T14:00:12.000Z"
}Errors
400The request is not valid.details.issueslists the fields. Codes: invalid_request.401Missing, unknown, expired or revoked credential. Codes: invalid_credentials.403API access is off for the organization, the credential lacks the scope, the user's access expired, the dataset belongs to a product the organization does not have, or the product does not offer the feature (maps for Site Selection). Codes: api_access_disabled, insufficient_scope, access_expired, feature_disabled, product_not_entitled.404Not found, or owned by another user or organization. Codes: not_found.429Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.500Unexpected error. Quoterequest_idto support. Codes: internal_error.
Delete a conversation
DELETE/conversations/{id}
Deletes the conversation and its branches. Deleting is permanent through the API.
Requires the conversations:write scope: rename, delete and branch conversations, and rate answers. Rate limit: 60 requests a minute per credential.
curl -X DELETE "https://platform.teroatlas.ai/v1/conversations/<id>" \
-H "Authorization: Bearer tero_YOUR_API_KEY"Parameters
| Field | Type |
|---|---|
idrequired | string · path |
Response 204
Deleted.
Errors
401Missing, unknown, expired or revoked credential. Codes: invalid_credentials.403API access is off for the organization, the credential lacks the scope, the user's access expired, the dataset belongs to a product the organization does not have, or the product does not offer the feature (maps for Site Selection). Codes: api_access_disabled, insufficient_scope, access_expired, feature_disabled, product_not_entitled.404Not found, or owned by another user or organization. Codes: not_found.429Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.500Unexpected error. Quoterequest_idto support. Codes: internal_error.
List a conversation's messages
GET/conversations/{id}/messages
Questions and answers in order, without result rows. Page through rows with /messages/{id}/rows.
Requires the conversations:read scope: read conversations, answers and result rows. Rate limit: 60 requests a minute per credential.
curl "https://platform.teroatlas.ai/v1/conversations/<id>/messages" \
-H "Authorization: Bearer tero_YOUR_API_KEY"Parameters
| Field | Type | Description |
|---|---|---|
idrequired | string · path | |
limit | integer · query | 1 to 100, default 50. |
offset | integer | null · query | default 0. |
Response 200
A page of messages. Content type: application/json.
| Field | Type |
|---|---|
messagesrequired | object[] |
messages[].message_idrequired | string |
messages[].rolerequired | "user" | "assistant" | "system" |
messages[].contentrequired | string |
messages[].sqlrequired | string | null |
messages[].row_countrequired | integer | null |
messages[].feedbackrequired | "up" | "down" |
messages[].created_atrequired | string |
totalrequired | integer |
limitrequired | integer |
offsetrequired | integer |
Example response
{
"messages": [],
"total": 2,
"limit": 50,
"offset": 0
}Errors
400The request is not valid.details.issueslists the fields. Codes: invalid_request.401Missing, unknown, expired or revoked credential. Codes: invalid_credentials.403API access is off for the organization, the credential lacks the scope, the user's access expired, the dataset belongs to a product the organization does not have, or the product does not offer the feature (maps for Site Selection). Codes: api_access_disabled, insufficient_scope, access_expired, feature_disabled, product_not_entitled.404Not found, or owned by another user or organization. Codes: not_found.429Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.500Unexpected error. Quoterequest_idto support. Codes: internal_error.
Branch a conversation
POST/conversations/{id}/branches
Copies the conversation, up to up_to_message_id if given, into a new conversation titled title, or after the parent conversation. Use it to keep asking after the 10-question limit, or to analyse earlier answers with mode: analysis.
Requires the conversations:write scope: rename, delete and branch conversations, and rate answers. Rate limit: 60 requests a minute per credential.
curl -X POST "https://platform.teroatlas.ai/v1/conversations/<id>/branches" \
-H "Authorization: Bearer tero_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'Parameters
| Field | Type |
|---|---|
idrequired | string · path |
Request body
| Field | Type | Description |
|---|---|---|
up_to_message_id | string | |
title | string | The new conversation's title. Defaults to the parent conversation's title. 1 to 200 characters. |
Response 201
The new conversation. Content type: application/json.
| Field | Type | Description |
|---|---|---|
conversation_idrequired | string | |
titlerequired | string | null | |
schemarequired | string | null | |
message_countrequired | integer | |
branched_fromrequired | string | null | |
sourcerequired | "app" | "api" | "mcp" | Where the conversation started: the TeroAI web app, the REST API, or an MCP client. |
created_atrequired | string | |
updated_atrequired | string |
Example response
{
"conversation_id": "d4b2e1f3-7d66-4c9f-8e1b-2f3e4d5c6b7a",
"title": "How many congressional districts are in Texas?",
"schema": "congressional_districts",
"message_count": 2,
"branched_from": "c3a1f0d2-6c55-4b8e-9d0a-1f2e3d4c5b6a",
"source": "api",
"created_at": "2026-10-27T14:00:00.000Z",
"updated_at": "2026-10-27T14:00:12.000Z"
}Errors
400The request is not valid.details.issueslists the fields. Codes: invalid_request.401Missing, unknown, expired or revoked credential. Codes: invalid_credentials.403API access is off for the organization, the credential lacks the scope, the user's access expired, the dataset belongs to a product the organization does not have, or the product does not offer the feature (maps for Site Selection). Codes: api_access_disabled, insufficient_scope, access_expired, feature_disabled, product_not_entitled.404Not found, or owned by another user or organization. Codes: not_found.429Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.500Unexpected error. Quoterequest_idto support. Codes: internal_error.
Messages
Get an answer
GET/messages/{id}
An answer with its question and SQL, without result rows.
Requires the conversations:read scope: read conversations, answers and result rows. Rate limit: 60 requests a minute per credential.
curl "https://platform.teroatlas.ai/v1/messages/<id>" \
-H "Authorization: Bearer tero_YOUR_API_KEY"Parameters
| Field | Type |
|---|---|
idrequired | string · path |
Response 200
The answer. Content type: application/json.
| Field | Type |
|---|---|
message_idrequired | string |
conversation_idrequired | string |
questionrequired | string | null |
answerrequired | string |
sqlrequired | string | null |
row_countrequired | integer |
feedbackrequired | "up" | "down" |
created_atrequired | string |
Example response
{
"message_id": "m7b2c4d6-1a3e-4f5a-8b9c-0d1e2f3a4b5c",
"conversation_id": "c3a1f0d2-6c55-4b8e-9d0a-1f2e3d4c5b6a",
"question": "How many congressional districts are in Texas?",
"answer": "Texas has 38 congressional districts.",
"sql": "SELECT COUNT(*) AS districts FROM congressional_districts WHERE state = 'TX'",
"row_count": 1,
"feedback": null,
"created_at": "2026-10-27T14:00:12.000Z"
}Errors
400The request is not valid.details.issueslists the fields. Codes: invalid_request.401Missing, unknown, expired or revoked credential. Codes: invalid_credentials.403API access is off for the organization, the credential lacks the scope, the user's access expired, the dataset belongs to a product the organization does not have, or the product does not offer the feature (maps for Site Selection). Codes: api_access_disabled, insufficient_scope, access_expired, feature_disabled, product_not_entitled.404Not found, or owned by another user or organization. Codes: not_found.429Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.500Unexpected error. Quoterequest_idto support. Codes: internal_error.
Page through an answer's rows
GET/messages/{id}/rows
Result rows of an answer, up to 1000 per page.
Requires the conversations:read scope: read conversations, answers and result rows. Rate limit: 60 requests a minute per credential.
curl "https://platform.teroatlas.ai/v1/messages/<id>/rows" \
-H "Authorization: Bearer tero_YOUR_API_KEY"Parameters
| Field | Type | Description |
|---|---|---|
idrequired | string · path | |
limit | integer · query | 1 to 1000, default 100. |
offset | integer | null · query | default 0. |
Response 200
A page of rows. Content type: application/json.
| Field | Type |
|---|---|
rowsrequired | object[] |
totalrequired | integer |
limitrequired | integer |
offsetrequired | integer |
Example response
{
"rows": [
{
"districts": 38
}
],
"total": 1,
"limit": 100,
"offset": 0
}Errors
400The request is not valid.details.issueslists the fields. Codes: invalid_request.401Missing, unknown, expired or revoked credential. Codes: invalid_credentials.403API access is off for the organization, the credential lacks the scope, the user's access expired, the dataset belongs to a product the organization does not have, or the product does not offer the feature (maps for Site Selection). Codes: api_access_disabled, insufficient_scope, access_expired, feature_disabled, product_not_entitled.404Not found, or owned by another user or organization. Codes: not_found.429Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.500Unexpected error. Quoterequest_idto support. Codes: internal_error.
Rate an answer
PUT/messages/{id}/feedback
Marks an answer as helpful (up) or not (down). null clears the rating.
Requires the conversations:write scope: rename, delete and branch conversations, and rate answers. Rate limit: 60 requests a minute per credential.
curl -X PUT "https://platform.teroatlas.ai/v1/messages/<id>/feedback" \
-H "Authorization: Bearer tero_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"rating":"up"}'Parameters
| Field | Type |
|---|---|
idrequired | string · path |
Request body
| Field | Type |
|---|---|
ratingrequired | "up" | "down" |
Response 200
The rating. Content type: application/json.
| Field | Type |
|---|---|
message_idrequired | string |
ratingrequired | "up" | "down" |
Example response
{
"message_id": "m7b2c4d6-1a3e-4f5a-8b9c-0d1e2f3a4b5c",
"rating": "up"
}Errors
400The request is not valid.details.issueslists the fields. Codes: invalid_request.401Missing, unknown, expired or revoked credential. Codes: invalid_credentials.403API access is off for the organization, the credential lacks the scope, the user's access expired, the dataset belongs to a product the organization does not have, or the product does not offer the feature (maps for Site Selection). Codes: api_access_disabled, insufficient_scope, access_expired, feature_disabled, product_not_entitled.404Not found, or owned by another user or organization. Codes: not_found.429Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.500Unexpected error. Quoterequest_idto support. Codes: internal_error.
Chart an answer
POST/messages/{id}/chart
A chart specification for an answer's rows: chart type, index column, series and data. Render it with any charting library. Spends tokens.
Requires the data:query scope: ask questions and generate charts, maps, reports and SQL explanations. Rate limit: 10 requests a minute per credential.
curl -X POST "https://platform.teroatlas.ai/v1/messages/<id>/chart" \
-H "Authorization: Bearer tero_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'Parameters
| Field | Type |
|---|---|
idrequired | string · path |
Request body
An empty JSON object, {}.
Response 200
The chart specification. Content type: application/json.
| Field | Type |
|---|---|
chartTyperequired | string |
indexrequired | string |
categoriesrequired | string[] |
datarequired | object[] |
Example response
{
"chartType": "bar",
"index": "state",
"categories": [
"districts"
],
"data": [
{
"state": "TX",
"districts": 38
}
]
}Errors
400The request is not valid.details.issueslists the fields. Codes: invalid_request.401Missing, unknown, expired or revoked credential. Codes: invalid_credentials.402The organization's billing is not active. Codes: billing_inactive.403API access is off for the organization, the credential lacks the scope, the user's access expired, the dataset belongs to a product the organization does not have, or the product does not offer the feature (maps for Site Selection). Codes: api_access_disabled, insufficient_scope, access_expired, feature_disabled, product_not_entitled.404Not found, or owned by another user or organization. Codes: not_found.429Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.500Unexpected error. Quoterequest_idto support. Codes: internal_error.503The analysis service failed or did not answer in time.upstream_timeoutis sent with aRetry-Afterheader. Codes: upstream_unavailable, upstream_timeout.
Map an answer
POST/messages/{id}/map
A map image of an answer's geographic rows: a PNG 1200 pixels wide by default, or an SVG with format: "svg". Spends tokens. Fails with map_unavailable when the rows cannot be mapped, and with feature_disabled for an answer from a Site Selection (SSIS) conversation: maps are a District Intelligence (CDIS) feature.
Requires the data:query scope: ask questions and generate charts, maps, reports and SQL explanations. Rate limit: 10 requests a minute per credential.
curl -X POST "https://platform.teroatlas.ai/v1/messages/<id>/map" \
-H "Authorization: Bearer tero_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'Parameters
| Field | Type |
|---|---|
idrequired | string · path |
Request body
| Field | Type |
|---|---|
format | "png" | "svg" |
Response 200
The map image. Content type: image/png, image/svg+xml.
Errors
400The request is not valid.details.issueslists the fields. Codes: invalid_request.401Missing, unknown, expired or revoked credential. Codes: invalid_credentials.402The organization's billing is not active. Codes: billing_inactive.403API access is off for the organization, the credential lacks the scope, the user's access expired, the dataset belongs to a product the organization does not have, or the product does not offer the feature (maps for Site Selection). Codes: api_access_disabled, insufficient_scope, access_expired, feature_disabled, product_not_entitled.404Not found, or owned by another user or organization. Codes: not_found.422The answer cannot be mapped. Codes: map_unavailable.429Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.500Unexpected error. Quoterequest_idto support. Codes: internal_error.503The analysis service failed or did not answer in time.upstream_timeoutis sent with aRetry-Afterheader. Codes: upstream_unavailable, upstream_timeout.
Write a report on an answer
POST/messages/{id}/report
A written report on an answer's rows, with a title, summary and sections. Spends tokens.
Requires the data:query scope: ask questions and generate charts, maps, reports and SQL explanations. Rate limit: 10 requests a minute per credential.
curl -X POST "https://platform.teroatlas.ai/v1/messages/<id>/report" \
-H "Authorization: Bearer tero_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'Parameters
| Field | Type |
|---|---|
idrequired | string · path |
Request body
| Field | Type | Description |
|---|---|---|
page_count | integer | 1 to 10. |
Response 200
The report. Content type: application/json.
| Field | Type |
|---|---|
titlerequired | string |
summaryrequired | string |
sectionsrequired | object[] |
sections[].headingrequired | string |
sections[].contentrequired | string |
datarequired | object[] |
metadatarequired | object |
metadata.queryrequired | string |
metadata.generatedAtrequired | string |
metadata.reportTyperequired | string |
Example response
{
"title": "Congressional districts in Texas",
"summary": "Texas has 38 districts.",
"sections": [
{
"heading": "Overview",
"content": "Texas has 38 congressional districts."
}
],
"data": [
{
"districts": 38
}
],
"metadata": {
"query": "How many congressional districts are in Texas?",
"generatedAt": "2026-10-27T14:01:00.000Z",
"reportType": "summary"
}
}Errors
400The request is not valid.details.issueslists the fields. Codes: invalid_request.401Missing, unknown, expired or revoked credential. Codes: invalid_credentials.402The organization's billing is not active. Codes: billing_inactive.403API access is off for the organization, the credential lacks the scope, the user's access expired, the dataset belongs to a product the organization does not have, or the product does not offer the feature (maps for Site Selection). Codes: api_access_disabled, insufficient_scope, access_expired, feature_disabled, product_not_entitled.404Not found, or owned by another user or organization. Codes: not_found.429Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.500Unexpected error. Quoterequest_idto support. Codes: internal_error.503The analysis service failed or did not answer in time.upstream_timeoutis sent with aRetry-Afterheader. Codes: upstream_unavailable, upstream_timeout.
Explain an answer's SQL
POST/messages/{id}/sql_explanation
The answer's SQL split into sections, each explained in plain language. Spends tokens.
Requires the data:query scope: ask questions and generate charts, maps, reports and SQL explanations. Rate limit: 10 requests a minute per credential.
curl -X POST "https://platform.teroatlas.ai/v1/messages/<id>/sql_explanation" \
-H "Authorization: Bearer tero_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'Parameters
| Field | Type |
|---|---|
idrequired | string · path |
Request body
An empty JSON object, {}.
Response 200
The explanation. Content type: application/json.
| Field | Type |
|---|---|
sqlrequired | string |
sectionsrequired | object[] |
sections[].sql_sectionrequired | string |
sections[].explanationrequired | string |
sections[].start_charrequired | integer | null |
sections[].end_charrequired | integer | null |
sections[].matchedrequired | boolean |
input_tokens | integer |
output_tokens | integer |
total_tokens | integer |
timestamprequired | string |
Example response
{
"sql": "SELECT COUNT(*) AS districts FROM congressional_districts WHERE state = 'TX'",
"sections": [
{
"sql_section": "WHERE state = 'TX'",
"explanation": "Keeps only districts in Texas.",
"start_char": 52,
"end_char": 70,
"matched": true
}
],
"timestamp": "2026-10-27T14:01:00.000Z"
}Errors
400The request is not valid.details.issueslists the fields. Codes: invalid_request.401Missing, unknown, expired or revoked credential. Codes: invalid_credentials.402The organization's billing is not active. Codes: billing_inactive.403API access is off for the organization, the credential lacks the scope, the user's access expired, the dataset belongs to a product the organization does not have, or the product does not offer the feature (maps for Site Selection). Codes: api_access_disabled, insufficient_scope, access_expired, feature_disabled, product_not_entitled.404Not found, or owned by another user or organization. Codes: not_found.429Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.500Unexpected error. Quoterequest_idto support. Codes: internal_error.503The analysis service failed or did not answer in time.upstream_timeoutis sent with aRetry-Afterheader. Codes: upstream_unavailable, upstream_timeout.
Error envelope
Every error response has this body.
| Field | Type |
|---|---|
errorrequired | object |
error.coderequired | "invalid_request" | "invalid_credentials" | "billing_inactive" | "api_access_disabled" | "insufficient_scope" | "access_expired" | "feature_disabled" | "product_not_entitled" | "not_found" | "conversation_limit_reached" | "schema_mismatch" | "payload_too_large" | "map_unavailable" | "token_limit_exceeded" | "rate_limited" | "upstream_unavailable" | "upstream_timeout" | "internal_error" |
error.messagerequired | string |
error.request_idrequired | string |
error.detailsrequired | object |