Returning.AI
  1. User Fields
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
        • Read API keys
        • Delete API key
        • Update API key
      • Users
        • Get user
      • Community Users
        • Get community users
        • Get user
      • User Fields
        • Get all user fields for a community
          GET
        • Get specific user field
          GET
        • Create user field
          POST
        • Update user field
          PUT
        • Delete user field
          DELETE
      • 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. User Fields

Create user field

POST
/apis/v1/communities/{communityId}/user-fields
Creates a new user field for a community.
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
Community API key with userFields permission can also be used

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Path Params
communityId
string 
required
The ID of the community
Body Params application/json
field
string 
required
The field identifier/key for the user field.
>= 1 characters<= 50 characters
Example:
userLevel
name
string 
required
The display name of the user field that will be shown to users
>= 1 characters<= 100 characters
Example:
User Level
type
string 
required
The data type of the user field. Determines how the field value is stored and validated.
Example:
number
Example
{
    "field": "userLevel",
    "name": "User Level",
    "type": "number"
}

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 --location --request POST 'https://application.returning.ai/apis/v1/communities//user-fields' \
--header 'Content-Type: application/json' \
--data-raw '{
    "field": "userLevel",
    "name": "User Level",
    "type": "number"
}'

Responses

🟢201Created
application/json
Create user field successful
Body
meta
object 
optional
status
string 
optional
statusCode
number 
optional
message
string 
optional
Success message for the operation
data
object 
optional
_id
string 
optional
The unique identifier of the user field
name
string 
optional
The name of the user field
type
string 
optional
The type of the user field
creator
object 
optional
communityId
string 
optional
The ID of the community this field belongs to
createdAt
string <date-time>
optional
When the field was created
updatedAt
string <date-time>
optional
When the field was last updated
Example
{
    "meta": {
        "status": "success",
        "statusCode": 201
    },
    "message": "Create user field successful",
    "data": {
        "_id": "6857de260f3c24d98fd7ca85",
        "name": "User Level",
        "type": "number",
        "creator": {
            "_id": "61100af5c548eb5c7ebc7819",
            "id": 123456789,
            "avatar": "https://returning-ai.com/avatar.png",
            "displayName": "Admin",
            "username": "admin"
        },
        "communityId": "6167dba9c548eb5c7ec28057",
        "createdAt": "2025-06-22T11:28:50.301Z",
        "updatedAt": "2025-06-22T11:28:50.301Z"
    }
}
🟠400Bad Request
🟠404Record Not Found
🔴500Server Error
Modified at 2025-07-17 16:33:31
Previous
Get specific user field
Next
Update user field