---
title: "Create a world for an agent"
method: POST
path: "/api/agents/{agentId}/worlds"
tags: ["agents"]
---

# Create a world for an agent

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

## Request

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

Create a new world for a specific agent

## Path parameters

- `agentId` string, uuid, required

## Request body

- object
  - `name` string: Name of the world
  - `sourceType` string: Type of source (e.g., discord, telegram)
  - `sourceId` string: Platform-specific identifier
  - `metadata` object: Additional world metadata

## Response `201`

World created successfully

- object
  - `success` boolean
  - `data` object
    - `world` World
      - `id` string, uuid: Unique identifier for the world
      - `name` string: Name of the world
      - `agentId` string, uuid: ID of the agent that owns this world
      - `sourceType` string: Type of source (discord, telegram, etc)
      - `sourceId` string: Platform-specific identifier
      - `metadata` object: Additional world metadata

## Other responses

- `400`: Invalid agent ID or request
- `404`: Agent not found
- `500`: Error creating world

---

[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)
