getOrCreateUser

Retrieves the User object for given discriminating tags. If the user does not exist, it will be created. If the user already exists, its name, pictureUrl, attributes, and tags will be updated with the provided values.

POST/v1/chat/users/get-or-create

Authorization

AuthorizationBearer
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Header parameters

x-bp-authenticated-principalstring
Authenticated principal. Injected by the authentication middleware.
x-bot-idstring
Bot id
x-integration-id?string
Integration id
x-integration-alias?string
Integration alias

Request body

User data

tagsobject
Tags for the user. Set to null or empty string to remove.
integrationName?stringdeprecated
[DEPRECATED] To create a User from within a bot, call an action of the integration instead.(max length: 200)
name?string
Name of the user(max length: 200)
pictureUrl?string
URI of the user picture(max length: 40000)
properties?object
**EXPERIMENTAL** - Optional shared properties. Set individual properties to null or empty string to remove them.
attributes?objectdeprecated
DEPRECATED - Use properties instead.
discriminateByTags?string[]
Optional list of tag names to use for strict matching when looking up existing users. If provided, all specified tags must match exactly for a user to be considered a match. For example, with an existing user whose tags are {"foo": "a", "bar": "b", baz: "c"}: Without this parameter, ALL tags must match exactly. With ["bar","baz"], all listed tags must match their values, and other tags are not considered.

Response

Returns a User object if a valid identifier was provided. Returns an Error otherwise

userobject
The user object represents someone interacting with the bot within a specific integration. The same person interacting with a bot in slack and messenger will be represented with two different users.
metaobject