Poll for async ask query result
GET /api/v1/{bucket}/ask/jobs/{jobId}
Polls the status of an async ask query job. Returns the generated SQL and query results when complete, or the current status if still processing.
Jobs expire after 1 hour (DynamoDB TTL). Worker timeout is detected after 130 seconds.
For Bearer token auth, the caller must be the user who submitted the job. API key auth can poll any job.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Flock bucket ID. The caller must have access to this bucket.
Example
exampleJob ID returned by POST /api/v1/{bucket}/ask.
Example
a6220339-7ed3-42cf-b93a-67f78043567aResponses
Section titled “ Responses ”Job status or completed results
object
object
Examples
Still running
{ "data": { "job_id": "a6220339-7ed3-42cf-b93a-67f78043567a", "status": "processing" }}Completed with results
{ "data": { "columns": [ "membership_type", "count" ], "rows": [ [ "Standard", 450 ], [ "Premium", 120 ] ], "generated_sql": "SELECT membership_type, count(*) as count FROM member GROUP BY membership_type" }, "meta": { "bucket": "example", "question": "How many members by type?" }}Query failed
{ "data": { "job_id": "a6220339-7ed3-42cf-b93a-67f78043567a", "status": "failed", "error_code": "generation_failed", "error_message": "Could not generate a query for that question." }}Authentication required
object
object
Machine-readable error code.
Example
unauthorizedHuman-readable error message.
Example
Authentication requiredExample
{ "error": { "code": "unauthorized", "message": "Authentication required" }}Access denied to bucket
object
object
Machine-readable error code.
Example
unauthorizedHuman-readable error message.
Example
Authentication requiredExample
{ "error": { "code": "forbidden", "message": "Access denied to bucket 'example'" }}Resource not found
object
object
Machine-readable error code.
Example
unauthorizedHuman-readable error message.
Example
Authentication requiredExample
{ "error": { "code": "not_found", "message": "Unknown table: foo" }}