{"openapi":"3.1.0","info":{"title":"TeroAI API","version":"1.0.0","description":"Ask questions about geospatial and census-style data in plain language, and turn the answers into charts, maps and reports. Authenticate with an API key from the TeroAI dashboard. Every error has the shape `{ error: { code, message, request_id, details } }`."},"servers":[{"url":"https://platform.teroatlas.ai/v1"}],"tags":[{"name":"Account"},{"name":"Questions"},{"name":"Conversations"},{"name":"Messages"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"An API key, `tero_` and 64 hexadecimal characters."},"apiKeyHeader":{"type":"apiKey","in":"header","name":"x-api-key"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["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"]},"message":{"type":"string"},"request_id":{"type":"string"},"details":{"type":"object","additionalProperties":{}}},"required":["code","message","request_id","details"]}},"required":["error"]}},"parameters":{}},"paths":{"/me":{"get":{"operationId":"getMe","summary":"Who this credential acts as","description":"The credential's type and scopes, the user it acts as, and its organization. The organization always comes from the credential.\n\nRequires the `usage:read` scope: read the organization's usage and quota. Rate limit: 60 requests a minute per credential.","tags":["Account"],"security":[{"bearerAuth":[]},{"apiKeyHeader":[]}],"responses":{"200":{"description":"The credential, user and organization.","content":{"application/json":{"schema":{"type":"object","properties":{"credential":{"type":"object","properties":{"type":{"type":"string","enum":["api_key","oauth"]},"id":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["data:read","data:query","conversations:read","conversations:write","usage:read"]}}},"required":["type","id","scopes"]},"user":{"type":"object","properties":{"user_id":{"type":"string"},"email":{"type":["string","null"]},"name":{"type":["string","null"]}},"required":["user_id","email","name"]},"organization":{"type":"object","properties":{"org_id":{"type":"string"},"name":{"type":["string","null"]},"plan":{"type":["string","null"]}},"required":["org_id","name","plan"]}},"required":["credential","user","organization"]},"example":{"credential":{"type":"api_key","id":"key_01","scopes":["data:read","data:query","usage:read"]},"user":{"user_id":"user_01","email":"dev@example.com","name":"Dev Example"},"organization":{"org_id":"org_01","name":"Example Corp","plan":"team"}}}}},"401":{"description":"Missing, unknown, expired or revoked credential. Codes: invalid_credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unexpected error. Quote `request_id` to support. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/usage":{"get":{"operationId":"getUsage","summary":"Token usage and quota","description":"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.\n\nRequires the `usage:read` scope: read the organization's usage and quota. Rate limit: 60 requests a minute per credential.","tags":["Account"],"security":[{"bearerAuth":[]},{"apiKeyHeader":[]}],"responses":{"200":{"description":"Usage this period.","content":{"application/json":{"schema":{"type":"object","properties":{"tokens_used":{"type":"integer"},"token_limit":{"type":"integer"},"percent_used":{"type":"number"},"resets_at":{"type":["string","null"],"format":"date-time","description":"When the quota next resets, at 00:00 UTC. Null when it does not reset on a schedule, as during a trial."},"plan":{"type":["string","null"]},"limits":{"type":"array","items":{"type":"object","properties":{"scope":{"type":"string","enum":["member_week","week","month","trial","runs"],"description":"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`)."},"used":{"type":"integer"},"limit":{"type":"integer"},"resets_at":{"type":["string","null"],"format":"date-time","description":"When the counter next resets. Weeks start Tuesday 07:00 America/New_York. Null when it does not reset, as during a trial."},"ends_at":{"type":["string","null"],"format":"date-time","description":"Trial only: when the trial ends."}},"required":["scope","used","limit","resets_at"]},"description":"Every limit that applies to the organization. A request is refused with `token_limit_exceeded` when any token limit is used up."}},"required":["tokens_used","token_limit","percent_used","resets_at","plan","limits"]},"example":{"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"}]}}}},"401":{"description":"Missing, unknown, expired or revoked credential. Codes: invalid_credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unexpected error. Quote `request_id` to support. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/schemas":{"get":{"operationId":"listSchemas","summary":"List datasets","description":"The datasets the organization's products cover. Pass a name as `schema` when starting a conversation.\n\nRequires the `data:read` scope: list the available datasets. Rate limit: 60 requests a minute per credential.","tags":["Questions"],"security":[{"bearerAuth":[]},{"apiKeyHeader":[]}],"responses":{"200":{"description":"The datasets.","content":{"application/json":{"schema":{"type":"object","properties":{"schemas":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"table_count":{"type":["integer","null"]},"column_count":{"type":["integer","null"]}},"required":["name","table_count","column_count"]}}},"required":["schemas"]},"example":{"schemas":[{"name":"congressional_districts","table_count":4,"column_count":61}]}}}},"401":{"description":"Missing, unknown, expired or revoked credential. Codes: invalid_credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The organization's billing is not active. Codes: billing_inactive.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unexpected error. Quote `request_id` to support. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The analysis service failed or did not answer in time. `upstream_timeout` is sent with a `Retry-After` header. Codes: upstream_unavailable, upstream_timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/questions":{"post":{"operationId":"askQuestion","summary":"Ask a data question","description":"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.\n\nRequires the `data:query` scope: ask questions and generate charts, maps, reports and SQL explanations. Rate limit: 10 requests a minute per credential.","tags":["Questions"],"security":[{"bearerAuth":[]},{"apiKeyHeader":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"question":{"type":"string","minLength":1,"maxLength":4000},"conversation_id":{"type":"string"},"schema":{"type":"string","description":"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":{"type":"string","enum":["standard","analysis"]},"stream":{"type":"boolean"},"include":{"type":"array","items":{"type":"string","enum":["geometries"]}}},"required":["question"]}}}},"responses":{"200":{"description":"The answer, or an event stream when `stream` is true.","content":{"application/json":{"schema":{"type":"object","properties":{"message_id":{"type":"string"},"conversation_id":{"type":"string"},"answer":{"type":"string"},"sql":{"type":["string","null"]},"rows":{"type":"array","items":{"type":"object","additionalProperties":{}}},"row_count":{"type":"integer"},"rows_truncated":{"type":"boolean"},"geography_ids":{"type":"array","items":{"type":"string"}},"execution_time_ms":{"type":["number","null"]},"tokens":{"type":"object","properties":{"input":{"type":"integer"},"output":{"type":"integer"},"total":{"type":"integer"}},"required":["input","output","total"]},"usage":{"type":"object","properties":{"tokens_used":{"type":"integer"},"token_limit":{"type":"integer"},"percent_used":{"type":"number"},"resets_at":{"type":["string","null"],"format":"date-time","description":"When the quota next resets, at 00:00 UTC. Null when it does not reset on a schedule, as during a trial."}},"required":["tokens_used","token_limit","percent_used","resets_at"]},"geometries":{}},"required":["message_id","conversation_id","answer","sql","rows","row_count","rows_truncated","geography_ids","execution_time_ms","tokens","usage"]},"example":{"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"}}},"text/event-stream":{"schema":{"type":"string","description":"Server-sent events"}}}},"400":{"description":"The request is not valid. `details.issues` lists the fields. Codes: invalid_request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, unknown, expired or revoked credential. Codes: invalid_credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The organization's billing is not active. Codes: billing_inactive.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or owned by another user or organization. Codes: not_found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"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.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"The request body is over 1 MB. Codes: payload_too_large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unexpected error. Quote `request_id` to support. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The analysis service failed or did not answer in time. `upstream_timeout` is sent with a `Retry-After` header. Codes: upstream_unavailable, upstream_timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/conversations":{"get":{"operationId":"listConversations","summary":"List conversations","description":"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.\n\nRequires the `conversations:read` scope: read conversations, answers and result rows. Rate limit: 60 requests a minute per credential.","tags":["Conversations"],"security":[{"bearerAuth":[]},{"apiKeyHeader":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"default":0},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","enum":["api","mcp","app","all"],"description":"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."},"required":false,"description":"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.","name":"source","in":"query"}],"responses":{"200":{"description":"A page of conversations.","content":{"application/json":{"schema":{"type":"object","properties":{"conversations":{"type":"array","items":{"type":"object","properties":{"conversation_id":{"type":"string"},"title":{"type":["string","null"]},"schema":{"type":["string","null"]},"message_count":{"type":"integer"},"branched_from":{"type":["string","null"]},"source":{"type":"string","enum":["app","api","mcp"],"description":"Where the conversation started: the TeroAI web app, the REST API, or an MCP client."},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["conversation_id","title","schema","message_count","branched_from","source","created_at","updated_at"]}},"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"}},"required":["conversations","total","limit","offset"]},"example":{"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}}}},"400":{"description":"The request is not valid. `details.issues` lists the fields. Codes: invalid_request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, unknown, expired or revoked credential. Codes: invalid_credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unexpected error. Quote `request_id` to support. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/conversations/{id}":{"get":{"operationId":"getConversation","summary":"Get a conversation","description":"A conversation and its first messages, without result rows.\n\nRequires the `conversations:read` scope: read conversations, answers and result rows. Rate limit: 60 requests a minute per credential.","tags":["Conversations"],"security":[{"bearerAuth":[]},{"apiKeyHeader":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"message_limit","in":"query"}],"responses":{"200":{"description":"The conversation.","content":{"application/json":{"schema":{"type":"object","properties":{"conversation_id":{"type":"string"},"title":{"type":["string","null"]},"schema":{"type":["string","null"]},"message_count":{"type":"integer"},"branched_from":{"type":["string","null"]},"source":{"type":"string","enum":["app","api","mcp"],"description":"Where the conversation started: the TeroAI web app, the REST API, or an MCP client."},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"messages":{"type":"array","items":{"type":"object","properties":{"message_id":{"type":"string"},"role":{"type":"string","enum":["user","assistant","system"]},"content":{"type":"string"},"sql":{"type":["string","null"]},"row_count":{"type":["integer","null"]},"feedback":{"type":["string","null"],"enum":["up","down"]},"created_at":{"type":"string","format":"date-time"}},"required":["message_id","role","content","sql","row_count","feedback","created_at"]}},"messages_total":{"type":"integer"}},"required":["conversation_id","title","schema","message_count","branched_from","source","created_at","updated_at","messages","messages_total"]},"example":{"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}}}},"400":{"description":"The request is not valid. `details.issues` lists the fields. Codes: invalid_request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, unknown, expired or revoked credential. Codes: invalid_credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or owned by another user or organization. Codes: not_found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unexpected error. Quote `request_id` to support. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"renameConversation","summary":"Rename a conversation","description":"Sets the conversation's title.\n\nRequires the `conversations:write` scope: rename, delete and branch conversations, and rate answers. Rate limit: 60 requests a minute per credential.","tags":["Conversations"],"security":[{"bearerAuth":[]},{"apiKeyHeader":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200}},"required":["title"]}}}},"responses":{"200":{"description":"The renamed conversation.","content":{"application/json":{"schema":{"type":"object","properties":{"conversation_id":{"type":"string"},"title":{"type":["string","null"]},"schema":{"type":["string","null"]},"message_count":{"type":"integer"},"branched_from":{"type":["string","null"]},"source":{"type":"string","enum":["app","api","mcp"],"description":"Where the conversation started: the TeroAI web app, the REST API, or an MCP client."},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["conversation_id","title","schema","message_count","branched_from","source","created_at","updated_at"]},"example":{"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"}}}},"400":{"description":"The request is not valid. `details.issues` lists the fields. Codes: invalid_request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, unknown, expired or revoked credential. Codes: invalid_credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or owned by another user or organization. Codes: not_found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unexpected error. Quote `request_id` to support. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteConversation","summary":"Delete a conversation","description":"Deletes the conversation and its branches. Deleting is permanent through the API.\n\nRequires the `conversations:write` scope: rename, delete and branch conversations, and rate answers. Rate limit: 60 requests a minute per credential.","tags":["Conversations"],"security":[{"bearerAuth":[]},{"apiKeyHeader":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deleted."},"401":{"description":"Missing, unknown, expired or revoked credential. Codes: invalid_credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or owned by another user or organization. Codes: not_found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unexpected error. Quote `request_id` to support. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/conversations/{id}/messages":{"get":{"operationId":"listConversationMessages","summary":"List a conversation's messages","description":"Questions and answers in order, without result rows. Page through rows with /messages/{id}/rows.\n\nRequires the `conversations:read` scope: read conversations, answers and result rows. Rate limit: 60 requests a minute per credential.","tags":["Conversations"],"security":[{"bearerAuth":[]},{"apiKeyHeader":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"default":0},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"A page of messages.","content":{"application/json":{"schema":{"type":"object","properties":{"messages":{"type":"array","items":{"type":"object","properties":{"message_id":{"type":"string"},"role":{"type":"string","enum":["user","assistant","system"]},"content":{"type":"string"},"sql":{"type":["string","null"]},"row_count":{"type":["integer","null"]},"feedback":{"type":["string","null"],"enum":["up","down"]},"created_at":{"type":"string","format":"date-time"}},"required":["message_id","role","content","sql","row_count","feedback","created_at"]}},"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"}},"required":["messages","total","limit","offset"]},"example":{"messages":[],"total":2,"limit":50,"offset":0}}}},"400":{"description":"The request is not valid. `details.issues` lists the fields. Codes: invalid_request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, unknown, expired or revoked credential. Codes: invalid_credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or owned by another user or organization. Codes: not_found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unexpected error. Quote `request_id` to support. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/conversations/{id}/branches":{"post":{"operationId":"branchConversation","summary":"Branch a conversation","description":"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`.\n\nRequires the `conversations:write` scope: rename, delete and branch conversations, and rate answers. Rate limit: 60 requests a minute per credential.","tags":["Conversations"],"security":[{"bearerAuth":[]},{"apiKeyHeader":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"up_to_message_id":{"type":"string"},"title":{"type":"string","minLength":1,"maxLength":200,"description":"The new conversation's title. Defaults to the parent conversation's title."}}}}}},"responses":{"201":{"description":"The new conversation.","content":{"application/json":{"schema":{"type":"object","properties":{"conversation_id":{"type":"string"},"title":{"type":["string","null"]},"schema":{"type":["string","null"]},"message_count":{"type":"integer"},"branched_from":{"type":["string","null"]},"source":{"type":"string","enum":["app","api","mcp"],"description":"Where the conversation started: the TeroAI web app, the REST API, or an MCP client."},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["conversation_id","title","schema","message_count","branched_from","source","created_at","updated_at"]},"example":{"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"}}}},"400":{"description":"The request is not valid. `details.issues` lists the fields. Codes: invalid_request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, unknown, expired or revoked credential. Codes: invalid_credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or owned by another user or organization. Codes: not_found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unexpected error. Quote `request_id` to support. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/messages/{id}":{"get":{"operationId":"getMessage","summary":"Get an answer","description":"An answer with its question and SQL, without result rows.\n\nRequires the `conversations:read` scope: read conversations, answers and result rows. Rate limit: 60 requests a minute per credential.","tags":["Messages"],"security":[{"bearerAuth":[]},{"apiKeyHeader":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"message_id":{"type":"string"},"conversation_id":{"type":"string"},"question":{"type":["string","null"]},"answer":{"type":"string"},"sql":{"type":["string","null"]},"row_count":{"type":"integer"},"feedback":{"type":["string","null"],"enum":["up","down"]},"created_at":{"type":"string","format":"date-time"}},"required":["message_id","conversation_id","question","answer","sql","row_count","feedback","created_at"]},"example":{"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"}}}},"400":{"description":"The request is not valid. `details.issues` lists the fields. Codes: invalid_request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, unknown, expired or revoked credential. Codes: invalid_credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or owned by another user or organization. Codes: not_found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unexpected error. Quote `request_id` to support. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/messages/{id}/rows":{"get":{"operationId":"getAnswerRows","summary":"Page through an answer's rows","description":"Result rows of an answer, up to 1000 per page.\n\nRequires the `conversations:read` scope: read conversations, answers and result rows. Rate limit: 60 requests a minute per credential.","tags":["Messages"],"security":[{"bearerAuth":[]},{"apiKeyHeader":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":1000,"default":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"default":0},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"A page of rows.","content":{"application/json":{"schema":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","additionalProperties":{}}},"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"}},"required":["rows","total","limit","offset"]},"example":{"rows":[{"districts":38}],"total":1,"limit":100,"offset":0}}}},"400":{"description":"The request is not valid. `details.issues` lists the fields. Codes: invalid_request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, unknown, expired or revoked credential. Codes: invalid_credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or owned by another user or organization. Codes: not_found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unexpected error. Quote `request_id` to support. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/messages/{id}/feedback":{"put":{"operationId":"rateAnswer","summary":"Rate an answer","description":"Marks an answer as helpful (`up`) or not (`down`). `null` clears the rating.\n\nRequires the `conversations:write` scope: rename, delete and branch conversations, and rate answers. Rate limit: 60 requests a minute per credential.","tags":["Messages"],"security":[{"bearerAuth":[]},{"apiKeyHeader":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"rating":{"type":["string","null"],"enum":["up","down"]}},"required":["rating"]}}}},"responses":{"200":{"description":"The rating.","content":{"application/json":{"schema":{"type":"object","properties":{"message_id":{"type":"string"},"rating":{"type":["string","null"],"enum":["up","down"]}},"required":["message_id","rating"]},"example":{"message_id":"m7b2c4d6-1a3e-4f5a-8b9c-0d1e2f3a4b5c","rating":"up"}}}},"400":{"description":"The request is not valid. `details.issues` lists the fields. Codes: invalid_request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, unknown, expired or revoked credential. Codes: invalid_credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or owned by another user or organization. Codes: not_found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unexpected error. Quote `request_id` to support. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/messages/{id}/chart":{"post":{"operationId":"generateChart","summary":"Chart an answer","description":"A chart specification for an answer's rows: chart type, index column, series and data. Render it with any charting library. Spends tokens.\n\nRequires the `data:query` scope: ask questions and generate charts, maps, reports and SQL explanations. Rate limit: 10 requests a minute per credential.","tags":["Messages"],"security":[{"bearerAuth":[]},{"apiKeyHeader":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"The chart specification.","content":{"application/json":{"schema":{"type":"object","properties":{"chartType":{"type":"string"},"index":{"type":"string"},"categories":{"type":"array","items":{"type":"string"}},"data":{"type":"array","items":{"type":"object","additionalProperties":{}}}},"required":["chartType","index","categories","data"]},"example":{"chartType":"bar","index":"state","categories":["districts"],"data":[{"state":"TX","districts":38}]}}}},"400":{"description":"The request is not valid. `details.issues` lists the fields. Codes: invalid_request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, unknown, expired or revoked credential. Codes: invalid_credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The organization's billing is not active. Codes: billing_inactive.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or owned by another user or organization. Codes: not_found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unexpected error. Quote `request_id` to support. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The analysis service failed or did not answer in time. `upstream_timeout` is sent with a `Retry-After` header. Codes: upstream_unavailable, upstream_timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/messages/{id}/map":{"post":{"operationId":"generateMap","summary":"Map an answer","description":"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.\n\nRequires the `data:query` scope: ask questions and generate charts, maps, reports and SQL explanations. Rate limit: 10 requests a minute per credential.","tags":["Messages"],"security":[{"bearerAuth":[]},{"apiKeyHeader":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"format":{"type":"string","enum":["png","svg"]}}}}}},"responses":{"200":{"description":"The map image.","content":{"image/png":{"schema":{"type":"string","format":"binary"}},"image/svg+xml":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"The request is not valid. `details.issues` lists the fields. Codes: invalid_request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, unknown, expired or revoked credential. Codes: invalid_credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The organization's billing is not active. Codes: billing_inactive.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or owned by another user or organization. Codes: not_found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The answer cannot be mapped. Codes: map_unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unexpected error. Quote `request_id` to support. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The analysis service failed or did not answer in time. `upstream_timeout` is sent with a `Retry-After` header. Codes: upstream_unavailable, upstream_timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/messages/{id}/report":{"post":{"operationId":"generateReport","summary":"Write a report on an answer","description":"A written report on an answer's rows, with a title, summary and sections. Spends tokens.\n\nRequires the `data:query` scope: ask questions and generate charts, maps, reports and SQL explanations. Rate limit: 10 requests a minute per credential.","tags":["Messages"],"security":[{"bearerAuth":[]},{"apiKeyHeader":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"page_count":{"type":"integer","minimum":1,"maximum":10}}}}}},"responses":{"200":{"description":"The report.","content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string"},"summary":{"type":"string"},"sections":{"type":"array","items":{"type":"object","properties":{"heading":{"type":"string"},"content":{"type":"string"}},"required":["heading","content"]}},"data":{"type":"array","items":{"type":"object","additionalProperties":{}}},"metadata":{"type":"object","properties":{"query":{"type":"string"},"generatedAt":{"type":"string"},"reportType":{"type":"string"}},"required":["query","generatedAt","reportType"]}},"required":["title","summary","sections","data","metadata"]},"example":{"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"}}}}},"400":{"description":"The request is not valid. `details.issues` lists the fields. Codes: invalid_request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, unknown, expired or revoked credential. Codes: invalid_credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The organization's billing is not active. Codes: billing_inactive.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or owned by another user or organization. Codes: not_found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unexpected error. Quote `request_id` to support. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The analysis service failed or did not answer in time. `upstream_timeout` is sent with a `Retry-After` header. Codes: upstream_unavailable, upstream_timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/messages/{id}/sql_explanation":{"post":{"operationId":"explainSql","summary":"Explain an answer's SQL","description":"The answer's SQL split into sections, each explained in plain language. Spends tokens.\n\nRequires the `data:query` scope: ask questions and generate charts, maps, reports and SQL explanations. Rate limit: 10 requests a minute per credential.","tags":["Messages"],"security":[{"bearerAuth":[]},{"apiKeyHeader":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"The explanation.","content":{"application/json":{"schema":{"type":"object","properties":{"sql":{"type":"string"},"sections":{"type":"array","items":{"type":"object","properties":{"sql_section":{"type":"string"},"explanation":{"type":"string"},"start_char":{"type":["integer","null"]},"end_char":{"type":["integer","null"]},"matched":{"type":"boolean"}},"required":["sql_section","explanation","start_char","end_char","matched"]}},"input_tokens":{"type":"integer"},"output_tokens":{"type":"integer"},"total_tokens":{"type":"integer"},"timestamp":{"type":"string"}},"required":["sql","sections","timestamp"]},"example":{"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"}}}},"400":{"description":"The request is not valid. `details.issues` lists the fields. Codes: invalid_request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, unknown, expired or revoked credential. Codes: invalid_credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The organization's billing is not active. Codes: billing_inactive.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"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.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or owned by another user or organization. Codes: not_found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited, or the monthly token quota is used up. Codes: token_limit_exceeded, rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unexpected error. Quote `request_id` to support. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The analysis service failed or did not answer in time. `upstream_timeout` is sent with a `Retry-After` header. Codes: upstream_unavailable, upstream_timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/openapi.json":{"get":{"operationId":"getOpenApiDocument","summary":"This document","description":"The OpenAPI 3.1 description of this API. Public: no credential needed.","tags":["Account"],"security":[],"responses":{"200":{"description":"The OpenAPI document.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}}}}}},"webhooks":{}}