Skip to Content
REST APIAPI reference

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.

FieldType
credentialrequiredobject
credential.typerequired"api_key" | "oauth"
credential.idrequiredstring
credential.scopesrequired"data:read" | "data:query" | "conversations:read" | "conversations:write" | "usage:read"[]
userrequiredobject
user.user_idrequiredstring
user.emailrequiredstring | null
user.namerequiredstring | null
organizationrequiredobject
organization.org_idrequiredstring
organization.namerequiredstring | null
organization.planrequiredstring | 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

  • 401 Missing, unknown, expired or revoked credential. Codes: invalid_credentials.
  • 403 API 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.
  • 429 Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.
  • 500 Unexpected error. Quote request_id to 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.

FieldTypeDescription
tokens_usedrequiredinteger
token_limitrequiredinteger
percent_usedrequirednumber
resets_atrequiredstring | nullWhen the quota next resets, at 00:00 UTC. Null when it does not reset on a schedule, as during a trial.
planrequiredstring | null
limitsrequiredobject[]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[].usedrequiredinteger
limits[].limitrequiredinteger
limits[].resets_atrequiredstring | nullWhen the counter next resets. Weeks start Tuesday 07:00 America/New_York. Null when it does not reset, as during a trial.
limits[].ends_atstring | nullTrial 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

  • 401 Missing, unknown, expired or revoked credential. Codes: invalid_credentials.
  • 403 API 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.
  • 429 Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.
  • 500 Unexpected error. Quote request_id to 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.

FieldType
schemasrequiredobject[]
schemas[].namerequiredstring
schemas[].table_countrequiredinteger | null
schemas[].column_countrequiredinteger | null
Example response
{
  "schemas": [
    {
      "name": "congressional_districts",
      "table_count": 4,
      "column_count": 61
    }
  ]
}

Errors

  • 401 Missing, unknown, expired or revoked credential. Codes: invalid_credentials.
  • 402 The organization's billing is not active. Codes: billing_inactive.
  • 403 API 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.
  • 429 Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.
  • 500 Unexpected error. Quote request_id to support. Codes: internal_error.
  • 503 The analysis service failed or did not answer in time. upstream_timeout is sent with a Retry-After header. 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

FieldTypeDescription
questionrequiredstring1 to 4000 characters.
conversation_idstring
schemastringThe 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"
streamboolean
include"geometries"[]

Response 200

The answer, or an event stream when stream is true. Content type: application/json, text/event-stream.

FieldTypeDescription
message_idrequiredstring
conversation_idrequiredstring
answerrequiredstring
sqlrequiredstring | null
rowsrequiredobject[]
row_countrequiredinteger
rows_truncatedrequiredboolean
geography_idsrequiredstring[]
execution_time_msrequirednumber | null
tokensrequiredobject
tokens.inputrequiredinteger
tokens.outputrequiredinteger
tokens.totalrequiredinteger
usagerequiredobject
usage.tokens_usedrequiredinteger
usage.token_limitrequiredinteger
usage.percent_usedrequirednumber
usage.resets_atrequiredstring | nullWhen the quota next resets, at 00:00 UTC. Null when it does not reset on a schedule, as during a trial.
geometriesany
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

  • 400 The request is not valid. details.issues lists the fields. Codes: invalid_request.
  • 401 Missing, unknown, expired or revoked credential. Codes: invalid_credentials.
  • 402 The organization's billing is not active. Codes: billing_inactive.
  • 403 API 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.
  • 404 Not found, or owned by another user or organization. Codes: not_found.
  • 409 The conversation reached its 10-question limit, or a follow-up names a dataset other than its conversation's. Codes: conversation_limit_reached, schema_mismatch.
  • 413 The request body is over 1 MB. Codes: payload_too_large.
  • 429 Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.
  • 500 Unexpected error. Quote request_id to support. Codes: internal_error.
  • 503 The analysis service failed or did not answer in time. upstream_timeout is sent with a Retry-After header. 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

