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

# Create an API key

`POST /api/v1/api-keys`

## Request

- Base URL: `https://monit.rs`
- URL: `https://monit.rs/api/v1/api-keys`
- Auth: HTTP bearer

## Request body

- object
  - `name` string, required
  - `scopes` string[], required
  - `expires_at` string, date-time, nullable

## Response `201`

Key created; `key` shown once.

## Other responses

- `401`: Not authenticated.
- `403`: Active-key cap (10) reached.

---

[API](https://skmtc.dev/monit/apis/monit-rs-public-api.md) · [All operations](https://skmtc.dev/monit/apis/monit-rs-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/monit/apis/monit-rs-public-api/revisions/7e1923981112?raw)
