Edit Subscription API Keys with the Monetization API
You can now change the description and expiration date of a subscriber’s API key
through the Monetization API. Send a PATCH to
/v3/metering/{bucketId}/consumers/{consumerId}/keys/{apiKeyId} on
https://dev.zuplo.com with either field, or both:
- Rename a key: Set
descriptionto a new value, or to an empty string to clear it. - Extend or reactivate a key: Set
expiresOnto a future timestamp. Set it tonullto remove a future expiration so the key never expires. - Expire a key now: Set
expiresOnto the current time or earlier.
Fields you leave out stay as they are. A consumer always keeps at least one active key, so a request that would expire the last one fails. Roll the key first, then expire the old one.
You can also delete a subscriber’s key that has an expiration date, such as a rolled key still in its grace period, while the replacement key keeps working.
See Monetization API access for authentication and finding your bucket ID.
Address consumers by ID in the API Keys API
The consumer endpoints of the
API Keys API accept a consumer’s
ID wherever they take a consumer name, so you can pass the immutable csmr_...
ID instead of a name that might change. This covers reading, updating, and
deleting consumers, managing their keys, rolling keys, and managing key managers
and invites. If a consumer’s name matches the value you pass, that consumer
wins; otherwise the value is treated as an ID within the same bucket.
Bucket paths work the same way: use the bucket ID (bckt_...) shown on the
Bucket ID pill under
Services → API Keys → Consumers.
Bucket names still work for existing scripts. See
Bucket identifiers
for details.