API Reference
Compendium
Read and write entities and relationships in your realm's compendium. All members can read; only the realm creator can create, update, or delete.
GET /api/v1/realms/:realmId/compendium/entities
Returns a paginated list of entities in the realm, ordered newest first. Non-creator members only see entities their user ID appears in accessIds (or entities with an empty accessIds).
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| realmId* | string | The realm ID. |
Query Parameters
| Parameter | Type | Description |
|---|---|---|
| limit | integer | Number of results per page. Default: 50, maximum: 100. |
| cursor | string | Opaque pagination cursor from the previous response. Omit to start from the first page. |
Response
| Parameter | Type | Description |
|---|---|---|
| data* | Entity[] | Array of entity objects for this page. |
| nextCursor* | string | null | Cursor for the next page, or null on the last page. |
| hasMore* | boolean | True when additional pages exist. |
Entity
| Parameter | Type | Description |
|---|---|---|
| id* | string | Unique entity identifier. |
| name* | string | Display name of the entity. |
| type* | string | Entity type (e.g. character, location, faction). Varies by realm. |
| description* | string | null | Free-text description of the entity, or null. |
| accessIds* | string[] | User IDs that have viewer access to this entity. Empty array means accessible to all realm members. |
| coverImageUrl* | string | null | URL of the first image attached to this entity, or null if the entity has no images. |
| createdAt* | integer | Unix timestamp (ms) when the entity was created. |
curl https://realmsofshod.com/api/v1/realms/clxyz.../compendium/entities \
-H "Authorization: Bearer ros_your_token_here"{
"data": [
{
"id": "ent_abc...",
"name": "Elara Dusk",
"type": "character",
"description": "A wandering mage from the eastern provinces.",
"accessIds": [],
"coverImageUrl": "https://cdn.realmsofshod.com/entity-image/...",
"createdAt": 1716000000000
}
],
"nextCursor": "eyJjIjox...",
"hasMore": true
}GET /api/v1/realms/:realmId/compendium/entities/:entityId
Returns a single entity with its full notes and embedded relationship list. Returns 404 if the entity does not exist or the caller lacks viewer access.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| realmId* | string | The realm ID. |
| entityId* | string | The entity ID. |
Response
| Parameter | Type | Description |
|---|---|---|
| id* | string | Unique entity identifier. |
| name* | string | Display name of the entity. |
| type* | string | Entity type. |
| description* | string | null | Free-text description, or null. |
| notes* | string | Extended notes for the entity (may be empty string). |
| accessIds* | string[] | User IDs with viewer access. |
| images* | EntityImage[] | Ordered array of images attached to this entity. Empty array if none. |
| relationships* | Relationship[] | Relationships involving this entity. See Relationship below. |
| createdAt* | integer | Unix timestamp (ms). |
| updatedAt* | integer | Unix timestamp (ms). |
EntityImage
| Parameter | Type | Description |
|---|---|---|
| id* | string | Unique image identifier. |
| order* | integer | Zero-based display order. The image with order 0 is the cover image. |
| imageUrl* | string | Public URL of the image. |
Relationship
| Parameter | Type | Description |
|---|---|---|
| id* | string | Relationship ID. |
| type* | string | Relationship type. |
| fromEntityId* | string | ID of the source entity. |
| toEntityId* | string | ID of the target entity. |
| accessIds* | string[] | User IDs with viewer access. |
| entity* | EntityStub | The other entity in the relationship: { id, type, name }. |
curl https://realmsofshod.com/api/v1/realms/clxyz.../compendium/entities/ent_abc... \
-H "Authorization: Bearer ros_your_token_here"{
"id": "ent_abc...",
"name": "Elara Dusk",
"type": "character",
"description": "A wandering mage from the eastern provinces.",
"notes": "First appeared in session 3. May be connected to the Silver Covenant.",
"accessIds": [],
"images": [
{ "id": "img_001...", "order": 0, "imageUrl": "https://cdn.realmsofshod.com/entity-image/..." },
{ "id": "img_002...", "order": 1, "imageUrl": "https://cdn.realmsofshod.com/entity-image/..." }
],
"relationships": [
{
"id": "rel_xyz...",
"type": "allied_with",
"fromEntityId": "ent_abc...",
"toEntityId": "ent_def...",
"accessIds": [],
"entity": {
"id": "ent_def...",
"type": "faction",
"name": "The Silver Covenant"
}
}
],
"createdAt": 1716000000000,
"updatedAt": 1716500000000
}POST /api/v1/realms/:realmId/compendium/entities
Creates a new entity in the realm. Requires the authenticated user to be the realm creator; other members receive 404. Returns 201 Created.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| realmId* | string | The realm ID. |
Request Body
| Parameter | Type | Description |
|---|---|---|
| name* | string | Display name of the entity. |
| type* | string | Entity type. Must be a valid type for this realm. |
| description* | string | null | Description text, or null to leave blank. |
| accessIds* | string[] | User IDs to grant viewer access. Pass an empty array for realm-wide access. |
Response (201)
| Parameter | Type | Description |
|---|---|---|
| id* | string | ID of the newly created entity. |
| name* | string | Name of the entity. |
| type* | string | Entity type. |
| description* | string | null | Description, or null. |
| accessIds* | string[] | Granted access IDs. |
curl -X POST https://realmsofshod.com/api/v1/realms/clxyz.../compendium/entities \
-H "Authorization: Bearer ros_your_token_here" \
-H "Content-Type: application/json" \
-d '{"name":"Elara Dusk","type":"character","description":"A wandering mage","accessIds":[]}'{
"id": "ent_abc...",
"name": "Elara Dusk",
"type": "character",
"description": "A wandering mage",
"accessIds": []
}PATCH /api/v1/realms/:realmId/compendium/entities/:entityId
Updates one or more fields of an existing entity. All body fields are optional; supply only the fields you want to change. Requires realm creator access.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| realmId* | string | The realm ID. |
| entityId* | string | The entity ID. |
Request Body
| Parameter | Type | Description |
|---|---|---|
| name | string | New display name. Omit to keep the current value. |
| type | string | New entity type. Omit to keep the current value. |
| description | string | null | New description, null to clear it, or omit to keep the current value. |
| accessIds | string[] | Replacement access list. Omit to keep the current value. |
Returns 200 with the updated entity on success.
curl -X PATCH https://realmsofshod.com/api/v1/realms/clxyz.../compendium/entities/ent_abc... \
-H "Authorization: Bearer ros_your_token_here" \
-H "Content-Type: application/json" \
-d '{"description":"Updated description"}'{
"id": "ent_abc...",
"name": "Elara Dusk",
"type": "character",
"description": "Updated description",
"accessIds": [],
"coverImageUrl": "https://cdn.realmsofshod.com/entity-image/..."
}GET /api/v1/realms/:realmId/compendium/relationships
Returns a paginated list of relationships in the realm, ordered newest first. Note that relationship rows do not include the names of the connected entities. Use the entity endpoints to resolve IDs to names.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| realmId* | string | The realm ID. |
Query Parameters
| Parameter | Type | Description |
|---|---|---|
| limit | integer | Number of results per page. Default: 50, maximum: 100. |
| cursor | string | Opaque pagination cursor from the previous response. |
Response
| Parameter | Type | Description |
|---|---|---|
| data* | Relationship[] | Array of relationship objects for this page. |
| nextCursor* | string | null | Cursor for the next page, or null on the last page. |
| hasMore* | boolean | True when additional pages exist. |
Relationship
| Parameter | Type | Description |
|---|---|---|
| id* | string | Unique relationship identifier. |
| type* | string | Relationship type. |
| fromEntityId* | string | ID of the source entity. |
| toEntityId* | string | ID of the target entity. |
| accessIds* | string[] | User IDs with viewer access. |
| createdAt* | integer | Unix timestamp (ms). |
curl https://realmsofshod.com/api/v1/realms/clxyz.../compendium/relationships \
-H "Authorization: Bearer ros_your_token_here"{
"data": [
{
"id": "rel_xyz...",
"type": "allied_with",
"fromEntityId": "ent_abc...",
"toEntityId": "ent_def...",
"accessIds": [],
"createdAt": 1716000000000
}
],
"nextCursor": null,
"hasMore": false
}POST /api/v1/realms/:realmId/compendium/relationships
Creates a new relationship between two entities. Requires realm creator access. Returns 201 Created with the new relationship ID.
Returns 409 RELATIONSHIP_EXISTS if an identical relationship already exists, or 400 INVALID_ENTITY if either entity ID does not belong to the realm.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| realmId* | string | The realm ID. |
Request Body
| Parameter | Type | Description |
|---|---|---|
| type* | string | Relationship type. |
| fromEntityId* | string | ID of the source entity. Must belong to the realm. |
| toEntityId* | string | ID of the target entity. Must belong to the realm. |
| accessIds* | string[] | User IDs to grant viewer access. Pass an empty array for realm-wide access. |
curl -X POST https://realmsofshod.com/api/v1/realms/clxyz.../compendium/relationships \
-H "Authorization: Bearer ros_your_token_here" \
-H "Content-Type: application/json" \
-d '{"type":"allied_with","fromEntityId":"ent_abc...","toEntityId":"ent_def...","accessIds":[]}'{ "id": "rel_xyz..." }DELETE /api/v1/realms/:realmId/compendium/relationships/:relationshipId
Permanently deletes a relationship. Requires realm creator access. Returns 204 No Content with an empty body on success.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| realmId* | string | The realm ID. |
| relationshipId* | string | The relationship ID to delete. |
curl -X DELETE https://realmsofshod.com/api/v1/realms/clxyz.../compendium/relationships/rel_xyz... \
-H "Authorization: Bearer ros_your_token_here"