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

# Update Api Key

`PATCH /v1/api-keys/{key_id}`

## Request

- Base URL: `https://api.pinbridge.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.pinbridge.io/v1/api-keys/{key_id}`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer

Update API key name, scopes, or Pinterest account allow-list.

## Path parameters

- `key_id` string, uuid, required

## Headers

- `x-api-key` string, nullable
- `authorization` string, nullable

## Request body

- APIKeyUpdate: Request schema for updating API key metadata, scopes, or account allow-list. Fields left out are unchanged. Send ``pinterest_account_ids: null`` to lift an account restriction.
  - `name` string, nullable: Human-readable name for this API key
  - `scopes` string[], nullable: Scopes granted to this key. `read` covers list/get endpoints, `write` covers creating and updating pins, schedules, boards, assets and webhooks, and `destructive` covers deletes and revocations. Omit to grant every scope.
  - `pinterest_account_ids` string[], nullable: Optional allow-list of Pinterest account IDs this key may act on. Omit or send null to allow every account in the workspace.

## Response `200`

Successful Response

- APIKeyResponse: Response schema for API key (without the actual key).
  - `id` string, uuid, required
  - `workspace_id` string, uuid, required
  - `name` string, required
  - `scopes` string[], required
  - `pinterest_account_ids` string[], nullable
  - `last_used_at` string, date-time, nullable
  - `created_at` string, date-time, required
  - `revoked_at` string, date-time, nullable
  - `source` 'manual' | 'oauth', required: `manual` for keys created in the dashboard or API, `oauth` for keys minted when an AI agent or app connected through OAuth
  - `client_name` string, nullable: Name the OAuth client registered with. Null for manual keys, and for oauth keys whose client registered without a name.
  - `authorized_by_email` string, nullable: Email of the member who authorized the connection. Null for manual keys, and for oauth keys whose authorizing member no longer exists.

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/pinbridge/apis/pinbridge-api.md) · [All operations](https://skmtc.dev/pinbridge/apis/pinbridge-api/llms.txt) · [OpenAPI document](https://skmtc.dev/pinbridge/apis/pinbridge-api/revisions/b17603589d01?raw)
