Unitpost SMS topics API

SMS subscription categories recipients can opt out of, independent from email topics. STOP still opts a number out of every SMS.

GitHub OpenAPI

Operations 6

GET /sms/topics List SMS topics #
POST /sms/topics Create an SMS topic #
GET /sms/topics/{id} Retrieve an SMS topic #
PATCH /sms/topics/{id} Update an SMS topic #
DELETE /sms/topics/{id} Delete an SMS topic #
POST /sms/topics/{id}/opt-out Opt contacts out of an SMS topic #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • 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.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/unitpost-com:unitpost-com-sms-topics-api"
All apis
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.

Get an API 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 Specification

unitpost-com-sms-topics-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Unitpost SMS topics 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: SMS topics
  description: SMS subscription categories recipients can opt out of, independent from email topics. STOP still opts a number out of every SMS.
paths:
  /sms/topics:
    get:
      operationId: sms_topics_list
      tags:
      - SMS topics
      summary: List SMS topics
      description: 'Retrieve your SMS subscription topics, cursor-paginated. An SMS topic is a category of marketing SMS (e.g. Flash sales) recipients can opt out of while still receiving your other texts. SMS and email topics are separate: a contact''s email preference never changes their SMS one, and STOP still opts a number out of every SMS. Pass `?archived=true` to list archived topics instead. Create one with Create an SMS topic. Requires the `topics: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: archived
        in: query
        required: false
        schema:
          type: boolean
        description: When true, list only archived SMS topics instead of active ones.
      responses:
        '200':
          description: A page of SMS topics.
          content:
            application/json:
              schema:
                type: object
                properties:
                  object:
                    type: string
                    enum:
                    - list
                  has_more:
                    type: boolean
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Topic'
                required:
                - object
                - has_more
                - data
          headers:
            Unitpost-Warning:
              $ref: '#/components/headers/UnitpostWarning'
        '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'
        '404':
          description: SMS is not enabled for this workspace.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Invalid pagination params.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: '`operation_timed_out`: counting the topic''s subscribers took too long; retry after `Retry-After`.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      operationId: sms_topics_create
      tags:
      - SMS topics
      summary: Create an SMS topic
      description: 'Create an SMS subscription topic. `default_opt_in` decides whether contacts with no explicit preference are treated as subscribed. Names are unique per channel, so an SMS topic may share a name with an email topic. Topics are a plan feature: an unentitled workspace gets `403` with `limit_reached`. Requires the `topics:write` capability.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TopicCreate'
      responses:
        '201':
          description: Created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Topic'
          headers:
            Unitpost-Warning:
              $ref: '#/components/headers/UnitpostWarning'
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Insufficient scope, or topics aren't on your plan (`limit_reached`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: SMS is not enabled for this workspace.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: An SMS topic with that name already exists.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Validation error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /sms/topics/{id}:
    parameters:
    - name: id
      in: path
      required: true
      schema:
        type: string
    get:
      operationId: sms_topics_get
      tags:
      - SMS topics
      summary: Retrieve an SMS topic
      description: Retrieve a single SMS topic by `id`. An email topic id returns `404` here. Change it with Update an SMS topic. Requires the `topics:read` capability.
      responses:
        '200':
          description: The SMS topic.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Topic'
          headers:
            Unitpost-Warning:
              $ref: '#/components/headers/UnitpostWarning'
        '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'
        '404':
          description: SMS topic not found, or SMS is not enabled.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: '`operation_timed_out`: counting the topic''s subscribers took too long; retry after `Retry-After`.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    patch:
      operationId: sms_topics_update
      tags:
      - SMS topics
      summary: Update an SMS topic
      description: 'Update an SMS topic''s name, description or `default_opt_in`, or pass `{ "archived": true | false }` to archive or restore it. Changing `default_opt_in` subscribes (`true`) or unsubscribes (`false`) every contact with no explicit choice on the topic at once (SMS marketing still needs each one''s consent); `Unitpost-Warning` names how many. Archiving is blocked with `409` while an active SMS campaign or a live automation still uses the topic. Requires the `topics:write` capability.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TopicUpdate'
      responses:
        '200':
          description: The updated SMS topic.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Topic'
          headers:
            Unitpost-Warning:
              $ref: '#/components/headers/UnitpostWarning'
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Insufficient scope, or restoring needs a plan with topics.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: SMS topic not found, or SMS is not enabled.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: Name taken, or the topic is in use by an active campaign or automation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Validation error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      operationId: sms_topics_delete
      tags:
      - SMS topics
      summary: Delete an SMS topic
      description: 'Archive an SMS topic (a soft delete: subscription records are kept so you can restore it with `{ "archived": false }` on Update an SMS topic). Blocked with `409` while an active SMS campaign or a live automation still uses it. Requires the `topics:write` capability.'
      responses:
        '204':
          description: Archived.
          headers:
            Unitpost-Warning:
              $ref: '#/components/headers/UnitpostWarning'
        '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'
        '404':
          description: SMS topic not found, or SMS is not enabled.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: The topic is in use by an active campaign or automation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /sms/topics/{id}/opt-out:
    parameters:
    - name: id
      in: path
      required: true
      schema:
        type: string
    post:
      operationId: sms_topics_opt_out
      tags:
      - SMS topics
      summary: Opt contacts out of an SMS topic
      description: 'Opt many contacts out of this topic in one call, as a background job: the contacts you list (`contact_ids` or `emails`, up to 1,000, each a contact of this workspace) or every member of a segment (`segment_id`, however many; also needs `segments:read`). Send exactly one. Each contact is opted out as Set a contact''s topic preference would: one that was subscribed gets a `topic.unsubscribed` webhook and an activity row naming your key; one already opted out is left as it is, with no webhook. Suppressions and other topics are untouched, and there is no bulk opt-in. Listed contacts are checked first: the first that isn''t one of yours is a `404` naming it (`details`), and nothing starts. The answer is the job (`202`, `Location`); follow it with Retrieve a job. Pass an `Idempotency-Key` so a retry answers the same job instead of starting another. An email topic''s id is a `404` here. Requires the `topics:write` capability.'
      parameters:
      - name: Idempotency-Key
        in: header
        required: false
        description: Any unique string (1–256 characters, e.g. a UUID). Retrying with the same key and the same body within 24 hours returns the first result instead of sending again; the same key with a different body is `409 invalid_idempotent_request`, and one still in flight is `409 concurrent_idempotent_requests`.
        schema:
          type: string
          minLength: 1
          maxLength: 256
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TopicOptOut'
      responses:
        '202':
          description: The opt-out job (`Location` names it).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Job'
        '400':
          description: The body isn't JSON, or the `Idempotency-Key` header is not 1–256 characters.
          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 (`segment_id` also needs `segments:read`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: SMS topic not found, or SMS is not enabled; or a listed contact or the segment isn't in this workspace (`details` names it).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: 'Idempotency conflict: the same key with a different body or topic, or one still in flight; or `job_in_progress`: five opt-outs are already running in this workspace (follow them with `GET /jobs`).'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Not exactly one of `contact_ids`, `emails` and `segment_id`, more than 1,000 listed, or an unknown key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Too many opt-outs started this minute (`Retry-After`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '502':
          description: '`engine_unavailable`: the job couldn''t be started; nothing was opted out. Retry.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    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
    TopicUpdate:
      type: object
      properties:
        name:
          type: string
          maxLength: 120
        description:
          anyOf:
          - type: string
            maxLength: 500
          - type: 'null'
        default_opt_in:
          type: boolean
    TopicOptOut:
      type: object
      properties:
        contact_ids:
          description: Contacts of this workspace (`con_…`), up to 1,000.
          minItems: 1
          maxItems: 1000
          type: array
          items:
            type: string
            minLength: 1
        emails:
          description: Contacts of this workspace by email address, up to 1,000.
          minItems: 1
          maxItems: 1000
          type: array
          items:
            type: string
        segment_id:
          description: Every member of this segment (`seg_…`), however many. Also needs `segments:read`.
          type: string
          minLength: 1
      description: 'Who to opt out: exactly one of `contact_ids`, `emails` or `segment_id`.'
    TopicCreate:
      type: object
      properties:
        name:
          type: string
          maxLength: 120
        description:
          type: string
          maxLength: 500
        default_opt_in:
          type: boolean
      required:
      - name
    Topic:
      type: object
      properties:
        object:
          type: string
          const: topic
        id:
          type: string
        name:
          type: string
        description:
          anyOf:
          - type: string
          - type: 'null'
        channel:
          type: string
          enum:
          - email
          - sms
          description: Which channel the topic belongs to. Email topics are managed under `/email/topics`, SMS topics under `/sms/topics`.
        default_opt_in:
          type: boolean
        subscriber_count:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
          description: 'Contacts subscribed to this topic, among those the channel can reach (an email address, or an SMS number): for an opt-out topic everyone but those who opted out of it, for an opt-in topic those who opted in. A send also skips contacts unsubscribed from everything and suppressed addresses. The dashboard''s count.'
        unsubscribed_count:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
          description: Reachable contacts who opted out of this topic.
        created_at:
          type: string
        updated_at:
          type: string
      required:
      - object
      - id
      - name
      - description
      - channel
      - default_opt_in
      - created_at
      - updated_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
  headers:
    UnitpostWarning:
      description: 'Present when the request carried something this operation ignored (an unknown body key, a filter value it can''t apply, a recipient on a reserved domain it left out, …): one sentence per item, at most 1 KB in all (notes past that are counted, and a long list of addresses names the first ones and how many in all). The answer is the one without it. Send `Unitpost-Strict: true` to have such a request refused with a `422` instead; on `POST /email/batch` a reserved recipient refuses only its item, which comes back in `failed` while the rest of the batch is sent.'
      schema:
        type: string
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: Your workspace API key.