Overview

Send and receive SMS through a single connection for timely and cost-efficient communications using the Sinch SMS API.

Authentication

Find your API token for each service plan in your Sinch Customer Dashboard under APIs, then REST configuration.

The token is sent in the Authorization header of each endpoint preceded by Bearer. It's required for all requests made to the Sinch SMS API.

Example

Code within the header when sending an SMS via Node would look like this:

Copy
Copied
curl -X POST \
     -H "Authorization: Bearer {YOUR_API_Token}" \
     -H "Content-Type: application/json"  -d '
      {
          "from": "+19876543210",
          "to": [
              "+12345678900"
          ],
          "body": "Hi there! How are you?"
      }' \
  "https://us.sms.api.sinch.com/xms/v1/{YOUR_service_plan_id}/batches"
Need more help?

We've got you covered. First, Learn how to setup your free Sinch account and get a phone number in the Sinch Customer Dashboard.

Base URL

The following URLs can be used by the REST API. By default, your account will be created in the US environment. If you want access to servers in other parts of the world, contact your Sinch account manager.

Server URL
General API https://us.sms.api.sinch.com
Geographical APIs To set one up, contact your account manager.
US Production https://us.sms.api.sinch.com
EU Production https://eu.sms.api.sinch.com
Australia Production https://au.sms.api.sinch.com
Brazil Production https://br.sms.api.sinch.com
Canada Production https://ca.sms.api.sinch.com

SMS REST formats and conventions

Let's take a brief look at some of the formats used in the REST API.

JSON

JSON (application/json) is the content type of both requests and responses if not otherwise specified.

Requests with invalid JSON will be rejected.

Null values

Null values can be omitted in requests and will be omitted in responses. In some cases, explicitly setting null will overwrite a previously set value with null. See Update a group for an example.

Phone numbers (MSISDN)

Only MSISDNs in international format are accepted by the API.

MSISDNs can be sent in with or without a leading + (+123456789 or 123456789 are both valid) or with a leading 00. Any space, dash or bracket will also be ignored by the API.

All MSISDNs returned by the REST API will be without a + or 00 prefix, even if they were sent in with one.

Timestamps

Timestamps use the ISO-8601 standard. Examples of those are the fields send_at and expire_at in the Send message operation.

A time offset can be specified in accordance with ISO-8601 time offsets from UTC. If no time offset is specified (local time in ISO-8601) then UTC will be used.

All timestamps returned by the API will be represented in UTC time (which is precise, down to the millisecond).

Message limitations and capabilities

Information related to message criteria and limits can be found in the Message information section of the Resources tab.

Status Codes

A summary of status codes can be found on the HTTP status codes page.

New features

New features might result in additional request and response parameters. New request parameters will either have a default value or be considered optional to retain backwards compatibility. It's highly recommended to ignore any unexpected parameters when reading JSON in API responses and in callback handlers.