---
title: "Create a mailbox key for a customer"
method: POST
path: "/customers/{id}/api-keys"
tags: ["Partners"]
---

# Create a mailbox key for a customer

`POST /customers/{id}/api-keys`

## Request

- Base URL: `https://faivelo.com/api/partner`
- URL: `https://faivelo.com/api/partner/customers/{id}/api-keys`
- Auth: HTTP bearer

Mints an account key on the customer for `/api/v1/mailboxes/*` from your own product: read, search and send mail in your UI without IMAP. Scopes default to the full mailbox vocabulary (`mailboxes:read`, `mail:read`, `mail:send`, `mail:write`), or `mail:*` only when bound to one mailbox. The plaintext comes back once. Refused on sandbox customers (no mail store) and suspended ones. Requires `partner:write`.

## Path parameters

- `id` string, required

## Request body

- object
  - `name` string, required
  - `scopes` string[]: Defaults to everything allowed
  - `mailboxAddress` string, email: Bind the key to one mailbox on the customer
  - `expiresInDays` integer

## Response `201`

The key, plaintext included once

- object
  - `success` boolean
  - `data` object: A mailbox key on an end customer, minted by you for /api/v1/mailboxes/*
    - `id` string
    - `name` string
    - `prefix` string: Display fragment of the key
    - `scopes` string[]
    - `mailbox` string, nullable: Bound mailbox, or null for every mailbox on the customer
    - `lastUsedAt` string, date-time, nullable
    - `expiresAt` string, date-time, nullable
    - `createdAt` string, date-time
    - `key` string

## Other responses

- `400`: Invalid input, or a sandbox customer
- `401`: Missing or invalid API key, or not a partner key
- `403`: The key lacks the required scope, or provisioning is refused (partner paused, customer cap reached)
- `404`: Not found, including any customer that is not yours
- `409`: The customer is suspended
- `429`: Rate limit exceeded

---

[API](https://skmtc.dev/faivelo/apis/faivelo-api.md) · [All operations](https://skmtc.dev/faivelo/apis/faivelo-api/llms.txt) · [OpenAPI document](https://skmtc.dev/faivelo/apis/faivelo-api/revisions/a7413ddea5d1?raw)
