SMS
SMS over API

SMS over API

Use the SMS API (opens in a new tab) to receive SMS over API and to send API requests. If you want to automate your SMS traffic, you should use the SMS API.

Send and receive SMS over API

Send a simple SMS using basic request

To send a simple SMS message over API, use the /sms/3/messages endpoint.

For more information, see Send SMS message (opens in a new tab).

Send SMS using fully featured API

If you want to use the advanced functionality of SMS over API, such as validity period, transliteration, and so on, use fully featured SMS API (opens in a new tab). You can also use the version of our API where parameters can be set directly in the URL.

To receive an SMS message, or to transfer received SMS messages from the Infobip platform to yours, you can:

  • PULL messages you received to your number. These messages are stored on the Infobip platform and you can pull them when it suits you best. See the Get received messages (opens in a new tab) for more details.
  • PUSH received messages automatically to your dedicated URL.

Both of these of methods require you to set up a number and a type of forwarding actions for it, so that our platform knows what to do.

If you have not set up forwarding to a specific number, check your inbound logs for any received messages. This is very similar to our PULL action, however, logs only store your data for up to 48 hours.

SMS preview

Use SMS preview (opens in a new tab) to preview your SMS messages before sending them to your customers. You can assess the message length, a number of message parts, language, and transliteration output, and so on.

The preview method provides the following information:

  • originalText- original message content that was supplied for preview
  • textPreview- preview of the message content as it should appear on the recipient's device
  • messageCount- number of messages required to deliver textPreview
  • charactersRemaining- number of remaining characters before messageCount increase
  • configuration- configuration setup that should be included in advanced SMS in order to deliver textPreview message
  • languageCode- language code for the correct character set
  • transliteration- the transliteration of your sent message from one script to another; used to replace characters which are not recognized as part of your defaulted alphabet

Use this method to see how many characters are left unspent in the message and if the message fits in one or more messages.

Notify URL

Use the Notify URL feature to forward Delivery Reports, message status, pricing information or GSM errors (for example, EC_ABSENT_SUBSCRIBER) to your callback server using a predefined URL. Notify URL forwards the data as soon as the Infobip platform receives it.

Use the notifyUrl parameter to specify the URL.

In addition to the URL, you can also specify the following fields to make the feature more robust:

  • notifyContentType- determines which body type to push to the server, JSON or XML
  • messageId- customize your message ID, so that your response contains the same ID and is easier to find; otherwise, Infobip will automatically generate it for you in a response
  • bulkId- customize your bulk ID if sending multiple messages or to multiple recipients, so that your response contains the same ID and is easier to find; otherwise, Infobip will automatically generate it for you in a response
  • callbackData- additional user-defined data that will be sent on to the Notify URL

Push Retry Cycle

If your Notify URL is unavailable for any reason, forward attempts are made according to the following formula:

1min + (1min * retryNumber * retryNumber)

Examples for first few retry attempts are shown in the following table. The maximum number of retries is 20, that is, the last retry will occur 41:30h after the initial one. If your URL is not available for the whole retry period, the data will be lost.

RetryIntervalCumulative
001min00:01h
102min00:03h
205min00:08h
310min00:18h
417min00:35h
526min01:01h
637min01:38h

Send SMS to multiple destinations

There may be situations where it is beneficial that you send your SMS to multiple destinations. For example, you can send the same message to multiple phone numbers.

This example contains only two phone numbers for easier understanding.

SMS multiple destinations request

json
 
    {
      "messages": [
        {
          "from": "WineShop",
          "destinations": [
            {
              "to": "41793026727"
            },
            {
              "to": "41793026727"
            }
          ],
          "text": "Wine shop grand opening at Monday 8pm. Don't forget your wine glass!"
        }
      ]
    }
 

The following parameters are important for sending SMS to multiple destinations:

  • from - represents the sender of the SMS message, which can be alphanumeric or numeric:
    • Alphanumeric sender ID length must be between 3 and 11 characters (for example: CompanyName)
    • Numeric sender ID length must be between 3 and 16 characters
  • to - an array of message destination addresses, which must be in international format (for example, 41793026727)
  • text - content of the message being sent

This sends an SMS to two addresses with the same content and sender. The response will also contain a bulkId field to group your multiple recipients under one response so that you can easily fetch logs or reports. You can pass your custom bulk ID in the request, otherwise if omitted, the Infobip platform will automatically generate one and assign it to your response.

SMS multiple destinations response

json
 
    {
        "bulkId": "2034070510160109025",
        "messages": [
            {
                "to": "41793026727",
                "status": {
                    "groupId": 1,
                    "groupName": "PENDING",
                    "id": 26,
                    "name": "PENDING_ACCEPTED",
                    "description": "Message sent to next instance"
                },
                "messageId": "2034070510160109026"
            },
            {
                "to": "41793026834",
                "status": {
                    "groupId": 1,
                    "groupName": "PENDING",
                    "id": 26,
                    "name": "PENDING_ACCEPTED",
                    "description": "Message sent to next instance"
                },
                "messageId": "2034070510250109027"
            }
        ]
    }
 

The response includes the following:

  • bulkId - used for getting delivery reports (opens in a new tab) for SMS messages sent to multiple destinations
  • to - the recipient of the message
  • status - indicates the message status
  • smsCount - represents the number of SMS messages sent to one destination
  • messageId - uniquely identifies the message sent

Send multiple SMS to multiple destinations

If you want to target your customers by offering them their favorite product during your next promotion. Every customer is specific, and you should not send the same message to all of them. Tailor your SMS messages according to customers’ preferences to help get their full attention.

