Skip to main content

Create Vault

Creates a Vault for centrally storing and managing Credentials. The request body carries the display name and optional metadata; the response returns the complete Vault object.

Prerequisites

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

Endpoint

POST /vaults

Request body

FieldRequiredTypeDescription
display_nameYesstringHuman-readable name of the Vault, 1–255 characters
metadataNoobjectCustom key-value pairs for business metadata

Request example

curl -X POST "$AGENTSTUDIO_URL/vaults" \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "display_name": "production-keys",
    "metadata": {
      "environment": "production"
    }
  }'

Response example

{
  "id": "vlt_xxx",
  "type": "vault",
  "display_name": "production-keys",
  "metadata": {
    "environment": "production"
  },
  "archived_at": null,
  "created_at": "2026-06-20T10:00:00Z",
  "updated_at": "2026-06-20T10:00:00Z"
}

Response fields

FieldTypeDescription
idstringVault ID, format vlt_xxx
typestringAlways vault
display_namestringHuman-readable name of the Vault
metadataobjectCustom key-value pairs
archived_atstring | nullArchive timestamp; null if not archived
created_atstringCreation time, ISO 8601
updated_atstringLast update time, ISO 8601

Error codes

HTTP statusError codeDescription
400InvalidParameterRequired parameter missing or invalid
401InvalidApiKeyInvalid API key provided
Managed Agent API
Flow Agent API
Sandbox API
RAG API
Long-term Memory
ParseX API
Security API
Framework Integration