Skip to main content
GET
/
jobs
Get jobs
curl --request GET \
  --url https://api-dev.narrative.io/jobs \
  --header 'Authorization: Bearer <token>'
{
  "current_page": 1,
  "total_records": 1,
  "total_pages": 1,
  "records": [
    {
      "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.

Query Parameters

data_plane_id
string<uuid>

Filter jobs by data plane ID.

dataset_id
integer

Filter jobs where the input has a dataset_id (such as materalized-view)

offset
integer

Number of records to skip (page_number * per_page).

order_by
enum<string>

Order the results by a specific field. By default, job are order by created_at in descending order.

Available options:
created_at_asc,
created_at_desc,
updated_at_asc,
updated_at_desc
per_page
integer

Number of records to return. Defaults to 500, which is also the maximum; larger values are rejected with a 400.

Required range: x <= 500
state
enum<string>[]

Filter jobs by state. Repeat the parameter to match any of several states.

Available options:
cancelled,
completed,
failed,
pending,
pending_cancellation,
running
tag
string[]

Filter jobs by tag. Repeat the parameter to filter by multiple tags (e.g. ?tag=workflow_enqueued&tag=workflow_id=<uuid>); a job matches if it carries any of the supplied tags.

type
string[]

Filter jobs by type. Repeat the parameter to match any of several types.

Response

200 - application/json

OK

A paginated list of jobs.

records
object[]
required
current_page
integer<int64>
required

The number of requested page.

Example:

1

total_records
integer<int64>
required

Total amount of accessible Access Rules

Example:

15000

total_pages
integer<int64>
required

Total amount of pages.

Example:

10

prev_page
integer<int64>

The number of previous page (if exists). Also can refer to the latest existing page if non-existing page was requested.

Example:

1

next_page
integer<int64>

The number of next page (if exists).

Example:

42