Skip to main content

Payload Structure

Understand the JSON payload structure sent to webhooks and integrations.

Base Payload

Every webhook payload includes these base fields. The book, session, and shelf objects are included depending on the event type.

{
  "eventType": "session.completed",
  "timestamp": "2024-12-04T10:30:00Z",
  "book": { ... },
  "session": { ... },
  "shelf": null,
  "metadata": null
}
eventTypeThe type of event that triggered this notification (e.g., session.completed)
timestampISO 8601 formatted timestamp of when the event occurred
metadataOptional additional data (currently null, reserved for future use)

Book Object

Included in book-related events and session events. Contains details about the book.

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "title": "The Great Gatsby",
  "authors": ["F. Scott Fitzgerald"],
  "pages": 180,
  "currentPage": 180,
  "status": "finished",
  "isbn": "9780743273565",
  "progressPercentage": 100
}
FieldTypeDescription
idstringUnique identifier for the book (UUID)
titlestringThe title of the book
authorsstring[]Array of author names
pagesnumberTotal number of pages in the book
currentPagenumberCurrent reading position (page number)
statusstringReading status (to_read, reading, finished, abandoned)
isbnstring?ISBN number if available (optional)
progressPercentagenumberReading progress as a percentage (0-100)

Session Object

Included in session events. Contains details about the reading session.

{
  "id": "660e8400-e29b-41d4-a716-446655440001",
  "startedAt": "2024-12-04T10:05:00Z",
  "endedAt": "2024-12-04T10:30:00Z",
  "status": "completed",
  "durationMinutes": 25,
  "pagesRead": 42
}
FieldTypeDescription
idstringUnique identifier for the session (UUID)
startedAtstringISO 8601 timestamp when the session started
endedAtstring?ISO 8601 timestamp when the session ended (null if active)
statusstringSession status (active, paused, completed)
durationMinutesnumberDuration of the session in minutes
pagesReadnumberNumber of pages read during this session

Shelf Object

Included in shelf-related events. Contains details about the shelf.

{
  "id": "770e8400-e29b-41d4-a716-446655440002",
  "name": "Favorites",
  "icon": "star.fill",
  "bookCount": 12
}
FieldTypeDescription
idstringUnique identifier for the shelf (UUID)
namestringName of the shelf
iconstring?SF Symbol name for the shelf icon (optional)
bookCountnumberNumber of books on this shelf

Status Values

Book Status

to_readreadingfinishedabandoned

Session Status

activepausedcompleted