SET API · SET Close
Prepare a week: open to prepared
POST/v1/close/weeks/{week}/prepare
Moves a week from open to prepared and records the preparing key. Only after the week has ended (UTC), on or after Close's first week, while it is not signed, and with no exception in it left without a note.
Path parameters
weekstringrequiredYYYY-Www, a real ISO week such as2026-W33. Anything else answers 404not_found.
Headers
Idempotency-Keystring- Any unique string, so a retry runs once. See Idempotency.
Notes
- SET Close is switched on per deployment; while it is off every
/v1/close/*call answers 403close_off. CheckGET /v1/capabilities(features.close). - Needs a key with the
writescope. - A week is prepared after its Sunday ends (UTC): 409
week_not_endedbefore then. - Close's first week is the one holding the first day of
startPeriod(PUT /v1/close/settings); an earlier week answers 409before_start_week. - 409
open_exceptions, withcount, when an exception in the week has no note. Resolve each, or leave it open with a note. - Preparing does not need the earlier weeks signed; approving does.
preparedByis the key that prepared the week. That key, or one rotated from or to it, cannot approve it.- Emits the event
close.week.prepared. - This example is a recorded run of SET's own code (wallet release
e9b03447) with a sandbox key; ids and times are that run's.
Errors
403 close_off404 not_found409 week_not_ended409 before_start_week409 week_signed