This option gives you the ability to send multiple messages to multiple destinations by calling only one API method.

Multiple SMS to multiple destinations request

json
 
    {
      "messages": [
        {
          "from": "WineShop",
          "destinations": [
            {
              "to": "41793026727"
            }
          ],
          "text": "Hey Mike, delicious Istrian Malvazija is finally here. Feel free to visit us and try it for free!"
        },
        {
          "from": "WineShop",
          "destinations": [
            {
              "to": "41793026834"
            }
          ],
          "text": "Hi Jenny, we have new French Merlot on our shelves. Drop by our store for a free degustation!"
        }
      ]
    }
 

After you have sent these messages, you are able to get detailed statistics and analyze them. For example, you can measure how many customers received the SMS invitation by getting the delivery reports (opens in a new tab).

See the Response Status and Error Codes for further information on your message status.

Send SMS message over query parameters

Send an SMS that includes all of the required URL parameters in one query string by using Send SMS message over query parameters (opens in a new tab).

This is suitable for if you have an application with limited integration possibilities and you are not able to fully integrate with Send SMS message (opens in a new tab).

You can even send this message through your web browser address bar, in the same way that you would type an address to open a web page. This is something that you could put into your application without writing any code.

You need to replace hard-coded values like phone number and message text with placeholders, unless you want to send the same message to the same recipient every time. Placeholder names are provided by the application system you are using.

The first line is the API endpoint and this never changes, that is, https://api.infobip.com/sms/3/text/query?.

The question mark at the end represents the beginning of the query string parameters. This is a system of key-value pairs separated by symbol &. For example, from=InfoSMS&. This enables you to see what the values are and which values you need to replace by a value placeholder. Placeholder names and format will vary depending on your application.

Your application should now dynamically send different messages to different recipients and dynamically replace placeholders with the recipient’s phone number and message.

The default response format is JSON. However, if you prefer to receive XML instead, specify the format .xml extension at the end of the method URL, for example: https://api.infobip.com/sms/3/text/query.xml.

Send SMS with conversion tracking

Conversion tracking involves monitoring and analyzing marketing campaign performance to understand how well your message resonates with its target audience.

SMS conversion tracking allows you to notify the Infobip platform about a successful conversion of specific user actions. Typical user actions include, clicks on URL clicks, code input, form submissions, purchases, or other desired outcomes after receiving an SMS.

Once an action has taken place, information is sent to the Infobip platform for performance analysis.

Conversion tracking helps Infobip to see a better picture of how your traffic is performing and proactively take measures to correct any degradation in quality.

Providing detailed insights into customer behavior and campaign performance enables businesses to refine their marketing strategies, improve customer engagement, and ultimately drive more sales and revenue. Implementing SMS conversion tracking can significantly enhance the effectiveness of business marketing campaigns.

You can submit conversion information only for SMS messages. The goal of conversion tracking is to keep track of time-sensitive messages, like 2FA passwords, or messages that expect a quick reaction from your end users, like clicking a specific link.

Enable tracking by setting up a conversionTracking object within your message body.

For more details on how to send an SMS with conversion tracking enabled, see the API Reference (opens in a new tab).

A messageId is returned in the POST Send SMS Message response, which you need to provide to Infobip, as follows:

  1. The Infobip platform marks the start of the tracking process as soon as the message is sent out.
  2. Once the message is delivered and an end user performs an action (clicks a link, inputs a code, and so on), this counts as a successful conversion rate. You can track such actions through webhooks implemented on your side.
  3. Notify Infobip about the successful conversion by calling POST /ct/1/log/end/{messageId}. See Confirm conversion (opens in a new tab).

Once the Infobip platform is notified about the successful conversion, it can monitor the performance and use this data to provide you with a better service.

Schedule SMS

SMS API allows you to schedule messages for future delivery. This is particularly useful for time-sensitive campaigns, reminders, or announcements.

Use the Send SMS (opens in a new tab) endpoint with a date and time specified in the sendAt field. The date/time format should be yyyy-MM-dd'T'HH:mm:ss.SSSZ. You can also include a bulkId to manage the message later (reschedule, change a status, etc.).

json
"options": {
    "schedule": {
      "bulkId": "BULK-ID-123-xyz",
      "sendAt": "2025-05-19T11:15:00.000+0000"
    }
  }

Messages can be scheduled up to 180 days in advance. If bulkId is not provided, Infobip will autogenerate one, and return it in the response.

Control SMS delivery time

You can additionally set up a time window outside of which your SMS won't be delivered. Typically, this is used for scenarios in which there are some sending restrictions levied by third parties (e.g., political campaign consent rules, promotional materials compliance, etc.). Use the the Send SMS (opens in a new tab) endpoint with the deliveryTimeWindow field. The date/time format should be yyyy-MM-dd'T'HH:mm:ss.SSSZ.

NOTE

It's not recommended to create multiple messages with different deliveryTimeWindow under a single bulk, as it may affect searching for messages, rescheduling, canceling, or updating them.

Manage scheduled messages

To manage your scheduled SMS, use its bulkId to identify the message. With these endpoints, you can effectively schedule, manage, and monitor your SMS campaigns:

For a detailed step-by-step guide, see: Schedule an SMS using Infobip API

Need assistance

Explore Infobip Tutorials

Encountering issues

Contact our support

What's new? Check out

Release Notes

Unsure about a term? See

Glossary
Service status

Copyright @ 2006-2025 Infobip ltd.

Service Terms & ConditionsPrivacy policyTerms of use