---
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
  - `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
  - `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

---

[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)
