Founding churches get 50% off for 12 monthsFounding churches: 50% offApply as a founding churchApply

Pagination

Long lists are paged with page and per_page. Short lists are returned whole.

page and per_page#

ParameterMeaning
page1-based page number. Default 1.
per_pageRows per page. Default 25, at most 50. A larger value is refused with 422.

The response tells you where you are:

FieldMeaning
meta.totalHow many rows match your filters in all. Left out when zero.
meta.has_nexttrue when another page follows. Left out when false.
meta.has_prevtrue when an earlier page exists. Left out when false.
curl "$LECTERN_BASE_URL/v1/api/o/$LECTERN_SLUG/teachings?page=2&per_page=25&status=done" \
  -H "Authorization: Bearer $LECTERN_API_KEY"
Stop on has_next

Loop until meta.has_next is missing or false. Do not compute the number of pages from total and per_page: a page can be smaller than you asked for.

Which routes are paged#

  • GET /teachings is paged and filterable by q, status, branch_id, series_id and teacher_id.
  • GET /series, GET /teachers, GET /webhooks, GET /uploads and GET /webhooks/{id}/deliveries return a short, bounded list. They are not paged.
  • GET /search returns the best matches for your query, not a page of everything.

Consistency while paging#

Teachings are returned newest first. If a teaching is added while you page, rows can shift between pages, so a row may appear twice. De-duplicate on id when you build a full copy.

Next steps