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

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.
statusstringFilter to quests with this status. One of the Quest Statuses listed below.
entityIdstringFilter to quests linked to this entity.

Response

ParameterTypeDescription
data*QuestDisplay[]Array of quest objects for this page.
nextCursor*string | nullCursor for the next page, or null on the last page.
hasMore*booleanTrue 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

ParameterTypeDescription
realmId*stringThe realm ID.

Request Body

ParameterTypeDescription
title*stringDisplay name of the quest.
hook*stringHow the quest began.
goalTitle*stringShort summary of what must be done.
goalDescription*stringHow the party will know the goal is met.
reward*{ title: string, description: string } | nullThe reward for completing the quest, or null for no reward.
mechanic*string | nullQuest mechanic tag, or null.
motive*string | nullQuest motive tag, or null.
source*string | nullQuest source tag, or null.
entityIdsstring[]IDs of entities to link to this quest. Must belong to the realm. Defaults to an empty array.
isPublicToRealmbooleanWhen true, every current and future realm member can view this quest. Defaults to false.
accessIdsstring[]User IDs to grant viewer access when isPublicToRealm is false. The creator is always included. Defaults to an empty array.

Response (201)

ParameterTypeDescription
id*stringUnique quest identifier.
realmId*stringThe realm this quest belongs to.
title*stringDisplay name of the quest.
hook*stringHow the quest began.
goalTitle*stringShort summary of what must be done.
goalDescription*stringHow the party will know the goal is met.
rewardTitle*string | nullWhat is promised for completing the quest, or null if there is no reward.
rewardDescription*string | nullDetails of the reward, or null.
mechanic*string | nullQuest mechanic tag, or null. One of the Quest Mechanics listed below.
motive*string | nullQuest motive tag, or null. One of the Quest Motives listed below.
source*string | nullQuest source tag, or null. One of the Quest Sources listed below.
isPublicToRealm*booleanWhen 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*stringDerived from steps, never set directly. One of the Quest Statuses listed below.
originSceneId*string | nullThe scene this quest was created in, or null if it was created outside a session.
createdAt*integerUnix timestamp (ms) when the quest was created.
updatedAt*integerUnix 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

ParameterTypeDescription
realmId*stringThe realm ID.
questId*stringThe quest ID.

Response

ParameterTypeDescription
id*stringUnique quest identifier.
realmId*stringThe realm this quest belongs to.
title*stringDisplay name of the quest.
hook*stringHow the quest began.
goalTitle*stringShort summary of what must be done.
goalDescription*stringHow the party will know the goal is met.
rewardTitle*string | nullWhat is promised for completing the quest, or null if there is no reward.
rewardDescription*string | nullDetails of the reward, or null.
mechanic*string | nullQuest mechanic tag, or null. One of the Quest Mechanics listed below.
motive*string | nullQuest motive tag, or null. One of the Quest Motives listed below.
source*string | nullQuest source tag, or null. One of the Quest Sources listed below.
isPublicToRealm*booleanWhen 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*stringDerived from steps, never set directly. One of the Quest Statuses listed below.
originSceneId*string | nullThe scene this quest was created in, or null if it was created outside a session.
createdAt*integerUnix timestamp (ms) when the quest was created.
updatedAt*integerUnix timestamp (ms) when the quest was last updated.

QuestStep

ParameterTypeDescription
id*stringUnique step identifier.
type*stringStep type. One of the Quest Step Types listed below.
note*stringWhat happened during this step.
sceneId*string | nullThe scene this step was recorded in, or null if it was added outside a session.
createdAt*integerUnix timestamp (ms) when the step was added.
updatedAt*integerUnix 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

ParameterTypeDescription
realmId*stringThe realm ID.
questId*stringThe quest ID.

Request Body

