Update API key

Replaces the key's name, scopes and spending limit. spending_limit is a decimal string in USD, sent with its spending_limit_period; null removes the limit. The secret does not change, so live traffic keeps working.

PUT/api-keys/{id}
AuthAPI keyorOAuth tokenHow to send it

Path parameters

idstringrequired

The API key to update.

e.g. "ak_01KE7XWWEQ4MCGWKBQKJ1G47RP"

Request body

namestring | null
≥ 1 characters≤ 256 characters
scopesstring[]required
≥ 1 items
spending_limitstring | nullrequired

Most this key can spend per period, in USD. null removes the limit. A limit of 0 blocks every request.

e.g. "25.00"matches ^(0|[1-9]\d{0,7})(\.\d{1,2})?$
spending_limit_periodstring | null

When the limit resets, at the start of each UTC day, week or month. Required with a limit; leave it out, or null, without one.

"day""week""month"

Response

API key updated

dataobjectrequired

Errors

A failed call names what went wrong in code, with a sentence in message. The codes, which of them are worth retrying, and how to read a validation failure are on Errors.