Skip to main content

Create User

info

Basic API comes included with the Growth Plan


https://api.deadsimplechat.com/consumer/api/v1/user

Create User

This endpoint allows you to create a Chat Room User or a Chat Room Moderator, this API returns an accessToken for the user, which you can pass to the Chat Room to join the user to the Chat Room, refer the SSO using Auth Token Guide to learn more about how to implement it.

info

The auth query parameter is your private key. You can find it in your Dashboard under Developer -> Private Key.

Create UsersDescription
Query Parameters
authstringGo to Dashboard -> Developer -> Private Key is your auth Key
Body
chatRoomstringroomId of the chatRoom you want to link the user to. When creating a moderator if chatRoom is passed then the user will be the moderator of the specified chatRoom, if chatRoom is not specified then the user will be the moderator of all the chatRooms
externalUserIdnumberstringUserId from your database you want to associate the user
isModeratorbooleandefault: false-If true the user will be the moderator of the chatRoom
emailstringEmail address you want to associated with the user
profilePicstringURL of the profile pic you want to associate with the user, the URL should be https
metastringAny metadata you want to pass to the user
usernamestringusername of the user
uniqueUserIdentifierstringUniquely identify the user across all your chat rooms. It is an id of the user that you can set, you can use the same id as you use in your application for this user. This can also be used to login the user into the chat room

Difference between externalUserId and uniqueUserIdentifier

On the surface the externalUserId and uniqueUserIdentifier seems similar, but there are key differences:

  • externalUserId is like a metadata field to store the id of the user. There can be multiple users with the same externalUserId.

  • uniqueUserIdentifier uniquely identifies the user, no two users in an account can have the same uniqueUserIdentifier.

  • unqiueUserIdentifier can be used to login the user into the chat room.

Responses

200

JSON

{
"accessToken": "eyJhbGcwOiJIUzI1NiIsInRscCI6IkpXVCJ9.eyJfaWQiOiI2MTQxZmQ4N2MzYjY3NTAzMTdkMDRmNjQiLCJ1c2VybmFtZSI6ImpvbiIsInBhcmVudEN1c3RvbWVyQWNjb3VudCI6IjVjYjcxY2RkODJiYTZiMDAwNDJmYjQzZiIsImNyZWF0ZWRVc2luZ0FwaSI6dHJ1ZSwiY2hhdFJvb20iOiI1ZjM5NzhlYWYzYjIzMDQ3ZmJmYWI3YTYiLCJpc01vZGVyYXRvciI6dHJ1ZSwiZXh0ZXJuYWxVc2VySWQiOiJ1bmRlZmluZWQiLCJjdXN0b21lciI6IjVjYjcxY2RkODJiYTZiMDAwNDJmYjQzZiIsImNyZWF0ZWQiOiIyMDIxLTA5LTE1VDE0OjA0OjU1Ljc1MFoiLCJ1cGRhdGVkIjoiMjAyMS0wOS0xNVQxNDowNDo1NS43NTBaIiwiX192IjowLCJpYXQiOjE2MzE3MTQ2OTV9.XYL5HexNgh8RsNQ2sAHU8wdOvFSSfJCOqzDqSU7n2as",
"username": "jon",
"userId": "6141fd87c3b6750317d04f64",
"isModerator": true
}