PhoenixPerpetualsDocs API v1
Get an API key

API reference ยท Events

GET/v1/events/{event_id}

Get an event⁠.

Read

One event of the log, as the stream and the webhooks send it.

Path parameters#

Responses#

200OK
  • idstringrequired

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

  • typestringrequired

    What happened (GET /v1/webhook-event-types says what each type means).

    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.triggered

  • account_idstringrequired

    The account number.

  • 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.

401The request has no Authorization header.
{
  "error": {
    "type": "authentication",
    "code": "missing_api_key",
    "message": "No API key: send it as Authorization: Bearer <key>.",
    "request_id": "req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f",
    "retryable": false,
    "doc_url": "https://docs.phoenixperpsfunding.com/reference/errors#missing_api_key"
  }
}
403The key only works from the addresses you listed.
{
  "error": {
    "type": "permission",
    "code": "ip_not_allowed",
    "message": "This address is not on the key's allowlist.",
    "request_id": "req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f",
    "retryable": false,
    "doc_url": "https://docs.phoenixperpsfunding.com/reference/errors#ip_not_allowed"
  }
}
404The id is unknown, or older than the event log keeps.
{
  "error": {
    "type": "not_found",
    "code": "event_not_found",
    "message": "No event with that id.",
    "request_id": "req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f",
    "retryable": false,
    "doc_url": "https://docs.phoenixperpsfunding.com/reference/errors#event_not_found"
  }
}
429A request budget is used up (details.scope says which).
{
  "error": {
    "type": "rate_limit",
    "code": "rate_limited",
    "message": "Too many requests: slow down.",
    "request_id": "req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f",
    "retryable": true,
    "doc_url": "https://docs.phoenixperpsfunding.com/reference/errors#rate_limited"
  }
}
500An error we did not expect.
{
  "error": {
    "type": "server",
    "code": "internal_error",
    "message": "Something went wrong on our side.",
    "request_id": "req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f",
    "retryable": true,
    "doc_url": "https://docs.phoenixperpsfunding.com/reference/errors#internal_error"
  }
}
503The API is starting and has not loaded your keys yet.
{
  "error": {
    "type": "engine",
    "code": "not_ready",
    "message": "The API is starting. Try again in a moment.",
    "request_id": "req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f",
    "retryable": true,
    "doc_url": "https://docs.phoenixperpsfunding.com/reference/errors#not_ready"
  }
}

Errors#

Codes this endpoint can return. Match on the code, never on the message.

Guides, endpoints, fields and error codes.