> For the complete documentation index, see [llms.txt](https://nytshift.gitbook.io/nytshift-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nytshift.gitbook.io/nytshift-docs/market-data-and-providers/provider-alert-delivery.md).

# Provider alert delivery

## Contract

NIGHTSHIFT sends only `alert-opened` and `alert-resolved` Robinhood Chain provider events. Each POST uses HTTPS, rejects redirects, has an exact JSON body, a stable `idempotency-key` / `x-nightshift-delivery-id`, `x-nightshift-timestamp`, and `x-nightshift-signature: v1=<hex>`. Compute HMAC-SHA256 with the shared secret over `<timestamp>.<raw request body>` using constant-time comparison. Reject stale timestamps and duplicate IDs. Do not return 2xx until the event is durably accepted.

## Degraded delivery

1. Inspect `/api/rhc/providers/health` and its `delivery` object. Never copy the endpoint or secret into a ticket.
2. Confirm both server-process variables exist and `pnpm preflight` reports `HMAC webhook configured server-side`.
3. Check receiver TLS, availability and durable deduplication. NIGHTSHIFT never follows a redirect and never records response bodies.
4. Pending events retain their original ID across bounded retries and restart. Fix the receiver; do not edit the checkpoint or create a second delivery path.
5. A persistent `WEBHOOK_TIMEOUT`, `WEBHOOK_NETWORK_ERROR` or `WEBHOOK_HTTP_ERROR` remains visible without exposing upstream text.

## Secret rotation

Stop NIGHTSHIFT, rotate the receiver and server-process secret together, then restart. Pending events will use the new secret. Verify a controlled test receiver before relying on the channel for production incidents. Never store the secret in `config.json`, repository files, prompts, logs or browser storage.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://nytshift.gitbook.io/nytshift-docs/market-data-and-providers/provider-alert-delivery.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
