PhoenixPerpetualsDocs API v1
Get an API key

API reference

Webhook events⁠.

What a json endpoint receives, and every event type it can receive. How deliveries are signed, retried and checked: the Webhooks guide.

The body

  • idstringrequired

    The event; pass it as after (GET /v1/events) or resume (the stream) to continue from it.

  • typestringrequired

    What happened; webhook.ping is a test.

    One oforder.createdorder.editedorder.filledorder.canceledorder.rejectedorder.expiredfill.createdposition.openedposition.changedposition.closedstrategy.createdstrategy.leg_placedstrategy.leg_modifiedstrategy.leg_filledstrategy.leg_canceledstrategy.leg_rejectedstrategy.orphan_repairedstrategy.slicestrategy.triggeredstrategy.endedtradingview.alert_executedtradingview.alert_refusedaccount.updatedaccount.passedaccount.failedaccount.payout_eligibleaccount.disabledaccount.removedkey.loss_stopkey.expiringsystem.restartedrisk.warningrisk.clearedalert.triggeredwebhook.ping

  • The account number (none on webhook.ping).

  • timeinteger, Unix msrequired

    When it happened.

  • sourcestringrequired

    Where it came from: an order placed through this API or by an AI assistant (the MCP server), one placed on a trading platform, the engine itself (positions), a strategy of this API, or a TradingView alert.

    One ofapimcpplatformenginestrategytradingview

  • dataobjectrequired

    order or fill (the objects REST answers), with changes or close_reason when they apply. A position.* event carries position { market, side, size, average_price } as the engine reported it, and previous_size: read GET .../positions/{market} for its margin, P&L and liquidation.

  • api_versionstringrequired

    The API version the endpoint receives.

  • environmentstringrequired

    The environment of the endpoint and the account.

    One oflivesandbox

  • testboolean

    A test (webhook.ping) or a delivery resent as one.

Every event type

TypeGroupWhat it means
order.createdordersAn order rests on the engine (or a market order was taken).
order.editedordersAn order changed in place (size or price).
order.filledordersAn order filled.
order.canceledordersAn order was canceled; cancel_reason says why.
order.rejectedordersThe engine refused an order; reject.code says why.
order.expiredordersAn order ended by its time in force (gtd, ioc, fok).
fill.createdordersAn execution, with its price and fee.
strategy.createdordersA strategy started.
strategy.leg_placedordersA strategy placed an order.
strategy.leg_modifiedordersA strategy moved one of its orders (a trailing stop, break-even, a chase).
strategy.leg_filledordersAn order of a strategy filled.
strategy.leg_canceledordersAn order of a strategy was canceled.
strategy.leg_rejectedordersThe engine refused an order of a strategy.
strategy.orphan_repairedordersAn exit filled past flat and the position it opened was closed at once.
strategy.sliceordersA TWAP or VWAP slice was sent, carried or refused.
strategy.triggeredordersA conditional order's price was reached: its order was sent.
strategy.endedordersA strategy ended; end_reason says why.
tradingview.alert_executedordersA TradingView alert placed its orders.
tradingview.alert_refusedordersA TradingView alert was refused; reason says why.
position.openedpositionsA position opened (or turned to the other side).
position.changedpositionsA position's size or entry price changed.
position.closedpositionsA position closed.
account.updatedaccountAn account's balance or status changed.
account.passedaccountAn evaluation account passed.
account.failedaccountAn account breached a rule.
account.payout_eligibleaccountA funded account can request a payout.
account.disabledaccountAn account was disabled.
account.removedaccountAn account was removed.
key.loss_stopaccountA key reached its daily loss stop: its trading on the account is paused until the next day.
key.expiringaccountA key expires soon (api.keys.expiry_notice_days before its end), told on each account it reaches.
system.restartedaccountThe trading engine restarted: its orders and positions were reset (one event per account the API was following).
risk.warningriskAn account came near a limit.
risk.clearedriskAn account moved back from a limit.
alert.triggeredalertsA price alert fired: the market's price reached its level.
webhook.pingEvery endpointA test sent from your dashboard or the API.

Guides, endpoints, fields and error codes.