Buckets and Environments
API keys are stored in "buckets," which organize and isolate authentication credentials across different environments. Learn more in the API Key API documentation.
Default bucket configuration
Zuplo automatically creates three buckets for each project:
- Production: Stores API keys for the production environment (your default Git branch)
- Preview: Stores API keys shared across all preview environments (non-default Git branches)
- Development: Stores API keys for the development (working copy) environment
For more information on how environments relate to Git branches, see Branch-Based Deployments.
Bucket identifiers
Every bucket has an ID that starts with bckt_, and a name. Use the bucket ID
whenever you identify a bucket, both in the
Zuplo Developer API and in policy configuration. To copy
it, open
Services → API Keys → Consumers
in the Zuplo Portal and select the environment with the Dev / Preview / Prod
switcher. The Bucket ID pill sits beside the environment badge under the
API Key Service heading, with a copy button.
Deprecated
The bucket name is a legacy identifier. The Zuplo Portal doesn't display it, and the Developer API accepts it only for backward compatibility on the consumer, key, and manager endpoints. Pass the bucket ID instead.
Three endpoints are the exception and still require the bucket name:
GET /v1/accounts/{accountName}/key-buckets/{bucketName}PATCH /v1/accounts/{accountName}/key-buckets/{bucketName}DELETE /v1/accounts/{accountName}/key-buckets/{bucketName}
Custom bucket configuration
To use a custom bucket, specify its bucketId in your API Key policy options:
Code
For more information about finding a bucket ID, see Bucket identifiers.
When the configuration sets no bucket, the policy uses the default bucket for the current environment.
The policy's bucketName option is deprecated. Policies that set it keep
working, but the runtime logs a warning — use bucketId instead.
Creating custom buckets
Create custom buckets using the API Key management API. See the create buckets endpoint for details.
The following example creates a bucket for a QA environment. The response
includes the new bucket's id, which is the value to set as bucketId on the
policy:
Code
Replace YOUR_ACCOUNT_NAME with your account name and YOUR_ZAPI_KEY with your
Zuplo API key.