Realms of Shod logo

Realms of Shod

Overview
  • Getting Started

    • Quickstart
    • Storytelling
    • Using the H.U.B.
    • Sculpting Realms
    • Collaborating
    • Coins
  • Understanding the Interface

    • Navigation
    • Media Controls
    • Story Tools
  • Realms Sandbox

    • Play Modes
    • Gamestream
    • Transcripts
    • Compendium
  • World Building

    • Import / Export
    • Entities
  • Integrations

    • Discord
  • API Reference

    • Authentication
    • Realms API
    • Compendium API
    • Sessions API
  • Support

    • FAQs
    • Contact & Feedback
    • Privacy
Compendium API

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

ParameterTypeDescription
realmId*stringThe realm ID.

Query Parameters

ParameterTypeDescription
limitintegerNumber of results per page. Default: 50, maximum: 100.
cursorstringOpaque pagination cursor from the previous response. Omit to start from the first page.

Response

ParameterTypeDescription
data*Entity[]Array of entity objects for this page.
nextCursor*string | nullCursor for the next page, or null on the last page.
hasMore*booleanTrue when additional pages exist.

Entity

ParameterTypeDescription
id*stringUnique entity identifier.
name*stringDisplay name of the entity.
type*stringEntity type (e.g. character, location, faction). Varies by realm.
description*string | nullFree-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 | nullURL of the first image attached to this entity, or null if the entity has no images.
createdAt*integerUnix 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

ParameterTypeDescription
realmId*stringThe realm ID.
entityId*stringThe entity ID.

Response

ParameterTypeDescription
id*stringUnique entity identifier.
name*stringDisplay name of the entity.
type*stringEntity type.
description*string | nullFree-text description, or null.
notes*stringExtended 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*integerUnix timestamp (ms).
updatedAt*integerUnix timestamp (ms).

EntityImage

ParameterTypeDescription
id*stringUnique image identifier.
order*integerZero-based display order. The image with order 0 is the cover image.
imageUrl*stringPublic URL of the image.

Relationship

ParameterTypeDescription
id*stringRelationship ID.
type*stringRelationship type.
fromEntityId*stringID of the source entity.
toEntityId*stringID of the target entity.
accessIds*string[]User IDs with viewer access.
entity*EntityStubThe 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

ParameterTypeDescription
realmId*stringThe realm ID.

Request Body

ParameterTypeDescription
name*stringDisplay name of the entity.
type*stringEntity type. Must be a valid type for this realm.
description*string | nullDescription text, or null to leave blank.
accessIds*string[]User IDs to grant viewer access. Pass an empty array for realm-wide access.

Response (201)

ParameterTypeDescription
id*stringID of the newly created entity.
name*stringName of the entity.
type*stringEntity type.
description*string | nullDescription, 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

ParameterTypeDescription
realmId*stringThe realm ID.
entityId*stringThe entity ID.

Request Body

ParameterTypeDescription
namestringNew display name. Omit to keep the current value.
typestringNew entity type. Omit to keep the current value.
descriptionstring | nullNew description, null to clear it, or omit to keep the current value.
accessIdsstring[]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

ParameterTypeDescription
realmId*stringThe realm ID.

Query Parameters

ParameterTypeDescription
limitintegerNumber of results per page. Default: 50, maximum: 100.
cursorstringOpaque pagination cursor from the previous response.

Response

ParameterTypeDescription
data*Relationship[]Array of relationship objects for this page.
nextCursor*string | nullCursor for the next page, or null on the last page.
hasMore*booleanTrue when additional pages exist.

Relationship

ParameterTypeDescription
id*stringUnique relationship identifier.
type*stringRelationship type.
fromEntityId*stringID of the source entity.
toEntityId*stringID of the target entity.
accessIds*string[]User IDs with viewer access.
createdAt*integerUnix 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

ParameterTypeDescription
realmId*stringThe realm ID.

Request Body

ParameterTypeDescription
type*stringRelationship type.
fromEntityId*stringID of the source entity. Must belong to the realm.
toEntityId*stringID 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

ParameterTypeDescription
realmId*stringThe realm ID.
relationshipId*stringThe 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"
← Previous: Realms APINext Sessions API →