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

# Create a room

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

## Request

- Base URL: `http://localhost:3000`
- URL: `http://localhost:3000/api/agents/{agentId}/rooms`
- Auth: none declared

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.dev/elizaos/apis/eliza-os-api.md) - [All operations](https://skmtc.dev/elizaos/apis/eliza-os-api/llms.txt) - [OpenAPI document](https://skmtc.dev/elizaos/apis/eliza-os-api/revisions/d606a12682bb?raw)
