Download OpenAPI specification:Download

Applications

You can use the API to manage features of applications in your project.

Get Numbers

Get information about your numbers. It returns a list of numbers that you own, as well as their capability (voice or SMS). For the ones that are assigned to an app, it returns the application key of the app.

Request
Security:
Basic
or
Signed
Responses
200

A success response, or an Error.

Response Schema: application/json
Array of objects
Default: "numbers"

The object type. Will always be list of numbers, associated application keys and capabilities

Array
number
string

Numbers that you own in E.164 format.

applicationkey
string

Indicates the application where the number(s) will be assigned. If no number is assigned the applicationkey will not be returned.

capability
string

indicates the DID capability that needs to be assigned to the chosen application. Valid values are 'voice' and 'sms'. Please note that the DID needs to support the selected capability.

Enum: "voice" "sms"
get/v1/configuration/numbers
Request samples
import fetch from 'node-fetch';

async function run() {
  const resp = await fetch(
    `https://callingapi.sinch.com/v1/configuration/numbers`,
    {
      method: 'GET',
      headers: {
        Authorization: 'Basic ' + Buffer.from('<username>:<password>').toString('base64')
      }
    }
  );

  const data = await resp.text();
  console.log(data);
}

run();
Response samples
application/json
{
  • "numbers": [
    • {
      },
    • {
      },
    • {
      }
    ]
}

Update Numbers

Assign a number or a list of numbers to an application.

Request
Security:
Basic
or
Signed
Request Body schema: application/json
numbers
Array of strings [ 1 .. 100 ] items

The phone number or list of numbers in E.164 format.

applicationkey
string

indicates the application where the number(s) will be assigned. If empty, the application key that is used to sign the request will be used.

capability
string

indicates the DID capability that needs to be assigned to the chosen application. Valid values are 'voice' and 'sms'. Please note that the DID needs to support the selected capability.

Enum: "voice" "sms"
Responses
204

A success response, or an Error.

post/v1/configuration/numbers
Request samples
application/json
{
  • "numbers": "+14151112223333",
  • "applicationkey": "11983f76-12c8-1111-9515-4785c7b67ca8",
  • "capability": "voice"
}

Un-assign number

Un-assign a number from an application.

Request
Security:
Basic
or
Signed
Request Body schema: application/json
number
string

The phone number in E.164 format (https://en.wikipedia.org/wiki/E.164)

applicationkey
string

Indicates the application where the number(s) was assigned. dIf empty, the application key that is used to sign the request will be used.

capability
string

(optional) indicates the DID capability that was assigned to the chosen application. Please note that the DID needs to support the selected capability.

Enum: "voice" "sms"
Responses
204

A success response, or an Error.

delete/v1/configuration/numbers
Request samples
application/json
{
  • "numbers": "+14151112223333",
  • "applicationkey": "11983f76-12c8-1111-9515-4785c7b67ca8",
  • "capability": "voice"
}

Get Callback URLs

Returns any callback URLs configured for the specified application.

Request
Security:
Basic
or
Signed
path Parameters
applicationkey
required
string

The unique identifying key of the application.

Example: 94983f76-1161-6655-9515-4785c7b67dd8
Responses
200

A success response, or an Error.

Response Schema: application/json
object

Gets primary and if configured fallback callback URLs

primary
string

Your primary callback URL

fallback
string

Your fallback callback URL (returned if configured). It is used only if Sinch platform gets a timeout or error from your primary callback URL.

get/v1/configuration/callbacks/applications/{applicationkey}
Request samples
import fetch from 'node-fetch';

async function run() {
  const applicationkey = 'YOUR_applicationkey_PARAMETER';
  const resp = await fetch(
    `https://callingapi.sinch.com/v1/configuration/callbacks/applications/${applicationkey}`,
    {
      method: 'GET',
      headers: {
        Authorization: 'Basic ' + Buffer.from('<username>:<password>').toString('base64')
      }
    }
  );

  const data = await resp.text();
  console.log(data);
}

run();
Response samples
application/json
{}

Update Callbacks

Update the configured callback URLs for the specified application.

Request
Security:
Basic
or
Signed
path Parameters
applicationkey
required
string

The unique identifying key of the application.

Example: 94983f76-1161-6655-9515-4785c7b67dd8
Request Body schema: application/json
object

Contains primary and or fallback callback URLs

primary
string

Your primary callback URL

fallback
string

Your fallback callback URL

Responses
204

A success response, or an Error.

post/v1/configuration/callbacks/applications/{applicationkey}
Request samples
application/json
{}

Query number

Returns information about the requested number.

Request
Security:
Basic
or
Signed
path Parameters
number
required
string

The phone number you want to query.

Example: +46730170101
Responses
200

A success response, or an Error.

Response Schema: application/json
countryId
string

The ISO 3166-1 formatted country code.

numberType
string

The type of the number.

Enum: "Unknown" "Fixed" "Mobile" "Other"
normalizedNumber
string

The number in E.164 format.

restricted
boolean

Concerns whether the call is restricted or not.

object

The cost per minute to call the destination number.

get/v1/calling/query/number/{number}
Request samples
import fetch from 'node-fetch';

async function run() {
  const number = 'YOUR_number_PARAMETER';
  const resp = await fetch(
    `https://callingapi.sinch.com/v1/calling/query/number/${number}`,
    {
      method: 'GET',
      headers: {
        Authorization: 'Basic ' + Buffer.from('<username>:<password>').toString('base64')
      }
    }
  );

  const data = await resp.text();
  console.log(data);
}

run();
Response samples
application/json
{
  • "method": "numberItem",
  • "numberItem": {
    • "countryId": "SE",
    • "numberType": "Mobile",
    • "normalizednumber": "+14151112223333",
    • "restricted": false,
    • "rate": {
      }
    }
}