Document include_event body on POST /notify/:id #15
1 changed files with 17 additions and 4 deletions
21
README.md
21
README.md
|
|
@ -80,14 +80,27 @@ Response: { ok: true }
|
||||||
NIP-9a relay push callback. Called by relays or NPB when matching events are found.
|
NIP-9a relay push callback. Called by relays or NPB when matching events are found.
|
||||||
|
|
||||||
```
|
```
|
||||||
Body: { id, relay }
|
Body: { id, relay, event? }
|
||||||
Response: { ok: true, stored: boolean }
|
Response: { ok: true, stored: boolean }
|
||||||
Returns 404 if subscription not found or inactive.
|
Returns 404 if subscription not found or inactive.
|
||||||
```
|
```
|
||||||
|
|
||||||
When the event is not found at the relay (e.g. it was deleted or never arrived),
|
The optional `event` field supports NIP-98 `include_event` — relays can embed
|
||||||
the endpoint returns `{ ok: true, stored: false }` — the event is silently skipped
|
the full event inline to bypass fetching. When `event` is provided:
|
||||||
rather than erroring. The `stored` field is always present in a 200 response.
|
|
||||||
|
- `event.id` must match the `id` string, **and** the event signature must be
|
||||||
|
cryptographically valid (`verifyEvent` from nostr-tools).
|
||||||
|
- If either check fails, the endpoint returns **400** `{ error: 'Invalid event' }`.
|
||||||
|
|
||||||
|
When `event` is omitted, the server fetches the event from the relay using
|
||||||
|
`id` and `relay`. If the relay has no matching event (deleted, expired, or
|
||||||
|
never published), the endpoint returns `{ ok: true, stored: false }` — the
|
||||||
|
event is silently skipped rather than erroring.
|
||||||
|
|
||||||
|
After obtaining the event (from body or relay), it is stored in the local
|
||||||
|
database. If the event is already known (deduplication), `stored` is `false`;
|
||||||
|
otherwise `stored` is `true`. The `stored` field is always present in a 200
|
||||||
|
response.
|
||||||
|
|
||||||
### GET /confirm?token=...
|
### GET /confirm?token=...
|
||||||
Confirm email address via link from confirmation email.
|
Confirm email address via link from confirmation email.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue