Jobs

Update a job

put/api/jobs/{id}

Request

Path parameters

idinteger required

The ID of the job to update.

Request body

metaobject 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.

scheduled_datetimestring 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.

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

Example request

{
  "meta": {
    "description": "This job closes all tickets created in 2018"
  },
  "params": {
    "ticket_ids": [
      1,
      2,
      3
    ],
    "updates": {
      "status": "open"
    }
  },
  "scheduled_datetime": "2019-11-23T16:30:00.966927",
  "status": "canceled"
}

Response

The updated job.

idinteger

ID of the job.

cancel_requested_datetimestring date-time nullable

When the job cancellation was requested.

cancelled_datetimestring date-time nullable

When the job was canceled.

created_datetimestring date-time nullable

When the job was created.

ended_datetimestring date-time nullable

When the job ended.

failed_datetimestring date-time nullable

When the job failed.

infoobject

Data concerning the progress of the job. E.g: how many objects the job has already processed.

locked_datetimestring date-time nullable

When the job was locked. A job is only locked while it's actively running.

metaobject 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.

scheduled_datetimestring 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_datetimestring 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_idinteger

The ID of the user who created this job.

uristring

URI of the job.

Example response

{
  "id": 1234,
  "cancel_requested_datetime": "2019-11-23T16:31:00.966927",
  "cancelled_datetime": "2019-11-23T16:32:00.966927",
  "created_datetime": "2019-11-23T16:00:00.966927",
  "ended_datetime": "2019-11-23T16:32:00.966927",
  "failed_datetime": "2019-11-23T15:59:41.966927",
  "info": {
    "progress_count": 123
  },
  "locked_datetime": "2019-11-23T16:30:01.966927",
  "meta": {
    "description": "This job closes all tickets created in 2018"
  },
  "params": {
    "ticket_ids": [
      1,
      2,
      3
    ],
    "updates": {
      "status": "open"
    }
  },
  "scheduled_datetime": "2019-11-23T16:30:00.966927",
  "started_datetime": "2019-11-23T16:30:01.966927",
  "status": "canceled",
  "type": "updateTicket",
  "user_id": 42
}

Changes

No recorded changes to this operation across all 2 revisions of this API.