FieldTypeDescription
limitinteger · query1 to 100, default 20.
offsetinteger | null · querydefault 0.
source"api" | "mcp" | "app" | "all" · queryWhich 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.

FieldTypeDescription
conversationsrequiredobject[]
conversations[].conversation_idrequiredstring
conversations[].titlerequiredstring | null
conversations[].schemarequiredstring | null
conversations[].message_countrequiredinteger
conversations[].branched_fromrequiredstring | null
conversations[].sourcerequired"app" | "api" | "mcp"Where the conversation started: the TeroAI web app, the REST API, or an MCP client.
conversations[].created_atrequiredstring
conversations[].updated_atrequiredstring
totalrequiredinteger
limitrequiredinteger
offsetrequiredinteger
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

  • 400 The request is not valid. details.issues lists the fields. Codes: invalid_request.
  • 401 Missing, unknown, expired or revoked credential. Codes: invalid_credentials.
  • 403 API 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.
  • 429 Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.
  • 500 Unexpected error. Quote request_id to 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

FieldTypeDescription
idrequiredstring · path
message_limitinteger · query1 to 100, default 50.

Response 200

The conversation. Content type: application/json.

FieldTypeDescription
conversation_idrequiredstring
titlerequiredstring | null
schemarequiredstring | null
message_countrequiredinteger
branched_fromrequiredstring | null
sourcerequired"app" | "api" | "mcp"Where the conversation started: the TeroAI web app, the REST API, or an MCP client.
created_atrequiredstring
updated_atrequiredstring
messagesrequiredobject[]
messages[].message_idrequiredstring
messages[].rolerequired"user" | "assistant" | "system"
messages[].contentrequiredstring
messages[].sqlrequiredstring | null
messages[].row_countrequiredinteger | null
messages[].feedbackrequired"up" | "down"
messages[].created_atrequiredstring
messages_totalrequiredinteger
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

  • 400 The request is not valid. details.issues lists the fields. Codes: invalid_request.
  • 401 Missing, unknown, expired or revoked credential. Codes: invalid_credentials.
  • 403 API 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.
  • 404 Not found, or owned by another user or organization. Codes: not_found.
  • 429 Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.
  • 500 Unexpected error. Quote request_id to 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

FieldType
idrequiredstring · path

Request body

FieldTypeDescription
titlerequiredstring1 to 200 characters.

Response 200

The renamed conversation. Content type: application/json.

FieldTypeDescription
conversation_idrequiredstring
titlerequiredstring | null
schemarequiredstring | null
message_countrequiredinteger
branched_fromrequiredstring | null
sourcerequired"app" | "api" | "mcp"Where the conversation started: the TeroAI web app, the REST API, or an MCP client.
created_atrequiredstring
updated_atrequiredstring
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

  • 400 The request is not valid. details.issues lists the fields. Codes: invalid_request.
  • 401 Missing, unknown, expired or revoked credential. Codes: invalid_credentials.
  • 403 API 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.
  • 404 Not found, or owned by another user or organization. Codes: not_found.
  • 429 Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.
  • 500 Unexpected error. Quote request_id to 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

FieldType
idrequiredstring · path

Response 204

Deleted.

Errors

  • 401 Missing, unknown, expired or revoked credential. Codes: invalid_credentials.
  • 403 API 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.
  • 404 Not found, or owned by another user or organization. Codes: not_found.
  • 429 Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.
  • 500 Unexpected error. Quote request_id to 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

FieldTypeDescription
idrequiredstring · path
limitinteger · query1 to 100, default 50.
offsetinteger | null · querydefault 0.

Response 200

A page of messages. Content type: application/json.

