<!-- Generated from the operation definitions by `pnpm docs:reference`. Do not edit by hand. -->

# Webhook events

Every state change writes an event in the same transaction as the change. We deliver each one to every endpoint of its workspace and mode that wants its type, exactly once per endpoint, and retry a failed delivery after 1 minute, 5, 30, then 2, 5, 10 and every 12 hours, for three days. Events can arrive twice and out of order: keep the ids you have seen (`msg_…`) and skip repeats.

Test letters send the same events as live ones, with `"mode": "test"` and `"simulated": true`.

Software that sends letters for its own customers also gets the `customer.…`, `usage.month_closed` and `capacity.…` events, each with `customer: { id, ref, name }` where it is about one customer. Every letter event carries `customer: { ref, name }` beside `on_behalf_of`, as `get_letter` shows it, or null for a letter of your own; the name is null for a customer known only by its ref. [Sending for your customers](platforms.md) says which step sends which.

A letter sent for a later day (`post_on`) carries `scheduled`, `post_on`, `posts_on` and `cancel_until` on every letter event. Nothing is sent between the send and its posting day unless the day changes: then `letter.posting_moved` gives the day before (`previous_posts_on`), the new day (`posts_on`) and why (`reason`). A letter that missed its day on your side is `letter.held` with `reason: "missed_posting_day"` and `lapses_at`.

## Personal data

Payloads carry ids, states, times, money and your own reference, labels, `on_behalf_of` and the name of the customer a letter is for: never the recipient's name, address or postcode. Fetch those with `get_letter` when you need them, so a recipient's details erased on request are not left in your logs by us. When a closed customer's data is deleted, its name is blanked in our stored copies too (`customer.name` becomes null). The free-text fields (`note`, `question`, `answer`) hold what a person or our reviewer wrote; when a recipient's details are erased, any of them that names the person is replaced with "Erased on request" in our stored copy, so a later replay does not send it again. Copies already delivered are yours to delete.

## The envelope

Each delivery is an HTTPS `POST` of this JSON, in live mode to an https address only:

```json
{
  "id": "msg_example000000001",
  "type": "letter.on_record",
  "created": "2026-11-16T16:02:41.000Z",
  "mode": "live",
  "data": {
    "…": "the payload below"
  }
}
```

Answer with any 2xx within 10 seconds. We do not follow redirects.

## Check the signature

Each delivery carries `Atomside-Signature: t=<unix seconds>,v1=<hex>`, where the hex is the HMAC-SHA256 of `t`, a full stop and the raw body, keyed with your endpoint's signing secret. While you roll a secret there are two `v1` values, one per secret; accept either. Refuse a signature more than 5 minutes old.

In Node, with no dependencies:

```ts
import { createHmac, timingSafeEqual } from 'node:crypto';

/** True when the body was signed by Atomside with one of your secrets, in the last 5 minutes. */
export function verifyAtomsideSignature(
  rawBody: Buffer,
  header: string | undefined,
  secrets: string[],
  nowSeconds = Math.floor(Date.now() / 1000),
): boolean {
  const parts = (header ?? '').split(',').map((p) => p.trim().split('='));
  const t = Number(parts.find(([k]) => k === 't')?.[1]);
  const sent = parts.filter(([k]) => k === 'v1').map(([, v]) => Buffer.from(v ?? '', 'hex'));
  if (!Number.isInteger(t) || Math.abs(nowSeconds - t) > 300) return false;
  return secrets.some((secret) => {
    const mac = createHmac('sha256', secret);
    mac.update(`${String(t)}.`);
    mac.update(rawBody);
    const expected = mac.digest();
    return sent.some((s) => s.length === expected.length && timingSafeEqual(s, expected));
  });
}
```

Check the raw bytes, before any JSON parsing. In Express, use `express.raw({ type: "application/json" })` on the route. `@atomside/core` exports the same check as `verifyWebhookSignature`; a test runs the recipe above against real signatures, so it stays right.

## Events

