Upsert a User (By memberId)

If a user exists, update information. If it's not, create a new user.

Parameter

Accessible via URL https://api.channel.io/open/v5/users/@{memberId} and HTTP PUT

๐Ÿšง

Note that there is @ character in front of memberId

๐Ÿ“˜

Present parameters in PUT body. This method does currently accept application/json only.

ParameterExampleRequiredDescriptionParameter type
memberId12345Requiredmember (user) identification id used by your companyPath
profile{"name": "Gabrielle Chanel", ..}OptionalProfile object contains user informationBody
profileOnce{"utmSource": "google", ..}OptionalProfile object contains user information. But, do not update if property is presentBody
tags['tag1', 'tag2']OptionalUser's tag attribute . Replace all of them with the newly given array.Body
unsubscribeEmailtrue or falseOptionalWhen this property is set to true, no marketing email will be sent.Body
unsubscribeTextingtrue or falseOptionalWhen this property is set to true, no marketing email will be sent.

Example

PUT https://api.channel.io/open/v5/users/@12345

Your PUT body should look like below

{
   "profile": {
       "name": "test",
       "mobileNumber": "+821000000000",
       "email": "[email protected]",
       "property1": "value",
       "property2": 123
   },
   "profileOnce": {},
   "tags": ["tag1", "tag2"],
   "unsubscribeEmail": false,
   "unsubscribeTexting": false
}

Response

default response

{
  "user": {
    "id": "string",
    "channelId": "string",
    "memberId": "string",
    "veilId": "string",
    "unifiedId": "string",
    "type": "member",
    "name": "string",
    "mobileNumberQualified": true,
    "emailQualified": true,
    "profile": {
      "name": "string",
      "empty": true,
      "email": "string",
      "avatarUrl": "string",
      "mobileNumber": "string",
      "additionalProp1": {},
      "additionalProp2": {},
      "additionalProp3": {}
    },
    "profileOnce": {
      "name": "string",
      "empty": true,
      "email": "string",
      "avatarUrl": "string",
      "mobileNumber": "string",
      "additionalProp1": {},
      "additionalProp2": {},
      "additionalProp3": {}
    },
    "tags": [
      "string"
    ],
    "alert": 0,
    "unread": 0,
    "popUpChatId": "string",
    "blocked": true,
    "unsubscribeEmail": true,
    "unsubscribeTexting": true,
    "hasChat": true,
    "hasPushToken": true,
    "language": "string",
    "country": "string",
    "city": "string",
    "latitude": 0,
    "longitude": 0,
    "web": {
      "device": "string",
      "os": "string",
      "osName": "string",
      "browser": "string",
      "browserName": "string",
      "sessionsCount": 0,
      "lastSeenAt": 1656032153127
    },
    "mobile": {
      "device": "string",
      "os": "string",
      "osName": "string",
      "appName": "string",
      "appVersion": "string",
      "sessionsCount": 0,
      "lastSeenAt": 1656032153127
    },
    "sessionsCount": 0,
    "lastSeenAt": 1656032153129,
    "createdAt": 1656032153129,
    "updatedAt": 1656032153129,
    "version": 0,
    "managedKey": 0,
    "member": true,
    "email": "string",
    "avatarUrl": "string",
    "mobileNumber": "string",
    "systemLanguage": "string"
  },
  "online": {
    "channelId": "string",
    "personType": "string",
    "personId": "string",
    "id": "string"
  }
}