Send 2FA PIN code over SMS
Send a PIN code over SMS using a previously created message template.
Authorizations:
Scopes:
query Parameters
ncNeeded | boolean Example: ncNeeded=true Indicates if Number Lookup is needed before sending the 2FA message. If the parameter value is true, Number Lookup will be requested before sending the SMS. If the value is false, the SMS will be sent without requesting Number Lookup. Field's default value is |
Request Body schema:
applicationId required | string The ID of the application that represents your service, e.g. 2FA for login, 2FA for changing the password, etc. | ||
from | string Use this parameter if you wish to override the sender ID from the created message template parameter | ||
messageId required | string The ID of the message template (message body with the PIN placeholder) that is sent to the recipient. | ||
placeholders | object Key value pairs that will be replaced during message sending. Placeholder keys should NOT contain curly brackets and should NOT contain a | ||
| |||
to required | string Phone number to which the 2FA message will be sent. Example: 41793026727. |
Responses
successful response
Bad Request
Unauthorized
Forbidden
Error responses
Internal Server Error
Error responses
Request samples
- Payload
- cURL
- Java
- C#
- Go
- Python
- PHP
- JavaScript
- NodeJs
- Ruby
{- "applicationId": "1234567",
- "messageId": "7654321",
- "from": "Sender 1",
- "to": "41793026727",
- "placeholders": {
- "firstName": "John"
}
}
Response samples
- default
- 400
- 401
- 403
- 4XX
- 500
- 5XX
{- "pinId": "9C817C6F8AF3D48F9FE553282AFA2B67",
- "to": "41793026727",
- "ncStatus": "NC_DESTINATION_REACHABLE",
- "smsStatus": "MESSAGE_SENT"
}
Need assistance
Encountering issues
What's new? Check out
Unsure about a term? See
Copyright @ 2006-2025 Infobip ltd.