| Event | When |
|---|---|
| [`letter.quoted`](#letterquoted) | A letter was made from a quote. It moves on in the same moment. |
| [`letter.waiting_for_approval`](#letterwaiting_for_approval) | A letter waits for a person. reason says why, approval carries the link. |
| [`letter.approved`](#letterapproved) | A person approved a letter. It is now queued to print. |
| [`letter.queued`](#letterqueued) | A letter is queued to print, with nobody asked or after a hold. |
| [`letter.held`](#letterheld) | A letter is held: for our check, or waiting for credit. reason says which. |
| [`letter.printing`](#letterprinting) | A letter went to print. It can no longer be cancelled. |
| [`letter.printed`](#letterprinted) | A letter is printed and waiting to be posted. |
| [`letter.posted`](#letterposted) | A letter was posted. Its held credits are now charged. |
| [`letter.on_record`](#letteron_record) | A letter is on record, with its evidence. |
| [`letter.declined`](#letterdeclined) | A person, or Atomside, declined a letter. note says why. Held credits went back. |
| [`letter.lapsed`](#letterlapsed) | Nobody decided, or credit never came, before the time ran out. Held credits went back. |
| [`letter.cancelled`](#lettercancelled) | A letter was cancelled before it printed. Credits went back. |
| [`letter.failed`](#letterfailed) | A letter could not be printed. Credits went back. |
| [`letter.returned`](#letterreturned) | A posted letter came back to the return address. |
| [`group.settled`](#groupsettled) | Every letter of a group is settled: on record, declined, cancelled, failed or lapsed. Sent once, with the counts. |
| [`agent.paused`](#agentpaused) | An agent was paused, by a safeguard or a person. Its sends are refused until resumed. |
| [`agent.resumed`](#agentresumed) | A paused agent was resumed. |
| [`balance.low`](#balancelow) | A live balance fell below its warning level. Sent once until it is topped up again. |
| [`credits.bought`](#creditsbought) | A pack of credits arrived, bought by hand or by automatic top-up. automatic says which. |
| [`account.claimed`](#accountclaimed) | A person claimed an account an agent started alone. |
| [`letter.posting_moved`](#letterposting_moved) | A letter is now posted on another day: we moved it (the print room was full, closed or stopped), or a person on your team changed the day. reason says which. |
| [`letter.review_question`](#letterreview_question) | Our reviewer is holding a letter with a question for you. It stays held until answered. |
| [`letter.review_answered`](#letterreview_answered) | A person answered our reviewer’s question. The letter is back with our reviewer, still held. |
| [`customer.sender_code_posted`](#customersender_code_posted) | We posted a customer a code letter, to check its own sender. |
| [`customer.sender_verified`](#customersender_verified) | A customer entered its code. Its letters go from its own sender now, and held ones go on. |
| [`customer.sender_not_accepted`](#customersender_not_accepted) | We could not accept a customer’s sender. reason says why. |
| [`customer.suspended`](#customersuspended) | Atomside stopped letters for one customer. Its queued letters are held. |
| [`customer.suspension_lifted`](#customersuspension_lifted) | Letters for a suspended customer can go again. Held ones go on. |
| [`customer.closed`](#customerclosed) | A customer is closed. Its waiting letters were cancelled and their credits went back. |
| [`customer.data_deleted`](#customerdata_deleted) | We deleted a closed customer’s letters and addresses. Its records still verify. |
| [`usage.month_closed`](#usagemonth_closed) | A month is closed: its letters and credits by customer will not change again. |
| [`capacity.day_closed`](#capacityday_closed) | The print room is closed on a day. Letters booked for it move to the next posting day. |
| [`capacity.day_reopened`](#capacityday_reopened) | The print room is open on a day it had closed, after all. |

### `letter.quoted`

A letter was made from a quote. It moves on in the same moment.

`data`:

```json
{
  "type": "object",
  "properties": {
    "letter": {
      "type": "string"
    },
    "state": {
      "type": "string",
      "enum": [
        "quoted",
        "waiting_for_approval",
        "queued",
        "printing",
        "printed",
        "posted",
        "on_record",
        "declined",
        "lapsed",
        "cancelled",
        "held",
        "failed",
        "returned"
      ],
      "description": "The state the letter is in now."
    },
    "previous_state": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "quoted",
            "waiting_for_approval",
            "queued",
            "printing",
            "printed",
            "posted",
            "on_record",
            "declined",
            "lapsed",
            "cancelled",
            "held",
            "failed",
            "returned"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "event": {
      "type": "string",
      "description": "The move, for example approved, printing_started, posted."
    },
    "event_id": {
      "type": "string",
      "description": "The letter event (evt_…), as get_letter shows it."
    },
    "at": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
    },
    "mode": {
      "type": "string",
      "enum": [
        "test",
        "live"
      ]
    },
    "simulated": {
      "type": "boolean",
      "description": "True for test letters: nothing was printed or posted."
    },
    "reference": {
      "type": [
        "string",
        "null"
      ]
    },
    "on_behalf_of": {
      "type": [
        "string",
        "null"
      ]
    },
    "customer": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "ref": {
              "type": "string"
            },
            "name": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "ref",
            "name"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ],
      "description": "The customer it is for, by your ref and its name, as get_letter shows it; null for your own letter. The name is null for a customer known only by its ref, and once a closed customer’s data is deleted."
    },
    "labels": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "price": {
      "type": "object",
      "properties": {
        "credits": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991,
          "description": "Whole credits. 1 credit is 10p."
        },
        "gbp": {
          "type": "string",
          "pattern": "^-?\\d+\\.\\d{2}$",
          "description": "The same amount in pounds, ex VAT, as a decimal string."
        }
      },
      "required": [
        "credits",
        "gbp"
      ],
      "additionalProperties": false,
      "description": "An amount in credits, with pounds beside it."
    },
    "reason": {
      "description": "Why it waits or is held: over_daily_limit, possible_duplicate, waiting_for_credit…",
      "type": [
        "string",
        "null"
      ]
    },
    "note": {
      "description": "A decline note, or what went wrong.",
      "type": [
        "string",
        "null"
      ]
    },
    "duplicate_of": {
      "type": [
        "string",
        "null"
      ]
    },
    "approval": {
      "anyOf": [
        {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {}
        },
        {
          "type": "null"
        }
      ],
      "description": "On letter.waiting_for_approval: the approval id, link, expiry and hash covered."
    },
    "record": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "url": {
              "type": "string",
              "description": "The public record page. Anyone holding the link can check it."
            },
            "sha256": {
              "type": "string",
              "description": "SHA-256 of the record document: what is signed and chained."
            },
            "previous_sha256": {
              "type": [
                "string",
                "null"
              ]
            },
            "print_file_sha256": {
              "type": [
                "string",
                "null"
              ]
            },
            "chain": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "seq": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                }
              },
              "required": [
                "id",
                "seq"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "id",
            "url",
            "sha256",
            "previous_sha256",
            "print_file_sha256",
            "chain"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ],
      "description": "On letter.on_record: the record, its public link and its hashes."
    },
    "group": {
      "description": "The group (grp_…) when the letter was sent to several people in one go.",
      "type": [
        "string",
        "null"
      ]
    },
    "n": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        {
          "type": "null"
        }
      ],
      "description": "Its place in the group, from 1. Null for a single letter."
    },
    "scheduled": {
      "type": "boolean",
      "description": "True while a letter asked for a day (post_on) waits to go on it."
    },
    "post_on": {
      "anyOf": [
        {
          "type": "string",
          "format": "date",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
        },
        {
          "type": "null"
        }
      ],
      "description": "The posting day the sender asked for, or null."
    },
    "posts_on": {
      "anyOf": [
        {
          "type": "string",
          "format": "date",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
        },
        {
          "type": "null"
        }
      ],
      "description": "The posting day booked. Differs from post_on only when the letter was moved."
    },
    "cancel_until": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
        },
        {
          "type": "null"
        }
      ],
      "description": "Until when it can be cancelled: the cut-off on its posting day. Null once it went to print."
    },
    "lapses_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
        },
        {
          "type": "null"
        }
      ],
      "description": "On letter.held with reason missed_posting_day: when it lapses if nobody picks a new day."
    }
  },
  "required": [
    "letter",
    "state",
    "previous_state",
    "event",
    "event_id",
    "at",
    "mode",
    "simulated",
    "reference",
    "on_behalf_of",
    "customer",
    "labels",
    "price",
    "reason",
    "note",
    "duplicate_of",
    "approval",
    "record",
    "group",
    "n",
    "scheduled",
    "post_on",
    "posts_on",
    "cancel_until",
    "lapses_at"
  ],
  "additionalProperties": false
}
```

### `letter.waiting_for_approval`

A letter waits for a person. reason says why, approval carries the link.

Its `data` is the letter payload, shown under `letter.quoted`.

### `letter.approved`

A person approved a letter. It is now queued to print.

Its `data` is the letter payload, shown under `letter.quoted`.

### `letter.queued`

A letter is queued to print, with nobody asked or after a hold.

Its `data` is the letter payload, shown under `letter.quoted`.

### `letter.held`

A letter is held: for our check, or waiting for credit. reason says which.

Its `data` is the letter payload, shown under `letter.quoted`.

### `letter.printing`

A letter went to print. It can no longer be cancelled.

Its `data` is the letter payload, shown under `letter.quoted`.

### `letter.printed`

A letter is printed and waiting to be posted.

Its `data` is the letter payload, shown under `letter.quoted`.

### `letter.posted`

A letter was posted. Its held credits are now charged.

Its `data` is the letter payload, shown under `letter.quoted`.

### `letter.on_record`

A letter is on record, with its evidence.

Its `data` is the letter payload, shown under `letter.quoted`.

### `letter.declined`

A person, or Atomside, declined a letter. note says why. Held credits went back.

Its `data` is the letter payload, shown under `letter.quoted`.

### `letter.lapsed`

Nobody decided, or credit never came, before the time ran out. Held credits went back.

Its `data` is the letter payload, shown under `letter.quoted`.

### `letter.cancelled`

A letter was cancelled before it printed. Credits went back.

Its `data` is the letter payload, shown under `letter.quoted`.

### `letter.failed`

A letter could not be printed. Credits went back.

Its `data` is the letter payload, shown under `letter.quoted`.

### `letter.returned`

A posted letter came back to the return address.

Its `data` is the letter payload, shown under `letter.quoted`.

### `group.settled`

Every letter of a group is settled: on record, declined, cancelled, failed or lapsed. Sent once, with the counts.

`data`:

```json
{
  "type": "object",
  "properties": {
    "group": {
      "type": "string"
    },
    "reference": {
      "type": [
        "string",
        "null"
      ]
    },
    "letters": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991,
      "description": "Letters in the group."
    },
    "counts": {
      "type": "object",
      "propertyNames": {
        "type": "string",
        "enum": [
          "quoted",
          "waiting_for_approval",
          "queued",
          "printing",
          "printed",
          "posted",
          "on_record",
          "declined",
          "lapsed",
          "cancelled",
          "held",
          "failed",
          "returned"
        ]
      },
      "additionalProperties": {
        "type": "integer",
        "minimum": -9007199254740991,
        "maximum": 9007199254740991
      },
      "description": "Letters in each state, for example { \"on_record\": 11, \"declined\": 1 }."
    },
    "money": {
      "type": "object",
      "properties": {
        "charged": {
          "type": "object",
          "properties": {
            "credits": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991,
              "description": "Whole credits. 1 credit is 10p."
            },
            "gbp": {
              "type": "string",
              "pattern": "^-?\\d+\\.\\d{2}$",
              "description": "The same amount in pounds, ex VAT, as a decimal string."
            }
          },
          "required": [
            "credits",
            "gbp"
          ],
          "additionalProperties": false,
          "description": "Charged for the letters posted."
        },
        "returned": {
          "type": "object",
          "properties": {
            "credits": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991,
              "description": "Whole credits. 1 credit is 10p."
            },
            "gbp": {
              "type": "string",
              "pattern": "^-?\\d+\\.\\d{2}$",
              "description": "The same amount in pounds, ex VAT, as a decimal string."
            }
          },
          "required": [
            "credits",
            "gbp"
          ],
          "additionalProperties": false,
          "description": "Held and given back for the letters that did not go."
        }
      },
      "required": [
        "charged",
        "returned"
      ],
      "additionalProperties": false
    },
    "settled_at": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
    },
    "mode": {
      "type": "string",
      "enum": [
        "test",
        "live"
      ]
    },
    "simulated": {
      "type": "boolean",
      "description": "True for test letters: nothing was printed or posted."
    }
  },
  "required": [
    "group",
    "reference",
    "letters",
    "counts",
    "money",
    "settled_at",
    "mode",
    "simulated"
  ],
  "additionalProperties": false
}
```

### `agent.paused`

An agent was paused, by a safeguard or a person. Its sends are refused until resumed.

`data`:

```json
{
  "type": "object",
  "properties": {
    "agent": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "mode": {
      "type": "string",
      "enum": [
        "test",
        "live"
      ]
    },
    "paused_at": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
    },
    "by": {
      "type": "string",
      "enum": [
        "safeguard",
        "a_person"
      ]
    },
    "reason": {
      "description": "volume_spike, test_trigger, or null when a person paused it.",
      "type": [
        "string",
        "null"
      ]
    }
  },
  "required": [
    "agent",
    "name",
    "mode",
    "paused_at",
    "by",
    "reason"
  ],
  "additionalProperties": false
}
```

### `agent.resumed`

A paused agent was resumed.

`data`:

```json
{
  "type": "object",
  "properties": {
    "agent": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "mode": {
      "type": "string",
      "enum": [
        "test",
        "live"
      ]
    },
    "resumed_at": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
    }
  },
  "required": [
    "agent",
    "name",
    "mode",
    "resumed_at"
  ],
  "additionalProperties": false
}
```

### `balance.low`

A live balance fell below its warning level. Sent once until it is topped up again.

`data`:

```json
{
  "type": "object",
  "properties": {
    "balance": {
      "type": "object",
      "properties": {
        "credits": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991,
          "description": "Whole credits. 1 credit is 10p."
        },
        "gbp": {
          "type": "string",
          "pattern": "^-?\\d+\\.\\d{2}$",
          "description": "The same amount in pounds, ex VAT, as a decimal string."
        }
      },
      "required": [
        "credits",
        "gbp"
      ],
      "additionalProperties": false,
      "description": "Available plus held, as the console shows it."
    },
    "available": {
      "type": "object",
      "properties": {
        "credits": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991,
          "description": "Whole credits. 1 credit is 10p."
        },
        "gbp": {
          "type": "string",
          "pattern": "^-?\\d+\\.\\d{2}$",
          "description": "The same amount in pounds, ex VAT, as a decimal string."
        }
      },
      "required": [
        "credits",
        "gbp"
      ],
      "additionalProperties": false,
      "description": "An amount in credits, with pounds beside it."
    },
    "held": {
      "type": "object",
      "properties": {
        "credits": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991,
          "description": "Whole credits. 1 credit is 10p."
        },
        "gbp": {
          "type": "string",
          "pattern": "^-?\\d+\\.\\d{2}$",
          "description": "The same amount in pounds, ex VAT, as a decimal string."
        }
      },
      "required": [
        "credits",
        "gbp"
      ],
      "additionalProperties": false,
      "description": "An amount in credits, with pounds beside it."
    },
    "warn_below": {
      "type": "object",
      "properties": {
        "credits": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991,
          "description": "Whole credits. 1 credit is 10p."
        },
        "gbp": {
          "type": "string",
          "pattern": "^-?\\d+\\.\\d{2}$",
          "description": "The same amount in pounds, ex VAT, as a decimal string."
        }
      },
      "required": [
        "credits",
        "gbp"
      ],
      "additionalProperties": false,
      "description": "The warning level the balance fell below."
    },
    "at": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
    }
  },
  "required": [
    "balance",
    "available",
    "held",
    "warn_below",
    "at"
  ],
  "additionalProperties": false
}
```

### `credits.bought`

A pack of credits arrived, bought by hand or by automatic top-up. automatic says which.

`data`:

```json
{
  "type": "object",
  "properties": {
    "receipt": {
      "description": "The receipt (rcpt_…). Null in test mode, where a rehearsal buys free test credits.",
      "type": [
        "string",
        "null"
      ]
    },
    "credits": {
      "type": "object",
      "properties": {
        "credits": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991,
          "description": "Whole credits. 1 credit is 10p."
        },
        "gbp": {
          "type": "string",
          "pattern": "^-?\\d+\\.\\d{2}$",
          "description": "The same amount in pounds, ex VAT, as a decimal string."
        }
      },
      "required": [
        "credits",
        "gbp"
      ],
      "additionalProperties": false,
      "description": "The credits the pack added."
    },
    "automatic": {
      "type": "boolean",
      "description": "True when automatic top-up bought it; false for a pack bought by hand."
    },
    "ceiling": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "purchases_left": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991,
              "description": "Automatic purchases left in this month's ceiling."
            },
            "resets_at": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
              "description": "When the month starts again (UK time)."
            }
          },
          "required": [
            "purchases_left",
            "resets_at"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ],
      "description": "For an automatic purchase: what is left of the ceiling. Null for one bought by hand."
    },
    "at": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
    },
    "mode": {
      "type": "string",
      "enum": [
        "test",
        "live"
      ]
    }
  },
  "required": [
    "receipt",
    "credits",
    "automatic",
    "ceiling",
    "at",
    "mode"
  ],
  "additionalProperties": false
}
```

### `account.claimed`

A person claimed an account an agent started alone.

`data`:

```json
{
  "type": "object",
  "properties": {
    "account": {
      "type": "string"
    },
    "workspace": {
      "type": "string"
    },
    "agent": {
      "type": "string"
    },
    "claimed_at": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
    }
  },
  "required": [
    "account",
    "workspace",
    "agent",
    "claimed_at"
  ],
  "additionalProperties": false
}
```

### `letter.posting_moved`

A letter is now posted on another day: we moved it (the print room was full, closed or stopped), or a person on your team changed the day. reason says which.

`data`:

```json
{
  "type": "object",
  "properties": {
    "letter": {
      "type": "string"
    },
    "state": {
      "type": "string",
      "enum": [
        "quoted",
        "waiting_for_approval",
        "queued",
        "printing",
        "printed",
        "posted",
        "on_record",
        "declined",
        "lapsed",
        "cancelled",
        "held",
        "failed",
        "returned"
      ]
    },
    "posts_on": {
      "type": "string",
      "format": "date",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
      "description": "The new UK date it is posted (to)."
    },
    "previous_posts_on": {
      "type": "string",
      "format": "date",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
      "description": "The UK date it was booked for before (from)."
    },
    "reason": {
      "type": "string",
      "enum": [
        "print_room_full",
        "day_away",
        "printing_stopped",
        "day_full_at_approval",
        "changed_by_person",
        "checked_after_its_day"
      ],
      "description": "Why it moved (why). Our side: print_room_full (past the daily cap), day_away (the print room is closed that day), printing_stopped (printing was stopped at the cut-off), checked_after_its_day (our check of the letter ended after its day). day_full_at_approval: the day asked for filled while the letter waited, and the person who approved it saw the new day. changed_by_person: a person on your team changed the day."
    },
    "post_on": {
      "anyOf": [
        {
          "type": "string",
          "format": "date",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
        },
        {
          "type": "null"
        }
      ],
      "description": "The posting day the sender asked for, or null."
    },
    "cancel_until": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
        },
        {
          "type": "null"
        }
      ],
      "description": "The cut-off on the new day: cancel until then."
    },
    "at": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
    },
    "mode": {
      "type": "string",
      "enum": [
        "test",
        "live"
      ]
    }
  },
  "required": [
    "letter",
    "state",
    "posts_on",
    "previous_posts_on",
    "reason",
    "post_on",
    "cancel_until",
    "at",
    "mode"
  ],
  "additionalProperties": false
}
```

### `letter.review_question`

Our reviewer is holding a letter with a question for you. It stays held until answered.

`data`:

```json
{
  "type": "object",
  "properties": {
    "letter": {
      "type": "string"
    },
    "state": {
      "type": "string",
      "enum": [
        "quoted",
        "waiting_for_approval",
        "queued",
        "printing",
        "printed",
        "posted",
        "on_record",
        "declined",
        "lapsed",
        "cancelled",
        "held",
        "failed",
        "returned"
      ]
    },
    "question": {
      "type": "string",
      "description": "What our reviewer asked. A person answers it on the letter page."
    },
    "at": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
    },
    "mode": {
      "type": "string",
      "enum": [
        "test",
        "live"
      ]
    }
  },
  "required": [
    "letter",
    "state",
    "question",
    "at",
    "mode"
  ],
  "additionalProperties": false
}
```

### `letter.review_answered`

A person answered our reviewer’s question. The letter is back with our reviewer, still held.

`data`:

```json
{
  "type": "object",
  "properties": {
    "letter": {
      "type": "string"
    },
    "state": {
      "type": "string",
      "enum": [
        "quoted",
        "waiting_for_approval",
        "queued",
        "printing",
        "printed",
        "posted",
        "on_record",
        "declined",
        "lapsed",
        "cancelled",
        "held",
        "failed",
        "returned"
      ]
    },
    "question": {
      "type": "string",
      "description": "What our reviewer asked."
    },
    "answer": {
      "type": "string",
      "description": "What the person answered, in their words."
    },
    "at": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
    },
    "mode": {
      "type": "string",
      "enum": [
        "test",
        "live"
      ]
    }
  },
  "required": [
    "letter",
    "state",
    "question",
    "answer",
    "at",
    "mode"
  ],
  "additionalProperties": false
}
```

### `customer.sender_code_posted`

We posted a customer a code letter, to check its own sender.

`data`:

```json
{
  "type": "object",
  "properties": {
    "customer": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The customer (cus_…)."
        },
        "ref": {
          "type": "string",
          "description": "Your ref for the customer, as you gave it."
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "ref",
        "name"
      ],
      "additionalProperties": false
    },
    "posted_at": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
      "description": "When the code stops working."
    },
    "letters_sent": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991,
      "description": "Code letters posted to this customer so far, at most 3."
    },
    "mode": {
      "type": "string",
      "enum": [
        "test",
        "live"
      ]
    }
  },
  "required": [
    "customer",
    "posted_at",
    "expires_at",
    "letters_sent",
    "mode"
  ],
  "additionalProperties": false
}
```

### `customer.sender_verified`

A customer entered its code. Its letters go from its own sender now, and held ones go on.

`data`:

```json
{
  "type": "object",
  "properties": {
    "customer": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The customer (cus_…)."
        },
        "ref": {
          "type": "string",
          "description": "Your ref for the customer, as you gave it."
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "ref",
        "name"
      ],
      "additionalProperties": false
    },
    "via": {
      "type": "string",
      "enum": [
        "customer_page",
        "console",
        "api",
        "test_code"
      ]
    },
    "released_letters": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991,
      "description": "Letters that were held for the code and now go on."
    },
    "mode": {
      "type": "string",
      "enum": [
        "test",
        "live"
      ]
    }
  },
  "required": [
    "customer",
    "via",
    "released_letters",
    "mode"
  ],
  "additionalProperties": false
}
```

### `customer.sender_not_accepted`

We could not accept a customer’s sender. reason says why.

`data`:

```json
{
  "type": "object",
  "properties": {
    "customer": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The customer (cus_…)."
        },
        "ref": {
          "type": "string",
          "description": "Your ref for the customer, as you gave it."
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "ref",
        "name"
      ],
      "additionalProperties": false
    },
    "reason": {
      "type": "string",
      "description": "What our reviewer wrote, for the customer to put right."
    },
    "more_needed": {
      "type": "boolean",
      "description": "True when sending more details can still get it accepted."
    },
    "mode": {
      "type": "string",
      "enum": [
        "test",
        "live"
      ]
    }
  },
  "required": [
    "customer",
    "reason",
    "more_needed",
    "mode"
  ],
  "additionalProperties": false
}
```

### `customer.suspended`

Atomside stopped letters for one customer. Its queued letters are held.

`data`:

```json
{
  "type": "object",
  "properties": {
    "customer": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The customer (cus_…)."
        },
        "ref": {
          "type": "string",
          "description": "Your ref for the customer, as you gave it."
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "ref",
        "name"
      ],
      "additionalProperties": false
    },
    "reason": {
      "type": "string"
    },
    "held_letters": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991,
      "description": "Queued letters held until the suspension is lifted."
    },
    "mode": {
      "type": "string",
      "enum": [
        "test",
        "live"
      ]
    }
  },
  "required": [
    "customer",
    "reason",
    "held_letters",
    "mode"
  ],
  "additionalProperties": false
}
```

### `customer.suspension_lifted`

Letters for a suspended customer can go again. Held ones go on.

`data`:

```json
{
  "type": "object",
  "properties": {
    "customer": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The customer (cus_…)."
        },
        "ref": {
          "type": "string",
          "description": "Your ref for the customer, as you gave it."
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "ref",
        "name"
      ],
      "additionalProperties": false
    },
    "released_letters": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "mode": {
      "type": "string",
      "enum": [
        "test",
        "live"
      ]
    }
  },
  "required": [
    "customer",
    "released_letters",
    "mode"
  ],
  "additionalProperties": false
}
```

### `customer.closed`

A customer is closed. Its waiting letters were cancelled and their credits went back.

`data`:

```json
{
  "type": "object",
  "properties": {
    "customer": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The customer (cus_…)."
        },
        "ref": {
          "type": "string",
          "description": "Your ref for the customer, as you gave it."
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "ref",
        "name"
      ],
      "additionalProperties": false
    },
    "cancelled_letters": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "credits_returned": {
      "type": "object",
      "properties": {
        "credits": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991,
          "description": "Whole credits. 1 credit is 10p."
        },
        "gbp": {
          "type": "string",
          "pattern": "^-?\\d+\\.\\d{2}$",
          "description": "The same amount in pounds, ex VAT, as a decimal string."
        }
      },
      "required": [
        "credits",
        "gbp"
      ],
      "additionalProperties": false,
      "description": "An amount in credits, with pounds beside it."
    },
    "at_printer": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991,
      "description": "Letters already at the printer: they are still posted."
    },
    "mode": {
      "type": "string",
      "enum": [
        "test",
        "live"
      ]
    }
  },
  "required": [
    "customer",
    "cancelled_letters",
    "credits_returned",
    "at_printer",
    "mode"
  ],
  "additionalProperties": false
}
```

### `customer.data_deleted`

We deleted a closed customer’s letters and addresses. Its records still verify.

`data`:

```json
{
  "type": "object",
  "properties": {
    "customer": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "ref": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "ref"
      ],
      "additionalProperties": false
    },
    "mode": {
      "type": "string",
      "enum": [
        "test",
        "live"
      ]
    }
  },
  "required": [
    "customer",
    "mode"
  ],
  "additionalProperties": false
}
```

### `usage.month_closed`

A month is closed: its letters and credits by customer will not change again.

`data`:

```json
{
  "type": "object",
  "properties": {
    "month": {
      "type": "string",
      "description": "The UK month, as 2026-11."
    },
    "customers": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "letters": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "credits": {
      "type": "object",
      "properties": {
        "credits": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991,
          "description": "Whole credits. 1 credit is 10p."
        },
        "gbp": {
          "type": "string",
          "pattern": "^-?\\d+\\.\\d{2}$",
          "description": "The same amount in pounds, ex VAT, as a decimal string."
        }
      },
      "required": [
        "credits",
        "gbp"
      ],
      "additionalProperties": false,
      "description": "An amount in credits, with pounds beside it."
    },
    "returned_credits": {
      "type": "object",
      "properties": {
        "credits": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991,
          "description": "Whole credits. 1 credit is 10p."
        },
        "gbp": {
          "type": "string",
          "pattern": "^-?\\d+\\.\\d{2}$",
          "description": "The same amount in pounds, ex VAT, as a decimal string."
        }
      },
      "required": [
        "credits",
        "gbp"
      ],
      "additionalProperties": false,
      "description": "An amount in credits, with pounds beside it."
    },
    "csv_path": {
      "type": "string",
      "description": "Where to fetch the month, for example /v1/customers/usage?month=2026-11."
    },
    "mode": {
      "type": "string",
      "enum": [
        "test",
        "live"
      ]
    }
  },
  "required": [
    "month",
    "customers",
    "letters",
    "credits",
    "returned_credits",
    "csv_path",
    "mode"
  ],
  "additionalProperties": false
}
```

### `capacity.day_closed`

The print room is closed on a day. Letters booked for it move to the next posting day.

`data`:

```json
{
  "type": "object",
  "properties": {
    "day": {
      "type": "string",
      "format": "date",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
      "description": "The UK date the print room is closed."
    },
    "next_day": {
      "type": "string",
      "format": "date",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
      "description": "The posting day the letters moved to."
    },
    "letters_moved": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "booked": {
      "type": "boolean",
      "description": "True when your plan had print space booked that day."
    },
    "mode": {
      "type": "string",
      "enum": [
        "test",
        "live"
      ]
    }
  },
  "required": [
    "day",
    "next_day",
    "letters_moved",
    "booked",
    "mode"
  ],
  "additionalProperties": false
}
```

### `capacity.day_reopened`

The print room is open on a day it had closed, after all.

`data`:

```json
{
  "type": "object",
  "properties": {
    "day": {
      "type": "string",
      "format": "date",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
    },
    "mode": {
      "type": "string",
      "enum": [
        "test",
        "live"
      ]
    }
  },
  "required": [
    "day",
    "mode"
  ],
  "additionalProperties": false
}
```
