---
title: "Create API key"
method: POST
path: "/apikeys/create"
tags: ["API Keys"]
---

# Create API key

`POST /apikeys/create`

## Request

- Base URL: `https://api.databuddy.cc`
- URL: `https://api.databuddy.cc/apikeys/create`
- Auth: API key in header `x-api-key`

Creates a new API key. Returns the secret once; store it securely. Requires organization website configure permission.

## Request body

- object
  - `name` string, required
  - `description` string
  - `organizationId` string, required
  - `type` 'user' | 'sdk' | 'automation'
  - `scopes` string[]
  - `resources` object
  - `tags` string[]
  - `expiresAt` string, date-time
  - `ratelimit` object
    - `enabled` boolean
    - `max` integer, nullable
    - `window` integer, nullable

## Response `200`

OK

- object
  - `id` string, required
  - `secret` string, required
  - `prefix` string, required
  - `start` string, required

## Other responses

- `400`: 400
- `401`: 401
- `402`: 402
- `403`: 403
- `404`: 404
- `409`: 409
- `429`: 429
- `500`: 500
- `503`: 503

---

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