Returning.AI
  1. API Keys
Returning.AI
  • Returning.AI
    • Auth
      • register
      • verify email
      • login
      • secure auth
    • Server
      • create new server
      • get my servers
      • update server
      • role list of server
      • channel list of server
    • Role
      • create new role
      • update role
      • delete role
      • add role to a user on a server
      • remove role from a user on a server
      • get role list of user on a server
    • Channel
      • get channels list
      • create new channel
      • update channel
      • delete channel
    • Badge
      • get badges list
      • create new badge
      • update badge
      • delete badge
      • award badge to user
      • remove badge from user
    • Integration
      • users
        • create new user
        • manage user
        • user data
        • gamification stats
        • user bulk update
        • user bulk import
      • Messages
        • Send Message
        • Reply Message
        • React Message
      • Channels
        • Get Channels List
      • User Field Histories
        • Create user field history
        • Get user field histories
      • User Fields
        • Create user field
        • Get all user fields for a community
        • Delete user field
        • Update user field
        • Get specific user field
      • Users
        • Get user
    • Application
      • API Keys
        • Create API key
          POST
        • Read API keys
          GET
        • Delete API key
          DELETE
        • Update API key
          PUT
      • Users
        • Get user
      • Community Users
        • Get community users
        • Get user
      • User Fields
        • Get all user fields for a community
        • Get specific user field
        • Create user field
        • Update user field
        • Delete user field
      • User Field Histories
        • Get all user field histories in a community
        • Get user field histories for a specific field
        • Get user field histories for a specific user
        • Get user field histories of specific user field and user
        • Create user field history for specific user
  1. API Keys

Update API key

PUT
/apis/v1/communities/{communityId}/api-keys/{apiKeyId}
API Keys
Updates an existing API key for a community. This endpoint allows modification of
API key properties such as name, permissions, and expiration settings.
Security Requirements:
Bearer token authentication required
Only community owners and administrators can access this endpoint
User must have either COMMUNITY_OWNER or COMMUNITY_ADMIN permissions for the specified community
Key Features:
Update API key name for better identification
Modify permissions array to control access levels
Adjust expiration period or specific expiration date
API key value remains unchanged and secure
Emits real-time event to community members
Validates all input parameters for security

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Path Params
communityId
string <objectId>
required
The unique identifier of the community
Example:
675a1234bcde567890123456
apiKeyId
string <objectId>
required
The unique identifier of the API key to update
Example:
675b9876fedc432109876543
Body Params application/json
name
string 
required
The name of the API key for identification
>= 1 characters
Example:
Updated Slack Integration Key
permissions
array[string]
optional
Array of permissions to assign to the API key
Example:
["sendMessage","replyMessage","createUser","manageUser","getUserData","getUserStats","bulkUpdateUser","userFields"]
expirePeriod
number 
optional
Expiration period in days (0 for no expiration)
>= 0
Example:
0
expireDate
string <date-time>
optional
Specific expiration date for the API key
Example:
2025-12-15T23:59:59.000Z
Examples
{
    "name": "Updated Slack Integration Key",
    "permissions": [
        "sendMessage",
        "replyMessage",
        "createUser",
        "manageUser",
        "getUserData",
        "getUserStats",
        "bulkUpdateUser",
        "userFields"
    ],
    "expirePeriod": 0,
    "expireDate": "2025-12-15T23:59:59.000Z"
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
cURL
curl --location --request PUT 'https://application.returning.ai/apis/v1/communities//api-keys/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "Updated Slack Integration Key",
    "permissions": [
        "sendMessage",
        "replyMessage",
        "createUser",
        "manageUser",
        "getUserData",
        "getUserStats",
        "bulkUpdateUser",
        "userFields"
    ],
    "expirePeriod": 0,
    "expireDate": "2025-12-15T23:59:59.000Z"
}'

Responses

🟢200OK
application/json
Update API key successful
Body
meta
object 
optional
status
string 
optional
Response status
statusCode
number 
optional
HTTP status code
message
string 
optional
Success message for the operation
data
object 
optional
_id
string 
optional
The unique identifier of the API key
name
string 
optional
The updated name of the API key
key
string 
optional
The API key value (unchanged during update)
permissions
array[string]
optional
Array of permissions assigned to the API key
expirePeriod
number 
optional
Expiration period in days (0 for no expiration)
expireDate
string 
optional
Specific expiration date for the API key
updatedAt
string <date-time>
optional
When the API key was last updated
createdAt
string <date-time>
optional
When the API key was created
Example
{
    "meta": {
        "status": "success",
        "statusCode": 200
    },
    "message": "Update API key success.",
    "data": {
        "_id": "675b9876fedc432109876543",
        "name": "Updated Slack Integration Key",
        "key": "8f3e4d5c6b7a9e2f1a4b7c8d5e9f2a6b3c7e8f1a4b5c9d2e6f8a1b4c7e9f2a5b8c",
        "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"
    }
}
🟠400Bad Request
🟠401Unauthorized
🟠403Forbidden
🟠404Record Not Found
🔴500Server Error
Modified at 2025-07-07 16:49:45
Previous
Delete API key
Next
Get user