Skip to main content

Create Chat Room


<button style={{ marginBottom: "10px" }} class="button button--outline button--active button--primary"> Post

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
translationobjectTranslation strings for the chat room user interface. See loadTranslation for the accepted keys.
customCSSstringCustom css you want to pass to the chat room
mainColorstringMain colour of the chat room, as a CSS colour value (maximum length: 20)
sidebarColorstringColour of the chat room sidebar, as a CSS colour value (maximum length: 20)
hideInviteButtonstring"on" or "off". When "on" the invite button is hidden in 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
fileSharingModestringimageSharing or fileAndImageSharing. If imageSharing then only images can be shared in the chatRoom, fileAndImageSharing then images and files can be shared in the chatRoom. Omit the field to leave fileSharing disabled.
chatRoomPermissionLevelstringdefault is public. possible values: public provisioned_users members. 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.
enableChannelsstring"on" or "off". When on, channels are enabled in the chatroom.
enableLikeMessagestring"on" or "off". When "on" participants can like and react to messages.
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"
}

400

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": ""
}