World Rules
World rules define the canon of a project — physics, lore constraints, and character behavioral rules. They are fed into AI prompts to ensure consistency across all generated content.
Endpoints overview
| Method | Endpoint | Permission | Description |
|---|---|---|---|
GET | /api/world-rules | authenticated | List all world rules |
GET | /api/world-rules/project/:projectId | authenticated | List rules by project |
GET | /api/world-rules/:id | authenticated | Get world rule by ID |
POST | /api/world-rules | world_rule:create | Create a world rule |
PUT / PATCH | /api/world-rules/:id | world_rule:edit | Update a world rule |
DELETE | /api/world-rules/:id | world_rule:delete | Delete a world rule |
Endpoints
List all world rules
GET /api/world-rules — Auth required
Response — 200
[
{
"id": "wr-uuid-001",
"text": "No magic is allowed inside the lab. All technology must have a plausible scientific basis.",
"textI18n": {
"uk": "У лабораторії магія заборонена.",
"en": "No magic is allowed inside the lab.",
"es": "No se permite magia dentro del laboratorio."
},
"createdAt": "2025-01-15T10:00:00.000Z",
"updatedAt": "2025-01-15T10:00:00.000Z"
}
]
List world rules by project
GET /api/world-rules/project/:projectId — Auth required
Response — 200 — array of world rule objects (same shape as above)
Get world rule by ID
GET /api/world-rules/:id — Auth required
Response — 200 — single world rule object
Create world rule
POST /api/world-rules — Auth required, Permission: world_rule:create
Request body
{
"projectId": "proj-uuid-001",
"text": "No magic is allowed inside the lab."
}
| Field | Required | Notes |
|---|---|---|
projectId | yes | UUID of the parent project |
text | yes | The rule text; auto-translated to all locales |
Response — 201
{
"id": "wr-uuid-002",
"text": "No magic is allowed inside the lab.",
"textI18n": {
"uk": "У лабораторії магія заборонена.",
"en": "No magic is allowed inside the lab.",
"es": "No se permite magia dentro del laboratorio."
},
"createdAt": "2025-04-01T12:00:00.000Z",
"updatedAt": "2025-04-01T12:00:00.000Z"
}
Update world rule
PUT /api/world-rules/:id or PATCH /api/world-rules/:id — Auth required, Permission: world_rule:edit
Request body (all fields optional)
{
"text": "No magic or supernatural abilities are allowed anywhere in the facility."
}
Response — 200 — updated world rule object
Delete world rule
DELETE /api/world-rules/:id — Auth required, Permission: world_rule:delete
Response — 204