Secrets Store API
Every endpoint of Secrets Store on your realm's host, by area, with what each does and the page that covers it.
AvailableAPI
Every endpoint Secrets Store serves on your realm’s host. Each is called by a user signed in to the realm, as
themselves, with their session as a cookie; Call the API shows how to get $CVYUH_SESSION, and the
paging, revision and error rules every call shares. For example:
curl https://foobar.cvyuh.com/api/v0/vault/managed/v1/me/data/web/github \ -H "Cookie: x-cvyuh-token=$CVYUH_SESSION"Who may call each endpoint is on its page: most are for any user signed in to the realm, acting on their own vaults
and what is granted to them; enable, grantees and the realm’s secrets key are for realm administrators.
In the tables, <vault> is the vault a call is made to: me, user/<user>, group/<group> or realm (see
Vaults). <path> is a secret’s path, such as web/github. Every answer carries its content
under data; a call that changes something and has nothing to report answers 204. Until a realm administrator
turns the store on, every call but enable answers 409. PUT is taken wherever POST is.
Turning the store on
Section titled “Turning the store on”| Method | Endpoint | What it does | Page |
|---|---|---|---|
POST | https://foobar.cvyuh.com/api/v0/vault/managed/v1/enable | Turns the store on for the realm, writing its settings at their defaults: 201 the first time, 200 after. A realm administrator only | Realm settings |
GET | https://foobar.cvyuh.com/api/v0/vault/managed/v1/config | The defaults every vault takes: max_versions, cas_required, delete_version_after. Anyone signed in | Realm settings |
GET | https://foobar.cvyuh.com/api/v0/am/objects/v1/vaultSettings/vaultSettings | The realm’s secrets settings, with their rev | Realm settings |
PATCH | https://foobar.cvyuh.com/api/v0/am/objects/v1/vaultSettings/vaultSettings | Changes the settings named, each in its section; If-Match guards it | Realm settings |
Secrets
Section titled “Secrets”| Method | Endpoint | What it does | Page |
|---|---|---|---|
GET | https://foobar.cvyuh.com/api/v0/vault/managed/v1/<vault>/data/<path> | The latest version’s values and metadata; ?version=N for another | Versions |
POST | https://foobar.cvyuh.com/api/v0/vault/managed/v1/<vault>/data/<path> | Writes a new version: { "options": { "cas": N }, "data": { … } } | Versions |
PATCH | https://foobar.cvyuh.com/api/v0/vault/managed/v1/<vault>/data/<path> | Merges data into the latest, as a new version | Versions |
DELETE | https://foobar.cvyuh.com/api/v0/vault/managed/v1/<vault>/data/<path> | Deletes the latest version, softly | Delete, undelete and destroy |
POST | https://foobar.cvyuh.com/api/v0/vault/managed/v1/<vault>/delete/<path> | Deletes the versions named, softly: { "versions": [N, …] } | Delete, undelete and destroy |
POST | https://foobar.cvyuh.com/api/v0/vault/managed/v1/<vault>/undelete/<path> | Brings deleted versions back | Delete, undelete and destroy |
POST | https://foobar.cvyuh.com/api/v0/vault/managed/v1/<vault>/destroy/<path> | Removes the versions’ values for good | Delete, undelete and destroy |
GET | https://foobar.cvyuh.com/api/v0/vault/managed/v1/<vault>/metadata/<path> | The version map, settings and labels | Metadata |
POST | https://foobar.cvyuh.com/api/v0/vault/managed/v1/<vault>/metadata/<path> | Sets settings and replaces every label | Metadata |
PATCH | https://foobar.cvyuh.com/api/v0/vault/managed/v1/<vault>/metadata/<path> | Sets settings and merges labels | Metadata |
DELETE | https://foobar.cvyuh.com/api/v0/vault/managed/v1/<vault>/metadata/<path> | Deletes the whole secret: every version, its settings and labels | Delete, undelete and destroy |
GET or LIST | https://foobar.cvyuh.com/api/v0/vault/managed/v1/<vault>/metadata/<prefix>?list=true | The next segment of each path under the prefix; folders end in / | Listing |
GET | https://foobar.cvyuh.com/api/v0/vault/managed/v1/<vault>/subkeys/<path> | The names inside a version, values left out; ?version=N, ?depth=D | Subkeys |
Sharing
Section titled “Sharing”| Method | Endpoint | What it does | Page |
|---|---|---|---|
GET | https://foobar.cvyuh.com/api/v0/vault/managed/v1/<vault>/grants/<path> | The secret’s grants, each with edgeId, access, validTo, grantedBy and live | Grants |
POST | https://foobar.cvyuh.com/api/v0/vault/managed/v1/<vault>/grants/<path> | Gives a grant: { "user" or "group": id, "access": "view" or "use", "validTo": time } | Grants |
DELETE | https://foobar.cvyuh.com/api/v0/vault/managed/v1/<vault>/grants/<path>/<edgeId> | Takes one grant back | Grants |
GET | https://foobar.cvyuh.com/api/v0/vault/managed/v1/shared | Every secret granted to the caller or their groups: vault, path, access | Grants |
DELETE | https://foobar.cvyuh.com/api/v0/vault/managed/v1/grantees/<user> | Takes back every grant to a user, in every vault, unlisted: { "removed": N }. A realm administrator only | Offboard someone |
POST | https://foobar.cvyuh.com/api/v0/vault/managed/v1/<vault>/share/<path> | Makes a one-time share: { "version": N, "ttl": s, "recipient": id }; answers link and expires_at | One-time shares |
POST | https://foobar.cvyuh.com/api/v0/vault/managed/v1/shares | Reads a one-time share once: { "link": … } | One-time shares |
Emergency access
Section titled “Emergency access”| Method | Endpoint | What it does | Page |
|---|---|---|---|
GET | https://foobar.cvyuh.com/api/v0/vault/managed/v1/emergency | The caller’s nominations (nominated) and those naming them (nominatedFor) | Emergency access |
POST | https://foobar.cvyuh.com/api/v0/vault/managed/v1/emergency | Nominates a user: { "nominee": id, "delay": s } | Emergency access |
POST | https://foobar.cvyuh.com/api/v0/vault/managed/v1/emergency/<id>/request | The nominee asks; the delay starts | Emergency access |
POST | https://foobar.cvyuh.com/api/v0/vault/managed/v1/emergency/<id>/refuse | The grantor refuses the request standing | Emergency access |
DELETE | https://foobar.cvyuh.com/api/v0/vault/managed/v1/emergency/<id> | Either side ends the nomination | Emergency access |
Keys and protection
Section titled “Keys and protection”| Method | Endpoint | What it does | Page |
|---|---|---|---|
PUT | https://foobar.cvyuh.com/api/v0/am/keys/v1/secrets/encryption | Adds a new version of the realm’s secrets key. A realm administrator only | Key rotation |
DELETE | https://foobar.cvyuh.com/api/v0/am/keys/v1/secrets/encryption?shred=true | Destroys every version of the realm’s secrets key, and with it the realm’s vault | Crypto-shredding |
Sealed vaults
Section titled “Sealed vaults”Sealed vaults’ endpoints are planned for customers: no client seals on a user’s device yet, so none of them can be used. Every planned endpoint is in What’s next for sealed vaults.
Errors
Section titled “Errors”Every error answers with its status and a body naming the error and why. The ones this API gives:
| Status | When | What to do |
|---|---|---|
400 | The body isn’t a JSON object, or lacks a field the call needs (data, versions, link, nominee) | Send the body the call’s page shows |
400 | A path is empty or has an empty, . or .. segment | Use a path such as web/github |
400 | Check-and-set: options.cas doesn’t match the latest version, or is required and missing | Read the latest version and write again with it. See Check-and-set |
400 | A share’s ttl is 0 or past the realm’s shareMaxTtl; the version shared is deleted or destroyed | Send a ttl in range; share a live version |
400 | A grant names both or neither of user and group, or its validTo is past or not RFC 3339 | Send one grantee and a future time |
400 | A nomination names yourself or a delay of 0; a refusal with no request standing | See Emergency access |
400 | A settings change names a field the settings don’t have, or a value out of range | See Realm settings |
401 | No session, or it has ended | Sign in again; see Call the API |
403 | Not a realm administrator, for enable, grantees and the realm’s vault | Ask someone holding RealmOwner |
403 | No right in a group’s vault (not a member) or the realm’s, or a use grant asking for more than the latest version | Ask for membership or a view grant |
404 | In a personal vault: the path isn’t there, or you have no access. The store doesn’t say which | Ask the owner for a grant |
404 | A user, group, grant, nomination or version isn’t there; a one-time share is spent, expired or for someone else | Check the id. A share that answers 404 on its first read was read by someone else: change the secret |
404 | A grantee or nominee hasn’t used the store yet, or no member has opened a group’s vault | They make one call to the store; then retry |
404 | The session is for another realm | Sign in to the realm the vault is in |
405 | The method isn’t one the operation takes | Use the method in the tables above |
409 | The store isn’t turned on for the realm | A realm administrator calls enable |
412 | The settings, or a nomination, changed since you read them | Read again and retry with the new rev |
413 | The request body is larger than 2 MiB | Keep a secret’s values and labels under 2 MiB |
503 | The realm has no secrets key: the realm’s vault and one-time shares can’t be used | See Crypto-shredding |
Limits
Section titled “Limits”| Limit | Default | Range |
|---|---|---|
| Request body | 2 MiB | fixed |
| Versions kept per path | 10 | 1 to 100 |
| One-time share lifetime | 600 seconds | 1 second to shareMaxTtl (a week by default, at most 30 days) |
| Emergency delay | 604800 seconds | at least 1 second |
| Request rate, secrets per vault, grants per secret | no limit of the store’s own |
Each feature page lists the limits that apply to it.