The TingTing API is a REST API. All requests and responses use JSON. You interact with the API over HTTPS using standard HTTP methods.
Base URL
All endpoints are relative to:
https://app.tingting.io/api/v1/
Authentication
Every request must include a valid Bearer token in the Authorization header.
Authorization: Bearer <your_api_token>
Generate your API token from the Authentication endpoints. Tokens are long-lived, but you can rotate them at any time using the Generate API Token endpoint.
Set Content-Type: application/json on all requests that include a body.
curl --request POST \
--url https://app.tingting.io/api/v1/campaign/create/ \
--header 'Authorization: Bearer <your_api_token>' \
--header 'Content-Type: application/json' \
--data '{"name": "My Campaign"}'
All responses are JSON. Successful responses return the relevant data at the top level or nested under a named key (for example, results on list endpoints).
{
"message": "Operation successful",
"data": { ... }
}
List endpoints support cursor-based pagination using limit and offset query parameters.
| Parameter | Type | Description |
|---|
limit | integer | Maximum number of results to return per page. |
offset | integer | Number of results to skip before returning results. |
Paginated responses include the following fields:
| Field | Type | Description |
|---|
count | integer | Total number of matching results across all pages. |
total_pages | integer | Total number of pages given the current limit. |
next | string | null | URL of the next page, or null if on the last page. |
previous | string | null | URL of the previous page, or null if on the first page. |
results | array | Array of result objects for the current page. |
Example paginated response:
{
"count": 42,
"total_pages": 5,
"next": "https://app.tingting.io/api/v1/contacts/?limit=10&offset=10",
"previous": null,
"results": [
{ "id": 1, "name": "Ram Thapa" },
{ "id": 2, "name": "Sita Sharma" }
]
}
If you omit limit and offset, the API returns the default page size. Check individual endpoint documentation for default values.
Credit system
TingTing uses a credit-based billing model. Phone calls consume phone credits and SMS messages consume SMS credits. Most call and message responses include your remaining credit balances.
| Field | Description |
|---|
remaining_sms_credits | SMS credits remaining after the current request. |
remaining_phone_credits | Phone credits remaining after the current request. |
Requests will fail if you do not have enough credits. Monitor your balances and top up before running large campaigns.
HTTP status codes
| Code | Meaning | When it occurs |
|---|
| 200 | OK | The request succeeded. |
| 201 | Created | A new resource was created successfully. |
| 400 | Bad Request | The request body or parameters are invalid or missing. |
| 401 | Unauthorized | The token is missing, expired, or invalid. |
| 403 | Forbidden | You are authenticated but lack permission for this resource. |
| 404 | Not Found | The requested resource does not exist. |
| 429 | Too Many Requests | You have exceeded the rate limit. Retry after a short delay. |
| 500 | Internal Server Error | An unexpected error occurred on the server. |
Error responses
Errors return a JSON body with a message or detail field describing what went wrong.
{
"message": "No refresh token provided"
}
{
"detail": "Invalid token payload."
}
Some endpoints return errors under a detail key while others use message. Check the specific endpoint reference for the exact error shape.