TextIt API v2

We provide a RESTful JSON API for you to interact with your data from outside applications. The following endpoints are available:

To use the endpoint simply append .json to the URL. For example /api/v2/flows will return the documentation for that endpoint but a request to /api/v2/flows.json will return a JSON list of flow resources.

You may wish to use the API Explorer to interactively experiment with the API.

Verbs

All endpoints follow standard REST conventions. You can list a set of resources by making a GET request to the endpoint, create or update resources by making a POST request, or delete a resource with a DELETE request.

Status Codes

The success or failure of requests is represented by status codes as well as a message in the response body:

  • 200: A list or update request was successful.
  • 201: A resource was successfully created (only returned for POST requests).
  • 204: An empty response - used for both successful DELETE requests and POST requests that update multiple resources.
  • 400: The request failed due to invalid parameters. Do not retry with the same values, and the body of the response will contain details.
  • 403: You do not have permission to access this resource.
  • 404: The resource was not found (returned by POST and DELETE methods).
  • 429: You have exceeded the rate limit for this endpoint (see below).

Rate Limiting

All endpoints are subject to rate limiting. If you exceed the number of allowed requests in a given time window, you will get a response with status code 429. The response will also include a header called 'Retry-After' which will specify the number of seconds that you should wait for before making further requests.

The rate limit for all endpoints is 2,500 requests per hour. It is important to honor the Retry-After header when encountering 429 responses as the limit is subject to change without notice.

Date Values

Many endpoints either return datetime values or can take datatime parameters. The values returned will always be in UTC, in the following format: YYYY-MM-DDThh:mm:ss.ssssssZ, where ssssss is the number of microseconds and Z denotes the UTC timezone.

When passing datetime values as parameters, you should use this same format, e.g. 2016-10-13T11:54:32.525277Z.

URN Values

We use URNs (Uniform Resource Names) to describe the different ways of communicating with a contact. These can be phone numbers, Twitter handles etc. For example a contact might have URNs like:

  • tel:+250788123123
  • twitter:jack
  • mailto:jack@example.com

Phone numbers should always be given in full E164 format.

Translatable Values

Some endpoints return or accept text fields that may be translated into different languages. These should be objects with ISO-639-3 language codes as keys, e.g. {"eng": "Hello", "fra": "Bonjour"}

Authentication

You must authenticate all calls by including an Authorization header with your API token. The Authorization header should look like:

Authorization: Token YOUR_API_TOKEN

For security reasons, all calls must be made using HTTPS.

Clients

There is an official Python client library which we recommend for all Python users of the API.