curl --request POST \
--url https://api.example.com/api/create_room \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"room_name": "<string>",
"is_private": 123,
"password": "<string>"
}
'{
"message": "<string>",
"room_id": 123
}Create a new chat room (public or private)
curl --request POST \
--url https://api.example.com/api/create_room \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"room_name": "<string>",
"is_private": 123,
"password": "<string>"
}
'{
"message": "<string>",
"room_id": 123
}is_private is 1, ignored for public rooms.{
"error": "invalid fields received"
}
{
"error": "room already exists"
}
{
"error": "maximum number of public rooms reached (5). Please create a private room to continue the conversation with the people you would like to"
}
{
"error": "unauthorized"
}
{
"error": "room_name must be a string"
}
curl -X POST https://api.mirage.com/api/create_room \
-H "Authorization: your-auth-token" \
-H "Content-Type: application/json" \
-d '{
"room_name": "General Discussion",
"is_private": 0
}'
curl -X POST https://api.mirage.com/api/create_room \
-H "Authorization: your-auth-token" \
-H "Content-Type: application/json" \
-d '{
"room_name": "Secret Club",
"is_private": 1,
"password": "secure-password"
}'
{
"message": "room \"General Discussion\" created",
"room_id": 42
}