Developers

Documentation

One predictable REST API for every product, with official SDKs for PHP, Python and TypeScript — and a cURL example for everything.

Base URLhttps://api.digitel.africa/v1

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.

Authenticated request
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.

Install an SDK
composer require digitel/sdk

Requirements

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.

POST/email/messagesQueue a transactional email for delivery.
Request parameters
ParameterTypeRequiredDescription
fromstringYesSender address on a verified domain, e.g. [email protected].
tostring[]YesOne or more recipient email addresses.
subjectstringYesSubject line of the message.
textstringNoPlain-text body. Required if html is omitted.
htmlstringNoHTML body. Required if text is omitted.
reply_tostringNoAddress to set in the Reply-To header.
Send a message
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>"
  }'
Response
{
  "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.

POST/dns/zones/{zone}/recordsCreate a new DNS record in the given zone.
Request parameters
ParameterTypeRequiredDescription
typestringYesRecord type: A, AAAA, CNAME, MX, TXT, etc.
namestringYesRecord name, e.g. www or @ for the apex.
contentstringYesRecord value, e.g. an IP address or target host.
ttlintegerNoTime to live in seconds. Defaults to 3600.
priorityintegerNoPriority for MX and SRV records.
Create a record
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.

HTTP status codes
StatusMeaningWhen it happens
200 OKSuccessThe request succeeded.
201 CreatedCreatedA new resource was created.
400 Bad RequestInvalid requestA parameter is missing or malformed.
401 UnauthorizedBad credentialsThe API key is missing or invalid.
403 ForbiddenNot permittedThe key lacks access to this resource.
404 Not FoundNo such resourceThe resource does not exist.
422 Unprocessable EntityValidation failedThe request was well-formed but semantically invalid.
429 Too Many RequestsRate limitedYou exceeded your rate limit.
500 Server ErrorServer errorSomething went wrong on our end.
Error response
{
  "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.