---
title: "Create a new API key"
method: POST
path: "/apikey/createapikey"
tags: ["API Keys"]
---

# Create a new API key

`POST /apikey/createapikey`

## Request

- Base URL: `http://localhost:5000/api/v1`
- URL: `http://localhost:5000/api/v1/apikey/createapikey`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/scrubbe/apis/scrubbe-api/docs/apikey/createapikey/post.ts> (a function with typed inputs; its response is checked against the schema)

## Request body

- object
  - `name` string, required
  - `environment` 'PRODUCTION' | 'DEVELOPMENT', required
  - `scopes` string[]

## Response `201`

API key created (raw key shown only once)

---

[API](https://skmtc.dev/scrubbe/apis/scrubbe-api.md) - [All operations](https://skmtc.dev/scrubbe/apis/scrubbe-api/llms.txt) - [OpenAPI document](https://skmtc.dev/scrubbe/apis/scrubbe-api/revisions/45bb33d61b7e?raw)
