1. Users
Returning.AI
  • Getting Started
  • Users
    • Get user
      GET
    • Get Users with Filters
      POST
    • Create New User
      POST
    • Get User Data
      POST
    • Manage User Account
      POST
    • List mini-game logs by user email
      POST
    • Get user's current Mini Games and Streak stats
      POST
    • Get User Milestones
      POST
    • Update User Data, Identifier, And Roles
      POST
    • Update User XP and Currency
      POST
  • Messaging
    • Message Actions
      • Direct Channel
        • private DM channel
          • Reply Message
          • Send Message
          • React Message
        • public channel
          • Reply Message
          • Send Message
          • React Message
      • Forum Channel
        • Send Message
        • Reply Message
        • React Message
      • Text Channel
        • Reply Message
        • Send Message
        • React Message
      • Iframe Channel
        • Reply Message
        • Send Message
        • React Message
    • Get Messages
      GET
    • Send Message
      POST
    • Reply Message
      POST
    • React Message
      POST
    • Upload message images
      POST
  • Gamification
    • Leaderboards
      • List leaderboards with pagination
      • Create a new leaderboard
      • Update an existing leaderboard
      • Get a single leaderboard by ID
      • Delete a leaderboard
    • Streaks & Mini Games
      • List user streak logs
      • Update user spin-wheel information
    • Referral
      • Get referral programs
      • Get user's referral summary
    • Rolling Data
      • Get Daily Calculation Data
      • Get Rolling Calculation Data
    • Get tiers and XP settings
      GET
    • Get daily user gamification history
      POST
    • List user gamification logs
      POST
    • Get user activity stats
      POST
  • Rewards & Redemptions
    • Update redemption order status or refund
      PUT
    • List redemption orders by user email
      POST
    • List redemption statuses
      POST
    • Get redemption status by ID
      POST
    • List redemption orders by community
      POST
    • Create redemption order status
      POST
    • Get redemption order status history
      POST
  • Chart Analysis
    • Create Analysis
    • Get Analysis
    • Update Analysis
    • Delete Analysis
    • List Analyses
    • Append Drawings
  • Bulk Operations
    • List bulk update jobs
    • Get bulk update job status
    • Get bulk update job details
    • Bulk update users from CSV
    • Bulk update premium currency from CSV
  • Channels
    • Iframe
    • List integration channels
  • Events
    • Outgoing webhooks
      • Encryption
      • User Joins Server
      • User Visits server
      • New Message Posted Anywhere
      • New Message Posted To channel
      • Purchased Store Item
    • Incoming webhooks
      • API Keys & Encryption
      • Send message into channels
      • Update Custom User Fields
      • Update In-game currency
  • Widgets
    • Authenticated Widgets
    • Public widgets
  • Store
    • Purchase History
      • Update redemption instructions or voucher details
    • Categories
      • List Store categories
      • Create Store category
      • Get Store category by ID
      • Update Store category
      • Delete Store category
    • Products
      • List products
      • Update products in bulk
      • Create products in bulk
      • Create product with vouchers
      • Read product
      • Update product and append vouchers
      • Delete product
    • Redemption-transaction
      • Get redemption transaction detail
    • Get Store configuration
    • Update Store configuration
  • Community Analytics
    • Get Loyalty Overview
    • Get Phone Verification Contacts
  • Community
    • Appearance
      • Update community theme colors
      • Update community bot profile
      • Update community URL metadata
      • Update community name and URL
    • Community Users
      • Get community users
      • Get user
    • Create community
  • API Keys
    • Community API Keys
      • Create API key
      • Read API keys
      • Delete API key
      • Update API key
    • User API Keys
      • List user API keys
      • Create user API key
      • Update user API key
      • Delete user API key
      • Get current API key information
  • User Fields
    • User Field History
      • 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
      • Update A User Field Value
      • Deprecated Field-First History Write
      • Deprecated Field-First History Read
    • Get A User Field Definition
    • Update A User Field Definition
    • Create A User Field Definition
    • Delete A User Field Definition
    • List User Field Definitions
    • Delete user field
    • Update user field
    • Get specific user field
  • Legacy
    • Servers
      • Create server
      • List servers
      • Update server metadata
    • Bulk Operations
      • Bulk import users from CSV
    • Authentication
      • Secure Auth
      • Register user with password
      • Verify user email
      • Log in user with password
    • Badges
      • List badges
      • Create badge
      • Update badge
      • Delete badge
      • Remove badge from user
      • Award badge to user
    • Messaging
      • Reply to message
      • Send message
      • React to message
    • Roles & Permissions
      • List server roles
      • Create role
      • Update role
      • Delete role
      • List user roles
      • Add role to user
      • Remove role from user
    • Users
      • Upload user avatar
    • Channels
      • Create channel
      • Update channel
      • Delete channel
    • API Keys
      • List integration API keys
      • Create integration API key
      • Delete integration API key
      • Update integration API key
  • Schemas
    • Sample Schemas
    • Schemas
    • Outgoing webhooks
    • Analysis
    • Pet
    • Category
    • Tag
    • ValidationError
    • NotFoundError
    • InternalServerError
    • NotImplementedError
    • CreateUserFieldHistoryResponse
    • CreateUserFieldHistorySuccessResponse
    • UserFieldHistoryItem
    • GetUserFieldHistoriesResponse
    • UserFieldHistoriesValidationError
    • UserFieldHistoriesMetaWithValidation
    • UserFieldHistoriesMetaWithPagination
    • GetUserFieldHistoriesSuccessResponse
    • CreateUserFieldResponse
    • CreateUserFieldSuccessResponse
    • DeleteUserFieldResponse
    • DeleteUserFieldSuccessResponse
    • UserFieldCreator
    • GetUserFieldResponse
    • GetUserFieldSuccessResponse
    • ValidationErrorItem
    • GetUserFieldsMetaResponse
    • CreatorInfo
    • UserFieldResponse
    • GetUserFieldsSuccessResponse
    • UpdateUserFieldResponse
    • UpdateUserFieldPayload
    • UpdateUserFieldSuccessResponse
    • MetaResponse
    • GetUserResponse
    • GetUserSuccessResponse
    • Purchased store item
    • ErrorResponse
    • New message posted to channel
    • UpdateAnalysisRequest
    • User visits server
    • AppendDrawingsRequest
    • User join server
    • CreateAnalysisResponse
    • GetAnalysisResponse
    • UpdateAnalysisResponse
    • AppendDrawingsResponse
    • AnalysisMetadata
    • Expiry
    • Levels
    • LevelEntry
    • Drawing
    • HorizontalLineDrawing
    • LineDrawing
    • RectangleDrawing
    • ParallelDrawing
    • FibonacciRetracementDrawing
    • Coordinate
    • DrawingStyle
    • AnalysisDetail
    • AnalysisSummary
    • CreateAnalysisRequest
    • ListAnalysesResponse
    • StandardApiError
    • StandardSuccessEnvelope
    • PurchasedStoreItemEvent
    • ChannelMessagePostedEvent
    • UserVisitedCommunityEvent
    • UserJoinedCommunityEvent
  1. Users

