Skip to content

Secret

A Secret is a named credential stored write-only per environment and filled into a call at run time, never read back by a Worker.

Properties

PropertyTypeRequiredDescription
namestringrequiredThe name a Function declares, such as MAPS_KEY; list returns names only.
environmentstringrequiredThe environment that holds this value; a Function deploys to live only when every declared Secret exists there.
scopestringrequiredWhether the whole Startup or one Tenant holds it.
rotatedAtdatetimeWhen the value last changed.

Object

JSON
{
  "$id": "https://api.sb/kilnbakery.com/secrets/secret_1",
  "$type": "Secret",
  "name": "MAPS_KEY",
  "environment": "test",
  "scope": "startup",
  "rotatedAt": "2026-10-22T12:00:00Z"
}

Relationships

  • A Secret is used by many Functions: a Function declares the Secrets it reads; deploying to live fails when one is missing there. usedBy, inverse uses.

Verbs

  1. getReturns one Secret by id.
    GET /{namespace}/secrets/{id}readNo Event
  2. listReturns Secrets, newest first, one page at a time.
    GET /{namespace}/secretsreadNo Event
  3. revokeRevoke ends a Secret so no call fills it again; the record and its history stay.
    POST /{namespace}/secrets/{secret}/revokedoSecret.revoked
  4. rotateRotate replaces a Secret’s value, and calls already running finish on the old one.
    POST /{namespace}/secrets/{secret}/rotatedoSecret.rotated
  5. storeStore writes a Secret’s value for one environment; the value is never returned by any Interface.
    POST /{namespace}/secrets/storedoSecret.stored

A Secret is never deleted: it ends by Secret.revoke, and its records stay.

Permissions

Which Access level may call each Verb. One-way Verbs wait their delay window.

Operationowneradminmemberviewer
Secret.getYesYesYesYes
Secret.listYesYesYesYes
Secret.revokeYesNoNoNo
Secret.rotateYesYesNoNo
Secret.storeYesYesNoNo

Call it

Text
Store the secret “MAPS_KEY”.

Example

A delivery app's Function declares MAPS_KEY. The key is stored once in the test environment and once in live, and the Function deploys to live only after both exist.