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 administratorEverything below.
Technical contactServices: virtual machines, websites, email, DNS, network, tickets. Not invoices.
Billing contactInvoices, the billing contact, contracts and tickets.
Read-onlyReading everything, changing nothing.

Errors

An error answers with its status and a JSON body: {"detail": "…"}.

400The request can't be done as asked; detail says why.
401No key, or a key that is unknown, expired or revoked.
403The key's role doesn't allow it.
404Not found - or not this customer's.
409It conflicts with what is there, e.g. the hosting package has no room left.
422A field isn't valid; detail lists which.
429Too many requests: wait a minute.
503A 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

Nimag API