create room
curl --request POST \
--url https://apix.us.amity.co/api/v1/rooms \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"description": "<string>",
"thumbnailFileId": "<string>",
"metadata": {},
"liveChatEnabled": true,
"parentRoomId": "<string>",
"type": "directStreaming"
}
'import requests
url = "https://apix.us.amity.co/api/v1/rooms"
payload = {
"title": "<string>",
"description": "<string>",
"thumbnailFileId": "<string>",
"metadata": {},
"liveChatEnabled": True,
"parentRoomId": "<string>",
"type": "directStreaming"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
description: '<string>',
thumbnailFileId: '<string>',
metadata: {},
liveChatEnabled: true,
parentRoomId: '<string>',
type: 'directStreaming'
})
};
fetch('https://apix.us.amity.co/api/v1/rooms', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apix.us.amity.co/api/v1/rooms",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'description' => '<string>',
'thumbnailFileId' => '<string>',
'metadata' => [
],
'liveChatEnabled' => true,
'parentRoomId' => '<string>',
'type' => 'directStreaming'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apix.us.amity.co/api/v1/rooms"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"thumbnailFileId\": \"<string>\",\n \"metadata\": {},\n \"liveChatEnabled\": true,\n \"parentRoomId\": \"<string>\",\n \"type\": \"directStreaming\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apix.us.amity.co/api/v1/rooms")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"thumbnailFileId\": \"<string>\",\n \"metadata\": {},\n \"liveChatEnabled\": true,\n \"parentRoomId\": \"<string>\",\n \"type\": \"directStreaming\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apix.us.amity.co/api/v1/rooms")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"thumbnailFileId\": \"<string>\",\n \"metadata\": {},\n \"liveChatEnabled\": true,\n \"parentRoomId\": \"<string>\",\n \"type\": \"directStreaming\"\n}"
response = http.request(request)
puts response.read_body{
"rooms": [
{
"_id": "<string>",
"targetId": "<string>",
"referenceType": "post",
"referenceId": "<string>",
"liveChannelId": "<string>",
"liveChatEnabled": true,
"title": "<string>",
"roomId": "<string>",
"description": "<string>",
"thumbnailFileId": "<string>",
"participants": [
{
"userId": "<string>",
"userInternalId": "64be1f6cb9b4106b5a6bbf3f"
}
],
"livePlaybackUrl": "https://stream.example.com/someid.m3u8?token=token",
"liveThumbnailUrl": "https://image.example.com/someid/thumbnail.png?token=token",
"recordedPlaybackInfos": [
{
"url": "https://apix.eu.amity.co/api/v1/rooms/roomid/recorded/someid/watch",
"thumbnailUrl": "https://apix.eu.amity.co/api/v1/rooms/roomid/recorded/someid/thumbnail"
}
],
"durationSeconds": 123,
"moderation": {
"flagLabels": [
{
"category": "<string>",
"threshold": 123,
"detectedAt": "2023-11-07T05:31:56Z"
}
],
"terminateLabels": [
{
"category": "<string>",
"threshold": 123,
"detectedAt": "2023-11-07T05:31:56Z"
}
],
"updatedAt": "2023-11-07T05:31:56Z"
},
"parentRoomId": "<string>",
"childRoomIds": [],
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"creatorInternalId": "64be1f6cb9b4106b5a6bbf3f",
"updatedAt": "2023-11-07T05:31:56Z",
"liveAt": "2023-11-07T05:31:56Z",
"endedAt": "2023-11-07T05:31:56Z",
"recordedAt": "2023-11-07T05:31:56Z",
"isDeleted": true,
"deletedAt": "2023-11-07T05:31:56Z",
"deletedBy": "<string>",
"path": "<string>",
"metadata": {}
}
],
"roomChildrens": [
{
"_id": "<string>",
"targetId": "<string>",
"referenceType": "post",
"referenceId": "<string>",
"liveChannelId": "<string>",
"liveChatEnabled": true,
"title": "<string>",
"roomId": "<string>",
"description": "<string>",
"thumbnailFileId": "<string>",
"participants": [
{
"userId": "<string>",
"userInternalId": "64be1f6cb9b4106b5a6bbf3f"
}
],
"livePlaybackUrl": "https://stream.example.com/someid.m3u8?token=token",
"liveThumbnailUrl": "https://image.example.com/someid/thumbnail.png?token=token",
"recordedPlaybackInfos": [
{
"url": "https://apix.eu.amity.co/api/v1/rooms/roomid/recorded/someid/watch",
"thumbnailUrl": "https://apix.eu.amity.co/api/v1/rooms/roomid/recorded/someid/thumbnail"
}
],
"durationSeconds": 123,
"moderation": {
"flagLabels": [
{
"category": "<string>",
"threshold": 123,
"detectedAt": "2023-11-07T05:31:56Z"
}
],
"terminateLabels": [
{
"category": "<string>",
"threshold": 123,
"detectedAt": "2023-11-07T05:31:56Z"
}
],
"updatedAt": "2023-11-07T05:31:56Z"
},
"parentRoomId": "<string>",
"childRoomIds": [],
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"creatorInternalId": "64be1f6cb9b4106b5a6bbf3f",
"updatedAt": "2023-11-07T05:31:56Z",
"liveAt": "2023-11-07T05:31:56Z",
"endedAt": "2023-11-07T05:31:56Z",
"recordedAt": "2023-11-07T05:31:56Z",
"isDeleted": true,
"deletedAt": "2023-11-07T05:31:56Z",
"deletedBy": "<string>",
"path": "<string>",
"metadata": {}
}
],
"users": [
{
"userId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"_id": "<string>",
"path": "<string>",
"userInternalId": "<string>",
"userPublicId": "<string>",
"roles": [
"<string>"
],
"permissions": [],
"displayName": "<string>",
"profileHandle": "<string>",
"description": "<string>",
"avatarFileId": "<string>",
"avatarCustomUrl": "<string>",
"flagCount": 123,
"hashFlag": {
"bits": 123,
"hashes": 123,
"hash": [
"<string>"
]
},
"metadata": {},
"isGlobalBan": true,
"isBrand": true,
"isDeleted": true
}
],
"files": [
{
"fileId": "<string>",
"fileUrl": "<string>",
"accessType": "public",
"altText": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"attributes": {
"name": "<string>",
"extension": "<string>",
"size": 123,
"mimeType": "<string>",
"metadata": {
"exif": {},
"gps": {},
"height": 123,
"width": 123,
"isFull": true
}
}
}
]
}{
"status": "error",
"code": 400000,
"message": "Bad Request."
}{
"status": "error",
"code": 400400,
"message": "Resource Not Found."
}{
"status": "error",
"code": 500000,
"message": "Unexpected error"
}Room
create room
POST
/
api
/
v1
/
rooms
create room
curl --request POST \
--url https://apix.us.amity.co/api/v1/rooms \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"description": "<string>",
"thumbnailFileId": "<string>",
"metadata": {},
"liveChatEnabled": true,
"parentRoomId": "<string>",
"type": "directStreaming"
}
'import requests
url = "https://apix.us.amity.co/api/v1/rooms"
payload = {
"title": "<string>",
"description": "<string>",
"thumbnailFileId": "<string>",
"metadata": {},
"liveChatEnabled": True,
"parentRoomId": "<string>",
"type": "directStreaming"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
description: '<string>',
thumbnailFileId: '<string>',
metadata: {},
liveChatEnabled: true,
parentRoomId: '<string>',
type: 'directStreaming'
})
};
fetch('https://apix.us.amity.co/api/v1/rooms', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apix.us.amity.co/api/v1/rooms",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'description' => '<string>',
'thumbnailFileId' => '<string>',
'metadata' => [
],
'liveChatEnabled' => true,
'parentRoomId' => '<string>',
'type' => 'directStreaming'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apix.us.amity.co/api/v1/rooms"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"thumbnailFileId\": \"<string>\",\n \"metadata\": {},\n \"liveChatEnabled\": true,\n \"parentRoomId\": \"<string>\",\n \"type\": \"directStreaming\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apix.us.amity.co/api/v1/rooms")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"thumbnailFileId\": \"<string>\",\n \"metadata\": {},\n \"liveChatEnabled\": true,\n \"parentRoomId\": \"<string>\",\n \"type\": \"directStreaming\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apix.us.amity.co/api/v1/rooms")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"thumbnailFileId\": \"<string>\",\n \"metadata\": {},\n \"liveChatEnabled\": true,\n \"parentRoomId\": \"<string>\",\n \"type\": \"directStreaming\"\n}"
response = http.request(request)
puts response.read_body{
"rooms": [
{
"_id": "<string>",
"targetId": "<string>",
"referenceType": "post",
"referenceId": "<string>",
"liveChannelId": "<string>",
"liveChatEnabled": true,
"title": "<string>",
"roomId": "<string>",
"description": "<string>",
"thumbnailFileId": "<string>",
"participants": [
{
"userId": "<string>",
"userInternalId": "64be1f6cb9b4106b5a6bbf3f"
}
],
"livePlaybackUrl": "https://stream.example.com/someid.m3u8?token=token",
"liveThumbnailUrl": "https://image.example.com/someid/thumbnail.png?token=token",
"recordedPlaybackInfos": [
{
"url": "https://apix.eu.amity.co/api/v1/rooms/roomid/recorded/someid/watch",
"thumbnailUrl": "https://apix.eu.amity.co/api/v1/rooms/roomid/recorded/someid/thumbnail"
}
],
"durationSeconds": 123,
"moderation": {
"flagLabels": [
{
"category": "<string>",
"threshold": 123,
"detectedAt": "2023-11-07T05:31:56Z"
}
],
"terminateLabels": [
{
"category": "<string>",
"threshold": 123,
"detectedAt": "2023-11-07T05:31:56Z"
}
],
"updatedAt": "2023-11-07T05:31:56Z"
},
"parentRoomId": "<string>",
"childRoomIds": [],
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"creatorInternalId": "64be1f6cb9b4106b5a6bbf3f",
"updatedAt": "2023-11-07T05:31:56Z",
"liveAt": "2023-11-07T05:31:56Z",
"endedAt": "2023-11-07T05:31:56Z",
"recordedAt": "2023-11-07T05:31:56Z",
"isDeleted": true,
"deletedAt": "2023-11-07T05:31:56Z",
"deletedBy": "<string>",
"path": "<string>",
"metadata": {}
}
],
"roomChildrens": [
{
"_id": "<string>",
"targetId": "<string>",
"referenceType": "post",
"referenceId": "<string>",
"liveChannelId": "<string>",
"liveChatEnabled": true,
"title": "<string>",
"roomId": "<string>",
"description": "<string>",
"thumbnailFileId": "<string>",
"participants": [
{
"userId": "<string>",
"userInternalId": "64be1f6cb9b4106b5a6bbf3f"
}
],
"livePlaybackUrl": "https://stream.example.com/someid.m3u8?token=token",
"liveThumbnailUrl": "https://image.example.com/someid/thumbnail.png?token=token",
"recordedPlaybackInfos": [
{
"url": "https://apix.eu.amity.co/api/v1/rooms/roomid/recorded/someid/watch",
"thumbnailUrl": "https://apix.eu.amity.co/api/v1/rooms/roomid/recorded/someid/thumbnail"
}
],
"durationSeconds": 123,
"moderation": {
"flagLabels": [
{
"category": "<string>",
"threshold": 123,
"detectedAt": "2023-11-07T05:31:56Z"
}
],
"terminateLabels": [
{
"category": "<string>",
"threshold": 123,
"detectedAt": "2023-11-07T05:31:56Z"
}
],
"updatedAt": "2023-11-07T05:31:56Z"
},
"parentRoomId": "<string>",
"childRoomIds": [],
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"creatorInternalId": "64be1f6cb9b4106b5a6bbf3f",
"updatedAt": "2023-11-07T05:31:56Z",
"liveAt": "2023-11-07T05:31:56Z",
"endedAt": "2023-11-07T05:31:56Z",
"recordedAt": "2023-11-07T05:31:56Z",
"isDeleted": true,
"deletedAt": "2023-11-07T05:31:56Z",
"deletedBy": "<string>",
"path": "<string>",
"metadata": {}
}
],
"users": [
{
"userId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"_id": "<string>",
"path": "<string>",
"userInternalId": "<string>",
"userPublicId": "<string>",
"roles": [
"<string>"
],
"permissions": [],
"displayName": "<string>",
"profileHandle": "<string>",
"description": "<string>",
"avatarFileId": "<string>",
"avatarCustomUrl": "<string>",
"flagCount": 123,
"hashFlag": {
"bits": 123,
"hashes": 123,
"hash": [
"<string>"
]
},
"metadata": {},
"isGlobalBan": true,
"isBrand": true,
"isDeleted": true
}
],
"files": [
{
"fileId": "<string>",
"fileUrl": "<string>",
"accessType": "public",
"altText": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"attributes": {
"name": "<string>",
"extension": "<string>",
"size": 123,
"mimeType": "<string>",
"metadata": {
"exif": {},
"gps": {},
"height": 123,
"width": 123,
"isFull": true
}
}
}
]
}{
"status": "error",
"code": 400000,
"message": "Bad Request."
}{
"status": "error",
"code": 400400,
"message": "Resource Not Found."
}{
"status": "error",
"code": 500000,
"message": "Unexpected error"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Information of room to be created
Room title
Maximum string length:
1000Room description
Maximum string length:
5000Thumbnail file ID
Maximum string length:
50Custom metadata
Indicates whether the live channel (chat) is enabled for the room
Optional parent room ID for creating child streams
Maximum string length:
50Type of room: directStreaming for single participant streaming, coHosts for multiple participants
Available options:
directStreaming, coHosts ⌘I