Skip to content
Secrets StoreMarkdown

Metadata

A secret's versions, its own settings and your labels, read and set without opening its values.

AvailableAPI

Metadata is everything the store keeps about a secret except its values: which versions it holds and when each was written or deleted, the secret’s own settings for history and check-and-set, and labels you add, such as which team it belongs to. Reading it never opens the values, so it is how you check a secret’s history and settings.

  • Who: reading needs view: anyone with every right in the vault, or a view grantee. Setting it needs every right in the vault: the user in their own vault, a member in a group’s, a realm administrator in the realm’s.
  • Where: the API. There are no screens yet.
  • First: the store is on.
FieldWhat it is
current_version, oldest_versionThe latest version, and the oldest still kept
created_time, updated_timeWhen the path was first and last written
versionsEach version kept, with its created_time, its deletion_time if it is deleted, and whether it is destroyed
max_versionsHow many versions this path keeps, at most 100; 0 takes the realm’s
cas_requiredWhether every write of this path must use check-and-set
delete_version_afterHow long after its write a version reads as deleted; 0s takes the realm’s
custom_metadataYour own labels, such as { "team": "engineering" }

Each call is on https://foobar.cvyuh.com/api/v0/vault/managed/v1/<vault>/metadata/<path>:

ToMethod
Read itGET
Set settings and replace every labelPOST
Set settings and merge labelsPATCH; a label sent as null is removed

Setting metadata answers 204. Durations are whole seconds, or text such as "1h30m".

Keep five versions of web/github and label it (Call the API shows how to get $CVYUH_SESSION):

Terminal window
curl -X PATCH https://foobar.cvyuh.com/api/v0/vault/managed/v1/me/metadata/web/github \
-H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \
-H "Content-Type: application/json" \
-d '{ "max_versions": 5, "custom_metadata": { "team": "engineering" } }'
AnswerWhenWhat to do
400, “‘custom_metadata’ is not a valid value”A label isn’t text, or custom_metadata isn’t an objectSend labels as strings; null only with PATCH, to remove one
400 on max_versionsNot a whole number, or over 100Send 0 to 100
400 on delete_version_afterNot seconds or a duration such as "720h", or over ten yearsSend a valid duration
404 readingThe path isn’t there, or, in a personal vault, you have no accessCheck the path
403A use grant, or no right in a group’s or the realm’s vaultAsk for view, or for membership
LimitDefaultRange
max_versions0, the realm’s (10 unless changed)0 to 100
delete_version_after0s, the realm’s (kept)0 to ten years
cas_requiredfalse
Labelsnonetext values only; no fixed count, within the 2 MiB request
SymptomCauseFix
Lowering max_versions left old versions in placeA new limit applies at the next writeWrite the secret once; the oldest past the limit are dropped then
A new delete_version_after didn’t touch existing versionsIt applies to versions written after itDelete older versions yourself if you need them gone
Labels you set disappearedPOST replaces every labelUse PATCH to add or change one

Setting metadata is a CREATED change record on a new path, or UPDATED on an existing one, under who set it. Labels are sealed and never recorded. See Secrets audit trail.

  • Labels are text. custom_metadata is an object whose values are strings, sealed like the secret’s values.
  • A new limit applies at the next write. Lowering max_versions drops the oldest versions past it when the path is next written.
  • A new deletion time applies to versions written after it. Versions already written keep the time they were given.
  • Setting metadata creates the path if it doesn’t exist yet, with no versions.
  • Reading it needs view. Someone with only a use grant can’t read a secret’s metadata.