Skip to main content

List vaults

List vaults in the workspace with pagination and filters for metadata and archive status.

Endpoint

GET /vaults Paths are relative to the Base URL. Send Authorization: Bearer $DASHSCOPE_API_KEY on every request. For authentication details, see Authentication.

Request parameters

FieldRequiredTypeDescription
limitNointegerPage size. Default 20, range 1–100. An empty string, 0, a negative number, a non-number, or an out-of-range value returns 400
orderNostringSort direction, asc or desc. Default desc
afterNostringThe last_id from the previous page. Starts after that item and excludes it
metadata[key]NostringMetadata filter, exact metadata match. Multiple conditions are combined with AND
statusNostringVault status: active or archived. Both are included by default. Repeated status[] parameters are also supported, and their values are merged into one filter set
before is not a supported parameter.

Request example

curl -sS "$BASE_URL/vaults?limit=20&order=desc&status=active" \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY"

Response example

{
  "object": "list",
  "data": [
    {
      "id": "vlt_xxx",
      "object": "vault",
      "created_at": 1793941200,
      "name": "production-secrets",
      "metadata": {"team": "support"}
    }
  ],
  "first_id": "vlt_xxx",
  "last_id": "vlt_xxx",
  "has_more": false
}

Response fields

200, returns a list envelope:
FieldTypeDescription
objectstringList object type, fixed as list
dataarrayVaults on the current page
first_idstring / nullID of the first item on the page; null for an empty page
last_idstring / nullID of the last item on the page; use it as after for the next page. null for an empty page
has_morebooleanWhether more matching resources exist

Vault fields

FieldTypeDescription
idstringVault ID
objectstringVault object type, fixed as vault
created_atintegerCreation time in Unix seconds
namestring / nullDisplay name
metadataobjectMetadata, string key-value pairs; {} when not set
An empty page returns data: [], with first_id and last_id set to null and has_more set to false.

Error codes

For the error response structure, see Errors.
HTTP statusError type / codeSolution
400invalid_request_error / invalid_request_errorlimit, order, or a metadata filter is invalid
401authentication_error / invalid_api_keySend a valid Authorization: Bearer $DASHSCOPE_API_KEY header
404not_found_error / not_found_errorThe after cursor does not exist, is deleted, or belongs to another workspace
500server_error / server_errorRetry later. If it keeps failing, submit a ticket with x-request-id