Management API

What the management API is for, how to authenticate, how asynchronous requests work and how errors are reported.

The management API does what the dashboard does for databases, from a script: create and manage databases, issue and revoke their credentials, list backups and read usage. It is meant for CI, deployment pipelines and infrastructure as code.

It manages databases; it does not reach into them. Reading and writing documents goes to the database's cluster with a database key: see connecting an application.

Base URL

Every endpoint is under /v1 on the service's API host. The API host is the service's domain with api. in front of it.

export MIMIC_MANAGEMENT_API="https://api.<service-domain>"
curl "$MIMIC_MANAGEMENT_API/v1/databases" -H "Authorization: Bearer $MIMIC_API_KEY"

The samples on these pages read the host from MIMIC_MANAGEMENT_API and the key from MIMIC_API_KEY.

OpenAPI

The API's OpenAPI document is served without authentication at:

GET /v1/openapi.json

Use it to generate a client or to check a field. These pages describe the same contract.

Authentication

Authenticate every request with an API key, as a bearer token:

Authorization: Bearer mc_sk_…

Create the key in the dashboard under Settings → API Keys. A request without a key, or with one that is unknown or revoked, is answered 401. A dashboard session does not authenticate the management API, and neither does a database key.

A key belongs to one organization, so no request names an organization: GET /v1/databases lists the databases of the key's organization.

What a key may do

A key has a scope (the whole organization, or one database) and a role (admin or member).

EndpointAdmin, organizationMember, organizationEither role, one database
GET /v1/regionsYesYesYes
GET /v1/databasesYesYesOnly its database
POST /v1/databasesYes403403
POST …/backups/{backupId}/restoreYes403403
GET /v1/usageYesYes403
Everything else under /v1/databases/{databaseId}YesYesIts database; others are 404

No key can manage members, API keys or the audit log: those have no endpoints.

Requests and responses

  • Request bodies are JSON. Send Content-Type: application/json.
  • Responses are JSON. Times are ISO 8601 strings in UTC, such as 2026-01-15T10:00:00.000Z.
  • A field that has no value is null; it is not left out.
  • Names (name) are trimmed and must be 1 to 64 characters.
  • Lists are returned whole: there is no pagination. Operations return the 50 most recent, and database keys and token keys the 100 most recent.

Asynchronous requests

Creating, deleting, restoring, suspending, resuming and retrying a database take time, so they do not wait. Each answers 202 Accepted with the database in its new state, and the work continues as an operation.

The database's latestOperation reports the progress:

{
  "id": "db_…",
  "state": "provisioning",
  "latestOperation": {
    "id": "op_…",
    "databaseId": "db_…",
    "kind": "create_database",
    "state": "running",
    "step": "creating",
    "error": null,
    "createdAt": "2026-01-15T10:00:00.000Z",
    "updatedAt": "2026-01-15T10:00:02.000Z",
    "completedAt": null
  }
}

To wait for the result, poll GET /v1/databases/{databaseId}:

while true; do
  database=$(curl -s "$MIMIC_MANAGEMENT_API/v1/databases/$DATABASE_ID" \
    -H "Authorization: Bearer $MIMIC_API_KEY")
  state=$(echo "$database" | jq -r '.state')
  operation=$(echo "$database" | jq -r '.latestOperation.state')
  [ "$state" = "ready" ] && break
  [ "$operation" = "failed" ] && { echo "$database" | jq -r '.latestOperation.error'; exit 1; }
  sleep 2
done
  • Stop when state is the one you asked for.
  • Stop with an error when latestOperation.state is failed; latestOperation.error says why. POST /v1/databases/{databaseId}/retry runs it again.
  • A database runs one such operation at a time. A second request while one is in progress is answered 409.

The other endpoints answer when their work is done: 200 for a read or a rename, 201 for a created key, 204 with no body for a revocation.

Errors

An error is a JSON object whose _tag names its kind. Decide on the status code and _tag; message is for people and may change.

Status_tagFieldsMeaning
400InvalidRequestmessageThe request is well-formed but cannot be carried out, such as a region that is not offered
401UnauthenticatedmessageNo valid API key was sent
403ForbiddenmessageThe key can see the resource but its role or scope does not allow the action
404NotFoundresource, idThe resource does not exist, or belongs to another organization
409ConflictmessageThe action conflicts with the resource's state or with a name that is taken
503UnavailablemessageThe database's cluster could not be reached or has no room. Retry the request
{ "_tag": "NotFound", "resource": "database", "id": "db_…" }
{ "_tag": "Conflict", "message": "Wait for the database's current operation to finish." }

A request whose body, path or query does not match the endpoint's schema, for example a missing name or an unknown window, is also answered 400, with an empty body: there is no _tag to read. Check the request against the endpoint's reference.

Not found means not yours, too

A resource in another organization is reported exactly like one that does not exist. For a key scoped to one database, so is every other database of its own organization.

Retrying

  • 503 is safe to retry.
  • 409 usually means waiting: for the current operation to finish, or for a registration to end.
  • Do not blindly repeat a request that creates something after a timeout. Read the list first: the first request may have succeeded.

Reference