Create rooms
Prerequisites
1) Create the script
import "dotenv/config";
import GospaceAI from "@gospace-ai/api";
async function main() {
const gospace = new GospaceAI(process.env.GOSPACE_API_KEY!);
const res = await gospace.spatial.createRooms({
rooms: [
{
layer_id: "layer_123", // required: the layer this room belongs to
name: "Conference Room A", // required: room name
spaces: ["space_001", "space_002"], // assign existing space IDs
// external_id: "conf-a", // optional
},
{
layer_id: "layer_123",
name: "Focus Room 1",
spaces: ["space_003"], // single space assigned to the room
}
],
});
console.log(JSON.stringify(res.data, null, 2));
}
main().catch((err) => {
console.error("Request failed:", err);
process.exit(1);
});2) Run the script
3) (Optional) Verify rooms and their spaces
Last updated
Was this helpful?