Jobs

The job object

Records a piece of work the API accepted and carries out asynchronously. Endpoints answering 202 Accepted point at one with a Location header; poll it for the outcome.

idstring

Job ID.

objectstringenumValues:job

Resource type identifier.

typestringenumValues:bulk_createbulk_upsertexport

The kind of work the job carries out.

resource_typestringnullableenumValues:accountactorentity

The kind of resource the job operates on, as an object-type value (e.g. product).

type names the verb — what the job does — and this names the subject, so a job that produced no results still says what it was for.

statusstringenumValues:createdstartedcompleted

How far the job has got.

completed means the work was processed, not that every row succeeded — read each entry's own status in results.

created_byactornullable

The actor who requested the work.

idstring

Unique identifier of the actor.

objectstringenumValues:actor

Resource type identifier.

typestringenumValues:userapi_keyagent

Actor type.

  • user: a human user account.
  • api_key: a programmatic caller authenticating with an API key.
  • agent: an automated agent acting on the account's behalf.
  • group: a shared group identity, such as a "Customer Service" persona, rather than a single individual.
namestringnullable

The actor's display name.

handlestringnullable

Human-readable handle identifying the actor.

  • For user actors: the user's email address.
  • For api_key actors: the redacted key value.

Other actor types carry no handle.

avatar_urlstringnullable

URL of the actor's profile photo, if one is set.

Only populated for user actors.

rolerolenullable

The role the actor holds in the account, which determines what it is permitted to do.

idstring

Role ID.

objectstringenumValues:role

Resource type identifier.

namestring

Display name of the role.

Unique within the account.

typestringenumValues:adminuserscanner

The kind of role.

The type gates behavior that individual permissions do not cover, and some actions are reserved for a single role type.

  • admin: full administrative access. Sensitive areas such as API keys, billing, and third-party integrations are restricted to admins no matter what permissions another role holds.
  • user: a custom role tailored to a specific need, with its permissions defined explicitly. Roles created through the API always have this type.
  • scanner: the role used by shop-floor scanning stations, assigned automatically when a scanning-station user is created.
  • sales_rep: a role for sales representatives. Order analytics are scoped to the rep's own orders.
  • agent: a role assigned to an automated agent rather than a person.
ownerownernullable

Provenance of this role.

System-owned roles are platform-provided defaults shared across all accounts and cannot be updated or deleted; account-owned roles are custom to your account.

Always returned as null in this endpoint.
permissionsarray of stringnullable

Permissions granted by this role, in {permission}:{action} format, such as customers:read.

created_atstring (date-time)

Creation timestamp.

updated_atstring (date-time)

Last updated timestamp.

resultslistnullable

One entry per submitted row, saying what became of it. A bulk create records these when it accepts the request, so they stay provisional until status is completed.

page_info.has_next_page is true when the job produced more rows than it records.

objectstringenumValues:list

Resource type identifier.

page_infoobject

Pagination metadata.

next_page_urlstringnullable

Relative URL that fetches the next page of results.

previous_page_urlstringnullable

Relative URL that fetches the previous page of results.

has_next_pageboolean

Whether more results exist after this page.

has_prev_pageboolean

Whether results exist before this page.

dataarray of job_result

Resources in this page.

objectstringenumValues:job_result

Resource type identifier.

indexinteger

Zero-based row of the request this result names.

statusstringenumValues:createdupdatedfailed

What became of the row.

  • created: the row produced a new resource.
  • updated: the row updated an existing resource.
  • failed: the row was rejected and wrote nothing.
resourceentitynullable

The resource the row produced. Null when the row failed.

idstring

Unique identifier for the entity.

objectstringenumValues:entity

Resource type identifier.

typestringenumValues:accountactorentity

The resource kind that this entity references, as an object-type value (e.g. user, account).

Unlike object — which is always entity — this names the underlying resource the id points to.

namestringnullable

