Skip to content

Lore

POST/api/v1/lore/dev
POST
/api/v1/lore/dev

This endpoint is for development workflows - it takes compiled lore_output directly and creates a session without needing a persisted story.

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Request to create a dev session with inline lore_output.

Response Body

application/json

curl -X POST "https://example.com/api/v1/lore/dev" \  -H "Content-Type: application/json" \  -d '{    "lore_output": null  }'
{  "session_id": "string",  "websocket_url": "string"}
GET/api/v1/lore/sessions
GET
/api/v1/lore/sessions

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Query Parameters

filter?

Conditions as filter[][]=. Conditions on different fields all apply. in (any of) and all (every one of, on fields holding several values) take a comma-separated list (\, for a literal comma). exists takes true or false. Datetimes are RFC 3339, now, or a time before now such as -30m, -6h or -7d.

sort?string

Comma-separated sort keys, - for descending, at most 1. Keys: created_at, last_activity_at. Default: -last_activity_at.

limit?integer

Rows per page, 1 to 100 (default 25).

Range1 <= value <= 100
cursor?string

The page.next_cursor of the previous page. Cannot be combined with page.

page?integer

A 1-based page number, for jumping. Cannot be combined with cursor.

Range1 <= value
total?boolean

Set to true to include the number of matching rows in page.total.

Response Body

application/json

curl -X GET "https://example.com/api/v1/lore/sessions"
{  "page": {    "has_more": true,    "next_cursor": "string",    "page": 0,    "total": 0  },  "sessions": [    {      "connection_id": "string",      "created_at": "2019-08-24T14:15:22Z",      "id": "string",      "last_activity_at": "2019-08-24T14:15:22Z",      "state": "created",      "story_id": "string",      "universe_id": "string",      "user_id": "string"    }  ]}
POST/api/v1/lore/sessions
POST
/api/v1/lore/sessions

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Request to create a new Lore session.

Response Body

application/json

curl -X POST "https://example.com/api/v1/lore/sessions" \  -H "Content-Type: application/json" \  -d '{    "story_id": "string",    "universe_id": "string"  }'
{  "session": {    "connection_id": "string",    "created_at": "2019-08-24T14:15:22Z",    "id": "string",    "last_activity_at": "2019-08-24T14:15:22Z",    "state": "created",    "story_id": "string",    "universe_id": "string",    "user_id": "string"  },  "websocket_url": "string"}
GET/api/v1/lore/sessions/{session_id}
GET
/api/v1/lore/sessions/{session_id}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

session_id*string

Session ID

Response Body

application/json

curl -X GET "https://example.com/api/v1/lore/sessions/string"
{  "connection_id": "string",  "created_at": "2019-08-24T14:15:22Z",  "id": "string",  "last_activity_at": "2019-08-24T14:15:22Z",  "state": "created",  "story_id": "string",  "universe_id": "string",  "user_id": "string"}
DELETE/api/v1/lore/sessions/{session_id}
DELETE
/api/v1/lore/sessions/{session_id}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

session_id*string

Session ID

Response Body

curl -X DELETE "https://example.com/api/v1/lore/sessions/string"
Empty
GET/api/v1/lore/sessions/{session_id}/checkpoints
GET
/api/v1/lore/sessions/{session_id}/checkpoints

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

session_id*string

Session ID

Query Parameters

filter?

Conditions as filter[][]=. Conditions on different fields all apply. in (any of) and all (every one of, on fields holding several values) take a comma-separated list (\, for a literal comma). exists takes true or false. Datetimes are RFC 3339, now, or a time before now such as -30m, -6h or -7d.

sort?string

Comma-separated sort keys, - for descending, at most 1. Keys: name. Default: name.

limit?integer

Rows per page, 1 to 100 (default 25).

Range1 <= value <= 100
cursor?string

The page.next_cursor of the previous page. Cannot be combined with page.

page?integer

A 1-based page number, for jumping. Cannot be combined with cursor.

Range1 <= value
total?boolean

Set to true to include the number of matching rows in page.total.

Response Body

application/json

curl -X GET "https://example.com/api/v1/lore/sessions/string/checkpoints"
{  "checkpoints": [    {      "name": "string"    }  ],  "page": {    "has_more": true,    "next_cursor": "string",    "page": 0,    "total": 0  }}
POST/api/v1/lore/sessions/{session_id}/checkpoints
POST
/api/v1/lore/sessions/{session_id}/checkpoints

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

session_id*string

Session ID

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Request to save a checkpoint.

Response Body

application/json

curl -X POST "https://example.com/api/v1/lore/sessions/string/checkpoints" \  -H "Content-Type: application/json" \  -d '{    "data": null,    "name": "string"  }'
{  "name": "string"}
GET/api/v1/lore/sessions/{session_id}/checkpoints/{name}
GET
/api/v1/lore/sessions/{session_id}/checkpoints/{name}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

session_id*string

Session ID

name*string

Checkpoint name

Response Body

application/json

curl -X GET "https://example.com/api/v1/lore/sessions/string/checkpoints/string"
{  "created_at": "2019-08-24T14:15:22Z",  "data": null,  "name": "string"}
POST/api/v1/lore/sessions/{session_id}/command
POST
/api/v1/lore/sessions/{session_id}/command

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

session_id*string

Session ID

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Request to send a player command to a session.

Response Body

curl -X POST "https://example.com/api/v1/lore/sessions/string/command" \  -H "Content-Type: application/json" \  -d '{    "command": "string"  }'
Empty
POST/api/v1/lore/sessions/{session_id}/step
POST
/api/v1/lore/sessions/{session_id}/step

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

session_id*string

Session ID

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Request to advance a running session by one player command and synchronously collect the resulting story events.

Response Body

application/json

curl -X POST "https://example.com/api/v1/lore/sessions/string/step" \  -H "Content-Type: application/json" \  -d '{}'
{  "awaiting_input": true,  "events": [    {      "ackId": "string",      "data": null,      "event": "string"    }  ],  "session_id": "string",  "state": "created"}
GET/ws/lore
GET
/ws/lore

Unlike the generic WebSocket handler, this sends/receives raw LoreWsMessage format without any wrapping.

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Query Parameters

session*string

Lore session ID

token?string

JWT token (alternative to Authorization header)

Response Body

curl -X GET "https://example.com/ws/lore?session=string"
Empty