---
title: "Create API key"
method: POST
path: "/api-keys"
tags: ["API Keys"]
---

# Create API key

`POST /api-keys`

## Request

- Base URL: `https://api.mailforge.ai/public`
- URL: `https://api.mailforge.ai/public/api-keys`
- Auth: API key in header `Authorization`

Creates a new API key for the account. The raw key is returned once and cannot be retrieved again. Requires Firebase Bearer token.
Must be called without /public prefix

## Request body

- ApiCreateAPIKeyRequest
  - `name` string

## Response `200`

OK

- ApiCreateAPIKeyResponse
  - `accountId` string
  - `createdAt` string
  - `id` string
  - `isActive` boolean
  - `key` string: raw key, shown once
  - `name` string
  - `updatedAt` string

## Other responses

- `400`: Invalid request
- `401`: Unauthorized

---

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