# Consent, opt-outs and quiet hours

Who may be messaged first, and when - consent, STOP replies, preferences, the suppression list and quiet hours.

> **In a nutshell:** Before a business-initiated template goes out, PaalChat checks the suppression list, the contact's consent for its category, their preferences, the business's limits and its quiet hours. A STOP reply opts a contact out of marketing and notifications. Replies inside the 24-hour window are never blocked.

WhatsApp expects businesses to message people only when they want it. PaalChat applies
the rules for you on every **business-initiated** message (templates), in this order:

1. **Suppression list** - numbers the business must not message first
   ([Suppress a number](/docs/api/add-suppression)). Refused: `recipient_suppressed`.
2. **Consent** for the message's category - `marketing`, `notifications` or
   `transactional`. A revoked category is refused: `recipient_opted_out`.
3. **Preferences** - WhatsApp switched off, or the message's `topic` turned off.
   Refused: `recipient_preference_off`.
4. **Limits** - the business's [daily cap](/docs/rate-limits).
5. **Quiet hours** - outside them the message goes now; inside, it is accepted and held until
   they end (`scheduled_for`).

Replies inside the customer's 24-hour window skip all of this: the customer just wrote.

## Categories

Each send has a category. Pass `category` on [Send message](/docs/api/send-message), or let
PaalChat take it from the template: `MARKETING` → `marketing`, `AUTHENTICATION` →
`transactional`, anything else → `notifications`.

## Opt-outs and opt-ins

- A contact who replies **STOP** (or UNSUBSCRIBE, OPT OUT, CANCEL...) is opted out of
  `marketing` and `notifications`. **START** opts them back in. Transactional messages -
  codes and receipts - are not stopped by a keyword.
- Record opt-ins and opt-outs you collect yourself with
  [Record consent](/docs/api/set-consent).
- Every change is kept in the contact's consent history and sent to you as
  [`contact.consent`](/docs/api/callbacks/contact-consent).
- PaalTech can require a recorded opt-in before any marketing template; ask if your
  business needs it.

## Preferences

[Set notification preferences](/docs/api/set-preferences) stores what the contact chose in
your product: WhatsApp on or off, and topics - `fees`, `results`, `attendance`, `pta`,
`marketing`, `system`. Send `topic` with a template so PaalChat can respect it.

## Quiet hours and time zones

Set a business's `timezone` and `quiet_hours` (for example `22:00`-`06:00`) with
[Create or update business](/docs/api/upsert-business). During quiet hours, non-urgent
templates are accepted (`202`) and held until the hours end, in the **contact's** time zone
when it is known, else the business's. `transactional` messages are never held. To send
something urgent anyway, add `urgent: true` - this needs a key with the `messages.urgent`
ability.
