Secrets

Create a secret

Stores a value under a name, encrypted, for binding to computers with PUT /computers/{id}/secrets. The answer is the secret without its value; the value cannot be read back by any route.

Owners only. A name is unique within its scope: a taken one is a 409 with reason: "name_taken", and sending the same request again gets the same answer.

TWO LIMITS, both answered 400: the account holds at most 100 secrets at once, and deleting one frees a place. A workspace holding active secrets cannot be deleted (see DELETE /workspaces/{id}). Secrets orphaned by older workspace deletions remain unreachable and still count; this safeguard does not repair them. The account may create at most 1000 over its lifetime, deleted ones included, which deleting does not free — once that is reached, only support can raise it. GET /secrets reports both in limits.

Without workspace_id the secret is account-wide, and a computer in any workspace may be bound to it. An API key confined to a workspace creates in that workspace, and naming any other scope is a 403. From an account-wide key, a workspace_id that names no workspace of this account is a 400, No such workspace on this account.

Requires the owner role or higher.

post/secrets

Request

  • Base URL: https://app.mandala.computer/api/v1
  • URL: https://app.mandala.computer/api/v1/secrets
  • Auth: HTTP bearer

Request body

namestring required

Up to 60 characters, no control characters. Leading and trailing spaces are trimmed, and the trimmed name is stored. Unique within the scope, ignoring ASCII case: a name that differs from a taken one only in ASCII case (Token and token) collides, a 409 with reason: "name_taken".

valuestring required

The value, as text: 1 to 4096 bytes of UTF-8.

workspace_idstring nullable

The workspace it belongs to. Leave it out, or send null, for account-wide.

Response

The secret, without its value.

idstring required

csec- and sixteen hex characters. What a binding names as secret_id.

namestring required

Its name, as sent with leading and trailing spaces trimmed. Up to 60 characters. Unique within its scope, ignoring ASCII case: names that differ only in ASCII case collide (409, reason: "name_taken").

workspace_idstring nullable required

The workspace it belongs to, or null for one available account-wide.

revision_idstring required

csr- and twenty-four hex characters. Moves every time the value is replaced; a replace or delete sends back the one it read.

created_atstring required

RFC 3339 timestamp.

updated_atstring required

RFC 3339 timestamp of the last replace, or of the create.

last_used_atstring nullable required

When it was last delivered to a computer. null until it has been.

Changes

No recorded changes to this operation across all 1 revision of this API.