Archive a credential. This Bailian extension has no restore endpoint.
Endpoint
POST /vaults/{vault_id}/credentials/{credential_id}/archive
Paths are relative to the Base URL. Send Authorization: Bearer $DASHSCOPE_API_KEY on every request. For authentication details, see Authentication.
Path parametersvault_idstring (required)Parent vault ID. Treat it as an opaque IDcredential_id string (required)Credential ID. Treat it as an opaque IDThe request has no body. | Request example |
Response fields200, returns the archived credential:id stringCredential IDobject stringCredential object type, fixed as vault.credentialvault_id stringParent vault IDname stringDisplay namecreated_at integerCreation time in Unix secondsupdated_at integerLast update time in Unix secondsmetadata objectMetadata, string key-value pairs; {} when not set
auth type stringAuthentication type, fixed as environment_variablesecret_name stringEnvironment variable name
networking type stringNetwork access type, limited or unrestrictedallowed_hosts arrayDomains or IPv4 addresses allowed for limitedarchived_at, status, secret_value, the key identifier, or injection_location. An archived credential can still be retrieved, and the default list includes both active and archived. There is no restore endpoint. Archiving a vault also archives its child credentials. | Response example |
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 |