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

# Create API Key

`POST /api-keys`

Creates a new API Key to access SDP endpoints. API Key can be configured to have a granular read/write access, also API key can be restricted to the specific IP or range of the IPs.

## Request body

- CreateAPIKeyRequest
  - `name` string, required — Human-readable name for the API key
  - `permissions` string[], required — List of permissions granted to this API key
  - `expiry_date` string, date-time — Optional expiration date for the API key (must be in the future)
  - `allowed_ips` union — IP restrictions for the API key. If not provided, the key can be used from any IP
    - string — Single IP address or CIDR range
    - string[] — Array of IP addresses or CIDR ranges

## Response `201`

API key created successfully

- CreateAPIKeyResponse
  - `id` string — Unique identifier for the API key
  - `name` string — Human-readable name for the API key
  - `key` string — The actual API key (only returned once at creation)
  - `permissions` string[] — List of permissions granted to this API key
  - `allowed_ips` string[] — List of allowed IP addresses or CIDR ranges
  - `expiry_date` string, date-time — Expiration date of the API key
  - `created_at` string, date-time — When the API key was created
  - `created_by` string — User who created the API key
  - `updated_at` string, date-time — When the API key was last updated
  - `updated_by` string — User who last updated the API key
  - `last_used_at` string, date-time — When the API key was last used

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden

---

[API](https://skmtc.net/stellar/apis/stellar-disbursement-platform-api.md) · [All operations](https://skmtc.net/stellar/apis/stellar-disbursement-platform-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/stellar/stellar-disbursement-platform-api/revisions/39f9dc64156c/schema)
