Update API key
Updates name, permissions, or expiry for one community API key.
- Method
- PUT
- Path
https://api.returning.ai / v1/ communities/ {communityId}/ api-keys/ {apiKeyId} - Retries
- Retry timeouts after listing by
_id.
Authentication#
- Header
Authorization: Bearer <API_KEY>
Bearer community API key that can manage keys for this community. Keep it server-side.
Behaviour#
It does not rotate the secret. data.key is still returned.
Request#
Path parameters#
Headers#
Body#
RuleMin 1 chars
Eg"Updated Slack Integration Key"
RuleDefault []
Eg[ ... ]
RuleMin 0
Eg0
RuleDate-time
Eg"2025-12-15T23:59:59.000Z"
Watch for
- Update is not rotate. Create a replacement key, switch the integration, then delete the old
_id.
More examples and details
Updated (200). message is Update API key success. data includes _id, communityId, name, key, permissions, expirePeriod, createdAt, updatedAt.
Invalid permission enum values return the same Create API key validation error.-style enum detail as create.
Never paste live key values.
curl --request PUT \
--url 'https://api.returning.ai/v1/communities/<communityId>/api-keys/<apiKeyId>' \
--header 'Authorization: Bearer <API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"name": "Updated Slack Integration Key",
"permissions": [
"sendMessage",
"replyMessage",
"createUser",
"manageUser",
"getUserData",
"getUserStats",
"bulkUpdateUser",
"userFields"
],
"expirePeriod": 0,
"expireDate": "2025-12-15T23:59:59.000Z"
}'
Response#
HTTP 200. The secret does not change. List again and match _id. A key missing leaderboard still 403s GET /v1/leaderboards after this PUT unless you add that permission.
Eg{"status": "success", "statusCode": 200}
Eg"success"
Eg200
Eg"Update API key success."
Eg{ ... }
Eg"675b9876fedc432109876543"
Eg"Updated Slack Integration Key"
Eg"<API_KEY>"
Eg[ ... ]
Eg0
Eg"2025-12-15T23:59:59.000Z"
RuleDate-time
Eg"2024-12-15T15:45:22.789Z"
RuleDate-time
Eg"2024-12-15T10:30:45.123Z"
{
"meta": {
"status": "success",
"statusCode": 200
},
"message": "Update API key success.",
"data": {
"_id": "675b9876fedc432109876543",
"name": "Updated Slack Integration Key",
"key": "<API_KEY>",
"permissions": [
"sendMessage",
"replyMessage",
"createUser",
"manageUser",
"getUserData",
"getUserStats",
"bulkUpdateUser",
"userFields"
],
"expirePeriod": 0,
"expireDate": "2025-12-15T23:59:59.000Z",
"updatedAt": "2024-12-15T15:45:22.789Z",
"createdAt": "2024-12-15T10:30:45.123Z"
}
}
Errors#
Fix the request03
Fix the data02
Retry with backoff01
{
"meta": {
"status": "error",
"statusCode": 400
},
"message": "Update API key error.",
"errors": {
"name": "API key name cannot be empty"
}
}