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
      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
  • Community Analytics
    • Get Loyalty Overview
    • Get Phone Verification Contacts
  • Store
    • Purchase History
      • Update purchase history 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
    • 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
  • 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
  • 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
  • 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

Update User Data, Identifier, And Roles

Developing
POST
/v1/users/update

What this endpoint does#

Partially updates one user's profile, community roles, or active broker identifier. It is the only supported endpoint for intentionally replacing an already-set active identifier. Identifier replacement must be isolated from profile and role changes so cleanup cannot undo unrelated work.
INFO
Workflow
Current user -> update -> read user

Quick start#

{
  "identifier": { "type": "platform_user_id", "value": "3247779" },
  "updates": {
    "firstname": "Augusta",
    "roles": { "operator": "add", "names": ["VIP"] }
  }
}

Authentication and permission#

Profile and identifier changes require manageUser. A request containing updates.roles requires both manageUser and bulkUpdateUser. Keep the Community API key server-side.
identifier.type is platform_user_id, username, email, or custom_user_identifier. It selects the existing user. updates contains only the requested changes.

Complete examples#

Profile-only update:
{
  "identifier": { "type": "email", "value": "user@example.com" },
  "updates": { "firstname": "Augusta", "phone": "15551234567" }
}
Identifier-only replacement:
{
  "identifier": { "type": "platform_user_id", "value": "3247779" },
  "updates": { "custom_user_identifier": "<newBrokerCustomerId>" }
}
Do not locate by custom_user_identifier while changing that same identifier. Locate by platform ID or username. custom_user_identifier must be the only property in updates.
Role changes use roles.operator with add, subtract, or overwrite, and a non-empty unique roles.names array. add and subtract are idempotent by membership. overwrite replaces mutable current-community roles while retaining protected defaults and foreign-community roles.

Success and readback#

{
  "status": "success",
  "code": "USER_UPDATED",
  "message": "User updated successfully",
  "data": {
    "id": "3247779",
    "firstname": "Augusta",
    "lastname": "Lovelace",
    "email": "ada@example.com",
    "phone": "15551234567",
    "custom_user_identifier": "<brokerCustomerId>",
    "roles": ["@all", "VIP"]
  }
}
roles is present when the request changes roles. Read back with POST /v1/users/info. After an identifier change, also inspect the narrow identifier history before issuing dependent tokens or further writes.
CHECK
Readback
Run the follow-up read named above. Compare the returned identifiers and final stored values.

Errors and recovery#

400 INVALID_USER_UPDATE: identifier, updates, property, or role operation is malformed.
400 MIXED_IDENTIFIER_UPDATE_NOT_SUPPORTED: identifier replacement was combined with another update. Nothing is written; split the operation.
400 ROLE_NOT_FOUND, ROLE_NAME_AMBIGUOUS, or PROTECTED_ROLE_CHANGE_REJECTED: fix the role request.
401 AUTHENTICATION_REQUIRED / 403 API_KEY_PERMISSION_DENIED: fix authentication or required permissions.
404 USER_NOT_FOUND: the selected identity is not active in this community.
409 USER_EMAIL_CONFLICT or USER_IDENTIFIER_CONFLICT: reconcile the identity already owning the target value.
500 USER_UPDATE_RECONCILIATION_REQUIRED: identifier history/projection cleanup is ambiguous. Stop automatic retries and read back.
500 USER_UPDATE_FAILED: unexpected persistence failure; confirm current state before retrying.

Retry safety#

WARNING
Retry rule
This endpoint does not currently accept an Idempotency-Key. Role add and subtract are membership-idempotent, but a network timeout can still hide the response. Read the user back before repeating any update. Never retry an identifier replacement while reconciliation is required.

Gotchas#

Avoid this mistake

Next steps#

Read the updated user
Call POST /v1/users/info to confirm profile and roles. For identifier changes, read the relevant user-field history. Use the canonical user-field value endpoint for ordinary custom values; do not use it to replace an active identifier.

Request

Header Params

Body Params application/jsonRequired

Examples

Responses

🟢200Success
application/json
User updated successfully Branch on the HTTP status and top-level code; do not branch on the human-readable message.
Bodyapplication/json

🟠400Error
🟠401Error
🟠403Error
🟠404Error
🟠409Error
🔴500Error
🔴503Error
Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'https://api.returning.ai/v1/users/update' \
--header 'Authorization: Bearer <apiKey>' \
--header 'Content-Type: application/json' \
--data-raw '{
  "identifier": {
    "type": "email",
    "value": "ada@example.com"
  },
  "updates": {
    "firstname": "Augusta",
    "phone": "15551234567"
  }
}'
Response Response Example
200 - Success Example
{
  "status": "success",
  "code": "USER_UPDATED",
  "message": "User updated successfully",
  "data": {
    "id": "3247779",
    "firstname": "Augusta",
    "lastname": "Lovelace",
    "email": "ada@example.com",
    "phone": "15551234567",
    "custom_user_identifier": "<brokerCustomerId>",
    "roles": [
      "@all",
      "VIP"
    ]
  }
}
Modified at 2026-07-27 16:00:26
Previous
Get User Milestones
Next
Update User XP and Currency
Built with