REST API Reference¶
This reference is auto-generated from the FastAPI application's OpenAPI schema. Start the server with archetype serve (default: http://localhost:8000).
Worlds¶
List Worlds¶
GET /worlds
Create World¶
POST /worlds
Request body:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
name |
string | null | No | — | Name |
storage_uri |
string | No | "./archetype_data" |
Storage Uri |
namespace |
string | No | "archetypes" |
Namespace |
Response (200):
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
world_id |
string | Yes | — | World Id |
name |
string | null | No | — | Name |
tick |
integer | No | 0 |
Tick |
entity_count |
integer | No | 0 |
Entity Count |
Error codes: 422
Get World¶
GET /worlds/{world_id}
Path parameters:
| Parameter | Type | Description |
|---|---|---|
world_id |
string |
Response (200):
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
world_id |
string | Yes | — | World Id |
name |
string | null | No | — | Name |
tick |
integer | No | 0 |
Tick |
entity_count |
integer | No | 0 |
Entity Count |
Error codes: 422
Remove World¶
DELETE /worlds/{world_id}
Path parameters:
| Parameter | Type | Description |
|---|---|---|
world_id |
string |
Error codes: 422
Fork World¶
POST /worlds/{world_id}/fork
Path parameters:
| Parameter | Type | Description |
|---|---|---|
world_id |
string |
Request body:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
name |
string | null | No | — | Name |
Response (200):
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
world_id |
string | Yes | — | World Id |
name |
string | null | No | — | Name |
tick |
integer | No | 0 |
Tick |
entity_count |
integer | No | 0 |
Entity Count |
Error codes: 422
Commands¶
Submit Command¶
POST /worlds/{world_id}/commands
Path parameters:
| Parameter | Type | Description |
|---|---|---|
world_id |
string |
Request body:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
type |
string | No | "custom" |
Type |
tick |
integer | No | 0 |
Tick |
payload |
object | No | — | Payload |
priority |
integer | No | 0 |
Priority |
Response (200):
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
id |
string | Yes | — | Id |
type |
string | Yes | — | Type |
tick |
integer | Yes | — | Tick |
priority |
integer | Yes | — | Priority |
Error codes: 422
Get Command History¶
GET /worlds/{world_id}/commands
Path parameters:
| Parameter | Type | Description |
|---|---|---|
world_id |
string |
Query parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
limit |
integer | 100 |
Error codes: 422
Submit Batch¶
POST /worlds/{world_id}/commands/batch
Path parameters:
| Parameter | Type | Description |
|---|---|---|
world_id |
string |
Request body:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
commands |
array[SubmitCommandRequest] | Yes | — | Commands |
Error codes: 422
Get Pending Count¶
GET /worlds/{world_id}/commands/pending
Path parameters:
| Parameter | Type | Description |
|---|---|---|
world_id |
string |
Error codes: 422
Simulation¶
Step World¶
POST /worlds/{world_id}/step
Path parameters:
| Parameter | Type | Description |
|---|---|---|
world_id |
string |
Request body:
Error codes: 422
Run World¶
POST /worlds/{world_id}/run
Path parameters:
| Parameter | Type | Description |
|---|---|---|
world_id |
string |
Request body:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
num_steps |
integer | No | 1 |
Num Steps |
debug |
boolean | No | false |
Debug |
Response (200):
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
run_id |
string | Yes | — | Run Id |
world_id |
string | Yes | — | World Id |
ticks_completed |
integer | Yes | — | Ticks Completed |
commands_applied |
integer | Yes | — | Commands Applied |
final_tick |
integer | Yes | — | Final Tick |
Error codes: 422
List Processors¶
GET /worlds/{world_id}/processors
Path parameters:
| Parameter | Type | Description |
|---|---|---|
world_id |
string |
Error codes: 422
Query¶
Get World State¶
GET /worlds/{world_id}/state
Path parameters:
| Parameter | Type | Description |
|---|---|---|
world_id |
string |
Query parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
tick |
string | — |
Error codes: 422
Get Entity¶
GET /worlds/{world_id}/entities/{entity_id}
Path parameters:
| Parameter | Type | Description |
|---|---|---|
world_id |
string | |
entity_id |
integer |
Query parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
tick |
string | — |
Error codes: 422
Get Components¶
GET /worlds/{world_id}/components
Path parameters:
| Parameter | Type | Description |
|---|---|---|
world_id |
string |
Query parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
types |
string | "" |
Error codes: 422
Get Command History¶
GET /worlds/{world_id}/history
Path parameters:
| Parameter | Type | Description |
|---|---|---|
world_id |
string |
Query parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
limit |
integer | 100 |
Error codes: 422
Other¶
Root¶
GET /