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 Overview and authentication.
Endpoint
GET /vaults/{vault_id}/credentials/{credential_id}
Path parameters
| Field | Required | Type | Description |
|---|---|---|---|
vault_id | Yes | string | Vault ID, format vlt_xxx |
credential_id | Yes | string | Credential ID, format cred_xxx |
Request example
curl -X GET "$AGENTSTUDIO_URL/vaults/vlt_xxx/credentials/cred_xxx" \
-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": null,
"created_at": "2026-07-10T08:00:00Z",
"updated_at": "2026-07-10T08:00:00Z",
"request_id": "req_xxx"
}
Response fields
| Field | Type | Description |
|---|---|---|
id | string | Credential ID, format cred_xxx |
type | string | Always credential |
vault_id | string | Vault ID that the Credential belongs to |
display_name | string | Human-readable name of the Credential |
auth | object | Authentication information with sensitive values masked (e.g. secret_value is not returned) |
auth.type | string | Auth type; currently only environment_variable |
auth.secret_name | string | Environment variable name |
auth.networking | object | Network policy |
auth.networking.allowed_hosts | array | List of hosts allowed for real-key substitution |
auth.injection_location | object | Injection location. Currently only the Authorization header is supported; writing into the request body is not yet supported |
auth.injection_location.header | boolean | Whether to write into the Authorization header |
metadata | object | Custom key-value pairs |
archived_at | string | null | Archive timestamp; null if not archived |
created_at | string | Creation time, ISO 8601 |
updated_at | string | Last update time, ISO 8601 |
request_id | string | Unique request identifier |
Error codes
| HTTP status | Error code | Description |
|---|---|---|
| 400 | InvalidParameter | Required parameter missing or invalid |
| 401 | InvalidApiKey | Invalid API key provided |
Is this page helpful?