Retry a create safely: Idempotency-Key
A request can time out after Scoutworks has made the record. If you send it again, you could make a second one. To stop that, send an Idempotency-Key header with every POST: any printable text up to 255 characters, unique to the record you are making. A UUID is a good choice.
Each key keeps its own list, so two of your keys can use the same
Idempotency-Key without clashing. Most creates accept the header and recommend it. A create that must never run twice, such as POST /transactions, requires it and answers 400 without it.
Do not overwrite a newer change: If-Match
Every record you read with a single-record GET, and every record a write returns, comes with an ETag header. The tag changes whenever anything in the record changes.
To change a record only if nobody else has changed it since you read it, send that tag back as If-Match on the PATCH, PUT or DELETE:
412 with the code stale_write, and changes nothing. The 412 carries the record’s current ETag. Read the record again, decide what to do with the new values, and send the change with that tag.
- Send the tag exactly as you received it, quotes included.
If-Match: *matches any version. If-Matchis optional. Without it, the last write wins. We recommend it for anything a person might also edit in Scoutworks.- The tag describes the record as your key sees it. A key with more scopes sees more fields, so it gets a different tag for the same record.
- The tag covers everything in the record, totals included. A budget’s
spentand a fund’sremainingchange when someone records a transaction against them, so the tag changes too, even if nobody edited the budget or fund. On a busy budget, expect the occasional412: retry with the tag it carries.
PATCH /transactions/{transactionId} also takes the updatedAt you last read, in the body, and answers 412 the same way when it is stale.
Write many records at once: bulk writes
Endpoints that write many records in one request all work the same way:PUT /events/{eventId}/attendance (one register), POST /attendance/bulk (marks across registers), POST /badge-requirements/bulk (badge sign-offs) and POST /badge-awards/bulk (badge awards). They take a body of { "items": [...] }, with 1 to 100 items, and answer 200 with one result for each item, in the order you sent them:
- An item that is not valid, or that is refused, does not stop the others. Its result has
status: "error"and says why, and none of its changes are saved. - A request with no items, or more than 100, is refused as a whole with
400. - Each item is matched on what it is about (a member and a meeting, say), so sending the same items again is safe: unchanged items answer
unchanged. - A bulk request counts as one change against the limit of 30 changes a minute. See Rate limits.
- A bulk
POSTalso takes anIdempotency-Key. You do not need one to retry safely, but with one, a second copy of the request sent while the first is still running answers409instead of running too. A replay with the same key and body runs the items again and answers withIdempotent-Replayed: true; each item then answers as it stands, which isunchangedfor an item the first request wrote. PUT /events/{eventId}/attendancetakesIf-Matchwith the register’sETagfromGET /events/{eventId}/attendance, and answers with the register’s newETag.
write scope, on a young person whose record you can put back.
Try a write safely
There is no practice mode, and the public sandbox key is read only. So test a write on your own group, with your own key, on a record you made for the purpose:- Make a test record with the write itself. Add a test member called “Test Member”, a draft event, or a waiting-list application for a made-up child. A draft event is the safest: families hear of an event only when a leader publishes it.
- Check it in Scoutworks. Open the record and see that every field landed where you meant.
- Undo it in Scoutworks. Archive the test member, delete the draft event or the application, or delete the test transaction. The API never deletes a member, so this step is in the app.
- Then run it for real. Start with one real record, check it, then the rest.
"notify": true. Leave it out while you test.
Each recipe shows one write in full: curl, Python, JavaScript, PowerShell and n8n.
Who made the change
A change made with a key is recorded as made by the admin who created the key, and Scoutworks marks the record with the key’s name, so people can see a script did it. A write never emails or notifies parents unless the request asks it to.POST /badge-requirements/bulk takes notify: true to send the one notice the app sends for a sign-off, the Young Leader’s own; without it, nobody is told. A register mark or a badge award sends nothing either way, as in the app.