---
title: "POST /v1/apikeys"
method: POST
path: "/v1/apikeys"
tags: ["apikeys"]
---

# POST /v1/apikeys

`POST /v1/apikeys`

## Request body

- CreateApiKeyRequest
  - `description` string, nullable
  - `expiresInDays` integer, nullable
  - `scopes` string[]
  - `tenantId` string, nullable — Tenant to scope this key to (admin only). Keys created with a tenant_id can only access resources belonging to that tenant.

## Response `200`

API key created (plaintext shown once)

- ApiKeyCreated
  - `id` string, required
  - `key` string, required

---

[API](https://skmtc.net/smolmachines/apis/smolfleet-api.md) · [All operations](https://skmtc.net/smolmachines/apis/smolfleet-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/smolmachines/smolfleet-api/revisions/853ec529472a/schema)
