Skip to main content
POST
/
jobs
/
{job_id}
/
reschedule
Reschedule a job
curl --request POST \
  --url https://api-dev.narrative.io/jobs/{job_id}/reschedule \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "force": true
}'
{
  "job": {
    "job_id": "2a5b9ad7-dc8f-47bb-8e62-843a38f8054c",
    "data_plane_id": "f79cbdae-4848-47ca-95e8-69588364d185",
    "request_source": {
      "type": "api_user",
      "company_id": 1,
      "user_id": 407
    },
    "state": "completed",
    "type": "materialize-view",
    "input": {
      "nql": "CREATE MATERIALIZED VIEW \"test_stats\" AS SELECT \"value\" FROM \"company_data\".\"10674\"",
      "dataset_id": 10736,
      "stats_enabled": true,
      "compiled_select": "SELECT\n  `ds_10674`.`value`\nFROM\n  narrative.datasets.ds_10674 `ds_10674`"
    },
    "executor": "job-executor-98e1f48e-bf54-4f11-bbd1-73c445120266",
    "idempotency_key": "10736:29329c64e7b8a4eda86aaabe04872b832ab456b5543d0c259c812525391f158c:669a5f8e4f373c2f907700decde47511aac6470f5698e2b856fb07f09160e5f2",
    "result": {
      "dataset_id": 10736,
      "snapshot_id": 1724919539450264600,
      "recalculation_id": "abf9a2ec-426b-4751-bd16-fcb435061925"
    },
    "created_at": "2023-10-31T11:19:13.400498",
    "updated_at": "2023-10-31T11:25:08.327209",
    "ended_at": "2023-10-31T11:25:08.327194"
  }
}

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

Optional body for rescheduling a job. May be omitted entirely — an empty body keeps the default behavior, where rescheduling is a no-op for jobs already in a terminal state (completed, cancelled, failed).

force
boolean
default:false

When true, reschedule the job even if it is in a terminal state, resetting it to pending and clearing its executor so the operator re-dispatches it onto a fresh cluster. Use this to re-run a job that already finished. When omitted or false, terminal jobs are left untouched.

Response

OK

Result of rescheduling a job — what happened, plus the job's current state afterwards.

outcome
enum<string>
required

What a reschedule call did.

  • rescheduled — the job was put back on the queue (reset to pending, executor cleared).
  • skipped_terminal — the job was left untouched because it was already in a terminal state and force was not set.
Available options:
rescheduled,
skipped_terminal
job
object
required
Example:
{
"job_id": "2a5b9ad7-dc8f-47bb-8e62-843a38f8054c",
"data_plane_id": "f79cbdae-4848-47ca-95e8-69588364d185",
"request_source": {
"type": "api_user",
"company_id": 1,
"user_id": 407
},
"state": "completed",
"type": "materialize-view",
"input": {
"nql": "CREATE MATERIALIZED VIEW \"test_stats\" AS SELECT \"value\" FROM \"company_data\".\"10674\"",
"dataset_id": 10736,
"stats_enabled": true,
"compiled_select": "SELECT\n `ds_10674`.`value`\nFROM\n narrative.datasets.ds_10674 `ds_10674`"
},
"executor": "job-executor-98e1f48e-bf54-4f11-bbd1-73c445120266",
"idempotency_key": "10736:29329c64e7b8a4eda86aaabe04872b832ab456b5543d0c259c812525391f158c:669a5f8e4f373c2f907700decde47511aac6470f5698e2b856fb07f09160e5f2",
"result": {
"dataset_id": 10736,
"snapshot_id": 1724919539450264600,
"recalculation_id": "abf9a2ec-426b-4751-bd16-fcb435061925"
},
"created_at": "2023-10-31T11:19:13.400498",
"updated_at": "2023-10-31T11:25:08.327209",
"ended_at": "2023-10-31T11:25:08.327194"
}