BazaarLinkBazaarLink
Sign in
DocsAPI ReferenceSDK ReferenceAgentic UsageAI Skills
Management Keys

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.

PATCH/api/v1/keys/:id

Authorizations

Authorizationrequired
string · header

API key as bearer token in the Authorization header.

Path parameters

idrequired
string

The ID of the key to update.

Body

enabled
boolean

Enable (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.

spendLimitUsd
number | null

Sets 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.

positive, ≤1,000,000
spendLimitPeriod
string | null

Reset 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
PATCH /api/v1/keys/:id
curl -X PATCH https://bazaarlink.ai/api/v1/keys/key_abc123 \
  -H "Authorization: Bearer $BAZAARLINK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"enabled": false}'
Response examples

Updated. The response is just a confirmation flag, not the full key record — call list keys again to see the current state.

{
  "updated": true
}
Support
Support
Hi! How can we help you?
Send a message and we'll get back to you soon.
Update an API key — BazaarLink API