---
title: "List jobs"
method: GET
path: "/api/jobs"
tags: ["Jobs"]
---

# List jobs

`GET /api/jobs`

List jobs, paginated and ordered by their creation date, with the most recent ones first.

## Query parameters

- `cursor` string
- `limit` integer
- `order_by` 'created_datetime:asc' | 'created_datetime:desc'
- `status` 'cancel_requested' | 'canceled' | 'done' | 'errored' | 'fatal_errored' | 'pending' | 'running' | 'scheduled', nullable
- `type` 'applyMacro' | 'deleteTicket' | 'exportTicket' | 'importMacro' | 'exportMacro' | 'updateTicket' | 'exportTicketDrilldown' | 'exportConvertCampaignSalesDrilldown', nullable

## Response `200`

A list of jobs.

- object
  - `data` Job[], required
    - `id` integer — ID of the job.
    - `cancel_requested_datetime` string, date-time, nullable — When the job cancellation was requested.
    - `cancelled_datetime` string, date-time, nullable — When the job was canceled.
    - `created_datetime` string, date-time, nullable — When the job was created.
    - `ended_datetime` string, date-time, nullable — When the job ended.
    - `failed_datetime` string, date-time, nullable — When the job failed.
    - `info` object — Data concerning the progress of the job. E.g: how many objects the job has already processed.
    - `locked_datetime` string, date-time, nullable — When the job was locked. A job is only locked while it's actively running.
    - `meta` object, nullable — Metadata associated with the job. You can use this parameter to store structured information (key-value data) about the job. This field is not used by Gorgias.
    - `params` object — The parameters of the job.
      - `apply_and_close` boolean — Whether the ticket should be closed once the macro is applied on it. Only applies to `applyMacro` jobs.
      - `end_datetime` string, nullable — End of the interval from which to select tickets when the parameter `view` is used.
      - `macro_id` integer — The ID of the macro to apply on the selected tickets. Only applies to `applyMacro` jobs.
      - `start_datetime` string, nullable — Beginning of the interval from which to select tickets when the parameter `view` is used.
      - `ticket_ids` integer[] — A list of ticket IDs to be processed by the job.
      - `url` string — The path to the file to import.
      - `updates` object — Object (key-value) containing all the changes to apply on the selected tickets. Only applies to `updateTicket` jobs.
      - `view` object — A [view](#the-view-object)-like object used to select the tickets to be processed by the job.
      - `view_id` integer — The ID of an existing [view](#the-view-object) used to select the tickets to be processed by the job.
      - `context` object — Object (key-value) containing extra context for the job
    - `scheduled_datetime` string, date-time, nullable — When the job was scheduled to be started. A job cannot be scheduled more than 60 minutes in the future. If unspecified, the job is queued for execution immediately after creation.
    - `started_datetime` string, date-time, nullable — When the job started.
    - `status` 'cancel_requested' | 'canceled' | 'done' | 'errored' | 'fatal_errored' | 'pending' | 'running' | 'scheduled' — The status of the job. Options: cancel_requested, canceled, done, errored, fatal_errored, pending, running, scheduled
    - `type` 'applyMacro' | 'deleteTicket' | 'exportTicket' | 'importMacro' | 'exportMacro' | 'updateTicket' | 'exportTicketDrilldown' | 'exportConvertCampaignSalesDrilldown' — The type of the job. Options: applyMacro, deleteTicket, exportTicket, importMacro, exportMacro, updateTicket, exportTicketDrilldown, exportConvertCampaignSalesDrilldown
    - `user_id` integer — The ID of the user who created this job.
    - `uri` string — URI of the job.
  - `meta` object, required
    - `next_cursor` string — Value indicating a cursor for the next page.
    - `prev_cursor` string — Value indicating a cursor for the previous page.

---

[API](https://skmtc.net/gorgias/apis/gorgias-rest-api.md) · [All operations](https://skmtc.net/gorgias/apis/gorgias-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/gorgias/gorgias-rest-api/versions/36f2e31f4e81/schema)
