Query Approval

Submit query for approval

Submit a SQL query for human approval before execution. Returns a pending query ID for status polling. Optional Idempotency-Key retries return the original acceptance data and Location without creating another query. Keys are scoped to the organization and API key (or session user), remain reserved while the pending-query record exists, and cannot be reused with different connectionId, query or context. Poll Location for current status; a replay does not reopen expired or reviewed queries. Omitting the header preserves independent submissions.

post/queries/submit

Request

  • Base URL: https://app.aifordatabase.com/api/v1
  • URL: https://app.aifordatabase.com/api/v1/queries/submit
  • Auth: HTTP bearer

Headers

Idempotency-Keystring

Client-generated retry key. Reuse for identical retries; use a new key for a new submission. Persisted via the pending-query primary key across instances and restarts.

Request body

connectionIdstring required
querystring required
contextstring

Optional description of why this query needs to run

Response

Query submitted for approval. Poll the authenticated Location URL for its status.

errorunknown required

Changes

No recorded changes to this operation across all 1 revision of this API.