> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nexenergie.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Fetching Day-Ahead Price Forecasts via the OMIE API

> Step-by-step guide to calling the Nexenergie day-ahead forecast endpoint and processing the hourly EUR/MWh price array in your application.

Tenant **admins** register HTTPS endpoints. The platform POSTs JSON when forecasts or realized prices are published. Redirects are not followed.

## Events

<AccordionGroup>
  <Accordion title="forecast.published">
    A new forecast run is stored.
  </Accordion>

  <Accordion title="forecast.changed">
    The new run differs from the previous one by at least the configured deviation threshold.
  </Accordion>

  <Accordion title="prices.published">
    Clean OMIE prices for a product and delivery day are stored.
  </Accordion>

  <Accordion title="ping">
    Manual test from `POST /webhooks/{id}/test`. Always available.
  </Accordion>
</AccordionGroup>

## Register an endpoint

```bash theme={null}
curl -sS https://<host>/api/v1/webhooks \
  -H "Authorization: Bearer <access_jwt>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "trading-desk",
    "url": "https://example.com/nexenergie/hooks",
    "events": ["forecast.published", "forecast.changed", "prices.published"]
  }'
```

The response includes `secret` (prefix `whsec_`). It is not retrievable later. Rotate with `POST /api/v1/webhooks/{id}/rotate-secret`.

<Warning>
  Production URLs must be HTTPS and must not point at localhost, link-local, or private IPs.
</Warning>

## Envelope

Every delivery body looks like:

```json theme={null}
{
  "event": "forecast.published",
  "occurred_at": "2026-08-19T12:00:00+00:00",
  "data": {}
}
```

<Tabs>
  <Tab title="Forecast events">
    `data` includes `forecast_id`, `market_id`, `market_product_id`, `product`, `issued_at`, `model_version_id`, `unit`, and `points` (`time`, `value`, `p10`, `p90`).
  </Tab>

  <Tab title="Price events">
    `data` includes `market_id`, `market_product_id`, `product`, `delivery_date`, `unit`, and `points` (`time`, `value`).
  </Tab>
</Tabs>

## Verify signatures

Headers on every delivery:

* `Nex-Webhook-Id` — delivery id (idempotency key)
* `Nex-Webhook-Event` — event type
* `Nex-Webhook-Signature` — `t=<unix>,v1=<hex>`

`v1` is `HMAC-SHA256(secret, "<t>.<raw body>")` over the raw JSON bytes. Respond with **2xx** so the platform marks the delivery succeeded.
