Query Runner

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, failed, or unknown. These statuses are terminal.

A Harbor-bound scoped credential can submit freeform SQL only against its Harbor's backing connection, even if its profile allows other connections. Other credentials retain their existing connection access. Query results are stored temporarily and may expire; use the expires field from the result endpoint to understand how long they remain available.

post/api/connections/{connection_id}/query

Request

  • Base URL
    https://app.polytomic.com
  • Auth
    • HTTP bearer
    • or HTTP basic

Path parameters

connection_idstring uuid required

Unique identifier of the connection to run the query against

Example:248df4b7-aa70-47b8-a036-33ac447e668d

Query parameters

querystring

The query to execute against the connection

Example:SELECT * FROM table

Headers

X-Polytomic-Versionstring
X-Polytomic-Harbor-Sessionstring

Harbor session token; when supplied, the session must be active and bound to this credential and Harbor.

X-Polytomic-Activity-Request-IDstring

New nonzero UUID for each request, required for scoped credentials; a reused value is rejected.

Request body

querystring

The query to execute against the connection

Example request

{
  "query": "SELECT * FROM table"
}

Response

OK

Example response

{
  "data": {
    "count": 10,
    "expires": "2021-01-01T00:00:00Z",
    "fields": [
      "name",
      "age"
    ],
    "id": "43d893ef-322b-47da-badb-3cf10d13a556"
  }
}

Changes

    • breaking

      the response's property type changed from object to no type for status

    • warning

      removed the optional property / from the response with the status

    • warning

      removed the optional property / from the response with the status

    • warning

      removed the optional property / from the response with the status

    • warning

      removed the optional property / from the response with the status

    • warning

      removed the optional property / from the response with the status

    • warning

      removed the optional property / from the response with the status

    • warning

      removed the optional property / from the response with the status

    • info

      added to the response property allOf list for the response status

    • breaking

      the / response's property type changed from string to no type for status

    • info

      added to the / response property allOf list for the response status

    • info

      removed the created enum value from the / response property for the response status

    • info

      removed the done enum value from the / response property for the response status

    • info

      removed the failed enum value from the / response property for the response status

    • info

      removed the running enum value from the / response property for the response status

    • info

      removed the unknown enum value from the / response property for the response status