Entities¶
Entities are the nouns of the world — players, characters, NPCs, groups, locations,
maps, and items — every one a ### heading block in nerthus.entities.md. This page
covers reading, searching, creating, editing, renaming, and retiring them. Names are
URL-encoded in the path; the examples use the canonical
session: the character Eraster (owned by the
Gracz Stefan), Lord Tussal, and the NPC Opat Perrin.
Reads need entity.read, writes need entity.write. Every example runs against a live
daemon — see how the reference is tested.
Routes¶
| Method | Path | Cmdlet | Cap | Write |
|---|---|---|---|---|
| GET | /entities |
Find-NerthusEntity |
entity.read |
— |
| GET | /entities/integrity |
Test-NerthusEntityIntegrity |
entity.read |
— |
| GET | /entities/{name} |
Get-NerthusEntity |
entity.read |
— |
| GET | /entities/{name}/player |
— (owning Gracz of a Postać) | entity.read |
— |
| GET | /entities/{name}/history |
Get-NerthusEntityHistory |
log.read |
— |
| GET | /entities/{name}/sessions |
Get-NerthusEntitySessionProfile |
session.read |
— |
| GET | /entities/{name}/path |
Get-NerthusEntityPath |
entity.read |
— |
| POST | /entities |
New-NerthusEntity |
entity.write |
✓ |
| PATCH | /entities/{name} |
Set-NerthusEntity |
entity.write |
✓ |
| DELETE | /entities/{name} |
Remove-NerthusEntity |
entity.write |
✓ |
| POST | /entities/{name}/name |
Set-NerthusEntityName |
entity.write |
✓ |
Cap is the required capability (— = public, no token); Write (✓) marks routes that pass the write gate; a — in Cmdlet is reached directly, no wrapper. Paths are relative to /v1/api; the cross-cutting contract — middleware, envelopes, status codes — is on the API reference index.
POST /entities/{name}/name (body { name }) renames the block heading: it keeps the old name as an @alias, retargets exact @należy_do references, and answers 409 when the new name is already taken.
List and search entities¶
GET /v1/api/entities returns the { count, items } envelope. Filter with ?type=,
?status=, ?group=, ?location=, ?name= (substring). Here, the two characters.
Response 200 (trimmed):
{ "count": 2, "items": [
{ "Name": "Lord Tussal", "Type": "Postać", "Owner": "Roman" },
{ "Name": "Eraster", "Type": "Postać", "Owner": "Stefan" }
] }
Fetch one entity¶
GET /v1/api/entities/{name} resolves the name and returns the full projection.
Response 200 (trimmed):
The owning player of a character¶
GET /v1/api/entities/{name}/player returns the Gracz who owns a Postać.
Response 200 (trimmed):
Sessions an entity took part in¶
GET /v1/api/entities/{name}/sessions scans parsed metadata (@PU, @Uczestnicy,
locations) for the entity — needs session.read.
Response 200:
{ "entity": "Eraster", "count": 1, "sessions": [{ "header": "2026-07-01, Eraster rozmawia z Tussalem, Anward", "date": "2026-07-01" }] }
The audit history of an entity¶
GET /v1/api/entities/{name}/history returns audit lines touching the entity — needs
log.read.
Response 200:
Integrity check¶
GET /v1/api/entities/integrity reports schema findings across all entity blocks.
Response 200:
Preview a create without writing¶
?dryRun=true returns 200 { wouldCreate } and touches no disk — proven by the
follow-up 404. The scratch entity is a servant in Tussal's residence.
Response 200:
Create an entity¶
POST /v1/api/entities with a (name, type) — the pair must be unique. Type must be one
of the seven in the schema.
Response 201:
Rejected: duplicate¶
The same (name, type) twice is 409 — a duplicate heading would shadow the first.
Response 409:
{ "error": "a 'NPC' named 'Sługa Tussala' already exists — duplicate headings shadow each other; qualify the name (e.g. 'Sługa Tussala (Miasto)')" }
Fetch the created entity¶
Response 200 (trimmed):
Update a tag¶
PATCH /v1/api/entities/{name} sets one tag from the closed schema. Legacy ASCII
spellings canonicalize; an unknown tag is 422.
Response 200:
Rejected: unknown type¶
A type outside the closed schema is 422, nothing written. Here a real entity name with a
deliberately invalid type.
Response 422:
Rename an entity¶
POST /v1/api/entities/{name}/name renames the heading, keeps the old name as @alias,
and retargets @należy_do references.
Response 200:
Retire an entity (soft delete)¶
DELETE /v1/api/entities/{name} marks the block @status: Usunięty — never physical
removal.
Response 200: