Webhooks

Webhooks send events about your accounts to a URL you choose as they happen, so you do not need to keep a WebSocket open or poll. Add an endpoint on the Webhooks page of the developer portal and choose the events it receives.

Endpoints

  • The URL must start with https:// and point to a public internet address. It cannot contain spaces or control characters.
  • You can have up to 5 endpoints.
  • Each endpoint has its own signing secret (whsec_...). Reveal it in the portal at any time, or roll it: the old secret stops working at once.
  • Send Test Event in the portal delivers a webhook.test event so you can check your handler. You can send one every 10 seconds, and up to 30 an hour per endpoint, counting retries from the portal.

Event types

TypeWhenData
account.connectedThe account is connected and its data is flowing.account
account.disconnectedThe account stopped sending data or is restarting (reason: heartbeat_lost), or lost its broker connection (reason: broker_disconnected).account, reason
account.deployedDeploying finished: the account is online.account
account.deploy_failedDeploying failed. account.error says why.account
account.undeployedThe account was undeployed.account
deal.addedA new closing deal was recorded.deal
position.openedA position was opened.position
position.closedA position was closed in full.position (its last state)
billing.low_creditYour balance will not cover a renewal due within 3 days.account, renewsAt, balanceCents
billing.grace_startedA renewal was not paid: the account is undeployed at undeployAt unless you top up.account, undeployAt
billing.account_undeployedThe account was undeployed because its renewal was not paid.account
trade_request.completedA trade request finished: done, rejected, expired or unknown. data.tradeRequest has the result.tradeRequest, account

Deal and position events start once an account has finished its first history sync, so its past deals and already open positions do not arrive as new events. Changes made while an account was undeployed are sent after it is deployed again.

On an MT5 netting account a reversal sends deal.added for the closed volume, position.closed for the old ticket and position.opened for the new one. A close by on an MT5 hedging account sends deal.added for each of the two positions, and position.closed for each one it closed in full.

trade_request.completed is sent when a trade placed through the API finishes. When a late answer turns an unknown trade request into done or rejected, or into expired when the account received it too late and never sent it, a second event is sent for the same trade request with the real status and a new event id. The Trading guide explains the statuses.

Payload

Every delivery is a POST with a JSON body:

{
  "id": "6f1c2a4e-9b7d-4c3e-a1f0-2d8e5b7c9a14",
  "type": "deal.added",
  "createdAt": "2026-11-15T10:04:12.481233Z",
  "accountId": "3f6c1a2e-8b4d-4e0f-9a51-7c2d9e4b8a10",
  "data": {
    "deal": {
      "id": "b9e2d7c4-1f3a-4c8e-a6d2-5e7f9a0b1c23",
      "ticket": "66001122",
      "symbol": "EURUSD",
      "type": "sell",
      "volume": 0.1,
      "openPrice": 1.0842,
      "closePrice": 1.086,
      "openTime": "2026-11-15T09:40:00Z",
      "closeTime": "2026-11-15T10:04:11Z",
      "profit": 18.0,
      "swap": 0.0,
      "commission": -0.7,
      "positionId": "55123456",
      "stopLoss": 1.08,
      "takeProfit": 1.09,
      "comment": null,
      "platform": "mt5"
    }
  }
}

data uses the same shapes as the REST API: account as returned by Get Account, deal as in List History Deals, position as in List Positions, tradeRequest as returned by Get Trade Request. accountId is null for webhook.test.

Verifying signatures

Each delivery carries three headers:

HeaderValue
FundedOps-Signaturet=<unix seconds>,v1=<signature>
FundedOps-Event-IdThe event id.
FundedOps-Event-TypeThe event type.

v1 is the hex HMAC-SHA256 of the timestamp, a dot and the raw request body (t.body), keyed with your signing secret. Check it against the raw body before you parse the JSON, and reject deliveries whose timestamp is more than 5 minutes old.

With the Python SDK:

from fundedops import WebhookSignatureError, webhooks
 
SECRET = "whsec_..."
 
def handle(raw_body: bytes, signature_header: str) -> int:
    try:
        event = webhooks.verify(raw_body, signature_header, SECRET)
    except WebhookSignatureError:
        return 400
    if event.type == "deal.added":
        deal = event.data["deal"]
        print(deal["symbol"], deal["profit"])
    return 200

Without the SDK (Node.js):

import crypto from "node:crypto";
 
function verify(rawBody, header, secret) {
  const parts = Object.fromEntries(header.split(",").map((part) => part.split("=")));
  const expected = crypto
    .createHmac("sha256", secret)
    .update(`${parts.t}.${rawBody}`)
    .digest("hex");
  const fresh = Math.abs(Date.now() / 1000 - Number(parts.t)) <= 300;
  return (
    fresh &&
    typeof parts.v1 === "string" &&
    parts.v1.length === expected.length &&
    crypto.timingSafeEqual(Buffer.from(parts.v1), Buffer.from(expected))
  );
}

Responding and retries

  • Answer with any 2xx status within 10 seconds in total, from when we connect until your status and headers arrive, and do slow work after you have answered. The response body is never read.
  • Redirects are not followed and count as a failed delivery.
  • A failed delivery is retried after 30 seconds, 2 minutes, 10 minutes, 30 minutes, 2 hours, 6 hours, 12 hours and 24 hours, then dropped: about 2 days in all.
  • An endpoint with no successful delivery for 3 days is disabled and we email the address you sign in to the portal with. Enable it again in the portal; events from while it was disabled are not resent.
  • The portal keeps 30 days of deliveries with their status, attempts and last HTTP status. Retry sends an abandoned delivery again. You can retry each delivery once an hour, and retries count toward the 30 an hour of Send Test Event. A pending or succeeded delivery cannot be retried.

Order and duplicates

  • Events can arrive out of order. Sort by createdAt, and read the REST API when you need the current state.
  • The same event can arrive more than once, for example when your server answered after the timeout. Keep the ids you have handled and skip repeats.