Send 2FA PIN code over SMS

Send a PIN code over SMS using a previously created message template.

Please log in to see full path URL. Learn why.
post
/2fa/2/pin
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 true.

Request Body schema:
collapse all -
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 senderId.

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 pin placeholder. Valid example: "placeholders":{"firstName":"John"}

property name*
string
to
required
string

Phone number to which the 2FA message will be sent. Example: 41793026727.

Responses

default

successful response

400

Bad Request

401

Unauthorized

403

Forbidden

4XX

Error responses

500

Internal Server Error

5XX

Error responses

Request samples

Content type
Copy
Collapse all
{
  • "applicationId": "1234567",
  • "messageId": "7654321",
  • "from": "Sender 1",
  • "to": "41793026727",
  • "placeholders":
    {
    • "firstName": "John"
    }
}

Response samples

Content type
Copy
Collapse all
{
  • "pinId": "9C817C6F8AF3D48F9FE553282AFA2B67",
  • "to": "41793026727",
  • "ncStatus": "NC_DESTINATION_REACHABLE",
  • "smsStatus": "MESSAGE_SENT"
}

Encountering issues

Contact our support

What's new? Check out

Release Notes

Unsure about a term? See

Glossary

Research panel

Help shape the future of our products
Learn more
Service status

Copyright @ 2006-2025 Infobip ltd.