Skip to main content
PATCH
Change a key

Authorizations

Authorization
string
header
required

An API key that starts with cs_sk_, created under API and MCP, API keys. A key covers every site of its workspace or a chosen list, and carries permissions per resource (Analytics, Revenue and payments, Goals and events, Funnels, Sites, Notes, Alerts) and extras (Visitor details, Raw events export, Team members, Workspace name, See API keys, Manage API keys). A change acts for the key's creator, with their current role. A request outside them answers 403 naming the missing permission.

Path Parameters

keyId
string<uuid>
required

The key's id, from GET /keys.

Body

application/json
name
string
Required string length: 1 - 80
permissions
string[]
Required array length: 1 - 19 elements
Maximum string length: 40
siteIds
string[] | null
Required array length: 1 - 500 elements
Maximum string length: 80

Response

Done.

key
object

A key as the API shows it: never its hash, and its secret only in the answer that made it.