Create New User

POST
/v1/users

What this endpoint does#

Creates one user in the community selected by the Community API key. Use it for broker onboarding, federated/OAuth provisioning, local-password accounts, referral attribution, and initializing broker identifiers or other custom fields. Do not send communityId in the body.
INFO
Workflow
Create user -> read user

Quick start#

{
  "firstname": "Ada",
  "lastname": "Lovelace",
  "username": "ada_lovelace_123",
  "displayname": "Ada Lovelace",
  "email": "ada@example.com",
  "accessLevel": 1,
  "joinServer": true,
  "sendEmail": false,
  "emailPassword": false,
  "externalId": "<brokerCustomerId>"
}

Authentication and permission#

Send a server-side Community API key as Bearer <apiKey>. The key resolves the community and needs createUser. Never place an API key, broker credential, or login token in customFields.
Required fields are firstname, lastname, username, and accessLevel. A username cannot contain @. Email and username are normalized for duplicate checks.

Complete examples#

Federated user: omit password and confirmPassword, use joinServer: true, and normally set sendEmail and emailPassword to false. Store the stable broker identity in externalId when the community has an active identifier field.
Custom-field identifier fallback: if externalId is not configured, send customFields: [{"fieldIdorName":"customerid","value":"<brokerCustomerId>"}]. fieldIdOrName is an accepted compatibility alias, but prefer fieldIdorName on this endpoint.
Referral: add "referral":"<referrerReferralValue>". The value is passed to the community's referral mapping. Referral processing is a follow-up effect, so a referral failure does not reverse an already-created user.
Local password: send matching password and confirmPassword, each 8-20 characters with a number and special character, and enable the configured account-email flow when the user must receive credentials. Passwords are write-only. This API never returns them.
Custom-field values preserve meaningful falsy data. JSON false, numerical 0, and an empty string for a valid multi-line field are not discarded.

