Skip to main content
A copy of your group’s data in your own database lets you join it to other things, report on it in any tool, and keep working when Scoutworks is slow to reach. Keeping that copy right is the hard part. GET /changes makes it one loop: ask what changed since last time, fetch each record that changed, and remove each one that went.

How it works

GET /changes answers with a list of changes, each one a resource, an id, what happened and when:
  • It carries ids, never the records. For a created or updated change, fetch the record from GET /{resource}/{id}, such as GET /members/{memberId}. For a deleted change, remove your copy.
  • It needs no scope of its own. Members, events, badge records and tasks are in it, each only for a key that holds that area’s read scope: members:read, events:read, badges:read or tasks:read. A key with only members:read sees member changes and nothing else.
  • It never skips a change. Keep the nextCursor of the last page and send it next time. A change made while you were reading comes back on a later page or on your next run. You may see a record twice; fetching it again is harmless.
Try it with the sandbox key:

The loop

  1. The first time, read each list in full and save every record: GET /members, GET /events, GET /badges and GET /tasks, walking every page (see Pagination). Note the time before you start, then call GET /changes with since set to that time.
  2. Each run after that, call GET /changes with since set to the nextCursor you saved. Keep calling it with each new nextCursor while hasMore is true.
  3. For each change: deleted → remove your copy. created or updated → fetch the record and save it over your copy with the same id. A fetch that answers 404 means the record went after the change was listed: remove your copy.
  4. Save the last nextCursor once every change is applied, for the next run. If the run fails halfway, start again from the cursor you saved last time: nothing is lost.
  5. Once a week, do a full read and replace your copy. A few changes leave nothing to report (a parent linked to a member, a section renamed). The pagination guide lists them.
The order of the changes is resource by resource, not by time. Apply each change on its own and the order does not matter.

Python and SQLite

This script keeps scouts.db, a SQLite file, in step with your group. It stores each record as JSON beside its id, so it never needs changing when the API adds a field. It needs Python 3.9 or later and requests (pip install requests).
sync_to_sqlite.py
Run it as often as you like: every hour from cron or Task Scheduler is plenty. The first run reads everything; each run after that reads only what changed. To do the weekly full read, delete the sync_state row and run it again. A record is stored as the API returns it, so query it with SQLite’s JSON functions:

Postgres

The same loop works with Postgres. Store each record as jsonb and upsert on the id:
In the Python script above, swap sqlite3 for psycopg (pip install "psycopg[binary]") and change three statements:
Commit once at the end of a run, after the cursor is saved, so the copy and the cursor always move together. A view makes the members read like a table:

Switch to your group

Set SCOUTWORKS_API_KEY to your own key and SCOUTWORKS_API_URL to https://api.scoutworks.app/api/v1. Your key needs the read scope of each area you want to copy: members:read, events:read, badges:read and tasks:read. With members.contacts:read too, your copy of each member carries their date of birth and parents’ contact details: keep the file somewhere only the right people can open it.

If something goes wrong

  • 400 invalid_request on since: send a timestamp with a time zone, such as 2026-11-01T00:00:00Z, or a nextCursor exactly as you got it.
  • 403 insufficient_scope: the key holds none of the four read scopes.
  • The copy drifts: run the weekly full read. If it still drifts, tell us which record, and we will look.
See Errors for every code. Want to hear about changes the moment they happen, instead of asking? See Webhooks: use both, and the next sync catches any message that went astray.