Skip to content

API Keys

POST /api-keys/
FieldTypeRequiredDefaultDescription
tokenstringYesThe key value (generate securely)
partner_refstringYesPartner identifier
domains_allowedintegerNo0Domain limit (0 = unlimited)
mailboxes_per_domainintegerNo1Mailboxes per domain
aliases_per_mailboxintegerNo5Aliases per mailbox
activebooleanNotrueWhether the key is active
expires_atstringNonullISO 8601 expiration date. null = never expires
Terminal window
curl -X POST https://api.emboux.com/api-keys/ \
-H "Authorization: Bearer MASTER_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"token": "emb_k7f2a9xP3mN...",
"partner_ref": "partner_42",
"domains_allowed": 10,
"mailboxes_per_domain": 5,
"aliases_per_mailbox": 20,
"expires_at": "2026-12-31T23:59:59"
}'
{
"id": 1,
"token": "emb_k7f2a9xP3mN...",
"partner_ref": "partner_42",
"domains_allowed": 10,
"domains_used": 0,
"mailboxes_per_domain": 5,
"aliases_per_mailbox": 20,
"active": true,
"expires_at": "2026-12-31T23:59:59",
"created_at": "2025-01-15T10:00:00",
"last_used_at": null
}

PUT /api-keys/{token}

Update quotas or deactivate a key. Only provided fields are changed.

FieldTypeDescription
domains_allowedintegerNew domain limit
mailboxes_per_domainintegerNew mailbox limit
aliases_per_mailboxintegerNew alias limit
activebooleanActivate or deactivate
expires_atstringNew expiration date (null to remove)
Terminal window
curl -X PUT https://api.emboux.com/api-keys/emb_k7f2a9xP3mN... \
-H "Authorization: Bearer MASTER_TOKEN" \
-H "Content-Type: application/json" \
-d '{"domains_allowed": 20, "active": true}'

DELETE /api-keys/{token}

Permanently removes the key. Resources created with this key remain but become inaccessible.

Terminal window
curl -X DELETE https://api.emboux.com/api-keys/emb_k7f2a9xP3mN... \
-H "Authorization: Bearer MASTER_TOKEN"

GET /api-keys/{token}/usage?since={ISO_datetime}

Returns resources created by this key, optionally filtered by date.

ParameterTypeRequiredDescription
sincestringNoISO 8601 datetime. Only return resources created after this date.
Terminal window
curl "https://api.emboux.com/api-keys/emb_k7f2a9xP3mN.../usage?since=2025-01-01T00:00:00" \
-H "Authorization: Bearer MASTER_TOKEN"
{
"domains_allowed": 10,
"domains_used": 3,
"mailboxes_per_domain": 5,
"aliases_per_mailbox": 20,
"domains_created_since": [
{"name": "example.com", "created_at": "2025-01-10T08:00:00"}
],
"mailboxes_created_since": [
{"email": "user@example.com", "domain_name": "example.com", "created_at": "2025-01-10T08:05:00"}
],
"aliases_created_since": []
}

A partner can have multiple active API keys. All keys for the same partner:

  • Share the same quota pool (domain count, etc.)
  • See the same resources
  • Are independently revocable

This is useful for giving different teams or contractors separate keys for auditing and access control.