---
title: "Opt-out of SMS messages"
method: POST
path: "/api/channels/sms/opt-out"
tags: ["SMS"]
---

# Opt-out of SMS messages

`POST /api/channels/sms/opt-out`

## Request

- Base URL: `https://go.urbanairship.com`
- URL: `https://go.urbanairship.com/api/channels/sms/opt-out`
- Auth: one of:
  - HTTP basic
  - HTTP bearer
  - OAuth 2
    - Client credentials
    - Token URL: `http://oauth2.{domain}.com/token` scopes: `chn`
- TypeScript: <https://skmtc.dev/airship/apis/airship-api/docs/api/channels/sms/opt-out/post.ts> (a function with typed inputs; its response is checked against the schema)

This will mark an SMS channel as opted-out (inactive) and it will not receive alerts even when they are addressed in the future. To opt the user back in, call the registration function again with a valid `opted_in` value.

## Request body

- object
  - `msisdn` string, required: The mobile phone number you want to opt-out of SMS messages. Must be numeric characters only, without leading zeros. 15 digits maximum.
  - `sender` string, required: A long or short code the app is configured to send from. For example, `12345`.

## Response `202`

The msisdn/channel is opted-out of SMS notifications.

- object
  - `ok` boolean: If true, the operation completed successfully.

## Other responses

- `400`: The request body is not valid.

## Changes

- **2022-03-24** `ca569bd1394d`: 1 breaking, 1 info
  - added the new required request property `sender/sms_sender`
  - the `sender` request property's minLength was decreased from `1` to `0`

[Operation history](https://skmtc.dev/airship/apis/airship-api/changes/api/channels/sms/opt-out/post.md)

---

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