---
title: "Create API token"
method: POST
path: "/api/mail/v1/orders/{orderId}/api-tokens"
tags: ["Mail: API Tokens"]
---

# Create API token

`POST /api/mail/v1/orders/{orderId}/api-tokens`

Create an API token for the given mail order. The token grants access
to the [Hostinger Email API](https://api.mail.hostinger.com/), 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`.

## Path parameters

- `orderId` string, required

## Request body

- MailV1SchemaCreateApiTokenRequestSchema
  - `name` string, required — Human-readable label for this token
  - `scope` object, required — Mailbox scope this token can access
    - `has_all_mailboxes` boolean, required — Grant access to all current and future mailboxes of the order
    - `mailbox_ids` string[] — Required when `has_all_mailboxes` is false. Mailbox resource IDs of this order.

## Response `201`

Created response

- MailV1ApiTokensApiTokenCreatedResource
  - `id` string — Unique API token identifier
  - `token` string — Plaintext API token, returned only in this response. Grants access to the [Hostinger Email API](https://api.mail.hostinger.com/) for mailbox provisioning and management.
  - `name` string, nullable — Human-readable label for this token
  - `scope` MailV1ApiTokensApiTokenScopeResource
    - `has_all_mailboxes` boolean — Whether the token covers all current and future mailboxes of the order
    - `mailboxes` MailV1ApiTokensApiTokenMailboxResource[] — Mailboxes this token grants access to. Empty when `has_all_mailboxes` is true.
      - `id` string — Mailbox resource ID
      - `address` string
  - `created_at` string, date-time
  - `type` 'api_token' | 'oauth'

## Other responses

- `401` — Unauthenticated response
- `404` — Error response
- `409` — Error response
- `422` — Error response
- `500` — Error response

## Changes

> 88 revisions in range; 15 could not be searched.

- **2026-07-23** `a848f6782891` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/hostinger/apis/hostinger-api/changes/api/mail/v1/orders/:orderId/api-tokens/post.md)

---

[API](https://skmtc.dev/hostinger/apis/hostinger-api.md) · [All operations](https://skmtc.dev/hostinger/apis/hostinger-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/hostinger/hostinger-api/revisions/53ccee45e5eb/schema)
