Skip to content
SETSimple Easy Transactions
SET DocsSET Crypto API Suite and SET API referenceCurrent as of 2026-11-21 · wallet release 7d8a79fb
Browse: SET API

SET API · SET Close

Approve and sign a week

POST/v1/close/weeks/{week}/approve

Key scope: approve · Success: 200

Moves a prepared week to signed: SET computes snapshotHash, a SHA-256 over the week's matches chained to priorHash (the previous week's snapshotHash). The approving key must differ from the one that prepared it, and the week before must already be signed.

Path parameters

week stringrequired
YYYY-Www, a real ISO week such as 2026-W33. Anything else answers 404 not_found.

Headers

Idempotency-Key string
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 403 close_off. Check GET /v1/capabilities (features.close).
  • Needs a key with the approve scope, and read as well; write is not needed. A key without approve answers 403 scope_missing.
  • The second approver must be a different key (or person): the key that prepared the week, or one rotated from or to it, answers 409 same_approver.
  • Weeks are signed in order: 409 prior_week_open while the week before is not signed. Close's first week needs no prior week.
  • 409 week_not_prepared until the week is prepared.
  • If an exception appeared in the week after it was prepared, the call answers 409 open_exceptions and the week is open again; prepare it again once resolved.
  • 409 week_changed if a match in the week's months was written while it was being signed; read the week and approve again.
  • A week is signed, not locked: its month can still change until the month locks, and GET /v1/close/weeks/{week}/verify names what changed.
  • Emits the event close.week.signed.
  • The example was made with a second key holding the scopes read approve.
  • 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_off
  • 404 not_found
  • 409 week_not_ended
  • 409 before_start_week
  • 409 week_signed
  • 409 week_not_prepared
  • 409 same_approver
  • 409 prior_week_open
  • 409 week_changed
  • 403 scope_missing

All codes: Errors.