Vault
generate_secret
Write grantIdempotent
Generate a new value on the server for a secret in each product and environment given, such as to rotate a token, creating the name where it is missing. The value is never returned; a key pair returns only its public key. Returns each pair's outcome and version. Needs write access; production needs an admin or owner.
Inputs
productsarray of stringsRequiredThe products' slugs, such as storefront.
environmentsarray of stringsRequiredThe environments' slugs, such as staging. Each product must be deployed to each.
namestringRequiredThe secret's name, such as DATABASE_URL.
generatorobjectRequiredWhat to generate. Options left out use their defaults.
tools/callJSON-RPC
{ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "generate_secret", "arguments": { "products": [ "storefront" ], "environments": [ "staging", "production" ], "name": "SESSION_SECRET", "generator": { "type": "token", "bytes": 32 } } }}POST/clanker/v1/secrets:generate
curl -X POST https://api.clankership.com/clanker/v1/secrets:generate \ -H "Authorization: Bearer $CLANKER_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "products": [ "storefront" ], "environments": [ "staging", "production" ], "name": "SESSION_SECRET", "generator": { "type": "token", "bytes": 32 } }'