For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Log inBook a demo
GuidesAPI Reference
GuidesAPI Reference
  • API Reference
      • POSTRun Query
      • GETGet Query Results
Logo
Log inBook a demo
API ReferenceQuery Runner

Run Query

POST
https://app.polytomic.com/api/connections/:connection_id/query
POST
/api/connections/:connection_id/query
$curl -X POST https://app.polytomic.com/api/connections/248df4b7-aa70-47b8-a036-33ac447e668d/query \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{}'
1{
2 "data": {
3 "count": 10,
4 "error": "string",
5 "expires": "2021-01-01T00:00:00Z",
6 "fields": [
7 "name",
8 "age"
9 ],
10 "id": "43d893ef-322b-47da-badb-3cf10d13a556",
11 "results": [
12 {}
13 ],
14 "status": "created"
15 }
16}
Submits a query for asynchronous execution against the connection. This endpoint returns immediately with a query task ID. It does not wait for the query to finish. Poll [`GET /api/queries/{id}`](../../../../api-reference/query-runner/get-query) until `status` reaches `done` or `failed`. Only the user who created the query can fetch its results later. Query results are stored temporarily and may expire; use the `expires` field from the result endpoint to understand how long they will remain available.
Was this page helpful?
Previous

Get Query Results

Next

Submits a query for asynchronous execution against the connection.

This endpoint returns immediately with a query task ID. It does not wait for the query to finish. Poll GET /api/queries/{id} until status reaches done or failed.

Only the user who created the query can fetch its results later. Query results are stored temporarily and may expire; use the expires field from the result endpoint to understand how long they will remain available.

Authentication

AuthorizationBearer
Bearer user API key
OR
AuthorizationBasic

Basic organization-scoped API key

Path parameters

connection_idstringRequiredformat: "uuid"
Unique identifier of the connection to run the query against.

Headers

X-Polytomic-VersionstringOptional

Query parameters

querystringOptional
The query to execute against the connection.

Request

This endpoint expects an object.

Response

OK
dataobject

Errors

400
Bad Request Error
404
Not Found Error
500
Internal Server Error