---
title: "Create Pat"
method: POST
path: "/api/mcp-tokens"
tags: ["earmarkIQ Context"]
---

# Create Pat

`POST /api/mcp-tokens`

## Request

- Base URL: `https://api.earmarkiq.app` (the document declares no server; this is the origin it was published from)
- URL: `https://api.earmarkiq.app/api/mcp-tokens`
- Auth: HTTP bearer

Create a personal access token. The raw token is returned once and
stored only as a hash — copy it now.

## Request body

- TokenCreate
  - `name` string, required
  - `scopes` string[], nullable

## Response `201`

Successful Response

- TokenCreated
  - `id` string, required
  - `name` string, required
  - `token` string, required
  - `created_at` string, required
  - `expires_at` string, required
  - `scopes` string[], required
  - `covers` string[], required

## Other responses

- `422`: Validation Error

---

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