- Returning.AI
- Auth
- Server
- Role
- Channel
- Badge
- Integration
- users
- Messages
- Channels
- User Field Histories
- User Fields
- Users
- Application
Create user field
POST
/apis/v1/communities/{communityId}/user-fields
User Fields
Request
Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.Example:
Authorization: Bearer ********************
Path Params
communityId
string
required
Body Params application/json
name
string
required
>= 1 characters
Example:
User Level
type
enum<string>
required
Allowed values:
textnumberbooleandateselect
Example:
number
description
string
optional
Example:
The level of the user in the community
required
boolean
optional
Default:
false
Example:
false
defaultValue
optional
Example:
1
options
array[string]
optional
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
Body
meta
object
optional
status
string
optional
statusCode
number
optional
message
string
optional
data
object
optional
_id
string
optional
name
string
optional
type
enum<string>
optional
Allowed values:
textnumberbooleandateselect
creator
object
optional
communityId
string
optional
createdAt
string <date-time>
optional
updatedAt
string <date-time>
optional
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