HomeProductsSMS - OTP

SMS - OTP

NEW

€0.039 + VAT

Generate and send OTP codes via SMS worldwide through API. Numeric or alphanumeric OTPs, configurable length, and automatic message translation for 2FA authentication, user verification, and secure access.

Delivery

Real Time

available for
  • gz

SMS OTP via API is the service that allows you to automatically generate and send OTP (One-Time Password) codes via SMS, simplifying the integration of authentication and verification systems into websites, applications, and digital platforms.

With a single API request, you can send a secure numeric or alphanumeric OTP code to the user's mobile phone number, configuring its length according to your process requirements.

The message is automatically translated based on the recipient's country, allowing you to use the same authentication flow internationally without having to manually manage different texts and languages.

The service uses OTP MOBILE as the default sender and applies the rates provided for the SMS Worldwide service.

It is ideal for quickly integrating processes such as:

  • Two-factor authentication (2FA)
  • Mobile phone number verification
  • Registration confirmation and account creation
  • Secure login and access
  • Password reset and recovery
  • Operation and transaction confirmation
  • Payment authorization
  • User identity verification
  • Digital service activation

The POST/otp method allows you to automatically generate a secure OTP code and send it via SMS to the specified mobile phone number.

You only need to specify the recipient and, optionally, configure the characteristics of the code.

The OTP code can be:

  • Numeric
  • Alphanumeric

If not otherwise specified, a numeric code is generated. You can choose a length between 4 and 10 characters. The default value is 5. Through the cacheSeconds parameter, you can define how long the same OTP should be reused if multiple requests are made for the same recipient.

The value can be configured up to a maximum of 600 seconds. This feature helps, for example, prevent different codes from being generated when a user requests the OTP multiple times within a few minutes.

AUTOMATIC TRANSLATION

There is no need to manually create the SMS text. The service automatically generates the message containing the OTP code and translates it according to the country associated with the recipient's phone number. This allows you to use a single endpoint to manage international authentication processes, reducing development and maintenance complexity.

REQUEST EXAMPLE

POST/otp

This is an example request:

{
  "recipient": "+393331234567",
  "alphanumeric": false,
  "length": 5,
  "cacheSeconds": 0,
  "options": {
    "dryRun": false,
    "failOnMultipleMessages": false
  },
  "callback": {
    "method": "JSON",
    "field": "data",
    "url": "https://www.mysite.com/myEndpoint",
    "retry": 3,
    "headers": {
      "session_id": "9834r5fh589494"
    },
    "custom": {
      "my_custom_id": "123456789"
    }
  }
}

In this example, a 5-digit numeric OTP is generated for the specified number.

RESPONSE EXAMPLE

POST/otp

The response returns information about the message and the generated OTP code:

{
  "data": {
    "id": "633aabe3e4a9a0e69811ad7f",
    "username": "string",
    "state": "NEW",
    "sender": "string",
    "recipient": "string",
    "internationalPrefix": "39",
    "countryCode": "IT",
    "message": "string",
    "encoding": "GSM-7",
    "charactersCount": 0,
    "messageCount": 0,
    "price": 0,
    "totalPrice": 0,
    "blocklisted": true,
    "blocklistedReason": "string",
    "options": {
      "dryRun": false,
      "failOnMultipleMessages": false
    },
    "callback": {
      "method": "JSON",
      "field": "data",
      "url": "https://www.mysite.com/myEndpoint",
      "retry": 3,
      "headers": {
        "session_id": "9834r5fh589494"
      },
      "custom": {
        "my_custom_id":  "123456789"
      }
    },
    "createdAt": "2026-08-24T07:34:19.961Z",
    "updatedAt": "2026-08-24T07:34:19.961Z",
    "sentAt": "2026-08-24T07:34:19.961Z",
    "deliveredAt": "2026-08-24T07:34:19.961Z",
    "isOtp": true,
    "otp": "5F8A2",
    "otpOptions": {
      "length": 5,
      "alphanumeric": false,
      "cacheSeconds": 300
    }
  }
}

The returned data includes the generated OTP code, the settings used, and information about the SMS sent.

DELIVERY MONITORING

You can monitor the message status through the callback system. Openapi will automatically send SMS status updates to your endpoint, eliminating the need for continuous polling. You can also use the SMS v2 API endpoints to view the list of sent messages and retrieve the details of a specific message using its ID.

COSTS

The SMS OTP service uses the SMS Worldwide pricing model. The cost of sending therefore varies depending on the recipient's destination country and mobile network operator.

To find the current cost for each destination, please refer to the SMS Worldwide pricing section.

Sign Up

Do you need help?

Haven't found the answer you're looking for?

Fill in all the details, we will get back to you as soon as possible!

Frequently Asked Questions

SMS OTP is Openapi's API service that allows you to automatically generate a One-Time Password and send it via SMS to the user's mobile phone number. It is designed to quickly integrate verification, authentication, and authorization systems into applications, websites, and digital platforms.

What is SMS OTP?

An OTP is a code used within an authentication or verification process. It can be used, for example, to verify ownership of a mobile phone number, protect a login with two-factor authentication, confirm a registration, or authorize a sensitive operation.

What is an OTP code used for?

Yes. Through the alphanumeric parameter, you can choose to generate:

  • a numeric-only OTP;
  • an alphanumeric OTP.

By default, a numeric code is generated.

Can the OTP be numeric or alphanumeric?

Yes. You can configure OTP codes with a length between 4 and 10 characters.

If the parameter is not specified, a default length of 5 characters is used.

Can I choose the length of the OTP?

Through the cacheSeconds parameter, you can define a time interval during which new requests for the same recipient reuse the same OTP code. The maximum configurable value is 600 seconds.

This feature is useful, for example, when a user clicks the "Resend code" button multiple times.

What happens if I request an OTP multiple times for the same number?

No. The message is automatically generated by the service. In addition, the text is automatically translated based on the recipient's country, simplifying the use of the service in international applications.

Do I need to create the SMS text?

For SMS messages sent through the OTP endpoint, the default sender is OTP MOBILE.

Which sender is displayed?

Yes. You can configure a callback to automatically receive updates about the message status.

You can also use the API to view sent messages and retrieve information about a specific SMS.

Can I check whether the SMS OTP has been delivered?

The service uses the SMS Worldwide infrastructure and is designed for international sending. The SMS text is automatically adapted according to the country associated with the recipient's phone number.

Delivery conditions, any restrictions, and costs may vary depending on the country and mobile network operator.

In which countries is SMS OTP available?

SMS OTP is designed for companies, software houses, fintechs, marketplaces, ecommerce businesses, and digital platforms that need to integrate mobile phone number verification and authentication systems.

It is particularly suitable for 2FA, secure login, onboarding, account verification, password recovery, transaction confirmation, and authorization of sensitive operations.

WHO IS THE SMS OTP API FOR?

SMS OTP follows the SMS Worldwide pricing model. The price depends on the recipient's country and mobile network operator. The actual sending cost is therefore determined by the destination.

HOW MUCH DOES THE SMS OTP API COST?