---
title: "Create a room"
method: POST
path: "/api/agents/{agentId}/rooms"
tags: ["rooms", "agents"]
---

# Create a room

`POST /api/agents/{agentId}/rooms`

Creates a new room for an agent

## Path parameters

- `agentId` string, uuid, required

## Request body

- object
  - `name` string — Name of the room
  - `worldId` string, uuid — ID of the world
  - `roomId` string, uuid — Optional custom room ID
  - `entityId` string, uuid — Entity ID to add to the room

## Response `201`

Room created successfully

- object
  - `success` boolean
  - `data` Room
    - `id` string, uuid — Unique identifier for the room
    - `name` string — Name of the room
    - `source` string — Source of the room
    - `worldId` string, uuid — ID of the world this room belongs to
    - `entities` object[] — Entities in this room
      - `id` string, uuid
      - `name` string

## Other responses

- `400` — Invalid agent ID
- `404` — Agent not found
- `500` — Error creating room

---

[API](https://skmtc.net/elizaos/apis/eliza-os-api.md) · [All operations](https://skmtc.net/elizaos/apis/eliza-os-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/elizaos/eliza-os-api/revisions/f43280bfdb0c/schema)
