---
title: "Add Opt-In/Out Numbers"
method: POST
path: "/restapi/v1.0/account/{accountId}/a2p-sms/opt-outs/bulk-assign"
tags: ["High Volume SMS"]
---

# Add Opt-In/Out Numbers

`POST /restapi/v1.0/account/{accountId}/a2p-sms/opt-outs/bulk-assign`

## Request

- Base URL: `https://platform.ringcentral.com`
- URL: `https://platform.ringcentral.com/restapi/v1.0/account/{accountId}/a2p-sms/opt-outs/bulk-assign`
- Auth: OAuth 2
  - Authorization code: `https://platform.ringcentral.com/restapi/oauth/authorize`
  - Token URL: `https://platform.ringcentral.com/restapi/oauth/token`
- TypeScript: <https://skmtc.dev/ringcentral/apis/ringcentral-api/docs/restapi/v1.0/account/:accountId/a2p-sms/opt-outs/bulk-assign/post.ts> (a function with typed inputs; its response is checked against the schema)

Adds multiple opt-outs and/or opt-ins for the specified sender number and a set of recipient numbers.

## Path parameters

- `accountId` string, required

## Request body

- OptOutBulkAssignRequest: Consists of `from` field and `optOuts` and `optIns` lists. Both `optOuts` and `optIns` can be empty but not simultaneously - at least one of the lists must be entered."
  - `from` string, required: The phone number of a sender which the recipients should be opted out from or opted in to
  - `optOuts` string[]: The list of phone numbers to be opted out
  - `optIns` string[]: The list of phone numbers to be opted in

## Response `200`

The results of adding opt-outs and opt-ins.

- OptOutBulkAssignResponse: The results of adding opt-outs and opt-ins
  - `optIns` object: Contains successful and failed opt-ins
    - `successful` string[]: Recipients' phone numbers which opt-ins were successfully added for.
    - `failed` OptOutBulkAssignFailedEntry[]: Recipients' phone numbers which opt-ins were failed to be added for. Plus, error messages
      - `to` string: A recipient phone number
      - `errorMessage` string: An error happened on adding opt-out / opt-in
  - `optOuts` object: Contains successful and failed opt-outs
    - `successful` string[]: Recipients' phone numbers which opt-outs were successfully added for.
    - `failed` OptOutBulkAssignFailedEntry[]: Recipients' phone numbers which opt-outs were failed to be added for. Plus, error messages
      - `to` string: A recipient phone number
      - `errorMessage` string: An error happened on adding opt-out / opt-in

## Other responses

- `400`: Invalid Request
- `500`: Service Unavailable

---

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