For the complete documentation index, see llms.txt. This page is also available as Markdown.

Create API token

Create an API token for the given mail order.

Create API token

post

Create an API token for the given mail order. The token grants access to the Hostinger Email API, where you can provision and manage the mailboxes it is scoped to.

The plaintext token is returned only in this response, never again. A maximum of 10 tokens can exist per order. Use scope.has_all_mailboxes to cover all current and future mailboxes, or list specific mailboxes in scope.mailbox_ids.

Authorizations
AuthorizationstringRequired

API Token authentication

Path parameters
orderIdstringRequired

Order resource ID

Example: OR1a2b3c4d5e6f7g
Body
namestring · max: 255Required

Human-readable label for this token

Example: CRM integration
Responses
201

Created response

application/json
idstringOptional

Unique API token identifier

Example: 019683f8-1234-7abc-8def-0123456789ab
tokenstringOptional

Plaintext API token, returned only in this response. Grants access to the Hostinger Email API for mailbox provisioning and management.

Example: 4a6f8b2d1e9c3f7a0b5d8e2c4f1a7b3d9e6c2f8a1b4d7e0c3f6a9b2d5e8c1f4a
namestring · nullableOptional

Human-readable label for this token

Example: CRM integration
created_atstring · date-timeOptionalExample: 2026-05-05T12:00:00Z
typestring · enumOptionalExample: api_tokenPossible values:
post/api/mail/v1/orders/{orderId}/api-tokens
POST /api/mail/v1/orders/{orderId}/api-tokens HTTP/1.1
Host: developers.hostinger.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 97

{
  "name": "CRM integration",
  "scope": {
    "has_all_mailboxes": false,
    "mailbox_ids": [
      "AC1a2b3c4d5e6f7g"
    ]
  }
}
{
  "id": "019683f8-1234-7abc-8def-0123456789ab",
  "token": "4a6f8b2d1e9c3f7a0b5d8e2c4f1a7b3d9e6c2f8a1b4d7e0c3f6a9b2d5e8c1f4a",
  "name": "CRM integration",
  "scope": {
    "has_all_mailboxes": false,
    "mailboxes": [
      {
        "id": "AC1a2b3c4d5e6f7g",
        "address": "user@example.com"
      }
    ]
  },
  "created_at": "2026-05-05T12:00:00Z",
  "type": "api_token"
}

Last updated

Was this helpful?