Delivery endpoint
Webhooks
Have each new release posted straight to your own server, set up once from your account.
curl -H "X-API-Key: YOUR_API_KEY" \
"https://api.fxmacrodata.com/v1/webhooks/subscriptions"
import os
import requests
response = requests.get(
"https://api.fxmacrodata.com/v1/webhooks/subscriptions",
headers={"X-API-Key": os.environ["FXMACRODATA_API_KEY"]},
timeout=30,
)
response.raise_for_status()
print(response.json())
const response = await fetch("https://api.fxmacrodata.com/v1/webhooks/subscriptions", {
headers: { "X-API-Key": process.env.FXMACRODATA_API_KEY },
});
const payload = await response.json();
console.log(payload);
What it can do
8 routes in this endpoint
Create a webhook subscription
GET/v1/webhooks/deliveriesList webhook delivery logs
List recent delivery attempts for the account's subscriptions, newest first, with status, attempt count and response code.
GET/v1/webhooks/subscriptionsList webhook subscriptions
List the webhook subscriptions owned by the account. Signing secrets are not returned.
POST/v1/sandbox/replay/webhook-testSend one replayed release to your webhook
Use to send one practice delivery of a real past release to your own webhook subscription, signed exactly as a live delivery.
GET/v1/webhooks/subscriptions/{subscription_id}Get a webhook subscription
Return one webhook subscription with its filters, event types and status.
PATCH/v1/webhooks/subscriptions/{subscription_id}Update a webhook subscription
DELETE/v1/webhooks/subscriptions/{subscription_id}Delete a webhook subscription
POST/v1/webhooks/subscriptions/{subscription_id}/rotate-secretRotate a webhook signing secret
Issue a new signing secret for a subscription. The new secret is returned once and signs every later delivery.
Reference
Parameters and response fields
POST /v1/webhooks/subscriptions Create a webhook subscription
Register an HTTPS endpoint that receives a POST when a release is published. Filter by currency and indicator. events defaults to announcement; add schedule_change to also be told when a publisher moves, cancels or postpones a release, or adds a time to a date-only release. The response carries the signing secret once. Each generic delivery is signed: X-FXMD-Signature: v1=<hex> is the HMAC-SHA256 of {X-FXMD-Timestamp}.{X-FXMD-Event-ID}.{raw body} with that secret. X-FXMD-Event names the event type and X-FXMD-Delivery-ID identifies the delivery. A currency-scoped key can only subscribe to its own currencies.
Parameters
| Name | In | Type | Details |
|---|---|---|---|
| api_key | query | string | Active FXMacroData trial or subscription API key required for live delivery. Use the query parameter for browser or EventSource clients; server-side clients may use the X-API-Key header. |
Request body
| Field | Type | Details |
|---|---|---|
| url | string | HTTPS endpoint that receives webhook POSTs. |
| events[] | string[] | Webhook events: announcement (a release was published; the default when omitted) and schedule_change (a publisher moved, cancelled or postponed a release, or added a time to a date-only release). schedule_change is opt-in and available on the generic destination only. |
| currencies[] | string[] | Optional lowercase currency filters. Empty means all currencies. |
| indicators[] | string[] | Optional indicator slug filters. Empty means all indicators. |
| description | string | Optional customer label for support and operations. |
| destination | string | Delivery preset: generic (default, signed FXMacroData JSON), discord, slack, telegram or airtable. Chat presets reshape the body for the platform; airtable posts one flat record to an Airtable automation's "When webhook received" trigger. Presets are not signed. |
| destination_options | object | Preset options. Telegram: chat_id (required) and parse_mode (HTML or plain). Discord and Slack: optional username. All chat presets: optional prefix text, at most 100 characters, placed in front of every message. Generic: optional text_lang (en or es) with text_locale and text_timezone for a ready-to-send data.text, and include_chart_url: true (with optional chart_lang, en or es) for a data.chart_url link to the release chart image, fetched with your own key. |
GET /v1/webhooks/deliveries List webhook delivery logs
No API key required.
List recent delivery attempts for the account's subscriptions, newest first, with status, attempt count and response code.
Parameters
| Name | In | Type | Details |
|---|---|---|---|
| subscription_id | query | string | Limit the list to one subscription. |
| limit | query | integer | Deliveries to return, between 1 and 500. Default: 100. |
| api_key | query | string | Active FXMacroData trial or subscription API key required for live delivery. Use the query parameter for browser or EventSource clients; server-side clients may use the X-API-Key header. |
GET /v1/webhooks/subscriptions List webhook subscriptions
No API key required.
List the webhook subscriptions owned by the account. Signing secrets are not returned.
Parameters
| Name | In | Type | Details |
|---|---|---|---|
| api_key | query | string | Active FXMacroData trial or subscription API key required for live delivery. Use the query parameter for browser or EventSource clients; server-side clients may use the X-API-Key header. |
POST /v1/sandbox/replay/webhook-test Send one replayed release to your webhook
An API key on an active trial or subscription that includes live event delivery is required. Currency-scoped keys replay only their currencies.
Send one practice delivery of a real past release to a webhook subscription you own. The body is the same signed payload a live delivery carries, plus replay: true, replay_info and the X-FXMD-Replay: true header; verify the signature exactly as for live deliveries. Without start the latest stored release of the indicator is sent; with start, the first release on or after that time. The subscription must be active. Each subscription can receive one test every 10 seconds; test deliveries are sent once, are not retried and do not appear in /v1/webhooks/deliveries. The response reports how your endpoint answered and includes the exact payload sent.
Parameters
| Name | In | Type | Details |
|---|---|---|---|
| api_key | query | string | Active FXMacroData trial or subscription API key required for live delivery. Use the query parameter for browser or EventSource clients; server-side clients may use the X-API-Key header. |
Request body
| Field | Type | Details |
|---|---|---|
| subscription_id | string | A webhook subscription you own. |
| currency | string | Currency of the release to replay, e.g. usd. |
| indicator | string | Indicator slug, e.g. inflation. |
| start | string | Replay the first release on or after this time instead of the latest. |
Response fields
| Field | Type | Details |
|---|---|---|
| replay | boolean | Always true. |
| delivery_id | string | Identifier of this practice delivery, prefixed replay-. |
| delivered | boolean | True when your endpoint answered with a 2xx status. |
| status_code | integer | HTTP status your endpoint returned, or null when it could not be reached. |
| error | string | Connection error type when your endpoint could not be reached. |
| response_excerpt | string | The start of your endpoint's response body. |
| duration_ms | number | Time the delivery took, in milliseconds. |
| payload | object | The exact signed payload that was sent, with replay: true and replay_info. |
GET /v1/webhooks/subscriptions/{subscription_id} Get a webhook subscription
No API key required.
Return one webhook subscription with its filters, event types and status.
Parameters
| Name | In | Type | Details |
|---|---|---|---|
| subscription_idRequired | path | string | Subscription ID returned when the subscription was created. |
| api_key | query | string | Active FXMacroData trial or subscription API key required for live delivery. Use the query parameter for browser or EventSource clients; server-side clients may use the X-API-Key header. |
PATCH /v1/webhooks/subscriptions/{subscription_id} Update a webhook subscription
Change a subscription's URL, event types, filters, label, destination or status. Only the fields sent are changed. Set status to disabled to pause delivery.
Parameters
| Name | In | Type | Details |
|---|---|---|---|
| subscription_idRequired | path | string | Subscription ID returned when the subscription was created. |
| api_key | query | string | Active FXMacroData trial or subscription API key required for live delivery. Use the query parameter for browser or EventSource clients; server-side clients may use the X-API-Key header. |
Request body
| Field | Type | Details |
|---|---|---|
| url | string | |
| events[] | string[] | Replaces the event list. Use announcement, schedule_change or both. |
| currencies[] | string[] | |
| indicators[] | string[] | |
| description | string | |
| status | string | Use active or disabled. |
| destination | string | |
| destination_options | object |
DELETE /v1/webhooks/subscriptions/{subscription_id} Delete a webhook subscription
Delete a webhook subscription. Delivery to its URL stops.
Parameters
| Name | In | Type | Details |
|---|---|---|---|
| subscription_idRequired | path | string | Subscription ID returned when the subscription was created. |
| api_key | query | string | Active FXMacroData trial or subscription API key required for live delivery. Use the query parameter for browser or EventSource clients; server-side clients may use the X-API-Key header. |
POST /v1/webhooks/subscriptions/{subscription_id}/rotate-secret Rotate a webhook signing secret
No API key required.
Issue a new signing secret for a subscription. The new secret is returned once and signs every later delivery.
Parameters
| Name | In | Type | Details |
|---|---|---|---|
| subscription_idRequired | path | string | Subscription ID returned when the subscription was created. |
| api_key | query | string | Active FXMacroData trial or subscription API key required for live delivery. Use the query parameter for browser or EventSource clients; server-side clients may use the X-API-Key header. |
Works well with
Endpoints people use alongside Webhooks
The whole API
All 24 endpoint guides
Rates and markets