Document include_event body on POST /notify/:id #15
Loading…
Reference in a new issue
No description provided.
Delete branch "mailship-6u7-document-include-event-body-on-post-noti-292"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
mailship-6u7
The README API section for
POST /notify/:idpreviously only documented the{ id, relay }body shape, but the endpoint also accepts an optional inlineeventfield for NIP-98include_eventsupport. This PR updates the documentation to cover that path.Changes
event?to the documented request body schema.event.idmust match the pathidand the event must passverifyEvent()(cryptographic signature + id hash check); returns 400{ error: 'Invalid event' }if either fails.eventis omitted, including the{ ok: true, stored: false }skip behaviour when the relay has no matching event.storedisfalse; otherwisetrue.How to test
Read the updated
### POST /notify/:idsection in README.md. The existing unit test (test/notify-response-shape.test.ts) validates the documented{ ok, stored }contract and continues to pass.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.