API Reference
Quests API
Create and manage quests and their step timelines in your realm. Any realm member can read quests they have access to. Creating, updating, and deleting quests, including their steps, requires the Collaborator role or above.
GET /api/v1/realms/:realmId/compendium/quests
Returns a paginated list of quests the authenticated user has access to, ordered by most recently updated. Filter by status or entityId to narrow the results. Any realm member can call this endpoint.
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. |
| status | string | Filter to quests with this status. One of the Quest Statuses listed below. |
| entityId | string | Filter to quests linked to this entity. |
Response
| Parameter | Type | Description |
|---|---|---|
| data* | QuestDisplay[] | Array of quest 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. |
curl https://realmsofshod.com/api/v1/realms/clxyz.../compendium/quests?status=active \
-H "Authorization: Bearer ros_your_token_here"{
"data": [
{
"id": "quest_abc...",
"realmId": "realm_xyz...",
"title": "The Silver Locket",
"hook": "A merchant offers coin for a locket lost in the sewers.",
"goalTitle": "Recover the locket",
"goalDescription": "Bring the locket back to the merchant.",
"rewardTitle": "50 gold",
"rewardDescription": "Paid on delivery.",
"mechanic": "fetch",
"motive": "wealth",
"source": "commission",
"isPublicToRealm": true,
"accessIds": [],
"entityIds": ["ent_def..."],
"steps": [],
"status": "proposed",
"originSceneId": null,
"createdAt": 1716500000000,
"updatedAt": 1716500000000
}
],
"nextCursor": null,
"hasMore": false
}POST /api/v1/realms/:realmId/compendium/quests
Creates a new quest in the realm with an empty step timeline. Requires the Collaborator role or above; members without it receive 404. The creating user is automatically added to the access list unless the quest is public to the realm. Returns 201 Created.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| realmId* | string | The realm ID. |
Request Body
| Parameter | Type | Description |
|---|---|---|
| title* | string | Display name of the quest. |
| hook* | string | How the quest began. |
| goalTitle* | string | Short summary of what must be done. |
| goalDescription* | string | How the party will know the goal is met. |
| reward* | { title: string, description: string } | null | The reward for completing the quest, or null for no reward. |
| mechanic* | string | null | Quest mechanic tag, or null. |
| motive* | string | null | Quest motive tag, or null. |
| source* | string | null | Quest source tag, or null. |
| entityIds | string[] | IDs of entities to link to this quest. Must belong to the realm. Defaults to an empty array. |
| isPublicToRealm | boolean | When true, every current and future realm member can view this quest. Defaults to false. |
| accessIds | string[] | User IDs to grant viewer access when isPublicToRealm is false. The creator is always included. Defaults to an empty array. |
Response (201)
| Parameter | Type | Description |
|---|---|---|
| id* | string | Unique quest identifier. |
| realmId* | string | The realm this quest belongs to. |
| title* | string | Display name of the quest. |
| hook* | string | How the quest began. |
| goalTitle* | string | Short summary of what must be done. |
| goalDescription* | string | How the party will know the goal is met. |
| rewardTitle* | string | null | What is promised for completing the quest, or null if there is no reward. |
| rewardDescription* | string | null | Details of the reward, or null. |
| mechanic* | string | null | Quest mechanic tag, or null. One of the Quest Mechanics listed below. |
| motive* | string | null | Quest motive tag, or null. One of the Quest Motives listed below. |
| source* | string | null | Quest source tag, or null. One of the Quest Sources listed below. |
| isPublicToRealm* | boolean | When true, every current and future realm member can view this quest. |
| accessIds* | string[] | User IDs that have viewer access to this quest. Ignored when isPublicToRealm is true. |
| entityIds* | string[] | IDs of entities linked to this quest. |
| steps* | QuestStep[] | The quest's event timeline, ordered oldest to newest. See QuestStep below. |
| status* | string | Derived from steps, never set directly. One of the Quest Statuses listed below. |
| originSceneId* | string | null | The scene this quest was created in, or null if it was created outside a session. |
| createdAt* | integer | Unix timestamp (ms) when the quest was created. |
| updatedAt* | integer | Unix timestamp (ms) when the quest was last updated. |
curl -X POST https://realmsofshod.com/api/v1/realms/clxyz.../compendium/quests \
-H "Authorization: Bearer ros_your_token_here" \
-H "Content-Type: application/json" \
-d '{
"title": "The Silver Locket",
"hook": "A merchant offers coin for a locket lost in the sewers.",
"goalTitle": "Recover the locket",
"goalDescription": "Bring the locket back to the merchant.",
"reward": {"title": "50 gold", "description": "Paid on delivery."},
"mechanic": "fetch",
"motive": "wealth",
"source": "commission",
"entityIds": [],
"isPublicToRealm": true,
"accessIds": []
}'{
"id": "quest_abc...",
"realmId": "realm_xyz...",
"title": "The Silver Locket",
"hook": "A merchant offers coin for a locket lost in the sewers.",
"goalTitle": "Recover the locket",
"goalDescription": "Bring the locket back to the merchant.",
"rewardTitle": "50 gold",
"rewardDescription": "Paid on delivery.",
"mechanic": "fetch",
"motive": "wealth",
"source": "commission",
"isPublicToRealm": true,
"accessIds": [],
"entityIds": [],
"steps": [],
"status": "proposed",
"originSceneId": null,
"createdAt": 1716500000000,
"updatedAt": 1716500000000
}GET /api/v1/realms/:realmId/compendium/quests/:questId
Returns a single quest, including its full step timeline. Returns 404 if the quest does not exist or the caller lacks viewer access. Any realm member with access to the quest can call this endpoint.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| realmId* | string | The realm ID. |
| questId* | string | The quest ID. |
Response
| Parameter | Type | Description |
|---|---|---|
| id* | string | Unique quest identifier. |
| realmId* | string | The realm this quest belongs to. |
| title* | string | Display name of the quest. |
| hook* | string | How the quest began. |
| goalTitle* | string | Short summary of what must be done. |
| goalDescription* | string | How the party will know the goal is met. |
| rewardTitle* | string | null | What is promised for completing the quest, or null if there is no reward. |
| rewardDescription* | string | null | Details of the reward, or null. |
| mechanic* | string | null | Quest mechanic tag, or null. One of the Quest Mechanics listed below. |
| motive* | string | null | Quest motive tag, or null. One of the Quest Motives listed below. |
| source* | string | null | Quest source tag, or null. One of the Quest Sources listed below. |
| isPublicToRealm* | boolean | When true, every current and future realm member can view this quest. |
| accessIds* | string[] | User IDs that have viewer access to this quest. Ignored when isPublicToRealm is true. |
| entityIds* | string[] | IDs of entities linked to this quest. |
| steps* | QuestStep[] | The quest's event timeline, ordered oldest to newest. See QuestStep below. |
| status* | string | Derived from steps, never set directly. One of the Quest Statuses listed below. |
| originSceneId* | string | null | The scene this quest was created in, or null if it was created outside a session. |
| createdAt* | integer | Unix timestamp (ms) when the quest was created. |
| updatedAt* | integer | Unix timestamp (ms) when the quest was last updated. |
QuestStep
| Parameter | Type | Description |
|---|---|---|
| id* | string | Unique step identifier. |
| type* | string | Step type. One of the Quest Step Types listed below. |
| note* | string | What happened during this step. |
| sceneId* | string | null | The scene this step was recorded in, or null if it was added outside a session. |
| createdAt* | integer | Unix timestamp (ms) when the step was added. |
| updatedAt* | integer | Unix timestamp (ms) when the step was last edited. |
curl https://realmsofshod.com/api/v1/realms/clxyz.../compendium/quests/quest_abc... \
-H "Authorization: Bearer ros_your_token_here"{
"id": "quest_abc...",
"realmId": "realm_xyz...",
"title": "The Silver Locket",
"hook": "A merchant offers coin for a locket lost in the sewers.",
"goalTitle": "Recover the locket",
"goalDescription": "Bring the locket back to the merchant.",
"rewardTitle": "50 gold",
"rewardDescription": "Paid on delivery.",
"mechanic": "fetch",
"motive": "wealth",
"source": "commission",
"isPublicToRealm": true,
"accessIds": [],
"entityIds": ["ent_def..."],
"steps": [
{
"id": "step_001...",
"type": "discovery",
"note": "The party learned the locket fell into the sewer grate on Mill Street.",
"sceneId": null,
"createdAt": 1716550000000,
"updatedAt": 1716550000000
}
],
"status": "active",
"originSceneId": null,
"createdAt": 1716500000000,
"updatedAt": 1716550000000
}PATCH /api/v1/realms/:realmId/compendium/quests/:questId
Updates one or more fields of an existing quest, including its visibility. All body fields are optional; supply only the fields you want to change. Requires the Collaborator role or above; there is no restriction to the quest's own creator. Returns 200 with the updated quest on success.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| realmId* | string | The realm ID. |
| questId* | string | The quest ID. |
Request Body
| Parameter | Type | Description |
|---|---|---|
| title | string | New title. Omit to keep the current value. |
| hook | string | New hook text. Omit to keep the current value. |
| goalTitle | string | New goal title. Omit to keep the current value. |
| goalDescription | string | New goal description. Omit to keep the current value. |
| reward | { title: string, description: string } | null | New reward, or null to remove it. Omit to keep the current value. |
| mechanic | string | null | New mechanic tag, or null to clear it. Omit to keep the current value. |
| motive | string | null | New motive tag, or null to clear it. Omit to keep the current value. |
| source | string | null | New source tag, or null to clear it. Omit to keep the current value. |
| entityIds | string[] | Replacement list of linked entity IDs. Omit to keep the current value. |
| isPublicToRealm | boolean | New visibility. Omit to keep the current value. |
| accessIds | string[] | Replacement access list, used when isPublicToRealm is false. Omit to keep the current value. |
Response
| Parameter | Type | Description |
|---|---|---|
| id* | string | Unique quest identifier. |
| realmId* | string | The realm this quest belongs to. |
| title* | string | Display name of the quest. |
| hook* | string | How the quest began. |
| goalTitle* | string | Short summary of what must be done. |
| goalDescription* | string | How the party will know the goal is met. |
| rewardTitle* | string | null | What is promised for completing the quest, or null if there is no reward. |
| rewardDescription* | string | null | Details of the reward, or null. |
| mechanic* | string | null | Quest mechanic tag, or null. One of the Quest Mechanics listed below. |
| motive* | string | null | Quest motive tag, or null. One of the Quest Motives listed below. |
| source* | string | null | Quest source tag, or null. One of the Quest Sources listed below. |
| isPublicToRealm* | boolean | When true, every current and future realm member can view this quest. |
| accessIds* | string[] | User IDs that have viewer access to this quest. Ignored when isPublicToRealm is true. |
| entityIds* | string[] | IDs of entities linked to this quest. |
| steps* | QuestStep[] | The quest's event timeline, ordered oldest to newest. See QuestStep below. |
| status* | string | Derived from steps, never set directly. One of the Quest Statuses listed below. |
| originSceneId* | string | null | The scene this quest was created in, or null if it was created outside a session. |
| createdAt* | integer | Unix timestamp (ms) when the quest was created. |
| updatedAt* | integer | Unix timestamp (ms) when the quest was last updated. |
curl -X PATCH https://realmsofshod.com/api/v1/realms/clxyz.../compendium/quests/quest_abc... \
-H "Authorization: Bearer ros_your_token_here" \
-H "Content-Type: application/json" \
-d '{"goalDescription":"Bring the locket back to the merchant before nightfall."}'{
"id": "quest_abc...",
"realmId": "realm_xyz...",
"title": "The Silver Locket",
"hook": "A merchant offers coin for a locket lost in the sewers.",
"goalTitle": "Recover the locket",
"goalDescription": "Bring the locket back to the merchant before nightfall.",
"rewardTitle": "50 gold",
"rewardDescription": "Paid on delivery.",
"mechanic": "fetch",
"motive": "wealth",
"source": "commission",
"isPublicToRealm": true,
"accessIds": [],
"entityIds": ["ent_def..."],
"steps": [],
"status": "proposed",
"originSceneId": null,
"createdAt": 1716500000000,
"updatedAt": 1716600000000
}DELETE /api/v1/realms/:realmId/compendium/quests/:questId
Permanently deletes a quest and its step timeline. Requires the Collaborator role or above. Returns 204 No Content on success.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| realmId* | string | The realm ID. |
| questId* | string | The quest ID. |
curl -X DELETE https://realmsofshod.com/api/v1/realms/clxyz.../compendium/quests/quest_abc... \
-H "Authorization: Bearer ros_your_token_here"POST /api/v1/realms/:realmId/compendium/quests/:questId/steps
Adds a step to the end of a quest's timeline. Requires the Collaborator role or above. Returns 400 if the quest already has an ending step (completed, failed, or abandoned). A quest can have at most one ending step, and it must be the last one. Returns 201 Created with the full updated quest.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| realmId* | string | The realm ID. |
| questId* | string | The quest ID. |
Request Body
| Parameter | Type | Description |
|---|---|---|
| type* | string | Step type. One of the Quest Step Types listed below. |
| note* | string | What happened during this step. |
Response (201)
| Parameter | Type | Description |
|---|---|---|
| id* | string | Unique quest identifier. |
| realmId* | string | The realm this quest belongs to. |
| title* | string | Display name of the quest. |
| hook* | string | How the quest began. |
| goalTitle* | string | Short summary of what must be done. |
| goalDescription* | string | How the party will know the goal is met. |
| rewardTitle* | string | null | What is promised for completing the quest, or null if there is no reward. |
| rewardDescription* | string | null | Details of the reward, or null. |
| mechanic* | string | null | Quest mechanic tag, or null. One of the Quest Mechanics listed below. |
| motive* | string | null | Quest motive tag, or null. One of the Quest Motives listed below. |
| source* | string | null | Quest source tag, or null. One of the Quest Sources listed below. |
| isPublicToRealm* | boolean | When true, every current and future realm member can view this quest. |
| accessIds* | string[] | User IDs that have viewer access to this quest. Ignored when isPublicToRealm is true. |
| entityIds* | string[] | IDs of entities linked to this quest. |
| steps* | QuestStep[] | The quest's event timeline, ordered oldest to newest. See QuestStep below. |
| status* | string | Derived from steps, never set directly. One of the Quest Statuses listed below. |
| originSceneId* | string | null | The scene this quest was created in, or null if it was created outside a session. |
| createdAt* | integer | Unix timestamp (ms) when the quest was created. |
| updatedAt* | integer | Unix timestamp (ms) when the quest was last updated. |
curl -X POST https://realmsofshod.com/api/v1/realms/clxyz.../compendium/quests/quest_abc.../steps \
-H "Authorization: Bearer ros_your_token_here" \
-H "Content-Type: application/json" \
-d '{"type":"completed","note":"The party returned the locket and collected their reward."}'PATCH /api/v1/realms/:realmId/compendium/quests/:questId/steps/:stepId
Updates one or more fields of an existing step. Both body fields are optional; supply only the fields you want to change. Only the latest step on the timeline can be changed into an ending step. Requires the Collaborator role or above. Returns 200 with the full updated quest on success.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| realmId* | string | The realm ID. |
| questId* | string | The quest ID. |
| stepId* | string | The quest step ID. |
Request Body
| Parameter | Type | Description |
|---|---|---|
| type | string | New step type. Omit to keep the current value. |
| note | string | New note text. Omit to keep the current value. |
Response
| Parameter | Type | Description |
|---|---|---|
| id* | string | Unique quest identifier. |
| realmId* | string | The realm this quest belongs to. |
| title* | string | Display name of the quest. |
| hook* | string | How the quest began. |
| goalTitle* | string | Short summary of what must be done. |
| goalDescription* | string | How the party will know the goal is met. |
| rewardTitle* | string | null | What is promised for completing the quest, or null if there is no reward. |
| rewardDescription* | string | null | Details of the reward, or null. |
| mechanic* | string | null | Quest mechanic tag, or null. One of the Quest Mechanics listed below. |
| motive* | string | null | Quest motive tag, or null. One of the Quest Motives listed below. |
| source* | string | null | Quest source tag, or null. One of the Quest Sources listed below. |
| isPublicToRealm* | boolean | When true, every current and future realm member can view this quest. |
| accessIds* | string[] | User IDs that have viewer access to this quest. Ignored when isPublicToRealm is true. |
| entityIds* | string[] | IDs of entities linked to this quest. |
| steps* | QuestStep[] | The quest's event timeline, ordered oldest to newest. See QuestStep below. |
| status* | string | Derived from steps, never set directly. One of the Quest Statuses listed below. |
| originSceneId* | string | null | The scene this quest was created in, or null if it was created outside a session. |
| createdAt* | integer | Unix timestamp (ms) when the quest was created. |
| updatedAt* | integer | Unix timestamp (ms) when the quest was last updated. |
curl -X PATCH https://realmsofshod.com/api/v1/realms/clxyz.../compendium/quests/quest_abc.../steps/step_001... \
-H "Authorization: Bearer ros_your_token_here" \
-H "Content-Type: application/json" \
-d '{"note":"The party learned the locket fell through a grate on Mill Street."}'DELETE /api/v1/realms/:realmId/compendium/quests/:questId/steps/:stepId
Permanently deletes a step from a quest's timeline. Deleting an ending step reopens the quest. Requires the Collaborator role or above. Returns 200 with the full updated quest on success.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| realmId* | string | The realm ID. |
| questId* | string | The quest ID. |
| stepId* | string | The quest step ID. |
Response
| Parameter | Type | Description |
|---|---|---|
| id* | string | Unique quest identifier. |
| realmId* | string | The realm this quest belongs to. |
| title* | string | Display name of the quest. |
| hook* | string | How the quest began. |
| goalTitle* | string | Short summary of what must be done. |
| goalDescription* | string | How the party will know the goal is met. |
| rewardTitle* | string | null | What is promised for completing the quest, or null if there is no reward. |
| rewardDescription* | string | null | Details of the reward, or null. |
| mechanic* | string | null | Quest mechanic tag, or null. One of the Quest Mechanics listed below. |
| motive* | string | null | Quest motive tag, or null. One of the Quest Motives listed below. |
| source* | string | null | Quest source tag, or null. One of the Quest Sources listed below. |
| isPublicToRealm* | boolean | When true, every current and future realm member can view this quest. |
| accessIds* | string[] | User IDs that have viewer access to this quest. Ignored when isPublicToRealm is true. |
| entityIds* | string[] | IDs of entities linked to this quest. |
| steps* | QuestStep[] | The quest's event timeline, ordered oldest to newest. See QuestStep below. |
| status* | string | Derived from steps, never set directly. One of the Quest Statuses listed below. |
| originSceneId* | string | null | The scene this quest was created in, or null if it was created outside a session. |
| createdAt* | integer | Unix timestamp (ms) when the quest was created. |
| updatedAt* | integer | Unix timestamp (ms) when the quest was last updated. |
curl -X DELETE https://realmsofshod.com/api/v1/realms/clxyz.../compendium/quests/quest_abc.../steps/step_001... \
-H "Authorization: Bearer ros_your_token_here"The mechanic, motive, and source fields are optional tags. The status field is always derived from the step timeline and cannot be set directly: add a step with an ending type to move a quest out of active.
Quest Mechanics
| Type | Description |
|---|---|
| fetch | Retrieve an item or person. |
| deliver | Bring something to a destination. |
| escort | Protect someone on a journey. |
| rescue | Free someone from danger or captivity. |
| hunt | Track down and defeat a target. |
| defend | Hold a position against a threat. |
| investigate | Uncover facts or solve a mystery. |
| explore | Chart or discover unknown territory. |
| infiltrate | Get in and out undetected. |
| negotiate | Reach an agreement between parties. |
| sabotage | Disrupt an opponent's plans or assets. |
| escape | Get away from danger or confinement. |
| heist | Steal something of value. |
| build | Construct or establish something. |
| recruit | Bring someone onto the party's side. |
| other | A mechanic that does not fit the list above. |
Quest Motives
| Type | Description |
|---|---|
| justice | Righting a wrong. |
| vengeance | Settling a score. |
| wealth | Pursuing riches. |
| duty | An obligation that must be honored. |
| survival | Staying alive. |
| goodwill | Helping simply because it is good. |
| loyalty | Standing by an ally or cause. |
| curiosity | Wanting to know more. |
| glory | Seeking renown. |
| power | Gaining influence or control. |
| faith | Acting on belief or devotion. |
| redemption | Making amends for the past. |
| coercion | Acting under threat or blackmail. |
| other | A motive that does not fit the list above. |
Quest Sources
| Type | Description |
|---|---|
| commission | Hired for pay. |
| request | Asked for by someone in need. |
| order | Handed down by an authority. |
| rumor | Heard secondhand. |
| discovery | Stumbled upon. |
| crisis | Forced by an unfolding emergency. |
| backstory | Rooted in a character's history. |
| self_directed | The party set this goal themselves. |
| omen | Foretold or foreshadowed. |
| consequence | A direct result of an earlier choice. |
| other | A source that does not fit the list above. |
Quest Step Types — Progress
| Type | Description |
|---|---|
| discovery | The party learned something new. |
| milestone | A meaningful step forward. |
| complication | Something made the quest harder. |
| clock_tick | Time or pressure advanced. |
| encounter | A confrontation or meeting occurred. |
| atmosphere | Color or mood without plot movement. |
| decision | The party made a meaningful choice. |
Quest Step Types — Ending
| Type | Description |
|---|---|
| completed | The quest succeeded. Ends the quest. |
| failed | The quest failed. Ends the quest. |
| abandoned | The party gave up on the quest. Ends the quest. |
Quest Statuses
| Type | Description |
|---|---|
| proposed | The quest has no steps yet. |
| active | The quest has steps but no ending step. |
| completed | The latest ending step is completed. |
| failed | The latest ending step is failed. |
| abandoned | The latest ending step is abandoned. |
