Skip to API content
TalkLabs API Docs v3
Recipes
POST Chat

Create Room

\ name : required The name of the room \ description : optional The description of the room \ pictureurl : optional The URL for a picture for the room \ moderation : optional \…

POST /api/v3/{appid}/chat/rooms

This method requires authentication.

* name: (required) The name of the room
* description: (optional) The description of the room
* pictureurl: (optional) The URL for a picture for the room
* moderation: (optional) ["pre"/"post"] Defaults to post-moderation.
* enableactions: (optional) [true/false] Turns action commands on or off
* enableenterandexit: (optional) [true/false] Turn enter and exit events on or off. Disable for large rooms to reduce noise.
* enableprofanityfilter: (optional) [default=true / false] Enables profanity filtering.
* enableautoexpiresessions: (optional) [defaulttrue / false] Enables automatically expiring idle sessions, which removes inactive users from the room.
* delaymessageseconds: (optional) [default=0] Puts a delay on messages from when they are submitted until they show up in the chat. Used for throttling.
* roomisopen: (optional) [true/false] If false, users cannot perform any commands in the room, chat is suspended.
* maxreports: (optional) Default is 3. This is the maximum amount of user reported flags that can be applied to a message before it is sent to the moderation queue.
* customid: (optional) A customid for the room. Can be unused, or a unique key.
* customtype : (optional) Custom type string.
* custompayload : (optional) Custom payload string.
* customfield1 : (optional) User custom field 1. Store any string value you want here, limit 1024 bytes.
* customfield2 : (optional) User custom field 2. Store any string value you want here, limit 1024 bytes.
* customtags : (optional) A comma delimited list of tags
* private: (false | optional) If set to true a user cannot join this room unless explicitly granted with a call to the Set User Permission API.

Request

Parameters

Values in the path and query string.

appid path
string TalkLabs ID required

The TalkLabs application ID assigned to your account.

Example: your-app-id
Request

JSON body

Send as application/json.

name
string
userId
string customer-defined

The customer defined user ID from your application or identity system.

description
string
pictureUrl
string
moderation
integer · int32

Defaults to postmoderation

maxReports
integer · int32
enableActions
boolean
enableEnterAndExit
boolean
enableProfanityFilter
boolean
enableAutoExpireSessions
boolean
delayMessageSeconds
integer · int32
roomIsOpen
boolean
privateRoom
boolean

If TRUE set this to a private room, if false make it a public room

customType
string
customId
string customer-defined

A customer defined ID chosen by your application. TalkLabs stores it so you can retrieve the resource without keeping its TalkLabs ID.

customPayload
string
customField1
string
customField2
string
customTags
string[]
Request example
{
  "name": "New York City Chat (Post-Moderated)",
  "description": "Live from the top of the Empire State Building",
  "moderation": "post"
}
Request examples

Common variations

Historical examples filtered through the current request schema.

Create Room (Postmoderated)
{
  "name": "New York City Chat (Post-Moderated)",
  "description": "Live from the top of the Empire State Building",
  "moderation": "post"
}
Create Room (Premoderated)
{
  "name": "Tokyo Lounge",
  "description": "Live from Tokyo (Pre-Moderated)",
  "moderation": "pre"
}
Response

Status codes

Every JSON response uses the API result envelope.

200 OK ApiResult
400 Bad Request ApiResult
403 Forbidden ApiResult
500 Internal Server Error ApiResult
Example response · 200
{
  "message": "Success",
  "errors": {},
  "data": {
    "kind": "chat.room",
    "id": "5ec3c1945617e21bd8c5567b",
    "appid": "5ebbe03d5617e00de4b044c2",
    "ownerid": "userid_abe",
    "name": "New York City Chat (Post-Moderated)",
    "description": "Live from the top of the Empire State Building",
    "customtype": "",
    "customid": "new-york-city-club",
    "custompayload": "",
    "customtags": [],
    "customfield1": "",
    "customfield2": "",
    "enableactions": true,
    "enableenterandexit": true,
    "open": true,
    "inroom": 0,
    "added": "2020-05-19T11:23:00.3049587Z",
    "whenmodified": "2020-05-20T03:52:34.5114855Z",
    "moderation": "post",
    "maxreports": 0,
    "enableprofanityfilter": true,
    "delaymessageseconds": 0
  }
}
Search all 118 endpoints Try “join room”, “moderate”, or “POST”.
Request environment

Connect your application

These values fill request examples and the API console. They stay in this browser tab and are never sent to TalkLabs until you run a request.

Credentials are stored in sessionStorage, not in cookies or analytics.