younifyd
Menu

Create Job

Create a job

POST/api/jobs

Use it in a workflow

  1. Add a step and choose the Gorgias connector.
  2. Pick the Create Job action (under Jobs).
  3. Fill in the fields below, then reference the result from later steps as {{createJob.response.data}}.

Request

Request body

Enter the body as JSON in the step's Body field.

metaobject | null

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.

paramsobjectrequired

The parameters of the job.

apply_and_closeboolean

Whether the ticket should be closed once the macro is applied on it. Only applies to `applyMacro` jobs.

end_datetimestring | null

End of the interval from which to select tickets when the parameter `view` is used.

macro_idinteger

The ID of the macro to apply on the selected tickets. Only applies to `applyMacro` jobs.

start_datetimestring | null

Beginning of the interval from which to select tickets when the parameter `view` is used.

ticket_idsarray<integer>

A list of ticket IDs to be processed by the job.

urlstring

The path to the file to import.

updatesobject

Object (key-value) containing all the changes to apply on the selected tickets. Only applies to `updateTicket` jobs.

viewobject

A [view](#the-view-object)-like object used to select the tickets to be processed by the job.

view_idinteger

The ID of an existing [view](#the-view-object) used to select the tickets to be processed by the job.

contextobject

Object (key-value) containing extra context for the job

scheduled_datetimestring | null

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.

typestringrequired

The type of the job. Options: applyMacro, deleteTicket, exportTicket, importMacro, exportMacro, updateTicket, exportTicketDrilldown, exportConvertCampaignSalesDrilldown

One ofapplyMacrodeleteTicketexportTicketimportMacroexportMacroupdateTicketexportTicketDrilldownexportConvertCampaignSalesDrilldown

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

Response

Returns 201 with an object. Read it in later steps with {{createJob.response.data.<field>}}.

idinteger

ID of the job.

cancel_requested_datetimestring | null

When the job cancellation was requested.

cancelled_datetimestring | null

When the job was canceled.

created_datetimestring | null

When the job was created.

ended_datetimestring | null

When the job ended.

failed_datetimestring | null

When the job failed.

infoobject

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

locked_datetimestring | null

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

metaobject | null

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.

paramsobject

The parameters of the job.

apply_and_closeboolean

Whether the ticket should be closed once the macro is applied on it. Only applies to `applyMacro` jobs.

end_datetimestring | null

End of the interval from which to select tickets when the parameter `view` is used.

macro_idinteger

The ID of the macro to apply on the selected tickets. Only applies to `applyMacro` jobs.

start_datetimestring | null

Beginning of the interval from which to select tickets when the parameter `view` is used.

ticket_idsarray<integer>

A list of ticket IDs to be processed by the job.

urlstring

The path to the file to import.

updatesobject

Object (key-value) containing all the changes to apply on the selected tickets. Only applies to `updateTicket` jobs.

viewobject

A [view](#the-view-object)-like object used to select the tickets to be processed by the job.

view_idinteger

The ID of an existing [view](#the-view-object) used to select the tickets to be processed by the job.

contextobject

Object (key-value) containing extra context for the job

scheduled_datetimestring | null

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 | null

When the job started.

statusstring

The status of the job. Options: cancel_requested, canceled, done, errored, fatal_errored, pending, running, scheduled

One ofcancel_requestedcanceleddoneerroredfatal_erroredpendingrunningscheduled

typestring

The type of the job. Options: applyMacro, deleteTicket, exportTicket, importMacro, exportMacro, updateTicket, exportTicketDrilldown, exportConvertCampaignSalesDrilldown

One ofapplyMacrodeleteTicketexportTicketimportMacroexportMacroupdateTicketexportTicketDrilldownexportConvertCampaignSalesDrilldown

user_idinteger

The ID of the user who created this job.

uristring

URI of the job.

json
{
  "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"
}

Need more? See the Gorgias guide for connection setup and behaviour shared by every action.

Was this page helpful?