Skip to content
Secrets StoreMarkdown

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:

Terminal window
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.

MethodEndpointWhat it doesPage
POSThttps://foobar.cvyuh.com/api/v0/vault/managed/v1/enableTurns the store on for the realm, writing its settings at their defaults: 201 the first time, 200 after. A realm administrator onlyRealm settings
GEThttps://foobar.cvyuh.com/api/v0/vault/managed/v1/configThe defaults every vault takes: max_versions, cas_required, delete_version_after. Anyone signed inRealm settings
GEThttps://foobar.cvyuh.com/api/v0/am/objects/v1/vaultSettings/vaultSettingsThe realm’s secrets settings, with their revRealm settings
PATCHhttps://foobar.cvyuh.com/api/v0/am/objects/v1/vaultSettings/vaultSettingsChanges the settings named, each in its section; If-Match guards itRealm settings
MethodEndpointWhat it doesPage
GEThttps://foobar.cvyuh.com/api/v0/vault/managed/v1/<vault>/data/<path>The latest version’s values and metadata; ?version=N for anotherVersions
POSThttps://foobar.cvyuh.com/api/v0/vault/managed/v1/<vault>/data/<path>Writes a new version: { "options": { "cas": N }, "data": { … } }Versions
PATCHhttps://foobar.cvyuh.com/api/v0/vault/managed/v1/<vault>/data/<path>Merges data into the latest, as a new versionVersions
DELETEhttps://foobar.cvyuh.com/api/v0/vault/managed/v1/<vault>/data/<path>Deletes the latest version, softlyDelete, undelete and destroy
POSThttps://foobar.cvyuh.com/api/v0/vault/managed/v1/<vault>/delete/<path>Deletes the versions named, softly: { "versions": [N, …] }Delete, undelete and destroy
POSThttps://foobar.cvyuh.com/api/v0/vault/managed/v1/<vault>/undelete/<path>Brings deleted versions backDelete, undelete and destroy
POSThttps://foobar.cvyuh.com/api/v0/vault/managed/v1/<vault>/destroy/<path>Removes the versions’ values for goodDelete, undelete and destroy
GEThttps://foobar.cvyuh.com/api/v0/vault/managed/v1/<vault>/metadata/<path>The version map, settings and labelsMetadata
POSThttps://foobar.cvyuh.com/api/v0/vault/managed/v1/<vault>/metadata/<path>Sets settings and replaces every labelMetadata
PATCHhttps://foobar.cvyuh.com/api/v0/vault/managed/v1/<vault>/metadata/<path>Sets settings and merges labelsMetadata
DELETEhttps://foobar.cvyuh.com/api/v0/vault/managed/v1/<vault>/metadata/<path>Deletes the whole secret: every version, its settings and labelsDelete, undelete and destroy
GET or LISThttps://foobar.cvyuh.com/api/v0/vault/managed/v1/<vault>/metadata/<prefix>?list=trueThe next segment of each path under the prefix; folders end in /Listing
GEThttps://foobar.cvyuh.com/api/v0/vault/managed/v1/<vault>/subkeys/<path>The names inside a version, values left out; ?version=N, ?depth=DSubkeys
MethodEndpointWhat it doesPage
GEThttps://foobar.cvyuh.com/api/v0/vault/managed/v1/<vault>/grants/<path>The secret’s grants, each with edgeId, access, validTo, grantedBy and liveGrants
POSThttps://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
DELETEhttps://foobar.cvyuh.com/api/v0/vault/managed/v1/<vault>/grants/<path>/<edgeId>Takes one grant backGrants
GEThttps://foobar.cvyuh.com/api/v0/vault/managed/v1/sharedEvery secret granted to the caller or their groups: vault, path, accessGrants
DELETEhttps://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 onlyOffboard someone
POSThttps://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_atOne-time shares
POSThttps://foobar.cvyuh.com/api/v0/vault/managed/v1/sharesReads a one-time share once: { "link": … }One-time shares
MethodEndpointWhat it doesPage
GEThttps://foobar.cvyuh.com/api/v0/vault/managed/v1/emergencyThe caller’s nominations (nominated) and those naming them (nominatedFor)Emergency access
POSThttps://foobar.cvyuh.com/api/v0/vault/managed/v1/emergencyNominates a user: { "nominee": id, "delay": s }Emergency access
POSThttps://foobar.cvyuh.com/api/v0/vault/managed/v1/emergency/<id>/requestThe nominee asks; the delay startsEmergency access
POSThttps://foobar.cvyuh.com/api/v0/vault/managed/v1/emergency/<id>/refuseThe grantor refuses the request standingEmergency access
DELETEhttps://foobar.cvyuh.com/api/v0/vault/managed/v1/emergency/<id>Either side ends the nominationEmergency access
MethodEndpointWhat it doesPage
PUThttps://foobar.cvyuh.com/api/v0/am/keys/v1/secrets/encryptionAdds a new version of the realm’s secrets key. A realm administrator onlyKey rotation
DELETEhttps://foobar.cvyuh.com/api/v0/am/keys/v1/secrets/encryption?shred=trueDestroys every version of the realm’s secrets key, and with it the realm’s vaultCrypto-shredding

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.

Every error answers with its status and a body naming the error and why. The ones this API gives:

StatusWhenWhat to do
400The 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
400A path is empty or has an empty, . or .. segmentUse a path such as web/github
400Check-and-set: options.cas doesn’t match the latest version, or is required and missingRead the latest version and write again with it. See Check-and-set
400A share’s ttl is 0 or past the realm’s shareMaxTtl; the version shared is deleted or destroyedSend a ttl in range; share a live version
400A grant names both or neither of user and group, or its validTo is past or not RFC 3339Send one grantee and a future time
400A nomination names yourself or a delay of 0; a refusal with no request standingSee Emergency access
400A settings change names a field the settings don’t have, or a value out of rangeSee Realm settings
401No session, or it has endedSign in again; see Call the API
403Not a realm administrator, for enable, grantees and the realm’s vaultAsk someone holding RealmOwner
403No right in a group’s vault (not a member) or the realm’s, or a use grant asking for more than the latest versionAsk for membership or a view grant
404In a personal vault: the path isn’t there, or you have no access. The store doesn’t say whichAsk the owner for a grant
404A user, group, grant, nomination or version isn’t there; a one-time share is spent, expired or for someone elseCheck the id. A share that answers 404 on its first read was read by someone else: change the secret
404A grantee or nominee hasn’t used the store yet, or no member has opened a group’s vaultThey make one call to the store; then retry
404The session is for another realmSign in to the realm the vault is in
405The method isn’t one the operation takesUse the method in the tables above
409The store isn’t turned on for the realmA realm administrator calls enable
412The settings, or a nomination, changed since you read themRead again and retry with the new rev
413The request body is larger than 2 MiBKeep a secret’s values and labels under 2 MiB
503The realm has no secrets key: the realm’s vault and one-time shares can’t be usedSee Crypto-shredding
LimitDefaultRange
Request body2 MiBfixed
Versions kept per path101 to 100
One-time share lifetime600 seconds1 second to shareMaxTtl (a week by default, at most 30 days)
Emergency delay604800 secondsat least 1 second
Request rate, secrets per vault, grants per secretno limit of the store’s own

Each feature page lists the limits that apply to it.