---
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
  - `distribution_wallet_ids` string[] — IDs of the distribution accounts this key may act on. Omit the field to inherit the accounts its creator can reach at that moment. An empty array grants no account access. A key cannot be scoped to an account its creator cannot reach.
  - `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
  - `distribution_wallet_ids` string[] — IDs of the distribution accounts this API key may act on.
  - `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

## Changes

- **2026-08-31** `7588d8d2a3c7` — 4 info
  - added the new optional request property `distribution_wallet_ids`
  - added the new `read:distribution_wallets` enum value to the request property `permissions/items/`
  - added the new `write:distribution_wallets` enum value to the request property `permissions/items/`
  - added the optional property `distribution_wallet_ids` to the response with the `201` status
- **2026-01-08** `b6f8a6e65559` — 3 breaking, 1 info
  - removed the media type `*/*` for the response with the status `400`
  - removed the media type `*/*` for the response with the status `401`
  - removed the media type `*/*` for the response with the status `403`
  - added the media type `application/json` for the response with the status `400`
- **2025-07-22** `b61a8714148d` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/stellar/apis/stellar-disbursement-platform-api/changes/api-keys/post.md)

---

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