ParameterTypeDescription
titlestringNew title. Omit to keep the current value.
hookstringNew hook text. Omit to keep the current value.
goalTitlestringNew goal title. Omit to keep the current value.
goalDescriptionstringNew goal description. Omit to keep the current value.
reward{ title: string, description: string } | nullNew reward, or null to remove it. Omit to keep the current value.
mechanicstring | nullNew mechanic tag, or null to clear it. Omit to keep the current value.
motivestring | nullNew motive tag, or null to clear it. Omit to keep the current value.
sourcestring | nullNew source tag, or null to clear it. Omit to keep the current value.
entityIdsstring[]Replacement list of linked entity IDs. Omit to keep the current value.
isPublicToRealmbooleanNew visibility. Omit to keep the current value.
accessIdsstring[]Replacement access list, used when isPublicToRealm is false. Omit to keep the current value.

Response

ParameterTypeDescription
id*stringUnique quest identifier.
realmId*stringThe realm this quest belongs to.
title*stringDisplay name of the quest.
hook*stringHow the quest began.
goalTitle*stringShort summary of what must be done.
goalDescription*stringHow the party will know the goal is met.
rewardTitle*string | nullWhat is promised for completing the quest, or null if there is no reward.
rewardDescription*string | nullDetails of the reward, or null.
mechanic*string | nullQuest mechanic tag, or null. One of the Quest Mechanics listed below.
motive*string | nullQuest motive tag, or null. One of the Quest Motives listed below.
source*string | nullQuest source tag, or null. One of the Quest Sources listed below.
isPublicToRealm*booleanWhen 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*stringDerived from steps, never set directly. One of the Quest Statuses listed below.
originSceneId*string | nullThe scene this quest was created in, or null if it was created outside a session.
createdAt*integerUnix timestamp (ms) when the quest was created.
updatedAt*integerUnix 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

ParameterTypeDescription
realmId*stringThe realm ID.
questId*stringThe 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

ParameterTypeDescription
realmId*stringThe realm ID.
questId*stringThe quest ID.

Request Body

ParameterTypeDescription
type*stringStep type. One of the Quest Step Types listed below.
note*stringWhat happened during this step.

Response (201)

ParameterTypeDescription
id*stringUnique quest identifier.
realmId*stringThe realm this quest belongs to.
title*stringDisplay name of the quest.
hook*stringHow the quest began.
goalTitle*stringShort summary of what must be done.
goalDescription*stringHow the party will know the goal is met.
rewardTitle*string | nullWhat is promised for completing the quest, or null if there is no reward.
rewardDescription*string | nullDetails of the reward, or null.
mechanic*string | nullQuest mechanic tag, or null. One of the Quest Mechanics listed below.
motive*string | nullQuest motive tag, or null. One of the Quest Motives listed below.
source*string | nullQuest source tag, or null. One of the Quest Sources listed below.
isPublicToRealm*booleanWhen 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*stringDerived from steps, never set directly. One of the Quest Statuses listed below.
originSceneId*string | nullThe scene this quest was created in, or null if it was created outside a session.
createdAt*integerUnix timestamp (ms) when the quest was created.
updatedAt*integerUnix 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

ParameterTypeDescription
realmId*stringThe realm ID.
questId*stringThe quest ID.
stepId*stringThe quest step ID.

Request Body

ParameterTypeDescription
typestringNew step type. Omit to keep the current value.
notestringNew note text. Omit to keep the current value.

Response

ParameterTypeDescription
id*stringUnique quest identifier.
realmId*stringThe realm this quest belongs to.
title*stringDisplay name of the quest.
hook*stringHow the quest began.
goalTitle*stringShort summary of what must be done.
goalDescription*stringHow the party will know the goal is met.
rewardTitle*string | nullWhat is promised for completing the quest, or null if there is no reward.
rewardDescription*string | nullDetails of the reward, or null.
mechanic*string | nullQuest mechanic tag, or null. One of the Quest Mechanics listed below.
motive*string | nullQuest motive tag, or null. One of the Quest Motives listed below.
source*string | nullQuest source tag, or null. One of the Quest Sources listed below.
isPublicToRealm*booleanWhen 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*stringDerived from steps, never set directly. One of the Quest Statuses listed below.
originSceneId*string | nullThe scene this quest was created in, or null if it was created outside a session.
createdAt*integerUnix timestamp (ms) when the quest was created.
updatedAt*integerUnix 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

