---
title: "Trigger a double opt-in subscription flow"
method: POST
path: "/api/subscriptions/subscribeToDoubleOptIn"
tags: ["subscriptions"]
---

# Trigger a double opt-in subscription flow

`POST /api/subscriptions/subscribeToDoubleOptIn`

This endpoint triggers a double opt-in subscription for a user. <br/><br/>Once the user responds to the subscription confirmation message, they will be subscribed to the message types specified in the request body. <br/><br/>This endpoint can only be used with SMS, double opt-in message types. To enable it, contact your customer success manager.<br/><br/>Learn about <a href="https://support.iterable.com/hc/articles/29156459027348">identifying users by <code>userId</code> and <code>email</code></a>.<br/><br/><b>Response Format Notes:</b><ul><li>202 Accepted: Plain text (e.g., 'Request for double opt-in subscription accepted')</li><li>204 No Content: Returned when user is already subscribed to all requested message types (no body)</li><li>400 Bad Request (JSON parsing error): JSON <code>{error, message, code, data}</code></li><li>400 Bad Request (validation error): Plain text (e.g., 'User not found for userId: X or email: Y')</li><li>404 Not Found: JSON <code>{msg, code, params}</code> (returned when feature is not enabled)</li><li>500 Internal Server Error: Plain text</li></ul>

## Request body

- DoubleOptInSubscriptionsRequest
  - `brandName` string — To provide context, every double opt-in confirmation message includes a brand name. The value to use for this brand name is determined by (in priority order): the <code>brandName</code> included in the request body (if specified), the default brand name associated with the specified message types (if those message types all have the same default brand name), or a comma-separated, de-duplicated list of default brand names associated with the specified message types (if those message types have different default brand names).
  - `email` string — An email address that identifies a user profile in Iterable. Provide an <code>email</code> or a <code>userId</code> (but not both), depending on <a href="https://support.iterable.com/hc/articles/29156459027348">how your project identifies users</a>.
  - `messageTypeIds` object[], required — List of SMS, double opt-in message type IDs to which the user should be subscribed.
  - `phoneNumber` string — The <code>phoneNumber</code> to set on the specified user's profile.
  - `userId` string — A user ID that identifies a user profile in Iterable. Provide an <code>email</code> or a <code>userId</code> (but not both), depending on <a href="https://support.iterable.com/hc/articles/29156459027348">how your project identifies users</a>.

## Response `202`

Request accepted (plain text: 'Request for double opt-in subscription accepted')

## Other responses

- `204` — No content - user is already subscribed to all requested message types
- `400` — Invalid parameters - returns EITHER JSON {error, message, code, data} for request parsing errors OR plain text for validation errors (e.g., 'User not found for userId: X or email: Y')
- `401` — Invalid API key (JSON: {msg, code, params})
- `404` — Endpoint not found (JSON: {msg, code, params})
- `500` — Internal server error (plain text)

---

[API](https://skmtc.net/iterable/apis/iterable-api.md) · [All operations](https://skmtc.net/iterable/apis/iterable-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/iterable/iterable-api/revisions/afaab604b58c/schema)
