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

# Create an API key

`POST /api-keys`

## Request

- Base URL: `https://eu.bisibility.com/api/v1`
- URL: `https://eu.bisibility.com/api/v1/api-keys`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

The scope defaults to admin when omitted.

## Query parameters

- `project` string

## Headers

- `Bisibility-API-Version` 'v1'
- `X-Bisibility-Project` string
- `X-Bisibility-Source` 'sdk' | 'cli' | 'mcp'

## Request body

- ApiKeyCreate
  - `expires_in_days` 30 | 90 | 365 | null, nullable: Lifetime in days. Use null for no expiry.
  - `name` string, required
  - `scope` 'read' | 'write' | 'admin': Access tier. When omitted, defaults to admin for backward compatibility.

## Response `201`

Created

- ApiKeyIssued
  - `created_at` string, date-time, required
  - `expires_at` string, date-time, nullable, required
  - `id` string, required
  - `last_used_at` string, date-time, nullable, required
  - `name` string, required
  - `prefix` string, required
  - `revoked_at` string, date-time, nullable, required
  - `scope` 'read' | 'write' | 'admin', required
  - `masked_value` string, required
  - `token` string, required

## Other responses

- `400`: Bad request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not found
- `409`: Unsupported API version
- `429`: Rate limited

## Changes

- **2026-10-19** `a6e1ec0dec82`: 5 info
  - media type `application/json` was changed to a more specific media type `application/problem+json` for the response status `400`
  - media type `application/json` was changed to a more specific media type `application/problem+json` for the response status `401`
  - media type `application/json` was changed to a more specific media type `application/problem+json` for the response status `403`
  - media type `application/json` was changed to a more specific media type `application/problem+json` for the response status `404`
  - …1 more

[Operation history](https://skmtc.dev/bisibility/apis/bisibility-public-api/changes/api-keys/post.md)

---

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