API for Developers
Manage domains, hosting, servers, SMS and invoices from your own code, with one API.
- Home »
- API for Developers
What you do in My MozOut you can also do from your code: register domains, change DNS, create mailboxes, send SMS or pay invoices with your account credit.
Domains, DNS, hosting, e-mail, VPS, SMS and invoices, all at one address.
In Sandbox, reads are real and writes are simulated, at no cost to you.
Each key only does what you allow, per area, with read and write kept separate.
Always JSON responses, with messages in the language you ask for.
Every operation has examples and explained fields, and the Playground lets you make test requests in your browser.
Operations are grouped by area. Each key gets only the areas it needs, to read, to change or both.
Register, transfer and renew.
Zone records and backups.
Databases, FTP, cron and SSL.
Mailboxes and authentication.
Start, restart and reinstall.
Send and check the history.
View, download and pay.
Account details and users.
Products, extensions and currencies.
Tickets, articles and announcements.
View and buy extra products.
Reseller programmes and accounts.
Resellers, agencies and developers use the API to automate, from their own code, what they would otherwise do by hand in My MozOut.
Register domains, change DNS and create mailboxes for your customers without opening My MozOut. See also our reseller hosting.
Connect your billing system or website: check and pay invoices with your credit balance and send SMS to your customers.
Use scripts to start, restart or reinstall a VPS server and keep nameservers and DNS always up to date.
Authentication uses only an API key, sent in the Authorization header. Each key has its own rules and can be revoked at any time.
Every operation follows the same rules: JSON, HTTPS, a key in the header and error codes that never change.
code that never changes.page and per_page, up to 100 per page.X-RateLimit-Limit and X-RateLimit-Remaining headers.Accept-Language header.# List of domains
GET /v1/domains?page=1&per_page=10
200 OK
{
"data": [ ... ],
"meta": { "page": 1, "per_page": 10, "total": 3, "total_pages": 1 }
}
# Key without the required permission
403 Forbidden
{
"error": {
"code": "insufficient_scope",
"message": "...",
"correlation_id": "..."
}
}
Start in Sandbox, with no risk of changing your account or being charged, and move to Production when your program is ready.
On the API page in My MozOut, choose a name, Sandbox mode and permissions.
Use the Playground or the example on this page. Writes are simulated and free.
Create a prod_ key with minimal permissions. Only the key changes.
curl https://api.mozout.com/v1/sms/messages \
-H "Authorization: Bearer sandbox_..." \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 0f8fad5b-d9cb-469f-a165-70867728950e" \
-d '{"number": "+258841234567",
"text": "Your order is ready."}'
Sending an SMS with a Sandbox key: it is validated and answered in JSON, but nothing is sent or charged.
Idempotency-Key
Both keys use the same address and the same operations. The difference is what happens when a request changes something.
| Sandboxsandbox_ | Productionprod_ | |
|---|---|---|
| Reads real account data | Yes | Yes |
| Changes | Simulated, with the X-API-Simulated: true header | Real |
| Charges | Never | Paid from your credit balance |
| SMS | Validated but not sent | Sent and deducted from your SMS balance |
| Address | api.mozout.com/v1 | The same |
| X-API-Mode header | sandbox | production |
| Best for | Building and testing safely | Your finished program |
Articles to help you choose, set up and get the most from this service
The short answer: an API is the agreed way for one program to ask another for something. Instead of a person opening a page and clicking, your site sends…
Read the article
The short answer: if an API key, a token or a webhook secret has turned up somewhere it should not (a public repository, a file inside the site, a…
Read the article
To talk to an API from PHP you use cURL: open a request, send it, read the status code (200, 401, 404…) and only then decode the JSON in…
Read the article
The most frequently asked questions about API keys, modes and limits
Only with an API key, sent with every request in the Authorization: Bearer header. The API does not accept the key in the URL and only answers over HTTPS.
The owner of an account with an active service or domain, on the API page in My MozOut. Each account can have up to 20 keys.
A key is shown only once, when it is created, and we cannot recover it. Revoke it on the API page in My MozOut and create a new one.
Yes, with a Production key that has the domain and purchase permissions; the payment comes from your account's credit balance. Some cases stay in My MozOut, such as .mz and .ao domains of up to 3 characters, .ac.mz, .gov.mz and .mil.mz, and transfers of .mz and .ao domains. See our domain prices.
Yes. When you create the key, enter the list of IPs. Requests from any other address are refused with the ip_not_allowed error.
A sandbox_ key reads the real data of your account, but writes are simulated and never charged. A prod_ key reads and changes your account. The address is the same: the key decides.
Yes. An account can make up to 300 requests per minute, across all its keys. Some operations, such as domain registrations or payments, have their own limits, explained in the documentation.
In a POST request, send a unique code in the Idempotency-Key header. If the connection drops and you repeat the request with the same code within 24 hours, you get the same response and nothing is done twice.
Yes. Give the key the SMS permissions and you can send messages and check the balance, the history and the templates. See the prices on the SMS page.
No. A key never creates other keys, never changes the account password or e-mail and never sees card details. The most sensitive permissions, such as paying or reinstalling a VPS, are turned off by default.