Nimag API
Everything you do in the customer portal, from your own scripts and tools: virtual machines, websites, email, DNS, domains, orders, invoices and support.
Base URL
https://portal.nimag.net/api/v1
Requests and responses are JSON, in UTF-8. Times are ISO 8601, in UTC.
Authentication
Every request carries an API key, as a bearer token. An account administrator makes keys in the portal, under Account › API keys: give it a name, a role and how long it lasts. The key is shown once - keep it like a password, in your script's secrets, never in its code.
curl https://portal.nimag.net/api/v1/me \ -H "Authorization: Bearer nck_…"
A key acts for your account with the role chosen for it, and never with more than the role of the person who made it: if that person leaves or gets a smaller role, the key stops working. Revoke a key in the portal the moment you think it leaked. A key never opens a VM console, nor manages users or keys.
Roles and permissions
Each endpoint says the permission it needs; GET /me lists those of your key.
| Account administrator | Everything below. |
| Technical contact | Services: virtual machines, websites, email, DNS, network, tickets. Not invoices. |
| Billing contact | Invoices, the billing contact, contracts and tickets. |
| Read-only | Reading everything, changing nothing. |
Errors
An error answers with its status and a JSON body: {"detail": "…"}.
| 400 | The request can't be done as asked; detail says why. |
| 401 | No key, or a key that is unknown, expired or revoked. |
| 403 | The key's role doesn't allow it. |
| 404 | Not found - or not this customer's. |
| 409 | It conflicts with what is there, e.g. the hosting package has no room left. |
| 422 | A field isn't valid; detail lists which. |
| 429 | Too many requests: wait a minute. |
| 503 | A system behind the API doesn't answer right now: try again later. |
Rate limits
Up to 120 requests a minute per key and per endpoint. Beyond that, 429 until the minute is over.
OpenAPI
The whole API is described in openapi.json (OpenAPI 3.1): import it in Postman, Insomnia or Bruno, or generate a client from it.
Versions
This is version 1, at /api/v1. New endpoints and new fields come without notice - ignore the fields you don't know. Anything that would break a script comes as a new version.
Reference
Account
Who the key acts for, the account's details and its dashboard.
5 endpoints
Contracts
The contracts the customer signed with Nimag.
1 endpoints
Services
Every service of the customer, whatever its kind. A service's `id` is what the other groups take as `service_id`.
6 endpoints
Virtual machines
Virtual servers: their state, and starting, stopping and rebooting them.
6 endpoints
Network
IP addresses and their reverse DNS.
3 endpoints
DNS
Records of the DNS zones Nimag hosts for the customer.
4 endpoints
Web hosting
The hosting package: what it includes and what is used.
2 endpoints
Websites
Websites, with their databases, FTP accounts and shell users.
14 endpoints
Mailboxes, aliases, forwards and catch-alls of the customer's mail domains.
11 endpoints
Domains
Registering new domains and transferring existing ones.
8 endpoints
Object storage
S3-compatible object storage.
2 endpoints
Housing
Rack space in Nimag's data centre.
2 endpoints
Orders
The basket, placing orders and following them.
7 endpoints
Invoices
Invoices, their lines and PDF.
5 endpoints
Support
Support tickets and their messages.
5 endpoints
Managed network
Networks Nimag manages with UniFi: devices and Wi-Fi.
5 endpoints
Video conferencing
Meeting rooms and their recordings.
8 endpoints