Unitpost Workspace API
The workspace's name and image (writes need `branding:write`), who is calling (`GET /whoami`, any credential), and the activity log (`GET /activity`, `activity:read`: no key preset includes it).
The workspace's name and image (writes need `branding:write`), who is calling (`GET /whoami`, any credential), and the activity log (`GET /activity`, `activity:read`: no key preset includes it).
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-workspace-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 Workspace 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: Workspace
description: 'The workspace''s name and image (writes need `branding:write`), who is calling (`GET /whoami`, any credential), and the activity log (`GET /activity`, `activity:read`: no key preset includes it).'
paths:
/whoami:
get:
operationId: workspace_whoami
tags:
- Workspace
summary: Who am I
description: 'The calling credential: its workspace, the API key (name, prefix, scope preset) or the OAuth sign-in (the app and the member it acts for), the `capabilities` it may use after every clamp, and the workspace''s rate limit. Call it first to plan within what the credential may do instead of learning by `403`. Never returns the secret. Requires no capability: any valid credential may call it.'
responses:
'200':
description: The caller.
content:
application/json:
schema:
$ref: '#/components/schemas/Whoami'
'401':
description: Missing or invalid API key.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: The credential's key or workspace no longer exists.
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'
/activity:
get:
operationId: activity_list
tags:
- Workspace
summary: List activity
description: 'The workspace activity log, newest first and cursor-paginated: what changed, when, and who changed it (`actor.name`: a teammate, System, Ask Unit) and, for a change made over the API, MCP or Ask Unit, how (`actor.via`, with the API key). The rows the dashboard''s Activity page and each record''s timeline show. Narrow with `subject` (and `subject_id`), `contact_id`, `campaign_id`, `q` (the record''s name or the actor) and `channel=email`. Needs `activity:read`, which no key preset includes: the log names your teammates. Requires the `activity: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: subject
in: query
required: false
description: Only changes to this kind of record.
schema:
type: string
enum:
- contact
- segment
- topic
- field
- template
- component
- campaign
- email
- domain
- sender_email
- library_image
- api_key
- webhook
- suppression
- message
- handle
- workspace
- name: subject_id
in: query
required: false
description: 'With `subject`: one record''s changes (its id, e.g. `dom_…`).'
schema:
type: string
- name: contact_id
in: query
required: false
description: One contact's timeline (`con_…`).
schema:
type: string
- name: campaign_id
in: query
required: false
description: A campaign's changes and what it led to (e.g. unsubscribes through it) (`cmp_…`).
schema:
type: string
- name: q
in: query
required: false
description: Part of the record's name or the actor's (case-insensitive). At most 200 characters.
schema:
type: string
maxLength: 200
- name: channel
in: query
required: false
description: '`email`: without SMS rows.'
schema:
type: string
enum:
- email
responses:
'200':
description: A page of activity.
content:
application/json:
schema:
type: object
properties:
object:
type: string
enum:
- list
has_more:
type: boolean
data:
type: array
items:
$ref: '#/components/schemas/Activity'
required:
- object
- has_more
- data
'401':
description: Missing or invalid API key.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Insufficient scope (`activity:read`).
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'422':
description: Invalid pagination or filter params, or an unknown query parameter.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'503':
description: '`operation_timed_out`: a search took too long. Narrow it, or retry.'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/workspace:
patch:
operationId: workspace_update
tags:
- Workspace
summary: Rename the workspace
description: Change the workspace's name. Deleting the workspace stays in the dashboard. Requires the `branding:write` capability.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/WorkspaceUpdate'
responses:
'200':
description: The workspace.
content:
application/json:
schema:
$ref: '#/components/schemas/Workspace'
'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.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'422':
description: A bad `name`, or an unknown key.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/workspace/image:
put:
operationId: workspace_set_image
tags:
- Workspace
summary: Set the workspace image
description: Replace the workspace image (its avatar in the dashboard, and the email logo when there's no brand logo), from a public https `url` or base64 `data` (PNG, JPEG, GIF or WebP, up to 5 MB and 16,384 px a side). Requires the `branding:write` capability.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ImageUpload'
responses:
'200':
description: The workspace.
content:
application/json:
schema:
$ref: '#/components/schemas/Workspace'
'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.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'422':
description: Neither or both of `url` and `data`, an image that couldn't be fetched or read, the wrong type, over 5 MB, over 16,384 px a side or 50 megapixels, or an unknown key.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'429':
description: Too many uploads; retry after the wait.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'502':
description: Storing the image failed; nothing changed. Retry.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'503':
description: '`engine_unavailable`: image hosting isn''t configured on this deployment; nothing changed.'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
delete:
operationId: workspace_remove_image
tags:
- Workspace
summary: Remove the workspace image
description: Clear the workspace image. Requires the `branding:write` capability.
responses:
'200':
description: The workspace.
content:
application/json:
schema:
$ref: '#/components/schemas/Workspace'
'401':
description: Missing or invalid API key.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Insufficient scope.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
components:
schemas:
ImageUpload:
type: object
properties:
url:
description: A public https image to fetch (no redirects, no private addresses). PNG, JPEG, GIF or WebP, up to 5 MB and 16,384 px a side (50 megapixels at most); anything else is a 422 naming `url`.
type: string
maxLength: 2048
data:
description: The image bytes, base64 (no `data:` prefix), up to 5 MB of image. Base64 grows bytes by a third, and a request body may be up to 30 MB. At most 16,384 px a side and 50 megapixels; anything else is a 422 naming `data`.
type: string
maxLength: 7000000
file_id:
description: 'A file made with `POST /files` and purpose `image` (`file_…`): how an agent hands over a local image without base64 (an upload session), or an image up to 5 MB. Checked by its bytes when it was made, and again here.'
type: string
minLength: 1
maxLength: 64
content_type:
description: Required with `data`; refused with `url` and `file_id` (the server reads the type from the bytes).
type: string
enum:
- image/png
- image/jpeg
- image/gif
- image/webp
filename:
description: Shown in the library. Defaults to the URL's file name, or `image`.
type: string
minLength: 1
maxLength: 200
Activity:
type: object
properties:
object:
type: string
const: activity
id:
type: string
type:
type: string
description: What happened, e.g. `contact_created`, `campaign_sent`, `domain_verified`.
subject:
type: string
enum:
- contact
- segment
- topic
- field
- template
- component
- campaign
- email
- domain
- sender_email
- library_image
- api_key
- webhook
- suppression
- message
- handle
- workspace
description: The kind of record it happened to.
subject_id:
description: The record's id (prefixed where the record has a public id).
anyOf:
- type: string
- type: 'null'
subject_label:
description: 'The record''s name at the time: a contact''s email, a segment''s name, …; a phone number is masked (`+1••••••7755`).'
anyOf:
- type: string
- type: 'null'
contact_id:
anyOf:
- type: string
- type: 'null'
campaign_id:
description: The campaign the change is attributed to (e.g. an unsubscribe through its link).
anyOf:
- type: string
- type: 'null'
actor:
type: object
properties:
name:
description: 'Who made the change: a teammate''s name or email, `System`, `Carrier`, `Ask Unit`, or null.'
anyOf:
- type: string
- type: 'null'
via:
anyOf:
- type: object
properties:
surface:
type: string
enum:
- api
- mcp
- unit
credential:
anyOf:
- type: string
enum:
- api_key
- oauth
- type: 'null'
api_key_id:
anyOf:
- type: string
- type: 'null'
required:
- surface
- credential
- api_key_id
- type: 'null'
description: 'For a change made over the API, MCP or Ask Unit: how, and which API key.'
required:
- name
- via
metadata:
type: object
propertyNames:
type: string
additionalProperties: {}
description: 'Detail for the change, varying by `type`: a segment''s or topic''s name, a status before and after, a renamed field''s keys, related ids (`campaign_id`, …). Descriptive keys only: addresses, URLs and error text stay in the dashboard.'
created_at:
type: string
required:
- object
- id
- type
- subject
- subject_id
- subject_label
- contact_id
- campaign_id
- actor
- metadata
- created_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
WorkspaceUpdate:
type: object
properties:
name:
type: string
minLength: 1
maxLength: 120
description: The workspace's new name.
required:
- name
Whoami:
type: object
properties:
object:
type: string
const: whoami
workspace:
type: object
properties:
id:
type: string
description: The workspace's id (`ws_…`).
name:
type: string
slug:
type: string
required:
- id
- name
- slug
organization:
type: object
properties:
id:
type: string
description: The organization's id (`org_…`).
name:
type: string
required:
- id
- name
description: The organization the workspace belongs to. A key still reaches only its own workspace.
credential:
type: object
properties:
type:
type: string
enum:
- api_key
- oauth
description: An API key, or a sign-in through OAuth (the CLI, an MCP client).
id:
description: The API key's id (`key_…`); null for a sign-in.
anyOf:
- type: string
- type: 'null'
name:
description: The API key's name; null for a sign-in.
anyOf:
- type: string
- type: 'null'
prefix:
description: The key's non-secret display prefix (e.g. `pk_live_a1b2`); null for a sign-in.
anyOf:
- type: string
- type: 'null'
scope:
anyOf:
- type: string
enum:
- full
- sending
- read_only
- type: 'null'
description: The preset the key was made with; `capabilities` is what it may do. Null for a sign-in.
created_at:
anyOf:
- type: string
- type: 'null'
last_used_at:
anyOf:
- type: string
- type: 'null'
client_id:
description: The OAuth app a sign-in came from; null for a key.
anyOf:
- type: string
- type: 'null'
client_name:
anyOf:
- type: string
- type: 'null'
user:
description: The member a sign-in acts for (name, or email); null for a key.
anyOf:
- type: string
- type: 'null'
required:
- type
- id
- name
- prefix
- scope
- created_at
- last_used_at
- client_id
- client_name
- user
description: Never the secret.
capabilities:
type: array
items:
type: string
description: 'What this credential may do, after every clamp: a call that needs another one answers 403 `insufficient_scope`.'
rate_limit:
type: object
properties:
limit:
type: integer
minimum: -9007199254740991
maximum: 9007199254740991
description: Requests per window, shared by every credential of the workspace.
window_seconds:
type: integer
minimum: -9007199254740991
maximum: 9007199254740991
description: The window's length, in seconds.
required:
- limit
- window_seconds
required:
- object
- workspace
- credential
- capabilities
- rate_limit
Workspace:
type: object
properties:
object:
type: string
const: workspace
id:
type: string
name:
type: string
slug:
type: string
image_url:
description: The workspace image (its avatar in the dashboard).
anyOf:
- type: string
- type: 'null'
required:
- object
- id
- name
- slug
- image_url
securitySchemes:
apiKey:
type: http
scheme: bearer
description: Your workspace API key.