Get Credential

Updated at:

Retrieves the details of a specified Credential. The response is a Credential object with sensitive values masked in the auth field.

Prerequisites

Endpoint and authentication configured. For details, see API overview and authentication.

Endpoint

GET/vaults/{vault_id}/credentials/{credential_id}

Path parameters

vault_idstringRequired

Vault ID, format vlt_xxx

credential_idstringRequired

Credential ID, format cred_xxx

Request example

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

Response fields

idstring

Credential ID, format cred_xxx

typestring

Fixed as credential

vault_idstring

Vault ID that the Credential belongs to

display_namestring

Human-readable name of the Credential

authobject

Authentication information with sensitive values masked (e.g. secret_value is not returned)

auth.typestring

Auth type; currently only environment_variable is supported

auth.secret_namestring

Environment variable name

auth.networkingobject

Network policy

auth.networking.allowed_hostsarray

List of domains allowed for real-key substitution

auth.injection_locationobject

Substitution location. The location is the request header; placeholders in the request body and query parameters are not replaced

auth.injection_location.headerboolean

Whether to enable request-header substitution

metadataobject

Custom business key-value pairs

archived_atstring | null

Archive time; null if not archived

created_atstring

Creation time, ISO 8601

updated_atstring

Last update time, ISO 8601

request_idstring

Unique request identifier

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": null,
  "created_at": "2026-07-10T08:00:00Z",
  "updated_at": "2026-07-10T08:00:00Z",
  "request_id": "req_xxx"
}

Error codes

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