Skip to main content
POST
Rotate a secret

Authorizations

X-API-Key
string
header
required

An Anona Compute API key (ac_ followed by lowercase hex; older keys start with e2b_).

Path Parameters

name
string
required

Body

application/json
value
string
required
Maximum string length: 8192
allowedHosts
string[]

The hosts this secret may be sent to. Each entry is one of: an exact host (api.github.com, that host only); *. and a domain (*.github.com, any host under github.com but not github.com itself, so list both when you need both); or * on its own, for any host. Entries are bare host names: no scheme, port or path. A rule that aims the secret at a host outside the list is refused with 403.

Required array length: 1 - 64 elements
Example:

Response

The secret after the rotation, as the list shows it - the new version, its allowed hosts (the kept list when allowedHosts was left out) and its bindings, which carry on unchanged.

name
string
required
version
integer
required
allowedHosts
string[]
required

The hosts this secret may be sent to. Empty for a secret stored before allowed hosts existed, which cannot be used until a list is set.

createdAt
string<date-time>
required
updatedAt
string<date-time>
required
bindings
object[] | null
required

Where the secret is in use: one entry per host and header. A rule in a sandbox's create request or network update is bound for that sandbox alone (scope sandbox, scopeID the sandbox ID), so two sandboxes with the same rule have two bindings. A rule in the team egress settings or a template's policy is bound once (scope tenant_default or template) and used by every sandbox under it. A sandbox's own bindings are revoked when it ends (deleted, timed out or failed) and drop out of this list; a paused sandbox keeps them.