Skip to content

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.

bucket
required
string
/^[a-zA-Z0-9][a-zA-Z0-9\-]*$/

Flock bucket ID. The caller must have access to this bucket.

Example
example
jobId
required
string format: uuid

Job ID returned by POST /api/v1/{bucket}/ask.

Example
a6220339-7ed3-42cf-b93a-67f78043567a

Job status or completed results

object
data
required
object
job_id
string format: uuid
status
string
Allowed values: processing completed failed
columns
Array<string>
rows
Array<Array>
generated_sql
string
error_code
string
error_message
string
Examples

Still running

{
"data": {
"job_id": "a6220339-7ed3-42cf-b93a-67f78043567a",
"status": "processing"
}
}

Authentication required

object
error
required
object
code
required

Machine-readable error code.

string
Example
unauthorized
message
required

Human-readable error message.

string
Example
Authentication required
Example
{
"error": {
"code": "unauthorized",
"message": "Authentication required"
}
}

Access denied to bucket

object
error
required
object
code
required

Machine-readable error code.

string
Example
unauthorized
message
required

Human-readable error message.

string
Example
Authentication required
Example
{
"error": {
"code": "forbidden",
"message": "Access denied to bucket 'example'"
}
}

Resource not found

object
error
required
object
code
required

Machine-readable error code.

string
Example
unauthorized
message
required

Human-readable error message.

string
Example
Authentication required
Example
{
"error": {
"code": "not_found",
"message": "Unknown table: foo"
}
}