List secrets

View as Markdown

List Vault secret metadata. This Tool never returns usernames, passwords, values, or TOTP seeds.

List secrets

1const result = await bctrl.tools.call("vault.secrets.list", {
2 prefix: "production/",
3 hasTotp: true,
4 limit: 50,
5});
6
7for (const secret of result.secrets) {
8 console.log(secret.name, secret.type, secret.hasTotp);
9}

Secret names use slash-separated segments made from letters, numbers, ., _, ~, and -.

Request parameters

ParameterTypeRequiredDescription
prefixstringNoReturn names beginning with this prefix.
originstringNoReturn secrets authorized for this exact origin.
hasTotpbooleanNoFilter by whether a login has a TOTP seed.
cursorstringNoCursor returned by the previous page.
limitintegerNoResults per page. Defaults to 50; maximum 200.

Response

The result is { secrets, nextCursor }:

FieldTypeAlways presentDescription
secrets[].nameVaultSecretNameYesSecret name.
secrets[].type"login" | "value"YesStored secret shape.
secrets[].labelstringNoDisplay label, when set.
secrets[].originsstring[]NoExact allowed origins, when configured.
secrets[].originPatternsstring[]NoAllowed origin patterns, when configured.
secrets[].hasTotpbooleanYesWhether a TOTP seed exists.
secrets[].createdAtstringNoCreation timestamp, when available.
secrets[].updatedAtstringNoUpdate timestamp, when available.
nextCursorstring | nullYesCursor for the next page, or null when complete.

The Space’s Vault access policy controls which secrets the caller can use. See Spaces for the allow and deny rules.

Next