---
title: "Update an API key"
method: PUT
path: "/organizations/current/api-keys/{id}"
tags: ["Organizations"]
---

# Update an API key

`PUT /organizations/current/api-keys/{id}`

## Request

- Base URL: `https://api.hookdeck.com/2025-07-01`
- URL: `https://api.hookdeck.com/2025-07-01/organizations/current/api-keys/{id}`
- Auth: one of:
  - HTTP bearer
  - HTTP basic

Update the scopes and grants of an API key. The secret is unchanged.

## Path parameters

- `id` string, required: API key ID

## Request body

- object
  - `scopes` string[]: Permission scopes; defaults to ["*"] (full access) when omitted. For organization keys limited to specific projects, these scopes apply within each granted project. When the caller is an API key, every scope (including per-resource grant scopes) must be one the caller itself holds on the target project.
  - `grants` object: Organization keys: the projects the key is limited to, keyed by project ID with `true` (or `{}`) values — scopes stay in the root `scopes` property. Project keys: per-resource scope overrides keyed by resource ID.

## Response `200`

The updated API key

- ApiKey
  - `id` string, required: The API key ID
  - `label` string, required: The API key label
  - `key` string: The API key secret used as the bearer token
  - `team_id` string, nullable: The project the key is scoped to, or null for organization keys
  - `organization_id` string: The organization the key belongs to
  - `key_fingerprint` string, nullable: Non-secret fingerprint identifying the key
  - `scopes` string[]: Base permission scopes; ["*"] is full access
  - `grants` object: Per-subject scope overrides: keyed by project ID for organization keys, resource ID for project keys
  - `expires_at` string, nullable: When the key expires, or null while active
  - `updated_at` string: Last update timestamp
  - `created_at` string: Creation timestamp

## Other responses

- `400`: Bad Request
- `404`: Not Found

## Changes

- **2026-09-24** `9bebff6c68f9`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/hookdeck/apis/hookdeck-admin-rest-api/changes/organizations/current/api-keys/:id/put.md)

---

[API](https://skmtc.dev/hookdeck/apis/hookdeck-admin-rest-api.md) - [All operations](https://skmtc.dev/hookdeck/apis/hookdeck-admin-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/hookdeck/apis/hookdeck-admin-rest-api/revisions/b1b6f4bac5a1?raw)
