Skip to main content

Archive Credential

Archives a specified Credential. Once archived, the Credential is no longer injected into sessions but can still be queried and restored. The archived_at field in the response is set to the archive time.

Prerequisites

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

Endpoint

POST /vaults/{vault_id}/credentials/{credential_id}/archive

Path parameters

FieldRequiredTypeDescription
vault_idYesstringVault ID, format vlt_xxx
credential_idYesstringCredential ID, format cred_xxx

Request example

curl -X POST "$AGENTSTUDIO_URL/vaults/vlt_xxx/credentials/cred_xxx/archive" \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY"

Response example

{
  "id": "cred_xxx",
  "type": "credential",
  "vault_id": "vlt_xxx",
  "display_name": "Third-party API key",
  "auth": {
    "type": "environment_variable",
    "secret_name": "API_KEY",
    "networking": {
      "allowed_hosts": [
        "api.example.com",
        "*.example.com"
      ]
    },
    "injection_location": {
      "header": true
    }
  },
  "metadata": {},
  "archived_at": "2026-07-15T06:00:00Z",
  "created_at": "2026-07-10T08:00:00Z",
  "updated_at": "2026-07-15T06:00:00Z",
  "request_id": "req_xxx"
}

Response fields

FieldTypeDescription
idstringCredential ID, format cred_xxx
typestringAlways credential
vault_idstringVault ID that the Credential belongs to
display_namestringHuman-readable name of the Credential
authobjectAuthentication information with sensitive values masked
metadataobjectCustom key-value pairs
archived_atstringArchive timestamp, ISO 8601
created_atstringCreation time, ISO 8601
updated_atstringLast update time, ISO 8601
request_idstringUnique request identifier

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