FieldType
messagesrequiredobject[]
messages[].message_idrequiredstring
messages[].rolerequired"user" | "assistant" | "system"
messages[].contentrequiredstring
messages[].sqlrequiredstring | null
messages[].row_countrequiredinteger | null
messages[].feedbackrequired"up" | "down"
messages[].created_atrequiredstring
totalrequiredinteger
limitrequiredinteger
offsetrequiredinteger
Example response
{
  "messages": [],
  "total": 2,
  "limit": 50,
  "offset": 0
}

Errors

  • 400 The request is not valid. details.issues lists the fields. Codes: invalid_request.
  • 401 Missing, unknown, expired or revoked credential. Codes: invalid_credentials.
  • 403 API 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.
  • 404 Not found, or owned by another user or organization. Codes: not_found.
  • 429 Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.
  • 500 Unexpected error. Quote request_id to 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

FieldType
idrequiredstring · path

Request body

FieldTypeDescription
up_to_message_idstring
titlestringThe new conversation's title. Defaults to the parent conversation's title. 1 to 200 characters.

Response 201

The new conversation. Content type: application/json.

FieldTypeDescription
conversation_idrequiredstring
titlerequiredstring | null
schemarequiredstring | null
message_countrequiredinteger
branched_fromrequiredstring | null
sourcerequired"app" | "api" | "mcp"Where the conversation started: the TeroAI web app, the REST API, or an MCP client.
created_atrequiredstring
updated_atrequiredstring
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

  • 400 The request is not valid. details.issues lists the fields. Codes: invalid_request.
  • 401 Missing, unknown, expired or revoked credential. Codes: invalid_credentials.
  • 403 API 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.
  • 404 Not found, or owned by another user or organization. Codes: not_found.
  • 429 Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.
  • 500 Unexpected error. Quote request_id to 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

FieldType
idrequiredstring · path

Response 200

The answer. Content type: application/json.

FieldType
message_idrequiredstring
conversation_idrequiredstring
questionrequiredstring | null
answerrequiredstring
sqlrequiredstring | null
row_countrequiredinteger
feedbackrequired"up" | "down"
created_atrequiredstring
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

  • 400 The request is not valid. details.issues lists the fields. Codes: invalid_request.
  • 401 Missing, unknown, expired or revoked credential. Codes: invalid_credentials.
  • 403 API 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.
  • 404 Not found, or owned by another user or organization. Codes: not_found.
  • 429 Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.
  • 500 Unexpected error. Quote request_id to 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

FieldTypeDescription
idrequiredstring · path
limitinteger · query1 to 1000, default 100.
offsetinteger | null · querydefault 0.

Response 200

A page of rows. Content type: application/json.

FieldType
rowsrequiredobject[]
totalrequiredinteger
limitrequiredinteger
offsetrequiredinteger
Example response
{
  "rows": [
    {
      "districts": 38
    }
  ],
  "total": 1,
  "limit": 100,
  "offset": 0
}

Errors

  • 400 The request is not valid. details.issues lists the fields. Codes: invalid_request.
  • 401 Missing, unknown, expired or revoked credential. Codes: invalid_credentials.
  • 403 API 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.
  • 404 Not found, or owned by another user or organization. Codes: not_found.
  • 429 Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.
  • 500 Unexpected error. Quote request_id to 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

FieldType
idrequiredstring · path

Request body

FieldType
ratingrequired"up" | "down"

Response 200

The rating. Content type: application/json.

FieldType
message_idrequiredstring
ratingrequired"up" | "down"
Example response
{
  "message_id": "m7b2c4d6-1a3e-4f5a-8b9c-0d1e2f3a4b5c",
  "rating": "up"
}

Errors

  • 400 The request is not valid. details.issues lists the fields. Codes: invalid_request.
  • 401 Missing, unknown, expired or revoked credential. Codes: invalid_credentials.
  • 403 API 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.
  • 404 Not found, or owned by another user or organization. Codes: not_found.
  • 429 Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.
  • 500 Unexpected error. Quote request_id to 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

FieldType
idrequiredstring · path

Request body

An empty JSON object, {}.

Response 200

The chart specification. Content type: application/json.

