Developers
Documentation
One predictable REST API for every product, with official SDKs for PHP, Python and TypeScript — and a cURL example for everything.
Introduction#
The Digitel Africa API is a REST interface to South Africa's digital infrastructure platform. Manage business email, DNS, hosting, the cloud app platform, managed PostgreSQL databases, domains, SSL, and VPN from a single, predictable API. Every request uses standard HTTP verbs, returns JSON, and is served over TLS from the base URL below.
All endpoints are relative to the versioned base URL https://api.digitel.africa/v1. Official SDKs are available for PHP, Python, and TypeScript, and every example on this page includes a raw cURL equivalent so you can integrate from any language.
Base URL
Send all requests to https://api.digitel.africa/v1. The API is versioned in the path, so a future v2 will never break your v1 integration.
Authentication#
The API authenticates requests with a Bearer API key. Pass your key in the Authorization header on every request: Authorization: Bearer da_live_.... Requests without a valid key return 401 Unauthorized.
Create and rotate keys in the Digitel Africa console under Settings -> API keys. Live keys are prefixed da_live_ and test keys da_test_; test keys never touch production infrastructure or send real email.
curl https://api.digitel.africa/v1/account \
-H "Authorization: Bearer da_live_xxxxxxxxxxxxxxxx"Keep your keys secret
Treat live API keys like passwords. Never commit them to version control, embed them in client-side code, or share them in support tickets. Load keys from environment variables and rotate any key you believe has been exposed.
Installation#
Install the SDK for your language with its native package manager. Each SDK wraps authentication, retries, and typed responses so you can call the API without hand-building requests. If you are using cURL or another language, no installation is needed - just call the REST endpoints directly.
composer require digitel/sdkRequirements
The SDKs support PHP 8.1+, Python 3.8+, and Node.js 18+. All three are semantically versioned and published to Packagist, PyPI, and npm respectively.
Send an email#
Send a transactional email through your Digitel Africa | Mail domain by creating a message. The sending domain must be verified in the console before live delivery. The endpoint returns immediately with a message id you can use to track delivery.
/email/messagesQueue a transactional email for delivery.| Parameter | Type | Required | Description |
|---|---|---|---|
| from | string | Yes | Sender address on a verified domain, e.g. [email protected]. |
| to | string[] | Yes | One or more recipient email addresses. |
| subject | string | Yes | Subject line of the message. |
| text | string | No | Plain-text body. Required if html is omitted. |
| html | string | No | HTML body. Required if text is omitted. |
| reply_to | string | No | Address to set in the Reply-To header. |
curl https://api.digitel.africa/v1/email/messages \
-H "Authorization: Bearer da_live_xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"from": "[email protected]",
"to": ["[email protected]"],
"subject": "Welcome to Yourco",
"html": "<h1>Welcome aboard</h1>"
}'{
"id": "msg_01HZY8QK3P4RN2",
"object": "email.message",
"status": "queued",
"from": "[email protected]",
"to": ["[email protected]"],
"subject": "Welcome to Yourco",
"created_at": "2026-08-24T09:15:42Z"
}Create a DNS record#
Add a record to a DNS zone you manage. Replace {zone} in the path with the zone name or id, for example yourco.co.za. Changes propagate across the Digitel Africa anycast network within seconds.
/dns/zones/{zone}/recordsCreate a new DNS record in the given zone.| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | Record type: A, AAAA, CNAME, MX, TXT, etc. |
| name | string | Yes | Record name, e.g. www or @ for the apex. |
| content | string | Yes | Record value, e.g. an IP address or target host. |
| ttl | integer | No | Time to live in seconds. Defaults to 3600. |
| priority | integer | No | Priority for MX and SRV records. |
curl https://api.digitel.africa/v1/dns/zones/yourco.co.za/records \
-H "Authorization: Bearer da_live_xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"type": "A",
"name": "www",
"content": "196.10.52.14",
"ttl": 3600
}'Errors#
The API uses conventional HTTP status codes to signal success or failure. Codes in the 2xx range indicate success, 4xx codes indicate a problem with your request, and 5xx codes indicate an error on Digitel Africa's side. Every error response includes a machine-readable code and a human-readable message.
| Status | Meaning | When it happens |
|---|---|---|
| 200 OK | Success | The request succeeded. |
| 201 Created | Created | A new resource was created. |
| 400 Bad Request | Invalid request | A parameter is missing or malformed. |
| 401 Unauthorized | Bad credentials | The API key is missing or invalid. |
| 403 Forbidden | Not permitted | The key lacks access to this resource. |
| 404 Not Found | No such resource | The resource does not exist. |
| 422 Unprocessable Entity | Validation failed | The request was well-formed but semantically invalid. |
| 429 Too Many Requests | Rate limited | You exceeded your rate limit. |
| 500 Server Error | Server error | Something went wrong on our end. |
{
"error": {
"type": "validation_error",
"code": "invalid_parameter",
"message": "The 'to' field must contain at least one recipient.",
"param": "to",
"request_id": "req_01HZY9F2M8KQ7T"
}
}Include the request id
Every response carries a request_id. Quote it when contacting support so the team can trace the exact request.
Rate limits#
Requests are rate limited per API key. The current limit is 600 requests per minute for most endpoints; email sending is metered separately by your plan. Each response returns X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset headers so you can back off before hitting the ceiling.
Handle 429 responses
When you exceed the limit the API returns 429 Too Many Requests with a Retry-After header. Respect it and retry with exponential backoff; the official SDKs do this automatically.
Need a hand?
Browse the FAQs, or talk to our engineers — real people who know the platform.