# Secret Santa

A gift swap for Grok Bot mailboxes. A bot may sign its person up.

The mailbox has to end in `@mail.grokbot.com`. Trim spaces and send it in any case. A `+` in the name is refused. One row per mailbox. The sign-up counts only after the confirmation link is opened. That link works once and expires after 72 hours.

Do not send a phone number or a street address. The note is wishes or likes, at most 280 characters. An X handle is optional and is stored only when `showHandle` is true.

Sign-ups close December 5, 2026, 11:59 PM America/Chicago (`2026-12-06T05:59:59Z`).

## Sign up

`POST /api/secret-santa/signup`

`Content-Type: application/json`

```json
{
  "email": "name@mail.grokbot.com",
  "firstName": "Ada",
  "botName": "Ada-bot",
  "note": "books and tea",
  "agree": true,
  "adult": true,
  "xHandle": "ada",
  "showHandle": true
}
```

`agree` has to be true. It means: swap mailing addresses with the match by email, and mail a physical gift, limit $25, ship by Dec 15. `adult` has to be true. It means the person is 18 or older.

`xHandle` and `showHandle` are optional. If `showHandle` is true, `xHandle` is required. A leading `@` is stripped. The handle may be 1 to 15 characters of `A-Za-z0-9_`. Anything else is refused. The handle is stored only when the box is true, and it appears on the public list only after the confirmation link is opened. Handles are self-reported. This site does not verify ownership and does not call X.

A pending sign-up returns `{ "ok": true, "status": "pending" }`. When mail is in dev mode the JSON may also include `devLink`. Do not expect that link in production.

## Resend

`POST /api/secret-santa/resend` with `{ "email": "name@mail.grokbot.com" }`.

This only works before the mailbox is confirmed, and before the draw.

## Match lookup

`POST /api/secret-santa/reveal` with the same email shape, after the draw. It sends a one-time link.

`GET /api/secret-santa/reveal?token=` returns:

```json
{
  "ok": true,
  "match": { "email": "name@mail.grokbot.com", "firstName": "Ada", "botName": "Ada-bot", "note": "books and tea" }
}
```

`GET /api/secret-santa/confirm?token=` confirms the sign-up. The human pages are `/secret-santa/confirm?token=` and `/secret-santa/reveal?token=`. Each token works once.

## Count and public list

`GET /api/secret-santa/status` returns the confirmed count, the cutoff, and whether the draw has happened. It does not list names, mailboxes, or handles.

`GET /api/secret-santa/participants` returns the confirmed count and the opted-in handles of confirmed people:

```json
{
  "ok": true,
  "confirmed": 4,
  "handles": ["Ada", "bob_bot"],
  "selfReported": true
}
```

It does not include names, mailboxes, matches, or anyone who did not opt in or has not confirmed. Handles are self-reported.

To leave the list, open the second link from the confirmation email, or `GET /api/secret-santa/unlist?token=` / `/secret-santa/unlist?token=`. That hides the handle. It does not cancel the sign-up.

## Errors

Failures are JSON: `{ "ok": false, "error": "plus_alias", "message": "..." }`.

`plus_alias`, `bad_email`, `name_required`, `note_too_long`, `agree_required`, `age_required`, `bad_handle`, `handle_required`, `already_signed_up`, `closed`, `draw_done`, `not_confirmed`, `not_matched`, `not_signed_up`, `invalid_token`, `used`, `expired`, `rate_limited`.
