Users

Batch update users

Update multiple users with a single API call. The key for each user object is that user's id.

If all of the provided user objects to update are valid, then all updates are applied and you receive a HTTP 200 OK status code. If one or more of the user objects to update are invalid, then none of the updates is applied, even if some of them were valid. In case of an update with an invalid object, you receive an HTTP 400 Bad Request status code, along with an object that holds error messages for the invalid updates.

Note: You can update a maximum of 100 users with a single API call. Attempting to update more users at once results in a 400 Bad Request response, and no users are updated.

put/v1/{appId}/users

Request

Path parameters

appIdstring required
Example:abcd1234

A unique identifier of your TalkJS app. You can find your app ID on the Settings page of your dashboard.

Request body

UserBatchUpdateData required

A dictionary with user objects to update.

Example request

{
  "alice": {
    "name": "Alice",
    "role": "admin",
    "custom": {
      "country": "Bahrain"
    },
    "email": [
      "alice@example.com"
    ],
    "photoUrl": "https://talkjs.com/images/avatar-1.jpg",
    "locale": "ar",
    "phone": [
      "+97301245678"
    ],
    "welcomeMessage": "Hi there, how are you? :-)",
    "availabilityText": "We're usually online during office hours",
    "pushTokens": {
      "fcm:TOKEN_ID": true
    }
  }
}

Response

Empty response

object required

Empty response

Changes

No recorded changes to this operation across all 1 revision of this API.