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
          POST
        • Get all user fields for a community
          GET
        • Delete user field
          DELETE
        • Update user field
          PUT
        • Get specific user field
          GET
      • Users
        • Get user
    • Application
      • Users
        • Get user
      • Community Users
        • Get community users
        • Get community 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. User Fields

Create user field

POST
/apis/v1/communities/{communityId}/user-fields
User Fields
Creates a new user field for a community

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
name
string 
required
The name of the user field
>= 1 characters
Example:
User Level
type
enum<string> 
required
The type of the user field
Allowed values:
textnumberbooleandateselect
Example:
number
description
string 
optional
Optional description of the user field
Example:
The level of the user in the community
required
boolean 
optional
Whether the field is required
Default:
false
Example:
false
defaultValue
optional
Default value for the field
Example:
1
options
array[string]
optional
Available options for select type fields
Example:
["Beginner","Intermediate","Advanced"]
Example
{
    "name": "User Level",
    "type": "number",
    "description": "The level of the user in the community",
    "required": false,
    "defaultValue": 1
}

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://integration.returning.ai/apis/v1/communities//user-fields' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "User Level",
    "type": "number",
    "description": "The level of the user in the community",
    "required": false,
    "defaultValue": 1
}'

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
enum<string> 
optional
The type of the user field
Allowed values:
textnumberbooleandateselect
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": "Total Points",
        "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-06-23 14:46:45
Previous
Get user field histories
Next
Get all user fields for a community