Skip to main content

Create Chat Room


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

Create Chat Room

This endpoint allows you to create a chat room

info

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

ParametersDescription
Query
authstringDashboard->Developer-> Private Key is your auth. token
Body
customizationobjectsee below for details
customCSSstringCustom css you want to pass to the chat room
defaultNotificationEnabledstring"on" or "off". When on then notification sound is enabled by default, when off the notification sound is disabled by default
fileSharingModestringblank or imageSharing or fileAndImageSharing. Can be blank if blank then fileSharing is disabled. If imageSharing then only images can be shared in the chatRoom, fileAndImageSharing then images and files can be shared in the chatRoom.
chatRoomPermissionLevelstringdefault is public. possible values: public provisioned_users memebers. public: anyone can join by typing the username. provisioned_users: only the users created via api or dashboard can join. members: only the users added as members can join.
enableChnnelsstring"on" or "off". When on, channels are enabled in the chatroom.
moderatorOnlyOneToOneChatstring"on" or "off", When "on" only moderators can have 1-1 chat with participants
enableOneToOneChatstring"on" or "off", When "on" then One to One Private Chat is enabled in the Chatroom
preModeratedChatRoomstring"on" or "off", When it is "on" then Pre-Moderated Chat is enabled in the chat room
roomPasswordstringif passwordProtected is on then this value becomes required. This is the password of the room
passwordProtectedstringon or off
descriptionstringdescription of the chat room
namestringname of the chatroom
metadatastringmetadata field with a maximum length of 1000 characters

Responses

200

JSON

{
"success": true,
"roomId": "bbNiVFoXm",
"url": "https://deadsimplechat.com/bbNiVFoXm"
}

404

JSON

{
"error": {
"_original": {
"name": "Sample Chat Room",
"description": "Chat Room Created using API",
"passwordProtected": "on",
"mainColor": "#FFFFF",
"sidebarColor": "#281576",
"hideInviteButton": false,
"preModeratedChatRoom": false,
"fileSharingMode": "imageSharing",
"enableLikeMessage": "on",
"customization": {
"chatMessageFont": "20px"
}
},
"details": [
{
"message": "\"roomPassword\" is required",
"path": [
"roomPassword"
],
"type": "any.required",
"context": {
"label": "roomPassword",
"key": "roomPassword"
}
}
]
}
}

customization object can be passed to customize the chat room user interface, it has the following keys

JSON
   customization: {
"sidebarColor": "",
"backgroundColor": "",
"textColor": "",
"fontFamily": "",
"useCustomFont": "",
"fontSize": "",
"hideOnlineUsersList": "", // boolean true/false
"hideOnlineUserCounter": "", // boolean true/false
"hideEmojiPicker": "", // boolean true/false
"hideMarkdownSuggestions": "", // boolean true/false
"hideProfilePics": "", // boolean true/false
"hideClaimAndEditProfileButtons": "", // boolean true/false
"hideNotificationButton": "", // boolean true/false
"hideLoginFields": "", // boolean true/false
"hideHeader": "", // boolean true/false
"hideSidebar": "", // boolean true/false
"hideUniqueUserIdentifierField": true, // boolean true/false
"hideAccessTokenField": true, // boolean true/false
"collapseSidebar": "",
"sidebarTextColor": "",
"chatMessageColor": "",
"chatUnapprovedMessageBackgroundColor": "",
"buttonColor": "",
"buttonHoverColor": "",
"buttonTextColor": "",
"chatMessageFont": "",
"usernameFont": "",
"modalFont": "",
"timestampFont": "",
"sendButtonIconColor": "",
"sendButtonBackgroundColor": "",
"textareaBackgroundColor": "",
"textareaBorderColor": "",
"textareaFontSize": "",
"chatMessageHoverColor": "",
"usernameFontSize": "",
"timestampFontSize": "",
"sidebarHeadingTextColor": "",
"headerBackgroundColor": "",
"headerTextColor": "",
"headerFontSize": "",
"modalBackgroundColor": "",
"modalFontColor": "",
"modalHeadingFontSize": "",
"modalLabelFontSize": ""
}