Archive vault

Updated at:

Archive a vault and its child credentials. This endpoint is a Bailian extension.

Endpoint

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

POST/vaults/{vault_id}/archive

Path parameters

vault_idstringRequired

Vault ID. Treat it as an opaque ID

The request has no body.

Request example

curl -sS -X POST "$BASE_URL/vaults/vlt_xxx/archive" \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY"
import os
import requests

resp = requests.post(
    f"{os.environ['BASE_URL']}/vaults/vlt_xxx/archive",
    headers={"Authorization": f"Bearer {os.environ['DASHSCOPE_API_KEY']}"},
)
print(resp.json())

Response fields

200, returns the archived vault:

idstring

Vault ID

objectstring

Vault object type, fixed as vault

created_atinteger

Creation time in Unix seconds

namestring / null

Display name

metadataobject

Metadata, string key-value pairs; {} when not set

The response keeps the vault structure and does not return archived_at or status. Archiving a vault also archives its child credentials. Archived resources can still be retrieved, and the default list includes both active and archived. There is no restore endpoint.

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 statusError type / codeSolution
401authentication_error / invalid_api_keySend a valid Authorization: Bearer $DASHSCOPE_API_KEY header
404not_found_error / not_found_errorThe vault 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