Update an API key
Enables/disables a key, or sets/clears its spend limit — each call does exactly one of these, never both at once. A management endpoint with the same rule as key creation: the Bearer token must be a Management API Key, or use a logged-in session.
/api/v1/keys/:idAuthorizations
AuthorizationrequiredAPI key as bearer token in the Authorization header.
Path parameters
idrequiredThe ID of the key to update.
Body
enabledEnable (true) or disable (false) this key. Any manual toggle clears a prior spend-limit auto-disable flag, so the key is never silently auto-re-enabled later against your intent.
spendLimitUsdSets the spend limit in USD; pass null to clear the limit. Mutually exclusive with enabled — a single request can only send one or the other.
spendLimitPeriodReset period for the spend limit. Required whenever spendLimitUsd is set, and only accepts the raw day/week/month values — unlike the create-key endpoint, the daily/weekly/monthly aliases are NOT accepted here.
dayweekmonth