---
title: "Create Key"
method: POST
path: "/api-keys/"
tags: ["api-keys"]
---

# Create Key

`POST /api-keys/`

## Request body

- ApiKeyCreate
  - `name` string, required
  - `org_id` string, nullable
  - `project_id` string, nullable
  - `scopes` string[]
  - `source_id` string, uuid, nullable
  - `expires_at` string, date-time, nullable

## Response `200`

Successful Response

- ApiKeyCreated
  - `id` string, required
  - `name` string, required
  - `raw_key` string, required
  - `prefix` string, required
  - `last4` string, required
  - `org_id` string, nullable
  - `scopes` string[]
  - `source_id` string, nullable
  - `expires_at` string, nullable

## Other responses

- `422` — Validation Error

## Changes

- **2026-09-26** `ac3124ed97ef` — 7 info
  - added the new optional request property `expires_at`
  - added the new optional request property `scopes`
  - added the new optional request property `source_id`
  - added the optional property `expires_at` to the response with the `200` status
  - …3 more

[Change history](https://skmtc.dev/reasonblocks/apis/reasonblocks-control-plane-api/changes/api-keys/post.md)

---

[API](https://skmtc.dev/reasonblocks/apis/reasonblocks-control-plane-api.md) · [All operations](https://skmtc.dev/reasonblocks/apis/reasonblocks-control-plane-api/llms.txt) · [OpenAPI document](https://skmtc.dev/reasonblocks/apis/reasonblocks-control-plane-api/revisions/ac3124ed97ef?raw)
