latestSwagger 2.02026-08-10148196271.0 KB

afaab604b58c

subscriptions

Trigger a double opt-in subscription flow

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>

post/api/subscriptions/subscribeToDoubleOptIn

Request body

brandNamestring

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).

emailstring

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>.

messageTypeIdsobject[] required

List of SMS, double opt-in message type IDs to which the user should be subscribed.

phoneNumberstring

The <code>phoneNumber</code> to set on the specified user's profile.

userIdstring

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

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