Unitpost Jobs API
Background jobs for operations too large for one request — a custom-field delete or rename over thousands of contacts. Such a call answers `202` with a job; follow it here until it finishes.
Background jobs for operations too large for one request — a custom-field delete or rename over thousands of contacts. Such a call answers `202` with a job; follow it here until it finishes.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/unitpost-com:unitpost-com-jobs-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Unitpost Jobs API
version: v1
description: 'Public, versioned API for sending email and SMS and managing contacts, segments, campaigns, templates, domains, and webhooks. SMS is included on paid plans; on the free plan `POST /sms` returns `403` with `limit_reached`. Authenticate every request with an API key: `Authorization: Bearer `. A `User-Agent` header is required. Requests are scoped to the workspace that owns the key and are rate-limited per workspace. List endpoints are cursor-paginated via `limit`/`after`/`before` and return a `{ object: "list", has_more, data }` envelope. Register webhook endpoints to receive events: each create returns a `signing_secret` (`whsec_…`) exactly once. Every delivery is **svix-compatible**: it carries `svix-id`, `svix-timestamp`, and `svix-signature` (`v1,`) headers computed over `..` with your secret — verify them and reject deliveries whose signature doesn''t match (any Svix-compatible library works). Inbound email that lands on a receiving-enabled domain is readable under `/email/received`.'
servers:
- url: https://www.unitpost.com/api/v1
description: Base URL
security:
- apiKey: []
tags:
- name: Jobs
description: Background jobs for operations too large for one request — a custom-field delete or rename over thousands of contacts. Such a call answers `202` with a job; follow it here until it finishes.
paths:
/jobs/{id}:
parameters:
- name: id
in: path
required: true
schema:
type: string
get:
operationId: jobs_get
tags:
- Jobs
summary: Retrieve a job
description: 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.
responses:
'200':
description: The job.
content:
application/json:
schema:
$ref: '#/components/schemas/Job'
'401':
description: Missing or invalid API key.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: The API key lacks the read capability of the resource this job changes.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: Job not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/jobs:
get:
operationId: jobs_list
tags:
- Jobs
summary: List jobs
description: '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.'
parameters:
- name: limit
in: query
required: false
description: Max rows to return (default 20, max 100).
schema:
type: integer
minimum: 1
maximum: 100
- name: after
in: query
required: false
description: Return rows after this id (forward paging).
schema:
type: string
- name: before
in: query
required: false
description: Return rows before this id (backward paging).
schema:
type: string
- name: status
in: query
required: false
description: QUEUED, RUNNING, COMPLETED, FAILED or CANCELED.
schema:
type: string
enum:
- QUEUED
- RUNNING
- COMPLETED
- FAILED
- CANCELED
- name: kind
in: query
required: false
description: One kind, e.g. `contacts.export`, `contact_field.delete` or `contacts.topic_opt_out`.
schema:
type: string
responses:
'200':
description: A page of jobs.
content:
application/json:
schema:
type: object
properties:
object:
type: string
enum:
- list
has_more:
type: boolean
data:
type: array
items:
$ref: '#/components/schemas/Job'
required:
- object
- has_more
- data
'401':
description: Missing or invalid API key.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: The key can read no job kind.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'422':
description: A bad `status`, `kind` or pagination param, or an unknown query key.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/jobs/{id}/cancel:
parameters:
- name: id
in: path
required: true
schema:
type: string
post:
operationId: jobs_cancel
tags:
- Jobs
summary: Cancel a job
description: 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.
responses:
'200':
description: The job, canceled.
content:
application/json:
schema:
$ref: '#/components/schemas/Job'
'400':
description: The body isn't JSON.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':
description: Missing or invalid API key.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Insufficient scope for this job's kind.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: Job not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'409':
description: It has finished, or its kind can't be stopped.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'422':
description: A body key (this operation takes none).
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/jobs/{id}/retry:
parameters:
- name: id
in: path
required: true
schema:
type: string
post:
operationId: jobs_retry
tags:
- Jobs
summary: Retry a job
description: '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.'
responses:
'202':
description: The job, queued again.
content:
application/json:
schema:
$ref: '#/components/schemas/Job'
'400':
description: The body isn't JSON.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':
description: Missing or invalid API key.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Insufficient scope for this job's kind.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: Job not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'409':
description: It isn't `FAILED`.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'422':
description: A body key (this operation takes none).
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'502':
description: '`engine_unavailable`: the job couldn''t be handed back; it stays `FAILED`. Retry.'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/jobs/{id}/download:
parameters:
- name: id
in: path
required: true
schema:
type: string
get:
operationId: jobs_download
tags:
- Jobs
summary: Download a job's file
description: '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.'
responses:
'200':
description: Where to download it.
content:
application/json:
schema:
$ref: '#/components/schemas/JobDownload'
'401':
description: Missing or invalid API key.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Insufficient scope for this job's kind.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: Job not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'409':
description: No file yet, or none for this kind.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'422':
description: A query key (this operation takes none).
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'503':
description: Downloads aren't available in this environment.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
components:
schemas:
JobDownload:
type: object
properties:
object:
type: string
const: job_download
job_id:
type: string
url:
type: string
description: A signed URL to the file; it expires in 5 minutes.
filename:
type: string
expires_at:
type: string
required:
- object
- job_id
- url
- filename
- expires_at
Error:
type: object
properties:
error:
type: object
properties:
code:
type: string
description: Stable machine-readable error code (branch on this, not the message).
message:
type: string
description: 'Human-readable summary. For validation errors it''s path-prefixed (e.g. "template.variables.first_name: …").'
details:
type: array
description: 'Present on errors that carry per-field reasons: validation errors (422), a blocked campaign send (409), a plan that doesn''t include a feature (403 `limit_reached` with one entry whose `code` is `feature_not_in_plan` and whose `field` names the feature, e.g. `smsChannel`), and a send cap (429 `quota_exceeded` with one entry, `field` empty, whose `code` says which cap: `daily_quota_exceeded` or `monthly_quota_exceeded` (the free plan''s daily or monthly cap), `plan_required` (the workspace needs a paid plan to send this), `allowance_used` (a paid plan''s allowance is spent and it has no pay-as-you-go), `shared_plan_cap` (the organization''s shared plan, or this workspace''s cap on it, is used up) or `risk_throttled` (the account review''s daily cap, which an upgrade doesn''t lift)). One entry per offending field/blocker.'
items:
type: object
properties:
field:
type: string
description: Dotted path to the field, e.g. "template.variables.first_name" (empty for a whole-body problem).
code:
type: string
description: Machine-readable reason for this entry, when there is one (e.g. `template_not_published` on `template_id` for a blocked SMS campaign send, or `feature_not_in_plan` on `smsChannel` when the plan has no SMS). Absent on plain validation errors.
message:
type: string
required:
- field
- message
doc_url:
type: string
format: uri
description: 'A page that explains this error and what to do, when there is one: an absolute link on the API''s own host. Every 429 has one (a section of the rate-limits guide: the request limit, an operation''s limit, the plan''s send caps or the account review cap), as do `sending_paused`, the SMS access review''s `sms_review_pending` and `account_under_review`, and errors about domains, API keys, idempotency keys, plan limits, billing, SMS consent and suppression. A `details[].code` with a page of its own picks it. Additive; absent otherwise.'
required:
- code
- message
required:
- error
Job:
type: object
properties:
object:
type: string
const: job
id:
type: string
kind:
type: string
status:
type: string
enum:
- QUEUED
- RUNNING
- COMPLETED
- FAILED
- CANCELED
total:
anyOf:
- type: integer
minimum: -9007199254740991
maximum: 9007199254740991
- type: 'null'
processed:
type: integer
minimum: -9007199254740991
maximum: 9007199254740991
failed:
type: integer
minimum: -9007199254740991
maximum: 9007199254740991
error:
anyOf:
- type: string
- type: 'null'
created_at:
type: string
completed_at:
anyOf:
- type: string
- type: 'null'
required:
- object
- id
- kind
- status
- total
- processed
- failed
- error
- created_at
- completed_at
securitySchemes:
apiKey:
type: http
scheme: bearer
description: Your workspace API key.