A subscription is required to use this API. Please contact your account manager or our [sales team](🔗).

## Request



### HTTP headers

HeaderDescription
X-CM-ProductTokenYour product token. Retrieve from [Messaging Gateway app](🔗).
Content-Typeapplication/json

### Request body



### Parameters

ParameterTypeRequiredDescription
channelstringYesThe channel to send the code. Supported values: `auto`, `sms`, `push`, `whatsapp`, `voice`, `email`. Channel `auto` is only available with a [SOLiD subscription](🔗).
digitsintegerNoThe length of the code (min 4, max 10). default: 5.
expiryintegerNoThe expiry in seconds (min 10, max 3600). default: 60 seconds.

#### Parameters for channel `auto`

Only available with a [SOLiD subscription](🔗).

ParameterTypeRequiredDescription
fromstringYesThe number or name of the sender. This must be a valid phone number in E.164 format or an alphanumeric string between 3 and 11 characters. Please note that alphanumeric senders are not supported in all countries.
tostringYesThe receiver of the code. This must be a valid phone number in E.164 format.
localestringNoThe locale of the WhatsApp message. Supported values: `en`, `nl`, `fr`, `de`, `it`, `es`. Default: `en`

#### Parameters for channel `sms` or `push`

ParameterTypeRequiredDescription
fromstringYesThe number or name of the sender. This must be a valid phone number in E.164 format or an alphanumeric string between 3 and 11 characters. Please note that alphanumeric senders are not supported in all countries.
tostringYesThe receiver of the code. This must be a valid phone number in E.164 format.
messagestringNoSet a custom message. You can use the placeholder `{code}`, this will be replaced by the actual code. Example: `Your code is: {code}`.
pushAppKeystringWhen channel is `push`The app key.

#### Parameters for channel `whatsapp`

ParameterTypeRequiredDescription
fromstringYesThe number or name of the sender. This must be a valid phone number in E.164 format or an alphanumeric string between 3 and 11 characters. Please note that alphanumeric senders are not supported in all countries.
tostringYesThe receiver of the code. This must be a valid phone number in E.164 format.
messagestringNoSet a custom message. You can use the placeholder `{code}`, this will be replaced by the actual code. Example: `Your code is: {code}`. This is only used as a fallback in case the message could not be delivered via WhatsApp.
localestringNoThe locale of the message. This must match with configured locales for the template.

#### Parameters for channel `voice`

ParameterTypeRequiredDescription
fromstringYesThe number of the sender. This must be a valid phone number in E.164 format.
tostringYesThe number of the receiver. This must be a valid phone number in E.164 format.
localestringNoSet the spoken language in the voice call. Supported values: `de-DE`, `en-AU`, `en-GB`, `en-IN`, `en-US`, `es-ES`, `fr-CA`, `fr-FR`, `it-IT`, `ja-JP`, `nl-NL` Default: `en-GB`
anonymousbooleanNoSet whether the number of the caller (from) is hidden in the voice call. Default: `false`
messagestringNoSet a custom message to be used in the voice call. Do not include the {code} placeholder.

#### Parameters for channel `email`

ParameterTypeRequiredDescription
tostringYesThe email address of the receiver.
localestringNoThe locale for the email template.
messagestringNoSet a custom message to be used in the email message. Do not include the {code} placeholder.

## Response



### Parameters

ParameterDescription
idThe identifier of the OTP. Use this, together with the code received via the requested channel, to verify the code.
channelThe channel used to send the code.
verifiedIndicates if the OTP was verified.
createdAtThe date the OTP was created.
expiresAtThe date the OTP will expire.