Retrieve credential
Retrieve a credential's auth configuration and metadata. secret_value is never returned.
Endpoint
Paths are relative to the Base URL. Send Authorization: Bearer $DASHSCOPE_API_KEY on every request. For authentication details, see Authentication.
/vaults/{vault_id}/credentials/{credential_id}Path parameters
vault_idstringRequiredParent vault ID. Treat it as an opaque ID
credential_idstringRequiredCredential ID. Treat it as an opaque ID
Request example
curl -sS "$BASE_URL/vaults/vlt_xxx/credentials/vcrd_xxx" \
-H "Authorization: Bearer $DASHSCOPE_API_KEY"
import os
import requests
resp = requests.get(
f"{os.environ['BASE_URL']}/vaults/vlt_xxx/credentials/vcrd_xxx",
headers={"Authorization": f"Bearer {os.environ['DASHSCOPE_API_KEY']}"},
)
print(resp.json())
Response fields
200, returns a credential: The response does not return secret_value, the key identifier, or injection_location. An archived credential can still be retrieved.
idstringCredential ID
objectstringCredential object type, fixed as vault.credential
vault_idstringParent vault ID
namestringDisplay name
created_atintegerCreation time in Unix seconds
updated_atintegerLast update time in Unix seconds
metadataobjectMetadata, string key-value pairs; {} when not set
authobjectAuthentication settings.
Properties
typestringAuthentication type, fixed as environment_variable
secret_namestringEnvironment variable name
networkingobjectTarget domain settings.
Properties
typestringNetwork access type, limited or unrestricted
allowed_hostsarrayDomains or IPv4 addresses allowed for limited
Response example
{
"id": "vcrd_xxx",
"object": "vault.credential",
"vault_id": "vlt_xxx",
"name": "crm-token",
"created_at": 1793941200,
"updated_at": 1793941200,
"metadata": {"team": "support"},
"auth": {
"type": "environment_variable",
"secret_name": "CRM_TOKEN",
"networking": {
"type": "limited",
"allowed_hosts": ["api.example.com"]
}
}
}
Error codes
For the error response structure, see Errors.
| HTTP status | Error type / code | Solution |
|---|---|---|
401 | authentication_error / invalid_api_key | Send a valid Authorization: Bearer $DASHSCOPE_API_KEY header |
404 | not_found_error / not_found_error | The credential does not exist, is deleted, does not belong to the parent vault, or belongs to another workspace |
500 | server_error / server_error | Retry later. If it keeps failing, submit a ticket with x-request-id |