---
title: "Record an SMS opt-out"
method: POST
path: "/v1/sms/opt-outs"
tags: ["SMS"]
---

# Record an SMS opt-out

`POST /v1/sms/opt-outs`

## Request

- Base URL: `https://zernio.com/api`
- URL: `https://zernio.com/api/v1/sms/opt-outs`
- Auth: HTTP bearer

Marks a recipient as opted out on one of your SMS numbers. Use it for
opt-outs you collect yourself (for example keywords like UNSUB or
REVOKE, which the carrier does not recognize). Sends from that number
to the recipient are then refused with `409 recipient_opted_out`.

Idempotent. If the recipient is already opted out, the call succeeds
and `source` keeps the original value (`inbound_stop` when they texted
STOP).

## Request body

- SmsOptOutRequest
  - `accountId` string, required: ID of the SMS number account the opt-out applies to (from `GET /v1/accounts`).
  - `phone` string, required: Recipient phone number in E.164 format, e.g. +13105559999.

## Response `200`

Recipient is opted out

- object
  - `accountId` string
  - `phoneNumber` string
  - `optedOut` boolean: Always true.
  - `source` 'api' | 'inbound_stop': What set the current opt-out.

## Other responses

- `400`: Invalid request
- `401`: Missing or invalid API key. `code` is `missing_credentials` when no Authorization header was sent and `invalid_credentials` when the key is unknown, revoked or expired.
- `404`: Resource not found

## Changes

- **2026-11-15** `68271ba8bc8b`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/zernio/apis/zernio-api/changes/v1/sms/opt-outs/post.md)

---

[API](https://skmtc.dev/zernio/apis/zernio-api.md) - [All operations](https://skmtc.dev/zernio/apis/zernio-api/llms.txt) - [OpenAPI document](https://skmtc.dev/zernio/apis/zernio-api/revisions/68271ba8bc8b?raw)