FieldType
chartTyperequiredstring
indexrequiredstring
categoriesrequiredstring[]
datarequiredobject[]
Example response
{
  "chartType": "bar",
  "index": "state",
  "categories": [
    "districts"
  ],
  "data": [
    {
      "state": "TX",
      "districts": 38
    }
  ]
}

Errors

  • 400 The request is not valid. details.issues lists the fields. Codes: invalid_request.
  • 401 Missing, unknown, expired or revoked credential. Codes: invalid_credentials.
  • 402 The organization's billing is not active. Codes: billing_inactive.
  • 403 API 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.
  • 404 Not found, or owned by another user or organization. Codes: not_found.
  • 429 Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.
  • 500 Unexpected error. Quote request_id to support. Codes: internal_error.
  • 503 The analysis service failed or did not answer in time. upstream_timeout is sent with a Retry-After header. 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

FieldType
idrequiredstring · path

Request body

FieldType
format"png" | "svg"

Response 200

The map image. Content type: image/png, image/svg+xml.

Errors

  • 400 The request is not valid. details.issues lists the fields. Codes: invalid_request.
  • 401 Missing, unknown, expired or revoked credential. Codes: invalid_credentials.
  • 402 The organization's billing is not active. Codes: billing_inactive.
  • 403 API 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.
  • 404 Not found, or owned by another user or organization. Codes: not_found.
  • 422 The answer cannot be mapped. Codes: map_unavailable.
  • 429 Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.
  • 500 Unexpected error. Quote request_id to support. Codes: internal_error.
  • 503 The analysis service failed or did not answer in time. upstream_timeout is sent with a Retry-After header. 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

FieldType
idrequiredstring · path

Request body

FieldTypeDescription
page_countinteger1 to 10.

Response 200

The report. Content type: application/json.

FieldType
titlerequiredstring
summaryrequiredstring
sectionsrequiredobject[]
sections[].headingrequiredstring
sections[].contentrequiredstring
datarequiredobject[]
metadatarequiredobject
metadata.queryrequiredstring
metadata.generatedAtrequiredstring
metadata.reportTyperequiredstring
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

  • 400 The request is not valid. details.issues lists the fields. Codes: invalid_request.
  • 401 Missing, unknown, expired or revoked credential. Codes: invalid_credentials.
  • 402 The organization's billing is not active. Codes: billing_inactive.
  • 403 API 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.
  • 404 Not found, or owned by another user or organization. Codes: not_found.
  • 429 Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.
  • 500 Unexpected error. Quote request_id to support. Codes: internal_error.
  • 503 The analysis service failed or did not answer in time. upstream_timeout is sent with a Retry-After header. 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

FieldType
idrequiredstring · path

Request body

An empty JSON object, {}.

Response 200

The explanation. Content type: application/json.

FieldType
sqlrequiredstring
sectionsrequiredobject[]
sections[].sql_sectionrequiredstring
sections[].explanationrequiredstring
sections[].start_charrequiredinteger | null
sections[].end_charrequiredinteger | null
sections[].matchedrequiredboolean
input_tokensinteger
output_tokensinteger
total_tokensinteger
timestamprequiredstring
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

  • 400 The request is not valid. details.issues lists the fields. Codes: invalid_request.
  • 401 Missing, unknown, expired or revoked credential. Codes: invalid_credentials.
  • 402 The organization's billing is not active. Codes: billing_inactive.
  • 403 API 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.
  • 404 Not found, or owned by another user or organization. Codes: not_found.
  • 429 Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.
  • 500 Unexpected error. Quote request_id to support. Codes: internal_error.
  • 503 The analysis service failed or did not answer in time. upstream_timeout is sent with a Retry-After header. Codes: upstream_unavailable, upstream_timeout.

Error envelope

Every error response has this body.

FieldType
errorrequiredobject
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.messagerequiredstring
error.request_idrequiredstring
error.detailsrequiredobject
Last updated on