Back to explore

messaging

Chat

Credits: 0.000001

Create

POST /v1/chat/Create

Create a new chat room

Request

descriptionstring

chat description

namestring

name of the room

privateboolean

whether its a private room

user_idsarray

optional list of user ids

Response

roomobject

the unique chat room

Request

Response

{
    "room": {
        "id": "d8057208-f81a-4e14-ad7f-c29daa2bb910",
        "name": "general",
        "description": "The general chat room",
        "created_at": "2022-02-17T16:12:43.942557998Z",
        "user_ids": [],
        "private": false
    }
}

Credits: 0.000001

Delete

POST /v1/chat/Delete

Delete a chat room

Request

room_idstring

the chat room id to delete

Response

roomobject

Request

Response

{
    "room": {
        "id": "d8057208-f81a-4e14-ad7f-c29daa2bb910",
        "name": "general",
        "description": "The general chat room",
        "created_at": "2022-02-17T16:12:43.942557998Z",
        "user_ids": [],
        "private": false
    }
}

Credits: 0.000001

History

POST /v1/chat/History

List the messages in a chat

Request

room_idstring

the chat room id to get

Response

messagesarray

messages in the chat room

Request

Response

{
    "messages": [
        {
            "id": "d44c6dc0-89d7-4a36-b528-cfd6c728ccef",
            "client": "web",
            "room_id": "d8057208-f81a-4e14-ad7f-c29daa2bb910",
            "user_id": "user-1",
            "sent_at": "2022-02-17T16:18:35.683008885Z",
            "subject": "Random",
            "text": "Hey whats up?"
        }
    ]
}

Credits: 0.000001

Invite

POST /v1/chat/Invite

Invite a user to a chat room

Request

room_idstring

the room id

user_idstring

the user id

Response

roomobject

Request

Response

{
    "room": {
        "id": "d8057208-f81a-4e14-ad7f-c29daa2bb910",
        "name": "general",
        "description": "The general chat room",
        "created_at": "2022-02-17T16:12:43.942557998Z",
        "user_ids": [
            "user-1"
        ],
        "private": false
    }
}

Credits: 0.000001

Join

POST /v1/chat/Join

Join a chat room

Request

room_idstring

chat room to join

user_idstring

user id joining

Response

messageobject

Request

Response

{
    "message": {
        "id": "d44c6dc0-89d7-4a36-b528-cfd6c728ccef",
        "client": "web",
        "room_id": "d8057208-f81a-4e14-ad7f-c29daa2bb910",
        "user_id": "user-1",
        "sent_at": "2022-02-17T16:18:35.683008885Z",
        "subject": "Random",
        "text": "Hey whats up?"
    }
}

Credits: 0.000001

Kick

POST /v1/chat/Kick

Kick a user from a chat room

Request

room_idstring

the chat room id

user_idstring

the user id

Response

roomobject

Request

Response

{
    "room": {
        "id": "d8057208-f81a-4e14-ad7f-c29daa2bb910",
        "name": "general",
        "description": "The general chat room",
        "created_at": "2022-02-17T16:12:43.942557998Z",
        "user_ids": [],
        "private": false
    }
}

Credits: 0.000001

Leave

POST /v1/chat/Leave

Leave a chat room

Request

room_idstring

the chat room id

user_idstring

the user id

Response

roomobject

Request

Response

{
    "room": {
        "id": "d8057208-f81a-4e14-ad7f-c29daa2bb910",
        "name": "general",
        "description": "The general chat room",
        "created_at": "2022-02-17T16:12:43.942557998Z",
        "user_ids": [],
        "private": false
    }
}

Credits: 0.000001

List

POST /v1/chat/List

List available chats

Request

user_idstring

optional user id to filter by

Response

roomsarray

Request

Response

{
    "rooms": [
        {
            "id": "d8057208-f81a-4e14-ad7f-c29daa2bb910",
            "name": "general",
            "description": "The general chat room",
            "created_at": "2022-02-17T16:12:43.942557998Z",
            "user_ids": [],
            "private": false
        }
    ]
}

Credits: 0.000001

Send

POST /v1/chat/Send

Connect to a chat to receive a stream of messages Send a message to a chat

Request

clientstring

a client side id, should be validated by the server to make the request retry safe

room_idstring

id of the chat room the message is being sent to / from

subjectstring

subject of the message

textstring

text of the message

user_idstring

id of the user who sent the message

Response

messageobject

the message which was created

Request

Response

{
    "message": {
        "id": "d44c6dc0-89d7-4a36-b528-cfd6c728ccef",
        "client": "web",
        "room_id": "d8057208-f81a-4e14-ad7f-c29daa2bb910",
        "user_id": "user-1",
        "sent_at": "2022-02-17T16:18:35.683008885Z",
        "subject": "Random",
        "text": "Hey whats up?"
    }
}