Update a vault's name or metadata. Updates use POST and replace metadata as a whole.
Endpoint
POST /vaults/{vault_id}
Paths are relative to the Base URL. Send Authorization: Bearer $DASHSCOPE_API_KEY on every request. For authentication details, see Authentication.
Path parameters
| Field | Required | Type | Description |
|---|---|---|---|
vault_id | Yes | string | Vault ID. Treat it as an opaque ID |
Request body
| Field | Required | Type | Description |
|---|---|---|---|
name | No | string / null | Vault name, when omitted, the current value is kept; null clears the name, when provided, 1–256 bytes after trimming |
metadata | No | object | Metadata, when omitted, the current value is kept; null returns 400; {} clears it. Up to 16 items; key 1–64 characters, value up to 512 characters |
metadata is replaced as a whole, not merged; old keys that are not in the new object are removed. An empty object {} does not change nullable fields. Unknown fields return 400 unknown_parameter.
Request example
Response example
Response fields
200, returns the updated vault:
| Field | Type | Description |
|---|---|---|
id | string | Vault ID |
object | string | Vault object type, fixed as vault |
created_at | integer | Creation time in Unix seconds |
name | string / null | Display name |
metadata | object | Metadata, string key-value pairs; {} when not set |
Error codes
For the error response structure, see Errors.
| HTTP status | Error type / code | Solution |
|---|---|---|
400 | invalid_request_error / unknown_parameter | Remove unknown fields such as status |
400 | invalid_request_error / invalid_type | Fix the field type as described |
400 | invalid_request_error / invalid_request_error | Fix name as described and do not send metadata as null |
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 |
409 | conflict_error / conflict_error | Retry later. If it keeps failing, submit a ticket with x-request-id |
500 | server_error / server_error | Retry later. If it keeps failing, submit a ticket with x-request-id |