Skip to main content
PATCH
Update an API key

Authorizations

Authorization
string
header
required

Project-scoped secret API key (sk_…). Pass in the Authorization: Bearer <key> header. Grants access to the project the key was issued for.

Path Parameters

keyId
integer | null

Numeric API key identifier.

Example:

12

Body

application/json

Update an API key’s metadata. The key value cannot be changed.

name
string
Minimum string length: 1
description
string | null
scope
enum<string>

public (pk_) keys are safe to embed in browser/SDK code on an explicit allowlist of endpoints. secret (sk_) keys grant full project-scoped access and must be kept server-side.

Available options:
public,
secret
role
enum<string>

The caller’s role on this project.

Available options:
support,
smtpproxy,
editor,
publisher,
admin

Response

The updated API key.

A project-scoped API key. Scope (public/secret) controls what endpoints it can call; role gates write access.

id
integer
required

Numeric API key identifier.

Example:

12

project_id
integer
required
name
string
required

Human-readable label for the API key.

Example:

"Production server"

scope
enum<string>
required

public (pk_) keys are safe to embed in browser/SDK code on an explicit allowlist of endpoints. secret (sk_) keys grant full project-scoped access and must be kept server-side.

Available options:
public,
secret
role
enum<string>
required

The caller’s role on this project.

Available options:
support,
smtpproxy,
editor,
publisher,
admin
value
string
required

The key value, prefixed with sk_ (secret) or pk_ (public). Returned in full only on creation; subsequent reads return a masked form.

Example:

"sk_01HXY7Z9K8M5J2N4P6Q8R0S1T2"

created_at
string | null
required
updated_at
string | null
required
description
string | null

Optional description.

is_system_key
boolean

When true, the key is system-managed and cannot be archived from the API.