Human-readable display name for the entity (e.g. a user's full name, a sales order number).

handlestringnullable

Secondary human-readable identifier (e.g. email address, username, redacted API key value).

sub_resourceslistnullable

Resources produced as a side effect to the row's primary operation.

For example, when creating a production run, several batch records may also be created.

objectstringenumValues:list

Resource type identifier.

page_infoobject

Pagination metadata.

next_page_urlstringnullable

Relative URL that fetches the next page of results.

previous_page_urlstringnullable

Relative URL that fetches the previous page of results.

has_next_pageboolean

Whether more results exist after this page.

has_prev_pageboolean

Whether results exist before this page.

dataarray of entity

Resources in this page.

idstring

Unique identifier for the entity.

objectstringenumValues:entity

Resource type identifier.

typestringenumValues:accountactorentity

The resource kind that this entity references, as an object-type value (e.g. user, account).

Unlike object — which is always entity — this names the underlying resource the id points to.

namestringnullable

Human-readable display name for the entity (e.g. a user's full name, a sales order number).

handlestringnullable

Secondary human-readable identifier (e.g. email address, username, redacted API key value).

errorobjectnullable

Why the row was rejected, in the same shape a synchronous error response carries.

Null unless status is failed.

codestringenumValues:expired_tokenapi_key_expiredapi_key_revoked

A machine-readable code for the error.

typestringenumValues:api_erroridempotency_errorinvalid_request_error

The type of error.

messagestring

A human-readable message providing more details about the error.

paramstringnullable

The parameter that caused the error, if applicable.

doc_urlstringnullable

A URL to documentation about the error.

is_transientboolean

Whether this error is transient and the request can be retried.

quotaobjectnullable

Quota provides plan limit details when the error is limit_exceeded. Nil otherwise.

limitinteger

Limit is the maximum number of resources allowed by the current plan.

usedinteger

Used is the number of resources currently consumed.

reset_atstring (date-time)nullable

ResetAt is the time when the quota resets, if applicable. Nil for static (non-metered) limits.

request_log_urlstringnullable

RequestLogURL is a link to the dashboard page for this request's log entry. Nil when no request log is available.

errorobjectnullable

The failure that sank the job as a whole, in the same shape a synchronous error response carries.

A row rejected on its own merits reports its failure on its own entry in results instead, so this stays null even when some rows failed.

codestringenumValues:expired_tokenapi_key_expiredapi_key_revoked

A machine-readable code for the error.

typestringenumValues:api_erroridempotency_errorinvalid_request_error

The type of error.

messagestring

A human-readable message providing more details about the error.

paramstringnullable

The parameter that caused the error, if applicable.

doc_urlstringnullable

A URL to documentation about the error.

is_transientboolean

Whether this error is transient and the request can be retried.

quotaobjectnullable

Quota provides plan limit details when the error is limit_exceeded. Nil otherwise.

limitinteger

Limit is the maximum number of resources allowed by the current plan.

usedinteger

Used is the number of resources currently consumed.

reset_atstring (date-time)nullable

ResetAt is the time when the quota resets, if applicable. Nil for static (non-metered) limits.

request_log_urlstringnullable

RequestLogURL is a link to the dashboard page for this request's log entry. Nil when no request log is available.

exportjob_exportnullable

Where a completed export job's file can be downloaded.

Null on every other job, and returned only to a caller asking for JSON — otherwise retrieving the job redirects to it.

objectstringenumValues:job_export

Resource type identifier.

urlstring

Presigned link to the file, valid for five minutes.

If the link has expired, read the job again for a fresh one.

started_atstring (date-time)nullable

When the job began executing.

completed_atstring (date-time)nullable

When the job finished processing, whether or not every row succeeded.

failed_atstring (date-time)nullable

When the most recent attempt failed. A retry that succeeds leaves this alongside completed_at.

cancelled_atstring (date-time)nullable

When the job was cancelled.

created_atstring (date-time)

When the job was created.

updated_atstring (date-time)

When the job was last updated.

Used by