---
title: "Mint a project key"
method: POST
path: "/api/v1/projects/{slug}/keys"
tags: ["management"]
---

# Mint a project key

`POST /api/v1/projects/{slug}/keys`

## Request

- Base URL: `https://api.past.dev`
- URL: `https://api.past.dev/api/v1/projects/{slug}/keys`
- Auth: HTTP bearer

Mint a project key for one project. The clear value is in this response and nowhere else on the API.

## Path parameters

- `slug` string, required

## Request body

- CreateKeyRequest
  - `name` string, required

## Response `201`

The created key, with its clear value.

- CreatedKey
  - `id` string, required: The key id, used to revoke it.
  - `name` string, required
  - `keyPrefix` string, required
  - `keySuffix` string, required
  - `createdAt` string, date-time, required
  - `key` string, required: The clear value. Returned in this response and nowhere else.

## Other responses

- `400`: The request is malformed or violates a field constraint. Match behavior on the response code field.
- `401`: missing-api-key: no bearer. malformed-api-key: the header or the key has the wrong shape. unauthorized: the key is unknown, expired, revoked, or is a project key. These routes take the management key.
- `404`: The organization holds no live project with this slug.
- `default`: Any other failure uses the same JSON error envelope.

---

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