Creates a new user field for a community.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
Provide your bearer token in the Authorization
header when making requests to protected resources. Example:Authorization: Bearer ********************
Body Params application/json
The field identifier/key for the user field.
>= 1 characters<= 50 characters
The display name of the user field that will be shown to users
>= 1 characters<= 100 characters
The data type of the user field. Determines how the field value is stored and validated.
{
"field": "userLevel",
"name": "User Level",
"type": "number"
}
Request samples
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
application/json
Create user field successful
Success message for the operation
The unique identifier of the user field
The name of the user field
The type of the user field
The ID of the community this field belongs to
createdAt
string <date-time>
optionalWhen the field was created
updatedAt
string <date-time>
optionalWhen the field was last updated
{
"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"
}
}
Modified at 2025-07-17 16:33:31