Document include_event body on POST /notify/:id #15

Merged
matt merged 1 commit from mailship-6u7-document-include-event-body-on-post-noti-292 into main 2026-09-16 14:59:09 +00:00
Collaborator

mailship-6u7

The README API section for POST /notify/:id previously only documented the { id, relay } body shape, but the endpoint also accepts an optional inline event field for NIP-98 include_event support. This PR updates the documentation to cover that path.

Changes

  • Added event? to the documented request body schema.
  • Described the verification logic: event.id must match the path id and the event must pass verifyEvent() (cryptographic signature + id hash check); returns 400 { error: 'Invalid event' } if either fails.
  • Described the relay-fetch fallback when event is omitted, including the { ok: true, stored: false } skip behaviour when the relay has no matching event.
  • Described the dedup behaviour: if the event is already stored (UNIQUE constraint), stored is false; otherwise true.

How to test

Read the updated ### POST /notify/:id section in README.md. The existing unit test (test/notify-response-shape.test.ts) validates the documented { ok, stored } contract and continues to pass.

mailship-6u7 The README API section for `POST /notify/:id` previously only documented the `{ id, relay }` body shape, but the endpoint also accepts an optional inline `event` field for NIP-98 `include_event` support. This PR updates the documentation to cover that path. **Changes** - Added `event?` to the documented request body schema. - Described the verification logic: `event.id` must match the path `id` and the event must pass `verifyEvent()` (cryptographic signature + id hash check); returns 400 `{ error: 'Invalid event' }` if either fails. - Described the relay-fetch fallback when `event` is omitted, including the `{ ok: true, stored: false }` skip behaviour when the relay has no matching event. - Described the dedup behaviour: if the event is already stored (UNIQUE constraint), `stored` is `false`; otherwise `true`. **How to test** Read the updated `### POST /notify/:id` section in README.md. The existing unit test (`test/notify-response-shape.test.ts`) validates the documented `{ ok, stored }` contract and continues to pass.
hudson added 1 commit 2026-09-14 20:11:42 +00:00
document include_event body on POST /notify/:id
All checks were successful
CI / checks (pull_request) Successful in 33s
560c7ef9bc
The endpoint accepts an optional  field for NIP-98 include_event
support. When provided, the event is verified inline (id match + signature
check). When omitted, the event is fetched from the relay. Documents the
{ ok: true, stored: boolean } response and dedup behavior.
matt approved these changes 2026-09-16 14:59:04 +00:00
matt merged commit f4a3873f23 into main 2026-09-16 14:59:09 +00:00
matt deleted branch mailship-6u7-document-include-event-body-on-post-noti-292 2026-09-16 14:59:12 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: matt/mailship#15
No description provided.