Skip to main content

Update Vault

Updates the name or metadata of a Vault using patch semantics. At least one of display_name or metadata must be provided.

Prerequisites

Endpoint and authentication configured. For details, see Overview and authentication.

Endpoint

POST /vaults/{vault_id}

Path parameters

vault_id string (必选) Vault ID, format vlt_xxx

Request body

At least one of display_name or metadata must be provided.display_name string (可选)New human-readable name, 1–255 charactersmetadata object (可选)Patch semantics: setting a key to a string adds or overwrites it; setting a key to null deletes that key

Request example

curl -X POST "$AGENTSTUDIO_URL/vaults/vlt_xxx" \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "display_name": "Production secrets vault (renamed)",
    "metadata": {
      "environment": "production",
      "deprecated_key": null
    }
  }'

Response fields

id stringVault ID, format vlt_xxxtype stringAlways vaultdisplay_name stringHuman-readable name of the Vaultmetadata objectCustom key-value pairsarchived_at string | nullArchive timestamp; null if not archivedcreated_at stringCreation time, ISO 8601updated_at stringLast update time, ISO 8601

Response

{
  "id": "vlt_xxx",
  "type": "vault",
  "display_name": "Production secrets vault (renamed)",
  "metadata": {
    "environment": "production"
  },
  "archived_at": null,
  "created_at": "2026-06-20T10:00:00Z",
  "updated_at": "2026-07-01T14:30:00Z"
}

Error codes

HTTP statusError codeDescription
400InvalidParameterRequired parameter missing or invalid
401InvalidApiKeyInvalid API key provided