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

# Create a room

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

## Request

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

Create a new room for an agent

## Path parameters

- `agentId` string, uuid, required

## Request body

- object
  - `name` string, required: Name of the room
  - `type` 'DM' | 'GROUP' | 'CHANNEL': Type of room
  - `source` string: Source of the room
  - `worldId` string, uuid: ID of the world
  - `serverId` string: Server ID
  - `metadata` object: Additional room metadata

## Response `201`

Room created successfully

- object
  - `success` boolean
  - `data` object
    - `id` string, uuid
    - `name` string
    - `agentId` string, uuid
    - `createdAt` integer
    - `source` string
    - `type` string
    - `worldId` string, uuid
    - `serverId` string
    - `metadata` object

## Other responses

- `400`: Invalid agent ID or missing required fields
- `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)
