---
title: "Update API Key"
method: PATCH
path: "/api-keys/{id}"
tags: ["API Keys"]
---

# Update API Key

`PATCH /api-keys/{id}`

Updates an existing API key's permissions and IP restrictions. The API key name and expiration date cannot be modified after creation.

## Path parameters

- `id` string, required

## Request body

- UpdateAPIKeyRequest
  - `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 leave the key's current accounts unchanged; providing a list replaces them. An empty array removes all account access. A key cannot be scoped to an account the caller cannot reach.
  - `allowed_ips` union — IP restrictions for the API key. If not provided, existing restrictions remain unchanged
    - string — Single IP address or CIDR range
    - string[] — Array of IP addresses or CIDR ranges

## Response `200`

API key updated successfully

- APIKey
  - `id` string — Unique identifier for the API key
  - `name` string — Human-readable name for the API key
  - `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
- `404` — Not Found

## 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 `200` status
- **2026-01-08** `b6f8a6e65559` — 4 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`
  - removed the media type `*/*` for the response with the status `404`
  - …1 more
- **2025-07-22** `b61a8714148d` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/stellar/apis/stellar-disbursement-platform-api/changes/api-keys/:id/patch.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)
