Retrieve vault
Updated at:
Retrieve a vault's name, metadata, and creation time by ID.
Endpoint
Paths are relative to the Base URL. Send Authorization: Bearer $DASHSCOPE_API_KEY on every request. For authentication details, see Authentication.
GET
/vaults/{vault_id}Path parameters
vault_idstringRequiredVault ID. Treat it as an opaque ID
Request example
curl -sS "$BASE_URL/vaults/vlt_xxx" \
-H "Authorization: Bearer $DASHSCOPE_API_KEY"
import os
import requests
resp = requests.get(
f"{os.environ['BASE_URL']}/vaults/vlt_xxx",
headers={"Authorization": f"Bearer {os.environ['DASHSCOPE_API_KEY']}"},
)
print(resp.json())
Response fields
200, returns a vault:
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 archived vault can still be retrieved.
Response example
{
"id": "vlt_xxx",
"object": "vault",
"created_at": 1793941200,
"name": "production-secrets",
"metadata": {"team": "support"}
}
Error codes
For the error response structure, see Errors.
| HTTP status | Error type / code | Solution |
|---|---|---|
401 | authentication_error / invalid_api_key | Send a valid Authorization: Bearer $DASHSCOPE_API_KEY header |
404 | not_found_error / not_found_error | The vault does not exist, is deleted, or belongs to another workspace |
500 | server_error / server_error | Retry later. If it keeps failing, submit a ticket with x-request-id |
Is this page helpful?