Jobs

Retrieve a job

GET/api/v1/jobs/{id}

GET /jobs/{id}
curl -X GET 'https://www.unitpost.com/api/v1/jobs/job_123' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0'
Response · 200
{
  "object": "job",
  "id": "id_123",
  "kind": "string",
  "status": "QUEUED",
  "total": 1,
  "processed": 0,
  "failed": 0,
  "error": "string",
  "created_at": "2026-01-01T00:00:00.000Z",
  "completed_at": "2026-01-01T00:00:00.000Z"
}

Retrieve a background job by id to follow its progress. An operation that touches more contacts than fits in one request (for example Delete a custom contact field or Rename a custom field's key above 5,000 holders, or a campaign validation over more than 5,000 recipients) answers 202 with a job. Poll this until status is COMPLETED, FAILED or CANCELED; processed of total is the progress. A failed job keeps the work it finished; resume it with Retry a job. Reading a job takes the read capability of the resource it changes (contacts:read for a custom-field job or a contacts export, campaigns:read for a campaign check, topics:read for a topic opt-out). Requires the contacts:read capability.

Parameters1 field
FieldTypeDescription
idrequiredstring · path—
Response · 200 fields10 fields
FieldTypeDescription
objectrequiredstring—
idrequiredstring—
kindrequiredstring—
statusrequiredenumQUEUED | RUNNING | COMPLETED | FAILED | CANCELED—
totalrequiredinteger | null—
processedrequiredinteger—
failedrequiredinteger—
errorrequiredstring | null—
created_atrequiredstring—
completed_atrequiredstring | null—
200401403404

List jobs

GET/api/v1/jobs

GET /jobs
curl -X GET 'https://www.unitpost.com/api/v1/jobs' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0'
Response · 200
{
  "object": "list",
  "has_more": false,
  "data": [
    {
      "object": "job",
      "id": "id_123",
      "kind": "string",
      "status": "QUEUED",
      "total": 1,
      "processed": 0,
      "failed": 0,
      "error": "string",
      "created_at": "2026-01-01T00:00:00.000Z",
      "completed_at": "2026-01-01T00:00:00.000Z"
    }
  ]
}

Your background jobs, newest first and cursor-paginated, as Settings → Bulk operations lists them: the kinds an API operation starts that your key may read. Filter with status or kind. Requires the contacts:read capability.

Parameters5 fields
FieldTypeDescription
limitinteger · queryMax rows to return (default 20, max 100).
afterstring · queryReturn rows after this id (forward paging).
beforestring · queryReturn rows before this id (backward paging).
statusstring · queryQUEUED, RUNNING, COMPLETED, FAILED or CANCELED.
kindstring · queryOne kind, e.g. `contacts.export`, `contact_field.delete` or `contacts.topic_opt_out`.
Response · 200 fields10 fields
FieldTypeDescription
objectrequiredstring—
idrequiredstring—
kindrequiredstring—
statusrequiredenumQUEUED | RUNNING | COMPLETED | FAILED | CANCELED—
totalrequiredinteger | null—
processedrequiredinteger—
failedrequiredinteger—
errorrequiredstring | null—
created_atrequiredstring—
completed_atrequiredstring | null—
200401403422

Cancel a job

POST/api/v1/jobs/{id}/cancel

POST /jobs/{id}/cancel
curl -X POST 'https://www.unitpost.com/api/v1/jobs/job_123/cancel' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0'
Response · 200
{
  "object": "job",
  "id": "id_123",
  "kind": "string",
  "status": "QUEUED",
  "total": 1,
  "processed": 0,
  "failed": 0,
  "error": "string",
  "created_at": "2026-01-01T00:00:00.000Z",
  "completed_at": "2026-01-01T00:00:00.000Z"
}

Stop a queued or running job. A running job stops after the part in flight; the work already done stays. A kind that can't stop half-way (a custom-field rename) is a 409 saying why. Takes no body. Needs the capability that starts the kind (contacts:write for a custom-field job, contacts:read for an export, topics:write for a topic opt-out). Requires the contacts:read or contacts:write capability.

Parameters1 field
FieldTypeDescription
idrequiredstring · path—
Response · 200 fields10 fields
FieldTypeDescription
objectrequiredstring—
idrequiredstring—
kindrequiredstring—
statusrequiredenumQUEUED | RUNNING | COMPLETED | FAILED | CANCELED—
totalrequiredinteger | null—
processedrequiredinteger—
failedrequiredinteger—
errorrequiredstring | null—
created_atrequiredstring—
completed_atrequiredstring | null—
200400401403404409422

Retry a job

POST/api/v1/jobs/{id}/retry

POST /jobs/{id}/retry
curl -X POST 'https://www.unitpost.com/api/v1/jobs/job_123/retry' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0'
Response · 202
{
  "object": "job",
  "id": "id_123",
  "kind": "string",
  "status": "QUEUED",
  "total": 1,
  "processed": 0,
  "failed": 0,
  "error": "string",
  "created_at": "2026-01-01T00:00:00.000Z",
  "completed_at": "2026-01-01T00:00:00.000Z"
}

Resume a FAILED job from where it stopped: nothing it already processed runs again, but the rest does (a custom-field delete finishes removing the field from every contact). Any other status is a 409. Takes no body. Needs the capability that starts the kind (contacts:write for a custom-field job, contacts:read for an export, topics:write for a topic opt-out). Requires the contacts:read or contacts:write capability.

Parameters1 field
FieldTypeDescription
idrequiredstring · path—
Response · 202 fields10 fields
FieldTypeDescription
objectrequiredstring—
idrequiredstring—
kindrequiredstring—
statusrequiredenumQUEUED | RUNNING | COMPLETED | FAILED | CANCELED—
totalrequiredinteger | null—
processedrequiredinteger—
failedrequiredinteger—
errorrequiredstring | null—
created_atrequiredstring—
completed_atrequiredstring | null—
202400401403404409422502

Download a job's file

GET/api/v1/jobs/{id}/download

GET /jobs/{id}/download
curl -X GET 'https://www.unitpost.com/api/v1/jobs/job_123/download' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0'
Response · 200
{
  "object": "job_download",
  "job_id": "job_123",
  "url": "https://example.com",
  "filename": "string",
  "expires_at": "2026-01-01T00:00:00.000Z"
}

A finished job's file (a contacts export's CSV) as a signed url that expires in 5 minutes. A job that isn't COMPLETED, or a kind with no file, is a 409. Needs the kind's capability now: the file holds that data. Requires the contacts:read capability.

Parameters1 field
FieldTypeDescription
idrequiredstring · path—
Response · 200 fields5 fields
FieldTypeDescription
objectrequiredstring—
job_idrequiredstring—
urlrequiredstringA signed URL to the file; it expires in 5 minutes.
filenamerequiredstring—
expires_atrequiredstring—
200401403404409422503

Search docs and guides

Search the docs and product guides.