Success and readback#

{
  "status": "success",
  "code": "USER_CREATED",
  "message": "User created successfully",
  "data": {
    "userId": "3247779",
    "username": "ada_lovelace_123",
    "email": "ada@example.com",
    "communityMemberId": "<communityMemberObjectId>",
    "identifierKey": "customerid",
    "externalId": "<brokerCustomerId>",
    "created": true
  }
}
Treat data.userId as an opaque string. Save it, then confirm the result with POST /v1/users/info. The controller sends success only after its mandatory user and membership writes finish. Analytics, referral tracking, and email are follow-up effects and do not change an already-committed success into a failure.
CHECK
Readback
Run the follow-up read named above. Compare the returned identifiers and final stored values.

Errors and recovery#

400 DUPLICATE_EMAIL or DUPLICATE_USERNAME: no new user was created. Lookup and reconcile the existing identity.
400 PASSWORD_MISMATCH or PASSWORD_MATCHES_USERNAME: fix the local-password request.
400 EXTERNAL_IDENTIFIER_REQUIRED, EXTERNAL_IDENTIFIER_NOT_CONFIGURED, or EXTERNAL_IDENTIFIER_CONFLICT: use the community's configured identifier contract.
400 INVALID_CUSTOM_FIELDS: inspect errorFields; do not remove valid false, 0, or empty multi-line values.
401 AUTHENTICATION_REQUIRED / 403 API_KEY_PERMISSION_DENIED: fix the key or permission.
409 DUPLICATE_EXTERNAL_ID: lookup the existing broker identity instead of creating another user.
500 USER_CREATION_RECONCILIATION_REQUIRED: the outcome is ambiguous. Stop automatic creation and reconcile using data.userId and the external identifier.
500 USER_CREATE_FAILED: an unexpected failure occurred; do not assume a timeout means nothing was saved.

Retry safety#

WARNING
Retry rule
This endpoint does not currently accept an Idempotency-Key. After a timeout, do not blindly create again. First call POST /v1/users/info using the external identifier, email, or returned platform ID. Retry creation only after readback proves that no user was created.

Gotchas#

Avoid this mistake

Next steps#

Read the user
Read back with POST /v1/users/info. Use POST /v1/users/update for profile, role, or intentional identifier changes. Create field definitions before writing new custom-field values, then use the canonical user-first history endpoint for value updates.

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Header Params

Body Params application/json

Examples

Responses

🟢200OK
application/json
User created successfully. Use data.userId for follow-up reads and communityMemberId as the created community membership record.
Bodyapplication/json

🟠400Bad Request
🟠401Unauthorized
🟠403Forbidden
🟠409
🔴500Server Error
Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'https://api.returning.ai/v1/users' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
  "firstname": "Ada",
  "lastname": "Lovelace",
  "username": "ada_lovelace_123",
  "displayname": "Ada Lovelace",
  "email": "ada@example.com",
  "accessLevel": 1,
  "joinServer": true,
  "sendEmail": false,
  "emailPassword": false,
  "externalId": "broker-user-123"
}'
Response Response Example
200 - Success Example
{
  "status": "success",
  "code": "USER_CREATED",
  "message": "User created successfully",
  "data": {
    "userId": "3247779",
    "username": "ada_lovelace_123",
    "email": "ada@example.com",
    "communityMemberId": "66f000000000000000000001",
    "identifierKey": "customerid",
    "externalId": "<brokerCustomerId-or-cognitoSub>",
    "created": true
  }
}
Modified at 2026-07-27 16:00:10
Previous
Get Users with Filters
Next
Get User Data
Built with