Skip to main content
POST
Complete a job

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

job_id
string<uuid>
required

Unique identifier for a job.

Body

application/json

Marks a job as completed along with its result. The body is polymorphic: the type field selects the result shape, which must match the job's type. The remaining fields depend on type.

Common variants:

  • forecast{ "type": "forecast", "cost": <integer>, "rows": <integer> }
  • refresh_materialized_view{ "type": "refresh_materialized_view", "snapshot_id": "<string>", "row_stats": { "affected_rows": <integer>, "inserted_rows": <integer>, "updated_rows": <integer>, "deleted_rows": <integer> } }
  • datasets_execute_dml{ "type": "datasets_execute_dml", "affected_rows": <integer>, ... }

Other supported type values include datasets_create_table, datasets_truncate_table, datasets_delete_table, datasets_deliver_data, datasets_calculate_column_stats, datasets_suggest_mappings, model_inference_run, model_training_run, models_deliver_model, models_train_classifier, and health_check.

type
string
required

Discriminator selecting the result shape. Must match the job's type.

Response

OK

job_id
string<uuid>
required

Unique identifier for the job.

data_plane_id
string<uuid>
required

The data plane the job runs on.

request_source
object
required
Example:
state
enum<string>
default:pending
required
Available options:
failed,
cancelled,
completed,
pending,
scheduled,
pending_cancellation,
running
type
string
required

The type associated with the job. Jobs can have a type of nql-forecast or materialize-view.

input
object
required
Example:
executor
string
required

The internal job executor tied to the job.

execution_cluster
enum<string>
required

The type of the execution cluster to run the job on.

  • dedicated runs job on a dedicated cluster.
  • shared runs job on a shared cluster.
Available options:
dedicated,
shared
failures
object[]
required

causes of job failure

idempotency_key
string
required

The unique ID associated with the job.

result
object
required

The output of a materialized view.

Example:
created_at
string<date-time>
required

The timestamp representing when the job was created.

updated_at
string<date-time>
required

The timestamp representing when the job was updated.

attempted_at
string<date-time>
required

When the job's current attempt started. A job can be retried; each retry is a new attempt, so this advances to the latest one, while created_at stays at the original submission.

attempt_version
integer
required

Which attempt this is: 1 for the first, increasing by one on each retry.

ended_at
string<date-time>
required

The timestamp representing when the job finished.

compute_pool_id
string<uuid>

The compute pool associated with the job, if any.