Magic Telecom DID API

The Magic API allows you to automate the ordering and configuration of DID numbers.


While developing your integration with our API you can use the Magic Telecom sandbox to place orders and configure DIDs without affecting your live account.

  1. Create a Sandbox Account
  2. Retrieve your API Token
  3. Use for your API calls

Live Environment

Once your integration is complete you can visit Your Settings to manage your live API tokens. All calls should be made against the endpoint.

Using the API

The API follows REST principles—you can fetch, create, update, and delete resources by using GET, POST, PUT/PATCH, and DELETE HTTP requests. Most endpoints respond with JSON and expect JSON when there is a body. Make sure you set the Content-Type: application/json header when creating and updating via the API.


To use your account with the API simply pass your Sandbox or Live token in the X-Auth-Token header. You can test your token is working by receiving a 200 OK response code to the /authentications API endpoint:

curl --include --get \
  --header 'Accept: application/json' \
  --header 'X-Auth-Token: YOUR_SANDBOX_TOKEN' \

If you get a 403 Forbidden response, please ensure you are using your sandbox token and not your live token.

Filtering & Pagination

Many requests allow you to limit responses using the filter query parameter. For example, to search for locations containing “Orlando” in the United States you would perform the following request:

curl --include --get \
  --header 'Accept: application/json' \
  --header 'X-Auth-Token: YOUR_SANDBOX_TOKEN' \
  --data 'filter=country_iso2::US|location_name::Orlando' \

Successful requests return a total value in the response that lets you know how many results were found. You can use the page=2 URL parameter to view the second page of results, page=3 for the third, and so on. By default the API returns up to 10 results—you can modify this to any number between 1 and 100 using the limit=100 parameter.

Exploring the API

You can use our interactive API reference documentation to experiment with the API. Enter your API token at the top and click the different API calls to expand the documentation.

How to Guides

Using the SDKs

To make it easier to integrate with our API we provide SDK libraries for several popular programming languages:

Demo App

To see our API in action, visit our Demo App.

API Documentation

How to Guides