ParameterTypeDescription
realmId*stringThe realm ID.
questId*stringThe quest ID.
stepId*stringThe quest step ID.

Response

ParameterTypeDescription
id*stringUnique quest identifier.
realmId*stringThe realm this quest belongs to.
title*stringDisplay name of the quest.
hook*stringHow the quest began.
goalTitle*stringShort summary of what must be done.
goalDescription*stringHow the party will know the goal is met.
rewardTitle*string | nullWhat is promised for completing the quest, or null if there is no reward.
rewardDescription*string | nullDetails of the reward, or null.
mechanic*string | nullQuest mechanic tag, or null. One of the Quest Mechanics listed below.
motive*string | nullQuest motive tag, or null. One of the Quest Motives listed below.
source*string | nullQuest source tag, or null. One of the Quest Sources listed below.
isPublicToRealm*booleanWhen 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*stringDerived from steps, never set directly. One of the Quest Statuses listed below.
originSceneId*string | nullThe scene this quest was created in, or null if it was created outside a session.
createdAt*integerUnix timestamp (ms) when the quest was created.
updatedAt*integerUnix 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

TypeDescription
fetchRetrieve an item or person.
deliverBring something to a destination.
escortProtect someone on a journey.
rescueFree someone from danger or captivity.
huntTrack down and defeat a target.
defendHold a position against a threat.
investigateUncover facts or solve a mystery.
exploreChart or discover unknown territory.
infiltrateGet in and out undetected.
negotiateReach an agreement between parties.
sabotageDisrupt an opponent's plans or assets.
escapeGet away from danger or confinement.
heistSteal something of value.
buildConstruct or establish something.
recruitBring someone onto the party's side.
otherA mechanic that does not fit the list above.

Quest Motives

TypeDescription
justiceRighting a wrong.
vengeanceSettling a score.
wealthPursuing riches.
dutyAn obligation that must be honored.
survivalStaying alive.
goodwillHelping simply because it is good.
loyaltyStanding by an ally or cause.
curiosityWanting to know more.
glorySeeking renown.
powerGaining influence or control.
faithActing on belief or devotion.
redemptionMaking amends for the past.
coercionActing under threat or blackmail.
otherA motive that does not fit the list above.

Quest Sources

TypeDescription
commissionHired for pay.
requestAsked for by someone in need.
orderHanded down by an authority.
rumorHeard secondhand.
discoveryStumbled upon.
crisisForced by an unfolding emergency.
backstoryRooted in a character's history.
self_directedThe party set this goal themselves.
omenForetold or foreshadowed.
consequenceA direct result of an earlier choice.
otherA source that does not fit the list above.

Quest Step Types — Progress

TypeDescription
discoveryThe party learned something new.
milestoneA meaningful step forward.
complicationSomething made the quest harder.
clock_tickTime or pressure advanced.
encounterA confrontation or meeting occurred.
atmosphereColor or mood without plot movement.
decisionThe party made a meaningful choice.

Quest Step Types — Ending

TypeDescription
completedThe quest succeeded. Ends the quest.
failedThe quest failed. Ends the quest.
abandonedThe party gave up on the quest. Ends the quest.

Quest Statuses

TypeDescription
proposedThe quest has no steps yet.
activeThe quest has steps but no ending step.
completedThe latest ending step is completed.
failedThe latest ending step is failed.
abandonedThe latest ending step is abandoned.

Join us and connect for poems, content, updates, direct questions, community discussion, and more.

© 2026 Realms of Shod. All rights reserved.