---
title: "Create an API key. Without Bearer this creates an account and a full-access key. With Bearer, name, inbox_id, permissions, and ttl_hours or expires_at are accepted. The secret is returned once."
method: POST
path: "/api/v1/keys"
tags: ["Auth"]
---

# Create an API key. Without Bearer this creates an account and a full-access key. With Bearer, name, inbox_id, permissions, and ttl_hours or expires_at are accepted. The secret is returned once.

`POST /api/v1/keys`

## Request

- Base URL: `https://cooperemail.com`
- URL: `https://cooperemail.com/api/v1/keys`
- Auth: none required

## Request body

- ApiKeyCreate
  - `name` string
  - `inbox_id` string, nullable
  - `permissions` string[], nullable: Null or omitted means full access. Unknown names return 400 invalid_permission. draft_write creates, edits, and deletes drafts. draft_send sends a draft.
  - `ttl_hours` number
  - `expires_at` string, date-time

## Response `201`

Key created. key is the secret and is not stored in plaintext.

---

[API](https://skmtc.dev/cooperemail/apis/cooper-email-api.md) · [All operations](https://skmtc.dev/cooperemail/apis/cooper-email-api/llms.txt) · [OpenAPI document](https://skmtc.dev/cooperemail/apis/cooper-email-api/revisions/6d800a7b3e33?raw)
