Delete API key
Revokes one community API key by ObjectId.
- Method
- DELETE
- Path
https://api.returning.ai / v1/ communities/ {communityId}/ api-keys/ {apiKeyId} - Retries
- A timeout can hide a successful revoke.
Authentication#
- Header
Authorization: Bearer <API_KEY>
Bearer community API key that can manage keys for this community. Keep it server-side.
Behaviour#
The delete response still includes data.key. Treat it as secret-bearing.
Request#
Path parameters#
Headers#
RuleBearer <API_KEY>
Watch for
- Delete returns the secret in the body. Redact logs.
- User API key delete routes are not mounted.
More examples and details
Deleted (200). message is Delete API key success. Envelope includes data._id, name, key, and permissions of the revoked key.
Do not delete the managing key you are using until a replacement exists.
curl --request DELETE \
--url 'https://api.returning.ai/v1/communities/<communityId>/api-keys/<apiKeyId>' \
--header 'Authorization: Bearer <API_KEY>'
Response#
HTTP 200. List community keys and confirm the _id is absent. Calls with the revoked secret should fail authentication.
Eg{"status": "success", "statusCode": 200}
Eg"success"
Eg200
Eg"Delete API key success."
Eg{ ... }
Eg"675b9876fedc432109876543"
Eg"Slack Integration API Key"
Eg"<API_KEY>"
Eg[ ... ]
Eg365
RuleDate-time
Eg"2025-12-15T23:59:59.000Z"
RuleDate-time
Eg"2024-12-15T10:30:45.123Z"
RuleDate-time
Eg"2024-01-15T09:15:22.456Z"
{
"meta": {
"status": "success",
"statusCode": 200
},
"message": "Delete API key success.",
"data": {
"_id": "675b9876fedc432109876543",
"name": "Slack Integration API Key",
"key": "<API_KEY>",
"permissions": [
"sendMessage",
"replyMessage",
"createUser",
"manageUser",
"getUserData",
"getUserStats",
"bulkUpdateUser",
"userFields"
],
"expirePeriod": 365,
"expireDate": "2025-12-15T23:59:59.000Z",
"updatedAt": "2024-12-15T10:30:45.123Z",
"createdAt": "2024-01-15T09:15:22.456Z"
}
}
Errors#
Fix the request03
Fix the data01
Retry with backoff01
{
"meta": {
"status": "error",
"statusCode": 400
},
"message": "Delete API key error.",
"errors": {
"communityId": "Community ID must be a valid ObjectId"
}
}