Project Secrets API¶
Project secrets let members of a project share a credential — an SMTP password, an API key — through the platform. A secret is a key (a label, not itself secret) and a value. The value is encrypted at rest and is never returned by any endpoint except /read; who read it, and when, is logged.
Endpoints¶
All paths are below /projects/{project_id}.
| Method | Path | Description |
|---|---|---|
GET | /projects/{project_id}/project_secrets | List the project's secrets (metadata only, never the value) |
POST | /projects/{project_id}/project_secrets | Share a secret with the project |
GET | /projects/{project_id}/project_secrets/{id} | Show one secret's metadata and its read log |
POST | /projects/{project_id}/project_secrets/{id}/read | Reveal the value |
DELETE | /projects/{project_id}/project_secrets/{id} | Revoke the secret |
The secret object¶
| Field | Description |
|---|---|
id | Secret ID (UUID). |
project_id | The project the secret belongs to. |
key | The label. |
audience | all_members or specific_members. |
recipient_account_ids | Account IDs of the recipients. Empty for all_members. |
one_time | true if each recipient may read the secret once. |
expires_at | When the secret expires, or null. |
revoked_at | When the secret was revoked, or null. |
creator_id | Account ID of the member who shared it. |
you_have_read | Whether the caller has already used their one-time read. |
reads | The read log: a list of { "account_id", "read_at" }. Present on the show response only. |
created_at, updated_at | Timestamps. |
There is no value field. The read log holds who read the secret and when. The reader's IP address is recorded in the audit log, not in reads.
List secrets¶
Returns the project's secrets: metadata only, never the value. Status: 200, 401, 403, 404.
Create a secret¶
POST /projects/{project_id}/project_secrets
Authorization: Bearer <token>
Content-Type: application/json
{
"project_secret": {
"key": "SMTP_PASSWORD",
"value": "<secret-value>",
"audience": "specific_members",
"recipient_account_ids": ["<account-uuid>"],
"one_time": true,
"expires_at": "2026-12-31T23:59:59Z"
}
}
Any live project member may create a secret. The response is 201 with the secret object, without the value. Status: 201, 401, 403, 404, 422, 500.
Do not put real secrets into shell history or a shared terminal; read the value from a file or a prompt instead.
| Field | Required | Description |
|---|---|---|
key | yes | A label for the secret. It is not encrypted, so do not put anything sensitive in it. |
value | yes | The credential. Write-only. |
audience | yes | all_members or specific_members. |
recipient_account_ids | for specific_members | Account IDs of the recipients. |
one_time | no | Default false. When true, each recipient may read the secret once. |
expires_at | no | Date-time after which the secret expires. |
Rules:
specific_membersrequires a non-emptyrecipient_account_ids, and each ID must be a current project member.all_membersmust not carryrecipient_account_ids. Who may read it is decided by project membership at the moment of the read, not when the secret is created.keymust be unique among the project's live (non-revoked) secrets. A duplicate is rejected with422; an existing secret is never overwritten.one_timeallows one read per recipient, not one read in total.- A
500response never carries the submitted value or any other request parameter.
Read a secret¶
The response is 200 with the value:
{
"metadata": { "organization_id": "...", "timestamp": "..." },
"data": { "id": "...", "key": "SMTP_PASSWORD", "value": "<secret-value>" }
}
/read is a POST, not a GET, on purpose: the URL of a GET would end up in access logs, browser history and referer headers.
Every call is audit-logged (who, when, from which IP), whether it succeeds or is refused. A one_time secret allows exactly one successful read per recipient. A secret that is not one_time can be read repeatedly until it is revoked or expires.
| Status | Meaning |
|---|---|
200 | The value, in data.value. |
401, 403, 404 | Unauthorized / Forbidden / Not found. |
410 Gone | The secret can no longer be read. |
422 | Unprocessable content: the read was refused; see the error envelope. |
Show a secret and its read log¶
Returns the secret object with reads, the list of accounts that read it and when. you_have_read tells the caller whether their own one-time read is already used. Status: 200, 401, 403, 404.
Revoke a secret¶
The creator, a project Admin or an organization admin may revoke a secret. The response is 204 with no body. Status: 204, 401, 403, 404.
Revoking wipes the stored value but keeps the row and its read log. Deleting a secret does not make a past reader forget it, so the log stays available to answer "who has seen this?" afterwards. A revoked secret is never hard-deleted.
Share a credential¶
This walk-through shares an SMTP password with one colleague and checks afterwards who read it.
Step 1 — Create the secret¶
The creator posts the secret as shown under Create a secret, with audience set to specific_members, the colleague's account ID in recipient_account_ids and "one_time": true. Note the id in the response.
Step 2 — Tell the recipient¶
Send the colleague the project ID and the secret id.
Step 3 — The recipient reads it¶
POST /projects/<project-uuid>/project_secrets/<secret-uuid>/read
Authorization: Bearer <recipient-token>
The value is in data.value. Because the secret is one_time, a second read by the same colleague is refused.
Step 4 — Check the read log, then revoke¶
reads lists the colleague's account_id and read_at. When the credential is no longer needed, revoke it:
We recommend changing the credential at its source as well if someone who should no longer have it has read the secret: revoking removes the value from the platform, not from the reader.