Delete a Credential
DELETE /apisix/admin/consumers/{username}/credentials/{id}
DELETE /apisix/admin/consumers/{username}/credentials/{id}Interactive request editor loads with JavaScript.
X-API-KEY<token>
Admin API key configured in config.yaml under deployment.admin.admin_key. You can also pass the key as a query parameter api_key or cookie x_api_key.
In: header
Path Parameters
username*string
Consumer username.
Match
^[a-zA-Z0-9_\-]+$Length
1 <= length <= 256id*string
Unique identifier of the resource. Can be a string (alphanumeric, -, _, .) or a positive integer.
Query Parameters
force?"true"
When true, skip dependency checks before deletion.
Value in
- "true"
Response Body
application/json
application/json
application/json
curl -X DELETE "http://127.0.0.1:9180/apisix/admin/consumers/jack/credentials/my-resource-1?force=true"Successful response.
{
"key": "/apisix/consumers/john/credentials/cred-john-key-auth",
"deleted": "1"
}**Unauthorized** — The API key is missing, invalid, or lacks permission.
{
"error_msg": "failed to check token",
"description": "missing apikey"
}{
"error_msg": "failed to check token",
"description": "wrong apikey"
}{
"error_msg": "failed to check token",
"description": "invalid method for role viewer"
}Key not found
{
"error_msg": "Key not found"
}Complete operation details and schema variants
DELETE /apisix/admin/consumers/{username}/credentials/{id}
Delete a Credential
Delete a specific credential from a consumer.
Parameters
username(path, string, required): Consumer username.id(path, string, required): Unique identifier of the resource. Can be a string (alphanumeric,-,_,.) or a positive integer.force(query, string, optional): Whentrue, skip dependency checks before deletion.
Responses
200: Successful response.key(string, optional): The storage key or path identifier for the consumer credential.deleted(string, optional): The ID of the successfully deleted consumer credential.401: Unauthorized — The API key is missing, invalid, or lacks permission.error_msg(string, required): Authentication error message.description(string, optional): Detailed reason for the authentication failure.404: Not Found — The specified resource does not exist.error_msg(string, required): Error message indicating the resource was not found.
cURL
curl -X DELETE 'http://127.0.0.1:9180/apisix/admin/consumers/{username}/credentials/{id}'