{"openapi":"3.1.0","info":{"title":"Phoenix Perpetuals API","version":"1.0.0","description":"Your Phoenix Perpetuals accounts from your own code: accounts, live risk, positions, orders, fills and history."},"servers":[{"url":"https://api.phoenixperpsfunding.com","description":"Live","x-pp-environment":"live"},{"url":"https://sandbox-api.phoenixperpsfunding.com","description":"Sandbox","x-pp-environment":"sandbox"}],"x-pp-streams":{"account":{"live":"wss://api.phoenixperpsfunding.com/v1/stream","sandbox":"wss://sandbox-api.phoenixperpsfunding.com/v1/stream"},"market":"wss://stream.phoenixperpsfunding.com/v1/market-data"},"security":[{"bearer":[]}],"tags":[{"name":"Platform","description":"Who you are, the API version, limits and status."},{"name":"Markets","description":"The markets you can trade and their rules."},{"name":"Accounts","description":"Your evaluation, funded and sandbox accounts."},{"name":"Risk and history","description":"Live risk, the rules and how far you are, the equity curve and daily results."},{"name":"Margin","description":"Leverage and margin mode per market."},{"name":"Positions","description":"Open and closed positions."},{"name":"Orders","description":"Place, change and cancel orders; working and past orders."},{"name":"Exits and strategies","description":"Take-profit and stop-loss legs kept by the API, trailing stops, break-even, orders over time, and orders sent once a price is reached."},{"name":"Alerts","description":"Price alerts: told once when a market reaches your level, never trading."},{"name":"Fills","description":"Every execution with its fee."},{"name":"TradingView","description":"Alert links that turn TradingView alerts into orders: their settings and alert log, and how a message is read."},{"name":"Webhooks","description":"Your endpoints, their delivery log, tests and resends. Endpoints are made in your dashboard."},{"name":"Events","description":"What happened on your accounts, as the account stream sends it (wss://<host>/v1/stream)."}],"paths":{"/v1":{"get":{"operationId":"getApi","summary":"Get the API","description":"The environment of the host you called, the version, the server time, and whether the trading engine is reachable. No key needed.","tags":["Platform"],"x-pp-scope":"public","x-pp-stability":"stable","x-pp-resource":"platform","x-pp-method":"info","x-pp-errors":["rate_limited"],"security":[],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Platform"}},"required":["data"],"additionalProperties":false}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The API is starting and has not loaded your keys yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}}}}},"/v1/openapi.json":{"get":{"operationId":"getSpec","summary":"Get the OpenAPI document","description":"This API described as OpenAPI 3.1, the file the SDKs and these docs are built from.","tags":["Platform"],"x-pp-scope":"public","x-pp-stability":"stable","x-pp-resource":"platform","x-pp-method":"spec","x-pp-errors":["rate_limited"],"security":[],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","description":"This API as OpenAPI 3.1."}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The API is starting and has not loaded your keys yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}}}}},"/v1/status":{"get":{"operationId":"getStatus","summary":"Get the status","description":"Whether the environment takes requests, whether the trading engine is connected, and which features are on.","tags":["Platform"],"x-pp-scope":"public","x-pp-stability":"stable","x-pp-resource":"platform","x-pp-method":"status","x-pp-errors":["rate_limited"],"security":[],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Status"}},"required":["data"],"additionalProperties":false}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The API is starting and has not loaded your keys yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}}}}},"/v1/limits":{"get":{"operationId":"getLimits","summary":"Get the limits","description":"Every request budget and limit, as they stand now. Budgets are per minute; a request takes from each budget it belongs to, and the rate headers of each answer say what is left.","tags":["Platform"],"x-pp-scope":"public","x-pp-stability":"stable","x-pp-resource":"platform","x-pp-method":"limits","x-pp-errors":["rate_limited"],"security":[],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Limits"}},"required":["data"],"additionalProperties":false}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The API is starting and has not loaded your keys yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}}}}},"/v1/restricted-countries":{"get":{"operationId":"listRestrictedCountries","summary":"List restricted countries","description":"The countries whose residents cannot sign up or buy an account, as ISO 3166-1 alpha-2 codes with their names. The same list the website applies. No key needed.","tags":["Platform"],"x-pp-scope":"public","x-pp-stability":"stable","x-pp-resource":"platform","x-pp-method":"restrictedCountries","x-pp-errors":["rate_limited"],"security":[],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/RestrictedCountry"}},"has_more":{"type":"boolean","description":"More items follow: pass next_cursor to get them.","example":false},"next_cursor":{"type":["string","null"],"description":"The cursor of the next page, or null on the last one.","example":null},"as_of":{"type":"integer","format":"int64","x-pp-unit":"ms","description":"When the oldest figure in the list was read.","example":1791460800000}},"required":["data","has_more","next_cursor","as_of"],"additionalProperties":false}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The API is starting and has not loaded your keys yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}}}}},"/v1/me":{"get":{"operationId":"getMe","summary":"Get your key","description":"The key you called with: its access, the accounts it reaches, the limits you set on it and its budgets.","tags":["Platform"],"x-pp-scope":"read","x-pp-stability":"stable","x-pp-resource":"me","x-pp-method":"get","x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Me"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The API is starting and has not loaded your keys yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}}}}},"/v1/markets":{"get":{"operationId":"listMarkets","summary":"List markets","description":"Every market you can trade, with its tick size, size step, leverage, fee and exposure cap. The list is complete: it never pages.","tags":["Markets"],"x-pp-scope":"public","x-pp-stability":"stable","x-pp-resource":"markets","x-pp-method":"list","x-pp-errors":["rate_limited"],"security":[],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Market"}},"has_more":{"type":"boolean","description":"More items follow: pass next_cursor to get them.","example":false},"next_cursor":{"type":["string","null"],"description":"The cursor of the next page, or null on the last one.","example":null},"as_of":{"type":"integer","format":"int64","x-pp-unit":"ms","description":"When the oldest figure in the list was read.","example":1791460800000}},"required":["data","has_more","next_cursor","as_of"],"additionalProperties":false}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The API is starting and has not loaded your keys yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}}}}},"/v1/markets/stats":{"get":{"operationId":"listMarketStats","summary":"List market stats","description":"Every market's last price, its 24 h change, range and volume, and its open interest, in one call (the market data stream's stats channel sends the same every 5 s). The list is complete: it never pages. as_of: when these figures were read.","tags":["Markets"],"x-pp-scope":"public","x-pp-stability":"stable","x-pp-resource":"markets","x-pp-method":"stats","x-pp-errors":["rate_limited","state_unavailable","temporarily_unavailable"],"security":[],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MarketStats"}},"has_more":{"type":"boolean","description":"More items follow: pass next_cursor to get them.","example":false},"next_cursor":{"type":["string","null"],"description":"The cursor of the next page, or null on the last one.","example":null},"as_of":{"type":"integer","format":"int64","x-pp-unit":"ms","description":"When the oldest figure in the list was read.","example":1791460800000}},"required":["data","has_more","next_cursor","as_of"],"additionalProperties":false}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The trading engine did not give a complete answer in time; nothing partial is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"engine","code":"state_unavailable","message":"The account's figures cannot be read right now.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#state_unavailable"}}}}}}}},"/v1/markets/{market}":{"get":{"operationId":"getMarket","summary":"Get a market","tags":["Markets"],"x-pp-scope":"public","x-pp-stability":"stable","x-pp-resource":"markets","x-pp-method":"get","x-pp-errors":["rate_limited","market_not_found"],"security":[],"parameters":[{"name":"market","in":"path","required":true,"description":"A market id.","schema":{"type":"string","example":"BTC-USD"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Market"}},"required":["data"],"additionalProperties":false}}}},"404":{"description":"The market is not offered.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"market_not_found","message":"No market with that id.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#market_not_found"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The API is starting and has not loaded your keys yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}}}}},"/v1/accounts":{"get":{"operationId":"listAccounts","summary":"List accounts","description":"The accounts your key reaches in this environment, newest first, with their rule. On the live host: your evaluation and funded accounts. On the sandbox host: your sandbox accounts.","tags":["Accounts"],"x-pp-scope":"read","x-pp-stability":"stable","x-pp-resource":"accounts","x-pp-method":"list","x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","state_unavailable"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Account"}},"has_more":{"type":"boolean","description":"More items follow: pass next_cursor to get them.","example":false},"next_cursor":{"type":["string","null"],"description":"The cursor of the next page, or null on the last one.","example":null},"as_of":{"type":"integer","format":"int64","x-pp-unit":"ms","description":"When the oldest figure in the list was read.","example":1791460800000}},"required":["data","has_more","next_cursor","as_of"],"additionalProperties":false}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The trading engine did not give a complete answer in time; nothing partial is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"engine","code":"state_unavailable","message":"The account's figures cannot be read right now.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#state_unavailable"}}}}}}},"post":{"operationId":"createSandboxAccount","summary":"Open a sandbox account","description":"Reserves a new sandbox account; it opens within moments (status pending, then active). Every account you open counts toward your sandbox accounts for life, see GET /v1/limits.","tags":["Accounts"],"x-pp-scope":"trade","x-pp-stability":"stable","x-pp-resource":"accounts","x-pp-method":"createSandbox","x-pp-idempotent":true,"x-pp-environments":["sandbox"],"x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","sandbox_limit_reached","sandbox_disabled","idempotency_key_required","invalid_idempotency_key","insufficient_permission","temporarily_unavailable"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"A unique value per action: a retry with the same value never does it twice.","schema":{"type":"string","example":"sandbox-open-0001"}}],"responses":{"202":{"description":"Accepted","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Account"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Calls that create something need a key that makes a retry safe.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"invalid_request","code":"idempotency_key_required","message":"This call needs an Idempotency-Key header.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#idempotency_key_required"}}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"409":{"description":"Each customer may open a fixed number of sandbox accounts, ever.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"conflict","code":"sandbox_limit_reached","message":"You have opened every sandbox account you may.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#sandbox_limit_reached"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"Sandbox accounts are not being opened.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"engine","code":"sandbox_disabled","message":"The sandbox is closed for now.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#sandbox_disabled"}}}}}}}},"/v1/accounts/{account_id}":{"get":{"operationId":"getAccount","summary":"Get an account","description":"The account with its live risk (null while it is being opened).","tags":["Accounts"],"x-pp-scope":"read","x-pp-stability":"stable","x-pp-resource":"accounts","x-pp-method":"get","x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","account_not_found","state_unavailable"],"parameters":[{"name":"account_id","in":"path","required":true,"description":"The account number.","schema":{"type":"string","example":"SANDBOX-00042-001"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AccountDetail"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The account does not exist in this environment, or the key does not reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"account_not_found","message":"No account with that id is reachable with this key.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_found"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The trading engine did not give a complete answer in time; nothing partial is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"engine","code":"state_unavailable","message":"The account's figures cannot be read right now.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#state_unavailable"}}}}}}}},"/v1/accounts/{account_id}/risk":{"get":{"operationId":"getRisk","summary":"Get live risk","description":"Equity, open P&L, margin, exposure per market, the room to each loss limit, the profit target and the nearest liquidation: the figures of your dashboard, computed the same way.","tags":["Risk and history"],"x-pp-scope":"read","x-pp-stability":"stable","x-pp-resource":"accounts","x-pp-method":"risk","x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","account_not_found","state_unavailable","account_not_ready"],"parameters":[{"name":"account_id","in":"path","required":true,"description":"The account number.","schema":{"type":"string","example":"SANDBOX-00042-001"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AccountRisk"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The account does not exist in this environment, or the key does not reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"account_not_found","message":"No account with that id is reachable with this key.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_found"}}}}},"409":{"description":"The account exists but is not open on the trading engine yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"conflict","code":"account_not_ready","message":"This account is still being opened.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_ready"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The trading engine did not give a complete answer in time; nothing partial is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"engine","code":"state_unavailable","message":"The account's figures cannot be read right now.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#state_unavailable"}}}}}}}},"/v1/accounts/{account_id}/trading-policy":{"get":{"operationId":"getTradingPolicy","summary":"Get the trading policy","description":"Everything that decides whether an order goes through: the rule, the trading day, slippage bounds, margin, order limits, the limits you set on the key and its budgets.","tags":["Risk and history"],"x-pp-scope":"read","x-pp-stability":"stable","x-pp-resource":"accounts","x-pp-method":"tradingPolicy","x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","account_not_found","state_unavailable","account_not_ready"],"parameters":[{"name":"account_id","in":"path","required":true,"description":"The account number.","schema":{"type":"string","example":"SANDBOX-00042-001"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/TradingPolicy"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The account does not exist in this environment, or the key does not reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"account_not_found","message":"No account with that id is reachable with this key.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_found"}}}}},"409":{"description":"The account exists but is not open on the trading engine yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"conflict","code":"account_not_ready","message":"This account is still being opened.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_ready"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The trading engine did not give a complete answer in time; nothing partial is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"engine","code":"state_unavailable","message":"The account's figures cannot be read right now.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#state_unavailable"}}}}}}}},"/v1/accounts/{account_id}/progress":{"get":{"operationId":"getProgress","summary":"Get progress","description":"Each objective (profit target, trading days) and each loss limit, with where it stands.","tags":["Risk and history"],"x-pp-scope":"read","x-pp-stability":"stable","x-pp-resource":"accounts","x-pp-method":"progress","x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","account_not_found","state_unavailable","account_not_ready"],"parameters":[{"name":"account_id","in":"path","required":true,"description":"The account number.","schema":{"type":"string","example":"SANDBOX-00042-001"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Progress"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The account does not exist in this environment, or the key does not reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"account_not_found","message":"No account with that id is reachable with this key.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_found"}}}}},"409":{"description":"The account exists but is not open on the trading engine yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"conflict","code":"account_not_ready","message":"This account is still being opened.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_ready"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The trading engine did not give a complete answer in time; nothing partial is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"engine","code":"state_unavailable","message":"The account's figures cannot be read right now.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#state_unavailable"}}}}}}}},"/v1/accounts/{account_id}/history/equity":{"get":{"operationId":"getEquityHistory","summary":"Get the equity curve","tags":["Risk and history"],"x-pp-scope":"read","x-pp-stability":"stable","x-pp-resource":"history","x-pp-method":"equity","x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","account_not_found","state_unavailable","account_not_ready","invalid_parameter"],"parameters":[{"name":"account_id","in":"path","required":true,"description":"The account number.","schema":{"type":"string","example":"SANDBOX-00042-001"}},{"name":"resolution","in":"query","description":"One point per closed trade, or per trading day.","schema":{"type":"string","enum":["trade","day"],"default":"trade","example":"trade"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/EquityHistory"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"A query or path parameter is out of range or the wrong kind.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"invalid_request","code":"invalid_parameter","message":"A parameter has a value this route does not take.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#invalid_parameter"}}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The account does not exist in this environment, or the key does not reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"account_not_found","message":"No account with that id is reachable with this key.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_found"}}}}},"409":{"description":"The account exists but is not open on the trading engine yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"conflict","code":"account_not_ready","message":"This account is still being opened.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_ready"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The trading engine did not give a complete answer in time; nothing partial is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"engine","code":"state_unavailable","message":"The account's figures cannot be read right now.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#state_unavailable"}}}}}}}},"/v1/accounts/{account_id}/history/daily":{"get":{"operationId":"listDailyResults","summary":"List daily results","description":"One row per trading day with a trade or a payout (midnight to midnight New York), newest first.","tags":["Risk and history"],"x-pp-scope":"read","x-pp-stability":"stable","x-pp-resource":"history","x-pp-method":"daily","x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","account_not_found","state_unavailable","account_not_ready"],"parameters":[{"name":"account_id","in":"path","required":true,"description":"The account number.","schema":{"type":"string","example":"SANDBOX-00042-001"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DailyResult"}},"has_more":{"type":"boolean","description":"More items follow: pass next_cursor to get them.","example":false},"next_cursor":{"type":["string","null"],"description":"The cursor of the next page, or null on the last one.","example":null},"as_of":{"type":"integer","format":"int64","x-pp-unit":"ms","description":"When the oldest figure in the list was read.","example":1791460800000}},"required":["data","has_more","next_cursor","as_of"],"additionalProperties":false}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The account does not exist in this environment, or the key does not reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"account_not_found","message":"No account with that id is reachable with this key.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_found"}}}}},"409":{"description":"The account exists but is not open on the trading engine yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"conflict","code":"account_not_ready","message":"This account is still being opened.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_ready"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The trading engine did not give a complete answer in time; nothing partial is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"engine","code":"state_unavailable","message":"The account's figures cannot be read right now.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#state_unavailable"}}}}}}}},"/v1/accounts/{account_id}/margin":{"get":{"operationId":"listMarginSettings","summary":"List margin settings","description":"The leverage and margin mode of each market on this account.","tags":["Margin"],"x-pp-scope":"read","x-pp-stability":"stable","x-pp-resource":"margin","x-pp-method":"list","x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","account_not_found","state_unavailable","account_not_ready"],"parameters":[{"name":"account_id","in":"path","required":true,"description":"The account number.","schema":{"type":"string","example":"SANDBOX-00042-001"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MarginSetting"}},"has_more":{"type":"boolean","description":"More items follow: pass next_cursor to get them.","example":false},"next_cursor":{"type":["string","null"],"description":"The cursor of the next page, or null on the last one.","example":null},"as_of":{"type":"integer","format":"int64","x-pp-unit":"ms","description":"When the oldest figure in the list was read.","example":1791460800000}},"required":["data","has_more","next_cursor","as_of"],"additionalProperties":false}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The account does not exist in this environment, or the key does not reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"account_not_found","message":"No account with that id is reachable with this key.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_found"}}}}},"409":{"description":"The account exists but is not open on the trading engine yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"conflict","code":"account_not_ready","message":"This account is still being opened.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_ready"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The trading engine did not give a complete answer in time; nothing partial is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"engine","code":"state_unavailable","message":"The account's figures cannot be read right now.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#state_unavailable"}}}}}}}},"/v1/accounts/{account_id}/positions":{"get":{"operationId":"listPositions","summary":"List open positions","description":"Every open position, valued at the market price, with its liquidation and breach prices and the exits that protect it. The list is complete or the call fails: it is never partial.","tags":["Positions"],"x-pp-scope":"read","x-pp-stability":"stable","x-pp-resource":"positions","x-pp-method":"list","x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","account_not_found","state_unavailable","account_not_ready","invalid_parameter"],"parameters":[{"name":"account_id","in":"path","required":true,"description":"The account number.","schema":{"type":"string","example":"SANDBOX-00042-001"}},{"name":"market","in":"query","description":"Only this market.","schema":{"type":"string","example":"BTC-USD"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Position"}},"has_more":{"type":"boolean","description":"More items follow: pass next_cursor to get them.","example":false},"next_cursor":{"type":["string","null"],"description":"The cursor of the next page, or null on the last one.","example":null},"as_of":{"type":"integer","format":"int64","x-pp-unit":"ms","description":"When the oldest figure in the list was read.","example":1791460800000}},"required":["data","has_more","next_cursor","as_of"],"additionalProperties":false}}}},"400":{"description":"A query or path parameter is out of range or the wrong kind.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"invalid_request","code":"invalid_parameter","message":"A parameter has a value this route does not take.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#invalid_parameter"}}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The account does not exist in this environment, or the key does not reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"account_not_found","message":"No account with that id is reachable with this key.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_found"}}}}},"409":{"description":"The account exists but is not open on the trading engine yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"conflict","code":"account_not_ready","message":"This account is still being opened.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_ready"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The trading engine did not give a complete answer in time; nothing partial is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"engine","code":"state_unavailable","message":"The account's figures cannot be read right now.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#state_unavailable"}}}}}}}},"/v1/accounts/{account_id}/positions/{market}":{"get":{"operationId":"getPosition","summary":"Get an open position","tags":["Positions"],"x-pp-scope":"read","x-pp-stability":"stable","x-pp-resource":"positions","x-pp-method":"get","x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","account_not_found","state_unavailable","account_not_ready","position_not_found","invalid_parameter"],"parameters":[{"name":"account_id","in":"path","required":true,"description":"The account number.","schema":{"type":"string","example":"SANDBOX-00042-001"}},{"name":"market","in":"path","required":true,"description":"A market id.","schema":{"type":"string","example":"BTC-USD"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Position"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"A query or path parameter is out of range or the wrong kind.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"invalid_request","code":"invalid_parameter","message":"A parameter has a value this route does not take.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#invalid_parameter"}}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The account does not exist in this environment, or the key does not reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"account_not_found","message":"No account with that id is reachable with this key.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_found"}}}}},"409":{"description":"The account exists but is not open on the trading engine yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"conflict","code":"account_not_ready","message":"This account is still being opened.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_ready"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The trading engine did not give a complete answer in time; nothing partial is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"engine","code":"state_unavailable","message":"The account's figures cannot be read right now.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#state_unavailable"}}}}}}}},"/v1/accounts/{account_id}/closed-positions":{"get":{"operationId":"listClosedPositions","summary":"List closed positions","description":"Closed positions, newest first, each with the pieces it was closed in.","tags":["Positions"],"x-pp-scope":"read","x-pp-stability":"stable","x-pp-resource":"positions","x-pp-method":"listClosed","x-pp-pagination":{"param":"cursor","items":"data","next":"next_cursor","has_more":"has_more","limit":"limit"},"x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","account_not_found","state_unavailable","account_not_ready","invalid_parameter","invalid_cursor"],"parameters":[{"name":"account_id","in":"path","required":true,"description":"The account number.","schema":{"type":"string","example":"SANDBOX-00042-001"}},{"name":"market","in":"query","description":"Only this market.","schema":{"type":"string","example":"BTC-USD"}},{"name":"limit","in":"query","description":"Page size.","schema":{"type":"integer","minimum":1,"maximum":200,"default":50,"example":50}},{"name":"cursor","in":"query","description":"next_cursor from the previous page, with the same filters.","schema":{"type":"string","example":"eyJzIjoiZmlsbHMifQ.c2lnbmF0dXJl"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ClosedPosition"}},"has_more":{"type":"boolean","description":"More items follow: pass next_cursor to get them.","example":false},"next_cursor":{"type":["string","null"],"description":"The cursor of the next page, or null on the last one.","example":null},"as_of":{"type":"integer","format":"int64","x-pp-unit":"ms","description":"When the oldest figure in the list was read.","example":1791460800000}},"required":["data","has_more","next_cursor","as_of"],"additionalProperties":false}}}},"400":{"description":"A query or path parameter is out of range or the wrong kind.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"invalid_request","code":"invalid_parameter","message":"A parameter has a value this route does not take.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#invalid_parameter"}}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The account does not exist in this environment, or the key does not reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"account_not_found","message":"No account with that id is reachable with this key.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_found"}}}}},"409":{"description":"The account exists but is not open on the trading engine yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"conflict","code":"account_not_ready","message":"This account is still being opened.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_ready"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The trading engine did not give a complete answer in time; nothing partial is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"engine","code":"state_unavailable","message":"The account's figures cannot be read right now.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#state_unavailable"}}}}}}}},"/v1/accounts/{account_id}/orders":{"get":{"operationId":"listOrders","summary":"List orders","description":"Orders, newest first: working ones and past ones. Orders placed on a trading platform are listed too (source platform).","tags":["Orders"],"x-pp-scope":"read","x-pp-stability":"stable","x-pp-resource":"orders","x-pp-method":"list","x-pp-pagination":{"param":"cursor","items":"data","next":"next_cursor","has_more":"has_more","limit":"limit"},"x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","account_not_found","state_unavailable","invalid_parameter","invalid_cursor"],"parameters":[{"name":"account_id","in":"path","required":true,"description":"The account number.","schema":{"type":"string","example":"SANDBOX-00042-001"}},{"name":"status","in":"query","description":"working: the complete set of working orders. history: past orders. all: both.","schema":{"type":"string","enum":["all","working","history"],"default":"all","example":"working"}},{"name":"market","in":"query","description":"Only this market.","schema":{"type":"string","example":"BTC-USD"}},{"name":"client_order_id","in":"query","description":"The order you placed through the API with this id.","schema":{"type":"string","example":"momentum-0142"}},{"name":"limit","in":"query","description":"Page size.","schema":{"type":"integer","minimum":1,"maximum":200,"default":50,"example":50}},{"name":"cursor","in":"query","description":"next_cursor from the previous page, with the same filters.","schema":{"type":"string","example":"eyJzIjoiZmlsbHMifQ.c2lnbmF0dXJl"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Order"}},"has_more":{"type":"boolean","description":"More items follow: pass next_cursor to get them.","example":false},"next_cursor":{"type":["string","null"],"description":"The cursor of the next page, or null on the last one.","example":null},"as_of":{"type":"integer","format":"int64","x-pp-unit":"ms","description":"When the oldest figure in the list was read.","example":1791460800000},"history_complete":{"type":"boolean","description":"With past orders: false when the history reaches further back than this list covers.","example":true}},"required":["data","has_more","next_cursor","as_of"],"additionalProperties":false}}}},"400":{"description":"A query or path parameter is out of range or the wrong kind.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"invalid_request","code":"invalid_parameter","message":"A parameter has a value this route does not take.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#invalid_parameter"}}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The account does not exist in this environment, or the key does not reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"account_not_found","message":"No account with that id is reachable with this key.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_found"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The trading engine did not give a complete answer in time; nothing partial is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"engine","code":"state_unavailable","message":"The account's figures cannot be read right now.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#state_unavailable"}}}}}}},"post":{"operationId":"placeOrder","summary":"Place an order","description":"Places an order on the account. A market order waits a moment for its fill. When the engine's answer is lost on the way, the answer is 202 with status unconfirmed: read the order again (Location) rather than placing it again.","tags":["Orders"],"x-pp-scope":"trade","x-pp-stability":"stable","x-pp-resource":"orders","x-pp-method":"create","x-pp-idempotent":true,"x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","account_not_found","account_not_ready","account_not_tradable","insufficient_permission","invalid_request","unknown_field","idempotency_key_required","invalid_idempotency_key","idempotency_key_reused","operation_in_progress","state_unavailable","stale_quote","engine_unavailable","engine_busy","key_market_not_allowed","market_not_found","invalid_size_step","invalid_price_tick","price_out_of_band","stop_already_triggered","post_only_would_fill","limit_inside_spread","order_too_small","working_order_cap","key_reduce_only","key_max_order_notional","key_max_position_notional","insufficient_margin","exposure_cap_exceeded","reduce_only_violation","slippage_exceeded","no_price","market_closed","market_not_offered","market_option_held","weekend_close","market_halted","position_liquidating","account_paused","insufficient_balance","order_rejected","client_order_id_conflict"],"parameters":[{"name":"account_id","in":"path","required":true,"description":"The account number.","schema":{"type":"string","example":"SANDBOX-00042-001"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A unique value per action: a retry with the same value never does it twice.","schema":{"type":"string","example":"sandbox-open-0001"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrder"},"example":{"market":"BTC-USD","side":"buy","type":"market","size":"0.01","max_slippage_pct":"0.5","client_order_id":"momentum-0142","exits":{"take_profit":[{"distance":"600","size_pct":"100"}],"stop_loss":{"distance":"300"}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Order"}},"required":["data"],"additionalProperties":false}}}},"202":{"description":"Sent, but the engine's answer was lost on the way: read the order again (Location).","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Order"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"The request is malformed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"invalid_request","code":"invalid_request","message":"The request is not valid.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#invalid_request"}}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The account does not exist in this environment, or the key does not reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"account_not_found","message":"No account with that id is reachable with this key.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_found"}}}}},"409":{"description":"The account exists but is not open on the trading engine yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"conflict","code":"account_not_ready","message":"This account is still being opened.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_ready"}}}}},"422":{"description":"The account passed, failed, or was closed (details.reason).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"rule_rejection","code":"account_not_tradable","message":"This account cannot trade.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_tradable"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The trading engine did not give a complete answer in time; nothing partial is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"engine","code":"state_unavailable","message":"The account's figures cannot be read right now.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#state_unavailable"}}}}}}}},"/v1/accounts/{account_id}/orders/{order_id}":{"get":{"operationId":"getOrder","summary":"Get an order","tags":["Orders"],"x-pp-scope":"read","x-pp-stability":"stable","x-pp-resource":"orders","x-pp-method":"get","x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","account_not_found","state_unavailable","order_not_found"],"parameters":[{"name":"account_id","in":"path","required":true,"description":"The account number.","schema":{"type":"string","example":"SANDBOX-00042-001"}},{"name":"order_id","in":"path","required":true,"description":"The order.","schema":{"type":"string","example":"ord_01JAB7Q8XK4M2N5P7R9S3T5V7W"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Order"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The account does not exist in this environment, or the key does not reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"account_not_found","message":"No account with that id is reachable with this key.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_found"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The trading engine did not give a complete answer in time; nothing partial is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"engine","code":"state_unavailable","message":"The account's figures cannot be read right now.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#state_unavailable"}}}}}}},"patch":{"operationId":"modifyOrder","summary":"Change an order","description":"Changes the size or price of a working order placed through the API, in place. Without an Idempotency-Key a change is sent once; with one, the same change sent again under it is done once.","tags":["Orders"],"x-pp-scope":"trade","x-pp-stability":"stable","x-pp-resource":"orders","x-pp-method":"modify","x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","account_not_found","account_not_ready","account_not_tradable","insufficient_permission","invalid_request","unknown_field","idempotency_key_required","invalid_idempotency_key","idempotency_key_reused","operation_in_progress","state_unavailable","stale_quote","engine_unavailable","engine_busy","key_market_not_allowed","order_not_found","order_not_working","invalid_size_step","invalid_price_tick","price_out_of_band","stop_already_triggered","limit_inside_spread","post_only_would_fill","key_max_order_notional"],"parameters":[{"name":"account_id","in":"path","required":true,"description":"The account number.","schema":{"type":"string","example":"SANDBOX-00042-001"}},{"name":"order_id","in":"path","required":true,"description":"The order.","schema":{"type":"string","example":"ord_01JAB7Q8XK4M2N5P7R9S3T5V7W"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Optional: give one to send the change again safely; the same value never applies it twice.","schema":{"type":"string","example":"sandbox-open-0001"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModifyOrder"},"example":{"limit_price":"61900"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Order"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"The request is malformed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"invalid_request","code":"invalid_request","message":"The request is not valid.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#invalid_request"}}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The account does not exist in this environment, or the key does not reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"account_not_found","message":"No account with that id is reachable with this key.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_found"}}}}},"409":{"description":"The account exists but is not open on the trading engine yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"conflict","code":"account_not_ready","message":"This account is still being opened.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_ready"}}}}},"422":{"description":"The account passed, failed, or was closed (details.reason).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"rule_rejection","code":"account_not_tradable","message":"This account cannot trade.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_tradable"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The trading engine did not give a complete answer in time; nothing partial is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"engine","code":"state_unavailable","message":"The account's figures cannot be read right now.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#state_unavailable"}}}}}}},"delete":{"operationId":"cancelOrder","summary":"Cancel an order","description":"Cancels a working order of the account, placed through the API or on a trading platform. When it filled first, the answer is 409 order_not_working.","tags":["Orders"],"x-pp-scope":"trade","x-pp-stability":"stable","x-pp-resource":"orders","x-pp-method":"cancel","x-pp-retry-safe":true,"x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","account_not_found","account_not_ready","account_not_tradable","insufficient_permission","invalid_request","unknown_field","idempotency_key_required","invalid_idempotency_key","idempotency_key_reused","operation_in_progress","state_unavailable","stale_quote","engine_unavailable","engine_busy","key_market_not_allowed","order_not_found","order_not_working"],"parameters":[{"name":"account_id","in":"path","required":true,"description":"The account number.","schema":{"type":"string","example":"SANDBOX-00042-001"}},{"name":"order_id","in":"path","required":true,"description":"The order.","schema":{"type":"string","example":"ord_01JAB7Q8XK4M2N5P7R9S3T5V7W"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Order"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"The request is malformed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"invalid_request","code":"invalid_request","message":"The request is not valid.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#invalid_request"}}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The account does not exist in this environment, or the key does not reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"account_not_found","message":"No account with that id is reachable with this key.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_found"}}}}},"409":{"description":"The account exists but is not open on the trading engine yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"conflict","code":"account_not_ready","message":"This account is still being opened.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_ready"}}}}},"422":{"description":"The account passed, failed, or was closed (details.reason).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"rule_rejection","code":"account_not_tradable","message":"This account cannot trade.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_tradable"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The trading engine did not give a complete answer in time; nothing partial is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"engine","code":"state_unavailable","message":"The account's figures cannot be read right now.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#state_unavailable"}}}}}}}},"/v1/accounts/{account_id}/orders/test":{"post":{"operationId":"testOrder","summary":"Preview an order","description":"What an order would do now, sent nowhere: whether it would fill, rest or be refused (and why), its price, fee, margin, the position after it and the room under the exposure cap. Any key may call it.","tags":["Orders"],"x-pp-scope":"read","x-pp-stability":"stable","x-pp-resource":"orders","x-pp-method":"preview","x-pp-retry-safe":true,"x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","account_not_found","account_not_ready","state_unavailable","stale_quote","invalid_request","unknown_field","market_not_found","invalid_size_step","invalid_price_tick"],"parameters":[{"name":"account_id","in":"path","required":true,"description":"The account number.","schema":{"type":"string","example":"SANDBOX-00042-001"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrder"},"example":{"market":"BTC-USD","side":"buy","type":"market","size":"0.01","max_slippage_pct":"0.5"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WhatIf"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"The request is malformed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"invalid_request","code":"invalid_request","message":"The request is not valid.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#invalid_request"}}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The account does not exist in this environment, or the key does not reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"account_not_found","message":"No account with that id is reachable with this key.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_found"}}}}},"409":{"description":"The account exists but is not open on the trading engine yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"conflict","code":"account_not_ready","message":"This account is still being opened.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_ready"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The trading engine did not give a complete answer in time; nothing partial is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"engine","code":"state_unavailable","message":"The account's figures cannot be read right now.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#state_unavailable"}}}}}}}},"/v1/accounts/{account_id}/orders/cancel-all":{"post":{"operationId":"cancelAllOrders","summary":"Cancel all orders","description":"Cancels every working order of the account, from any platform, or only those of one market. A key limited to some markets cancels on those only.","tags":["Orders"],"x-pp-scope":"trade","x-pp-stability":"stable","x-pp-resource":"orders","x-pp-method":"cancelAll","x-pp-idempotent":true,"x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","account_not_found","account_not_ready","account_not_tradable","insufficient_permission","invalid_request","unknown_field","idempotency_key_required","invalid_idempotency_key","idempotency_key_reused","operation_in_progress","state_unavailable","stale_quote","engine_unavailable","engine_busy","key_market_not_allowed","market_not_found"],"parameters":[{"name":"account_id","in":"path","required":true,"description":"The account number.","schema":{"type":"string","example":"SANDBOX-00042-001"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A unique value per action: a retry with the same value never does it twice.","schema":{"type":"string","example":"sandbox-open-0001"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelAll"},"example":{"market":"BTC-USD"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CancelAllResult"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"The request is malformed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"invalid_request","code":"invalid_request","message":"The request is not valid.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#invalid_request"}}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The account does not exist in this environment, or the key does not reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"account_not_found","message":"No account with that id is reachable with this key.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_found"}}}}},"409":{"description":"The account exists but is not open on the trading engine yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"conflict","code":"account_not_ready","message":"This account is still being opened.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_ready"}}}}},"422":{"description":"The account passed, failed, or was closed (details.reason).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"rule_rejection","code":"account_not_tradable","message":"This account cannot trade.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_tradable"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The trading engine did not give a complete answer in time; nothing partial is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"engine","code":"state_unavailable","message":"The account's figures cannot be read right now.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#state_unavailable"}}}}}}}},"/v1/accounts/{account_id}/positions/{market}/close":{"post":{"operationId":"closePosition","summary":"Close a position","description":"Closes the position, or part of it, at the market. No other order is touched.","tags":["Positions"],"x-pp-scope":"trade","x-pp-stability":"stable","x-pp-resource":"positions","x-pp-method":"close","x-pp-idempotent":true,"x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","account_not_found","account_not_ready","account_not_tradable","insufficient_permission","invalid_request","unknown_field","idempotency_key_required","invalid_idempotency_key","idempotency_key_reused","operation_in_progress","state_unavailable","stale_quote","engine_unavailable","engine_busy","key_market_not_allowed","market_not_found","invalid_size_step","invalid_price_tick","price_out_of_band","stop_already_triggered","post_only_would_fill","limit_inside_spread","order_too_small","working_order_cap","key_reduce_only","key_max_order_notional","key_max_position_notional","insufficient_margin","exposure_cap_exceeded","reduce_only_violation","slippage_exceeded","no_price","market_closed","market_not_offered","market_option_held","weekend_close","market_halted","position_liquidating","account_paused","insufficient_balance","order_rejected","position_not_found"],"parameters":[{"name":"account_id","in":"path","required":true,"description":"The account number.","schema":{"type":"string","example":"SANDBOX-00042-001"}},{"name":"market","in":"path","required":true,"description":"A market id.","schema":{"type":"string","example":"BTC-USD"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A unique value per action: a retry with the same value never does it twice.","schema":{"type":"string","example":"sandbox-open-0001"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClosePosition"},"example":{"size":"0.005"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Order"}},"required":["data"],"additionalProperties":false}}}},"202":{"description":"Sent, but the engine's answer was lost on the way: read the order again (Location).","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Order"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"The request is malformed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"invalid_request","code":"invalid_request","message":"The request is not valid.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#invalid_request"}}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The account does not exist in this environment, or the key does not reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"account_not_found","message":"No account with that id is reachable with this key.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_found"}}}}},"409":{"description":"The account exists but is not open on the trading engine yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"conflict","code":"account_not_ready","message":"This account is still being opened.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_ready"}}}}},"422":{"description":"The account passed, failed, or was closed (details.reason).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"rule_rejection","code":"account_not_tradable","message":"This account cannot trade.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_tradable"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The trading engine did not give a complete answer in time; nothing partial is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"engine","code":"state_unavailable","message":"The account's figures cannot be read right now.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#state_unavailable"}}}}}}}},"/v1/accounts/{account_id}/flatten":{"post":{"operationId":"flatten","summary":"Flatten the account","description":"Cancels every working order, then closes every position. A key limited to some markets does this on those only.","tags":["Positions"],"x-pp-scope":"trade","x-pp-stability":"stable","x-pp-resource":"positions","x-pp-method":"flatten","x-pp-idempotent":true,"x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","account_not_found","account_not_ready","account_not_tradable","insufficient_permission","invalid_request","unknown_field","idempotency_key_required","invalid_idempotency_key","idempotency_key_reused","operation_in_progress","state_unavailable","stale_quote","engine_unavailable","engine_busy","key_market_not_allowed","market_closed"],"parameters":[{"name":"account_id","in":"path","required":true,"description":"The account number.","schema":{"type":"string","example":"SANDBOX-00042-001"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A unique value per action: a retry with the same value never does it twice.","schema":{"type":"string","example":"sandbox-open-0001"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FlattenResult"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"The request is malformed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"invalid_request","code":"invalid_request","message":"The request is not valid.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#invalid_request"}}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The account does not exist in this environment, or the key does not reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"account_not_found","message":"No account with that id is reachable with this key.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_found"}}}}},"409":{"description":"The account exists but is not open on the trading engine yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"conflict","code":"account_not_ready","message":"This account is still being opened.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_ready"}}}}},"422":{"description":"The account passed, failed, or was closed (details.reason).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"rule_rejection","code":"account_not_tradable","message":"This account cannot trade.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_tradable"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The trading engine did not give a complete answer in time; nothing partial is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"engine","code":"state_unavailable","message":"The account's figures cannot be read right now.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#state_unavailable"}}}}}}}},"/v1/accounts/{account_id}/margin/{market}":{"put":{"operationId":"setMargin","summary":"Set leverage and margin mode","description":"The leverage and margin mode new positions on the market use. Changing the leverage of an open position changes its margin.","tags":["Margin"],"x-pp-scope":"trade","x-pp-stability":"stable","x-pp-resource":"margin","x-pp-method":"set","x-pp-retry-safe":true,"x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","account_not_found","account_not_ready","account_not_tradable","insufficient_permission","invalid_request","unknown_field","idempotency_key_required","invalid_idempotency_key","idempotency_key_reused","operation_in_progress","state_unavailable","stale_quote","engine_unavailable","engine_busy","key_market_not_allowed","market_not_found","margin_mode_locked","margin_rejected","invalid_leverage","insufficient_margin","liquidation_risk","position_liquidating"],"parameters":[{"name":"account_id","in":"path","required":true,"description":"The account number.","schema":{"type":"string","example":"SANDBOX-00042-001"}},{"name":"market","in":"path","required":true,"description":"A market id.","schema":{"type":"string","example":"BTC-USD"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarginSettingInput"},"example":{"margin_mode":"isolated","leverage":5}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MarginSettingResult"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"The request is malformed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"invalid_request","code":"invalid_request","message":"The request is not valid.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#invalid_request"}}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The account does not exist in this environment, or the key does not reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"account_not_found","message":"No account with that id is reachable with this key.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_found"}}}}},"409":{"description":"The account exists but is not open on the trading engine yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"conflict","code":"account_not_ready","message":"This account is still being opened.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_ready"}}}}},"422":{"description":"The account passed, failed, or was closed (details.reason).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"rule_rejection","code":"account_not_tradable","message":"This account cannot trade.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_tradable"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The trading engine did not give a complete answer in time; nothing partial is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"engine","code":"state_unavailable","message":"The account's figures cannot be read right now.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#state_unavailable"}}}}}}}},"/v1/events":{"get":{"operationId":"listEvents","summary":"List events","description":"What happened on your accounts, oldest first: the same events the account stream sends. Poll with after = the id of the last event you have (next_cursor of the previous page).","tags":["Events"],"x-pp-scope":"read","x-pp-stability":"stable","x-pp-resource":"events","x-pp-method":"list","x-pp-pagination":{"param":"after","items":"data","next":"next_cursor","has_more":"has_more","limit":"limit"},"x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","account_not_found","invalid_parameter"],"parameters":[{"name":"account_id","in":"query","description":"Only this account.","schema":{"type":"string","example":"SANDBOX-00042-001"}},{"name":"after","in":"query","description":"The id of the last event you have: the ones after it, oldest first. Absent: from the oldest kept.","schema":{"type":"string","example":"evt_01JAB7Q8XK4M2N5P7R9S3T5V7W"}},{"name":"limit","in":"query","description":"Page size.","schema":{"type":"integer","minimum":1,"maximum":500,"default":100,"example":100}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Event"}},"has_more":{"type":"boolean","description":"More items follow: pass next_cursor to get them.","example":false},"next_cursor":{"type":["string","null"],"description":"The cursor of the next page, or null on the last one.","example":null},"as_of":{"type":"integer","format":"int64","x-pp-unit":"ms","description":"When the oldest figure in the list was read.","example":1791460800000}},"required":["data","has_more","next_cursor","as_of"],"additionalProperties":false}}}},"400":{"description":"A query or path parameter is out of range or the wrong kind.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"invalid_request","code":"invalid_parameter","message":"A parameter has a value this route does not take.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#invalid_parameter"}}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The account does not exist in this environment, or the key does not reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"account_not_found","message":"No account with that id is reachable with this key.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_found"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The API is starting and has not loaded your keys yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}}}}},"/v1/accounts/{account_id}/positions/{market}/exits":{"get":{"operationId":"getExits","summary":"Get a position's exits","description":"The take-profit and stop-loss legs this API keeps on the position: native orders on the engine, so they protect even when the API is away. Each group is at most the position: a take-profit fill trims the stop-losses by its size, the last fill cancels the rest.","tags":["Exits and strategies"],"x-pp-scope":"read","x-pp-stability":"stable","x-pp-resource":"exits","x-pp-method":"get","x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","account_not_found","state_unavailable","market_not_found"],"parameters":[{"name":"account_id","in":"path","required":true,"description":"The account number.","schema":{"type":"string","example":"SANDBOX-00042-001"}},{"name":"market","in":"path","required":true,"description":"A market id.","schema":{"type":"string","example":"BTC-USD"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Exits"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The account does not exist in this environment, or the key does not reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"account_not_found","message":"No account with that id is reachable with this key.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_found"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The trading engine did not give a complete answer in time; nothing partial is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"engine","code":"state_unavailable","message":"The account's figures cannot be read right now.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#state_unavailable"}}}}}}},"put":{"operationId":"setExits","summary":"Change a position's exits","description":"Places, changes and cancels take-profit and stop-loss legs together, against the state you read: when the position or a leg changed since, nothing is done (409 exits_changed, with the state now). The legs are reduce-only and never larger than the position.","tags":["Exits and strategies"],"x-pp-scope":"trade","x-pp-stability":"stable","x-pp-resource":"exits","x-pp-method":"set","x-pp-retry-safe":true,"x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","account_not_found","account_not_ready","account_not_tradable","insufficient_permission","invalid_request","unknown_field","idempotency_key_required","invalid_idempotency_key","idempotency_key_reused","operation_in_progress","state_unavailable","stale_quote","engine_unavailable","engine_busy","key_market_not_allowed","market_not_found","position_not_found","exits_changed","exit_operation_failed","exit_would_fill","exits_exceed_position","exit_leg_cap","strategy_limit","invalid_size_step","invalid_price_tick","price_out_of_band","stop_already_triggered"],"parameters":[{"name":"account_id","in":"path","required":true,"description":"The account number.","schema":{"type":"string","example":"SANDBOX-00042-001"}},{"name":"market","in":"path","required":true,"description":"A market id.","schema":{"type":"string","example":"BTC-USD"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExitsBatch"},"example":{"expected_position":{"side":"long","size":"0.01"},"expected_exits":[{"id":"ord_01JAB7Q8XK4M2N5P7R9S3T5V7W","size":"0.01","price":"61700"}],"operations":[{"op":"modify","id":"ord_01JAB7Q8XK4M2N5P7R9S3T5V7W","price":"61900"},{"op":"place","group":"take_profit","type":"limit","price":"63000","size":"0.01"}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Exits"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"The request is malformed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"invalid_request","code":"invalid_request","message":"The request is not valid.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#invalid_request"}}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The account does not exist in this environment, or the key does not reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"account_not_found","message":"No account with that id is reachable with this key.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_found"}}}}},"409":{"description":"The account exists but is not open on the trading engine yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"conflict","code":"account_not_ready","message":"This account is still being opened.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_ready"}}}}},"422":{"description":"The account passed, failed, or was closed (details.reason).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"rule_rejection","code":"account_not_tradable","message":"This account cannot trade.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_tradable"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The trading engine did not give a complete answer in time; nothing partial is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"engine","code":"state_unavailable","message":"The account's figures cannot be read right now.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#state_unavailable"}}}}}}}},"/v1/accounts/{account_id}/orders/{order_id}/exits":{"put":{"operationId":"setOrderExits","summary":"Attach exits to an order","description":"Sets (or, with an empty object, removes) the exits a working order of the API places when it fills.","tags":["Exits and strategies"],"x-pp-scope":"trade","x-pp-stability":"stable","x-pp-resource":"orders","x-pp-method":"setExits","x-pp-retry-safe":true,"x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","account_not_found","account_not_ready","account_not_tradable","insufficient_permission","invalid_request","unknown_field","idempotency_key_required","invalid_idempotency_key","idempotency_key_reused","operation_in_progress","state_unavailable","stale_quote","engine_unavailable","engine_busy","key_market_not_allowed","order_not_found","order_not_working","exit_would_fill","stop_already_triggered","strategy_limit","market_not_found"],"parameters":[{"name":"account_id","in":"path","required":true,"description":"The account number.","schema":{"type":"string","example":"SANDBOX-00042-001"}},{"name":"order_id","in":"path","required":true,"description":"The order.","schema":{"type":"string","example":"ord_01JAB7Q8XK4M2N5P7R9S3T5V7W"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderExits"},"example":{"take_profit":[{"distance":"600","size_pct":"50"},{"distance":"1200","size_pct":"50"}],"stop_loss":{"distance":"300","type":"stop_market"}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Order"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"The request is malformed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"invalid_request","code":"invalid_request","message":"The request is not valid.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#invalid_request"}}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The account does not exist in this environment, or the key does not reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"account_not_found","message":"No account with that id is reachable with this key.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_found"}}}}},"409":{"description":"The account exists but is not open on the trading engine yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"conflict","code":"account_not_ready","message":"This account is still being opened.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_ready"}}}}},"422":{"description":"The account passed, failed, or was closed (details.reason).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"rule_rejection","code":"account_not_tradable","message":"This account cannot trade.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_tradable"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The trading engine did not give a complete answer in time; nothing partial is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"engine","code":"state_unavailable","message":"The account's figures cannot be read right now.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#state_unavailable"}}}}}}}},"/v1/accounts/{account_id}/strategies":{"post":{"operationId":"createStrategy","summary":"Create a strategy","description":"Starts a strategy on the account. trailing_stop and break_even change the position's exits (the answer is the exits strategy). The programs (oco, twap, vwap, scaled, chase, conditional) place orders for you: each one is checked as an order you place yourself, and listed under the strategy. A conditional waits (status waiting, nothing on the engine) until its price is reached, then sends its order (strategy.triggered).","tags":["Exits and strategies"],"x-pp-scope":"trade","x-pp-stability":"stable","x-pp-resource":"strategies","x-pp-method":"create","x-pp-idempotent":true,"x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","account_not_found","account_not_ready","account_not_tradable","insufficient_permission","invalid_request","unknown_field","idempotency_key_required","invalid_idempotency_key","idempotency_key_reused","operation_in_progress","state_unavailable","stale_quote","engine_unavailable","engine_busy","key_market_not_allowed","market_not_found","invalid_size_step","invalid_price_tick","price_out_of_band","stop_already_triggered","post_only_would_fill","limit_inside_spread","order_too_small","working_order_cap","key_reduce_only","key_max_order_notional","key_max_position_notional","insufficient_margin","exposure_cap_exceeded","reduce_only_violation","slippage_exceeded","no_price","market_closed","market_not_offered","market_option_held","weekend_close","market_halted","position_liquidating","account_paused","insufficient_balance","order_rejected","position_not_found","exits_changed","exit_operation_failed","exits_exceed_position","exit_leg_cap","exit_would_fill","strategy_limit","client_strategy_id_conflict","rung_would_fill","strategy_type_disabled","trigger_already_met","key_loss_stop_active"],"parameters":[{"name":"account_id","in":"path","required":true,"description":"The account number.","schema":{"type":"string","example":"SANDBOX-00042-001"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A unique value per action: a retry with the same value never does it twice.","schema":{"type":"string","example":"sandbox-open-0001"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateStrategy"},"example":{"type":"twap","market":"BTC-USD","side":"buy","size":"0.05","duration_minutes":30,"interval_seconds":60,"client_strategy_id":"twap-07"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Strategy"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"The request is malformed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"invalid_request","code":"invalid_request","message":"The request is not valid.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#invalid_request"}}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The account does not exist in this environment, or the key does not reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"account_not_found","message":"No account with that id is reachable with this key.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_found"}}}}},"409":{"description":"The account exists but is not open on the trading engine yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"conflict","code":"account_not_ready","message":"This account is still being opened.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_ready"}}}}},"422":{"description":"The account passed, failed, or was closed (details.reason).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"rule_rejection","code":"account_not_tradable","message":"This account cannot trade.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_tradable"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The trading engine did not give a complete answer in time; nothing partial is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"engine","code":"state_unavailable","message":"The account's figures cannot be read right now.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#state_unavailable"}}}}}}},"get":{"operationId":"listStrategies","summary":"List strategies","description":"The account's strategies, newest first, with every order each one placed.","tags":["Exits and strategies"],"x-pp-scope":"read","x-pp-stability":"stable","x-pp-resource":"strategies","x-pp-method":"list","x-pp-pagination":{"param":"cursor","items":"data","next":"next_cursor","has_more":"has_more","limit":"limit"},"x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","account_not_found","invalid_parameter","invalid_cursor"],"parameters":[{"name":"account_id","in":"path","required":true,"description":"The account number.","schema":{"type":"string","example":"SANDBOX-00042-001"}},{"name":"status","in":"query","description":"active: waiting or working. ended: completed, canceled or ended. all: both.","schema":{"type":"string","enum":["all","active","ended"],"default":"all","example":"active"}},{"name":"market","in":"query","description":"Only this market.","schema":{"type":"string","example":"BTC-USD"}},{"name":"client_strategy_id","in":"query","description":"The strategy you created with this id.","schema":{"type":"string","example":"grid-07"}},{"name":"limit","in":"query","description":"Page size.","schema":{"type":"integer","minimum":1,"maximum":200,"default":50,"example":50}},{"name":"cursor","in":"query","description":"next_cursor from the previous page, with the same filters.","schema":{"type":"string","example":"eyJzIjoiZmlsbHMifQ.c2lnbmF0dXJl"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Strategy"}},"has_more":{"type":"boolean","description":"More items follow: pass next_cursor to get them.","example":false},"next_cursor":{"type":["string","null"],"description":"The cursor of the next page, or null on the last one.","example":null},"as_of":{"type":"integer","format":"int64","x-pp-unit":"ms","description":"When the oldest figure in the list was read.","example":1791460800000}},"required":["data","has_more","next_cursor","as_of"],"additionalProperties":false}}}},"400":{"description":"A query or path parameter is out of range or the wrong kind.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"invalid_request","code":"invalid_parameter","message":"A parameter has a value this route does not take.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#invalid_parameter"}}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The account does not exist in this environment, or the key does not reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"account_not_found","message":"No account with that id is reachable with this key.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_found"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The API is starting and has not loaded your keys yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}}}}},"/v1/accounts/{account_id}/strategies/{strategy_id}":{"get":{"operationId":"getStrategy","summary":"Get a strategy","tags":["Exits and strategies"],"x-pp-scope":"read","x-pp-stability":"stable","x-pp-resource":"strategies","x-pp-method":"get","x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","account_not_found","strategy_not_found"],"parameters":[{"name":"account_id","in":"path","required":true,"description":"The account number.","schema":{"type":"string","example":"SANDBOX-00042-001"}},{"name":"strategy_id","in":"path","required":true,"description":"The strategy.","schema":{"type":"string","example":"stg_01JAB7Q8XK4M2N5P7R9S3T5V7W"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Strategy"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The account does not exist in this environment, or the key does not reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"account_not_found","message":"No account with that id is reachable with this key.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_found"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The API is starting and has not loaded your keys yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}}}},"delete":{"operationId":"cancelStrategy","summary":"Cancel a strategy","description":"Stops the strategy and cancels its working orders (reason strategy). Orders that already filled stay filled.","tags":["Exits and strategies"],"x-pp-scope":"trade","x-pp-stability":"stable","x-pp-resource":"strategies","x-pp-method":"cancel","x-pp-retry-safe":true,"x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","account_not_found","account_not_ready","account_not_tradable","insufficient_permission","invalid_request","unknown_field","idempotency_key_required","invalid_idempotency_key","idempotency_key_reused","operation_in_progress","state_unavailable","stale_quote","engine_unavailable","engine_busy","key_market_not_allowed","strategy_not_found","strategy_not_active"],"parameters":[{"name":"account_id","in":"path","required":true,"description":"The account number.","schema":{"type":"string","example":"SANDBOX-00042-001"}},{"name":"strategy_id","in":"path","required":true,"description":"The strategy.","schema":{"type":"string","example":"stg_01JAB7Q8XK4M2N5P7R9S3T5V7W"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Strategy"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"The request is malformed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"invalid_request","code":"invalid_request","message":"The request is not valid.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#invalid_request"}}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The account does not exist in this environment, or the key does not reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"account_not_found","message":"No account with that id is reachable with this key.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_found"}}}}},"409":{"description":"The account exists but is not open on the trading engine yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"conflict","code":"account_not_ready","message":"This account is still being opened.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_ready"}}}}},"422":{"description":"The account passed, failed, or was closed (details.reason).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"rule_rejection","code":"account_not_tradable","message":"This account cannot trade.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_tradable"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The trading engine did not give a complete answer in time; nothing partial is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"engine","code":"state_unavailable","message":"The account's figures cannot be read right now.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#state_unavailable"}}}}}}}},"/v1/accounts/{account_id}/alerts":{"post":{"operationId":"createAlert","summary":"Create a price alert","description":"Arms an alert on the market: alert.triggered is sent once (the account stream, webhooks, GET /v1/events) when the price reaches the level. Its condition, above or below, is set from the price now. A read key is enough: an alert never trades.","tags":["Alerts"],"x-pp-scope":"read","x-pp-stability":"stable","x-pp-resource":"alerts","x-pp-method":"create","x-pp-idempotent":true,"x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","account_not_found","state_unavailable","invalid_request","unknown_field","idempotency_key_required","invalid_idempotency_key","idempotency_key_reused","operation_in_progress","market_not_found","key_market_not_allowed","stale_quote","alert_at_price","alert_limit"],"parameters":[{"name":"account_id","in":"path","required":true,"description":"The account number.","schema":{"type":"string","example":"SANDBOX-00042-001"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A unique value per action: a retry with the same value never does it twice.","schema":{"type":"string","example":"sandbox-open-0001"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePriceAlert"},"example":{"market":"BTC-USD","price":"120000","note":"breakout"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PriceAlert"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"The request is malformed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"invalid_request","code":"invalid_request","message":"The request is not valid.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#invalid_request"}}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The account does not exist in this environment, or the key does not reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"account_not_found","message":"No account with that id is reachable with this key.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_found"}}}}},"409":{"description":"A retry came while the first was not finished.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"conflict","code":"operation_in_progress","message":"The first request with this Idempotency-Key is still running.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#operation_in_progress"}}}}},"422":{"description":"The key is limited to some markets (details.markets).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"key_limit","code":"key_market_not_allowed","message":"This key may not trade this market.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#key_market_not_allowed"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The trading engine did not give a complete answer in time; nothing partial is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"engine","code":"state_unavailable","message":"The account's figures cannot be read right now.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#state_unavailable"}}}}}}},"get":{"operationId":"listAlerts","summary":"List price alerts","description":"The account's price alerts, newest first: armed ones, and those that fired or were disabled in the last kept days (GET /v1/limits).","tags":["Alerts"],"x-pp-scope":"read","x-pp-stability":"stable","x-pp-resource":"alerts","x-pp-method":"list","x-pp-pagination":{"param":"cursor","items":"data","next":"next_cursor","has_more":"has_more","limit":"limit"},"x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","account_not_found","invalid_parameter","invalid_cursor"],"parameters":[{"name":"account_id","in":"path","required":true,"description":"The account number.","schema":{"type":"string","example":"SANDBOX-00042-001"}},{"name":"status","in":"query","description":"Only alerts with this status (default all).","schema":{"type":"string","enum":["all","armed","triggered","disabled"],"default":"all","example":"armed"}},{"name":"market","in":"query","description":"Only this market.","schema":{"type":"string","example":"BTC-USD"}},{"name":"limit","in":"query","description":"Page size.","schema":{"type":"integer","minimum":1,"maximum":200,"default":50,"example":50}},{"name":"cursor","in":"query","description":"next_cursor from the previous page, with the same filters.","schema":{"type":"string","example":"eyJzIjoiZmlsbHMifQ.c2lnbmF0dXJl"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PriceAlert"}},"has_more":{"type":"boolean","description":"More items follow: pass next_cursor to get them.","example":false},"next_cursor":{"type":["string","null"],"description":"The cursor of the next page, or null on the last one.","example":null},"as_of":{"type":"integer","format":"int64","x-pp-unit":"ms","description":"When the oldest figure in the list was read.","example":1791460800000}},"required":["data","has_more","next_cursor","as_of"],"additionalProperties":false}}}},"400":{"description":"A query or path parameter is out of range or the wrong kind.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"invalid_request","code":"invalid_parameter","message":"A parameter has a value this route does not take.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#invalid_parameter"}}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The account does not exist in this environment, or the key does not reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"account_not_found","message":"No account with that id is reachable with this key.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_found"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The API is starting and has not loaded your keys yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}}}}},"/v1/accounts/{account_id}/alerts/{alert_id}":{"get":{"operationId":"getAlert","summary":"Get a price alert","tags":["Alerts"],"x-pp-scope":"read","x-pp-stability":"stable","x-pp-resource":"alerts","x-pp-method":"get","x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","account_not_found","alert_not_found"],"parameters":[{"name":"account_id","in":"path","required":true,"description":"The account number.","schema":{"type":"string","example":"SANDBOX-00042-001"}},{"name":"alert_id","in":"path","required":true,"description":"The alert.","schema":{"type":"string","example":"alr_01JAB7Q8XK4M2N5P7R9S3T5V7W"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PriceAlert"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The account does not exist in this environment, or the key does not reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"account_not_found","message":"No account with that id is reachable with this key.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_found"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The API is starting and has not loaded your keys yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}}}},"patch":{"operationId":"changeAlert","summary":"Move a price alert","description":"Changes an armed alert's level, its note, or both. A new level sets its condition again from the price now.","tags":["Alerts"],"x-pp-scope":"read","x-pp-stability":"stable","x-pp-resource":"alerts","x-pp-method":"modify","x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","account_not_found","alert_not_found","alert_not_armed","invalid_request","unknown_field","stale_quote","alert_at_price","market_not_found","key_market_not_allowed"],"parameters":[{"name":"account_id","in":"path","required":true,"description":"The account number.","schema":{"type":"string","example":"SANDBOX-00042-001"}},{"name":"alert_id","in":"path","required":true,"description":"The alert.","schema":{"type":"string","example":"alr_01JAB7Q8XK4M2N5P7R9S3T5V7W"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangePriceAlert"},"example":{"price":"121000"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PriceAlert"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"The request is malformed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"invalid_request","code":"invalid_request","message":"The request is not valid.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#invalid_request"}}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The account does not exist in this environment, or the key does not reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"account_not_found","message":"No account with that id is reachable with this key.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_found"}}}}},"409":{"description":"Only an armed alert moves; one that fired or was disabled must be armed again first (details.status).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"conflict","code":"alert_not_armed","message":"This alert is not armed.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#alert_not_armed"}}}}},"422":{"description":"An alert fires when the price reaches its level from one side; a level at the price now has none (details.last_price).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"rule_rejection","code":"alert_at_price","message":"This level is the price now.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#alert_at_price"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The latest price is too old to trade against.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"engine","code":"stale_quote","message":"The market's price is not current.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#stale_quote"}}}}}}},"delete":{"operationId":"deleteAlert","summary":"Delete a price alert","tags":["Alerts"],"x-pp-scope":"read","x-pp-stability":"stable","x-pp-resource":"alerts","x-pp-method":"delete","x-pp-retry-safe":true,"x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","account_not_found","alert_not_found"],"parameters":[{"name":"account_id","in":"path","required":true,"description":"The account number.","schema":{"type":"string","example":"SANDBOX-00042-001"}},{"name":"alert_id","in":"path","required":true,"description":"The alert.","schema":{"type":"string","example":"alr_01JAB7Q8XK4M2N5P7R9S3T5V7W"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DeletedAlert"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The account does not exist in this environment, or the key does not reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"account_not_found","message":"No account with that id is reachable with this key.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_found"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The API is starting and has not loaded your keys yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}}}}},"/v1/accounts/{account_id}/alerts/{alert_id}/rearm":{"post":{"operationId":"rearmAlert","summary":"Arm a price alert again","description":"Arms an alert that fired (or was disabled) again at its level, its condition set from the price now. An armed alert is answered as it is.","tags":["Alerts"],"x-pp-scope":"read","x-pp-stability":"stable","x-pp-resource":"alerts","x-pp-method":"rearm","x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","account_not_found","alert_not_found","stale_quote","alert_at_price","alert_limit","market_not_found","key_market_not_allowed"],"parameters":[{"name":"account_id","in":"path","required":true,"description":"The account number.","schema":{"type":"string","example":"SANDBOX-00042-001"}},{"name":"alert_id","in":"path","required":true,"description":"The alert.","schema":{"type":"string","example":"alr_01JAB7Q8XK4M2N5P7R9S3T5V7W"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PriceAlert"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The account does not exist in this environment, or the key does not reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"account_not_found","message":"No account with that id is reachable with this key.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_found"}}}}},"422":{"description":"An alert fires when the price reaches its level from one side; a level at the price now has none (details.last_price).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"rule_rejection","code":"alert_at_price","message":"This level is the price now.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#alert_at_price"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The latest price is too old to trade against.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"engine","code":"stale_quote","message":"The market's price is not current.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#stale_quote"}}}}}}}},"/v1/webhook-endpoints":{"get":{"operationId":"listWebhookEndpoints","summary":"List webhook endpoints","description":"Your endpoints in this environment. They are made, and their secrets rotated, in your dashboard only.","tags":["Webhooks"],"x-pp-scope":"read","x-pp-stability":"stable","x-pp-resource":"webhookEndpoints","x-pp-method":"list","x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEndpoint"}},"has_more":{"type":"boolean","description":"More items follow: pass next_cursor to get them.","example":false},"next_cursor":{"type":["string","null"],"description":"The cursor of the next page, or null on the last one.","example":null},"as_of":{"type":"integer","format":"int64","x-pp-unit":"ms","description":"When the oldest figure in the list was read.","example":1791460800000}},"required":["data","has_more","next_cursor","as_of"],"additionalProperties":false}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The API is starting and has not loaded your keys yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}}}}},"/v1/webhook-endpoints/{endpoint_id}":{"get":{"operationId":"getWebhookEndpoint","summary":"Get a webhook endpoint","tags":["Webhooks"],"x-pp-scope":"read","x-pp-stability":"stable","x-pp-resource":"webhookEndpoints","x-pp-method":"get","x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","webhook_endpoint_not_found"],"parameters":[{"name":"endpoint_id","in":"path","required":true,"description":"The endpoint.","schema":{"type":"string","example":"whk_01JAB7Q8XK4M2N5P7R9S3T5V7W"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WebhookEndpoint"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The id is unknown, or belongs to another customer or environment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"webhook_endpoint_not_found","message":"No webhook endpoint with that id.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#webhook_endpoint_not_found"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The API is starting and has not loaded your keys yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}}}},"delete":{"operationId":"deleteWebhookEndpoint","summary":"Delete an endpoint","tags":["Webhooks"],"x-pp-scope":"trade","x-pp-stability":"stable","x-pp-resource":"webhookEndpoints","x-pp-method":"delete","x-pp-retry-safe":true,"x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","webhook_endpoint_not_found","insufficient_permission","temporarily_unavailable"],"parameters":[{"name":"endpoint_id","in":"path","required":true,"description":"The endpoint.","schema":{"type":"string","example":"whk_01JAB7Q8XK4M2N5P7R9S3T5V7W"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DeletedEndpoint"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The id is unknown, or belongs to another customer or environment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"webhook_endpoint_not_found","message":"No webhook endpoint with that id.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#webhook_endpoint_not_found"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"A service this call needs did not answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"server","code":"temporarily_unavailable","message":"This cannot be done right now. Try again in a moment.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#temporarily_unavailable"}}}}}}}},"/v1/webhook-endpoints/{endpoint_id}/test":{"post":{"operationId":"testWebhookEndpoint","summary":"Send a test","description":"Queues a webhook.ping (test true) to the endpoint; read the delivery for the outcome. It calls your server: a trade key or app.","tags":["Webhooks"],"x-pp-scope":"trade","x-pp-stability":"stable","x-pp-resource":"webhookEndpoints","x-pp-method":"test","x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","webhook_endpoint_not_found","webhook_endpoint_not_active","insufficient_permission","temporarily_unavailable"],"parameters":[{"name":"endpoint_id","in":"path","required":true,"description":"The endpoint.","schema":{"type":"string","example":"whk_01JAB7Q8XK4M2N5P7R9S3T5V7W"}}],"responses":{"202":{"description":"Accepted","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WebhookDelivery"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The id is unknown, or belongs to another customer or environment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"webhook_endpoint_not_found","message":"No webhook endpoint with that id.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#webhook_endpoint_not_found"}}}}},"409":{"description":"Tests and resends go to active endpoints only.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"conflict","code":"webhook_endpoint_not_active","message":"This endpoint is paused or disabled.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#webhook_endpoint_not_active"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"A service this call needs did not answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"server","code":"temporarily_unavailable","message":"This cannot be done right now. Try again in a moment.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#temporarily_unavailable"}}}}}}}},"/v1/webhook-endpoints/{endpoint_id}/deliveries":{"get":{"operationId":"listWebhookDeliveries","summary":"List deliveries","description":"What was sent to the endpoint, newest first, with every try and what it answered.","tags":["Webhooks"],"x-pp-scope":"read","x-pp-stability":"stable","x-pp-resource":"webhookEndpoints","x-pp-method":"listDeliveries","x-pp-pagination":{"param":"cursor","items":"data","next":"next_cursor","has_more":"has_more","limit":"limit"},"x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","webhook_endpoint_not_found","invalid_parameter","invalid_cursor","temporarily_unavailable"],"parameters":[{"name":"endpoint_id","in":"path","required":true,"description":"The endpoint.","schema":{"type":"string","example":"whk_01JAB7Q8XK4M2N5P7R9S3T5V7W"}},{"name":"limit","in":"query","description":"Page size.","schema":{"type":"integer","minimum":1,"maximum":200,"default":50,"example":50}},{"name":"cursor","in":"query","description":"next_cursor from the previous page, with the same filters.","schema":{"type":"string","example":"eyJzIjoiZmlsbHMifQ.c2lnbmF0dXJl"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"}},"has_more":{"type":"boolean","description":"More items follow: pass next_cursor to get them.","example":false},"next_cursor":{"type":["string","null"],"description":"The cursor of the next page, or null on the last one.","example":null},"as_of":{"type":"integer","format":"int64","x-pp-unit":"ms","description":"When the oldest figure in the list was read.","example":1791460800000}},"required":["data","has_more","next_cursor","as_of"],"additionalProperties":false}}}},"400":{"description":"A query or path parameter is out of range or the wrong kind.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"invalid_request","code":"invalid_parameter","message":"A parameter has a value this route does not take.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#invalid_parameter"}}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The id is unknown, or belongs to another customer or environment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"webhook_endpoint_not_found","message":"No webhook endpoint with that id.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#webhook_endpoint_not_found"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"A service this call needs did not answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"server","code":"temporarily_unavailable","message":"This cannot be done right now. Try again in a moment.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#temporarily_unavailable"}}}}}}}},"/v1/webhook-endpoints/{endpoint_id}/deliveries/{delivery_id}":{"get":{"operationId":"getWebhookDelivery","summary":"Get a delivery","tags":["Webhooks"],"x-pp-scope":"read","x-pp-stability":"stable","x-pp-resource":"webhookEndpoints","x-pp-method":"getDelivery","x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","webhook_endpoint_not_found","delivery_not_found","temporarily_unavailable"],"parameters":[{"name":"endpoint_id","in":"path","required":true,"description":"The endpoint.","schema":{"type":"string","example":"whk_01JAB7Q8XK4M2N5P7R9S3T5V7W"}},{"name":"delivery_id","in":"path","required":true,"description":"The delivery.","schema":{"type":"string","example":"dlv_01JAB7Q8XK4M2N5P7R9S3T5V7W"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WebhookDelivery"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The id is unknown, or belongs to another customer or environment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"webhook_endpoint_not_found","message":"No webhook endpoint with that id.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#webhook_endpoint_not_found"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"A service this call needs did not answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"server","code":"temporarily_unavailable","message":"This cannot be done right now. Try again in a moment.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#temporarily_unavailable"}}}}}}}},"/v1/webhook-endpoints/{endpoint_id}/deliveries/{delivery_id}/resend":{"post":{"operationId":"resendWebhookDelivery","summary":"Send a delivery again","description":"Queues the same event again, marked test (the same event id: your receiver can tell it already has it). It calls your server: a trade key or app.","tags":["Webhooks"],"x-pp-scope":"trade","x-pp-stability":"stable","x-pp-resource":"webhookEndpoints","x-pp-method":"resendDelivery","x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","webhook_endpoint_not_found","webhook_endpoint_not_active","delivery_not_found","insufficient_permission","temporarily_unavailable"],"parameters":[{"name":"endpoint_id","in":"path","required":true,"description":"The endpoint.","schema":{"type":"string","example":"whk_01JAB7Q8XK4M2N5P7R9S3T5V7W"}},{"name":"delivery_id","in":"path","required":true,"description":"The delivery.","schema":{"type":"string","example":"dlv_01JAB7Q8XK4M2N5P7R9S3T5V7W"}}],"responses":{"202":{"description":"Accepted","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WebhookDelivery"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The id is unknown, or belongs to another customer or environment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"webhook_endpoint_not_found","message":"No webhook endpoint with that id.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#webhook_endpoint_not_found"}}}}},"409":{"description":"Tests and resends go to active endpoints only.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"conflict","code":"webhook_endpoint_not_active","message":"This endpoint is paused or disabled.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#webhook_endpoint_not_active"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"A service this call needs did not answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"server","code":"temporarily_unavailable","message":"This cannot be done right now. Try again in a moment.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#temporarily_unavailable"}}}}}}}},"/v1/webhook-endpoints/{endpoint_id}/disable":{"post":{"operationId":"disableWebhookEndpoint","summary":"Pause an endpoint","description":"Stops sending to it; its events wait (enable sends them).","tags":["Webhooks"],"x-pp-scope":"trade","x-pp-stability":"stable","x-pp-resource":"webhookEndpoints","x-pp-method":"disable","x-pp-retry-safe":true,"x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","webhook_endpoint_not_found","insufficient_permission","temporarily_unavailable"],"parameters":[{"name":"endpoint_id","in":"path","required":true,"description":"The endpoint.","schema":{"type":"string","example":"whk_01JAB7Q8XK4M2N5P7R9S3T5V7W"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WebhookEndpoint"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The id is unknown, or belongs to another customer or environment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"webhook_endpoint_not_found","message":"No webhook endpoint with that id.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#webhook_endpoint_not_found"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"A service this call needs did not answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"server","code":"temporarily_unavailable","message":"This cannot be done right now. Try again in a moment.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#temporarily_unavailable"}}}}}}}},"/v1/webhook-endpoints/{endpoint_id}/enable":{"post":{"operationId":"enableWebhookEndpoint","summary":"Resume an endpoint","tags":["Webhooks"],"x-pp-scope":"trade","x-pp-stability":"stable","x-pp-resource":"webhookEndpoints","x-pp-method":"enable","x-pp-retry-safe":true,"x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","webhook_endpoint_not_found","insufficient_permission","temporarily_unavailable"],"parameters":[{"name":"endpoint_id","in":"path","required":true,"description":"The endpoint.","schema":{"type":"string","example":"whk_01JAB7Q8XK4M2N5P7R9S3T5V7W"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WebhookEndpoint"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The id is unknown, or belongs to another customer or environment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"webhook_endpoint_not_found","message":"No webhook endpoint with that id.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#webhook_endpoint_not_found"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"A service this call needs did not answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"server","code":"temporarily_unavailable","message":"This cannot be done right now. Try again in a moment.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#temporarily_unavailable"}}}}}}}},"/v1/tradingview/hooks":{"get":{"operationId":"listTradingViewHooks","summary":"List TradingView links","description":"Your TradingView alert links in this environment. Links are made, and their addresses rotated, in your dashboard only: the address is a credential.","tags":["TradingView"],"x-pp-scope":"read","x-pp-stability":"stable","x-pp-resource":"tradingview","x-pp-method":"listHooks","x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TradingViewHook"}},"has_more":{"type":"boolean","description":"More items follow: pass next_cursor to get them.","example":false},"next_cursor":{"type":["string","null"],"description":"The cursor of the next page, or null on the last one.","example":null},"as_of":{"type":"integer","format":"int64","x-pp-unit":"ms","description":"When the oldest figure in the list was read.","example":1791460800000}},"required":["data","has_more","next_cursor","as_of"],"additionalProperties":false}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The API is starting and has not loaded your keys yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}}}}},"/v1/tradingview/hooks/{hook_id}":{"get":{"operationId":"getTradingViewHook","summary":"Get a TradingView link","tags":["TradingView"],"x-pp-scope":"read","x-pp-stability":"stable","x-pp-resource":"tradingview","x-pp-method":"getHook","x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","tradingview_hook_not_found"],"parameters":[{"name":"hook_id","in":"path","required":true,"description":"The TradingView link.","schema":{"type":"string","example":"K7x2mQ9pLr4A"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/TradingViewHook"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The id is unknown, revoked, or belongs to another customer or environment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"tradingview_hook_not_found","message":"No TradingView link with that id.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#tradingview_hook_not_found"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The API is starting and has not loaded your keys yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}}}},"delete":{"operationId":"deleteTradingViewHook","summary":"Revoke a TradingView link","tags":["TradingView"],"x-pp-scope":"trade","x-pp-stability":"stable","x-pp-resource":"tradingview","x-pp-method":"deleteHook","x-pp-retry-safe":true,"x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","tradingview_hook_not_found","insufficient_permission","temporarily_unavailable"],"parameters":[{"name":"hook_id","in":"path","required":true,"description":"The TradingView link.","schema":{"type":"string","example":"K7x2mQ9pLr4A"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DeletedHook"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The id is unknown, revoked, or belongs to another customer or environment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"tradingview_hook_not_found","message":"No TradingView link with that id.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#tradingview_hook_not_found"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"A service this call needs did not answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"server","code":"temporarily_unavailable","message":"This cannot be done right now. Try again in a moment.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#temporarily_unavailable"}}}}}}}},"/v1/tradingview/hooks/{hook_id}/alerts":{"get":{"operationId":"listTradingViewAlerts","summary":"List a link's alerts","description":"Every alert the link received, newest first, refused ones included, with what each did and why.","tags":["TradingView"],"x-pp-scope":"read","x-pp-stability":"stable","x-pp-resource":"tradingview","x-pp-method":"listAlerts","x-pp-pagination":{"param":"cursor","items":"data","next":"next_cursor","has_more":"has_more","limit":"limit"},"x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","tradingview_hook_not_found","invalid_parameter","invalid_cursor"],"parameters":[{"name":"hook_id","in":"path","required":true,"description":"The TradingView link.","schema":{"type":"string","example":"K7x2mQ9pLr4A"}},{"name":"status","in":"query","description":"Only alerts with this status.","schema":{"type":"string","example":"refused"}},{"name":"limit","in":"query","description":"Page size.","schema":{"type":"integer","minimum":1,"maximum":200,"default":50,"example":50}},{"name":"cursor","in":"query","description":"next_cursor from the previous page, with the same filters.","schema":{"type":"string","example":"eyJzIjoiZmlsbHMifQ.c2lnbmF0dXJl"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TradingViewAlert"}},"has_more":{"type":"boolean","description":"More items follow: pass next_cursor to get them.","example":false},"next_cursor":{"type":["string","null"],"description":"The cursor of the next page, or null on the last one.","example":null},"as_of":{"type":"integer","format":"int64","x-pp-unit":"ms","description":"When the oldest figure in the list was read.","example":1791460800000}},"required":["data","has_more","next_cursor","as_of"],"additionalProperties":false}}}},"400":{"description":"A query or path parameter is out of range or the wrong kind.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"invalid_request","code":"invalid_parameter","message":"A parameter has a value this route does not take.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#invalid_parameter"}}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The id is unknown, revoked, or belongs to another customer or environment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"tradingview_hook_not_found","message":"No TradingView link with that id.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#tradingview_hook_not_found"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The API is starting and has not loaded your keys yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}}}}},"/v1/tradingview/hooks/{hook_id}/alerts/{alert_id}":{"get":{"operationId":"getTradingViewAlert","summary":"Get an alert","tags":["TradingView"],"x-pp-scope":"read","x-pp-stability":"stable","x-pp-resource":"tradingview","x-pp-method":"getAlert","x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","tradingview_hook_not_found","tradingview_alert_not_found"],"parameters":[{"name":"hook_id","in":"path","required":true,"description":"The TradingView link.","schema":{"type":"string","example":"K7x2mQ9pLr4A"}},{"name":"alert_id","in":"path","required":true,"description":"The alert.","schema":{"type":"string","example":"tva_01JAB7Q8XK4M2N5P7R9S3T5V7W"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/TradingViewAlert"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The id is unknown, revoked, or belongs to another customer or environment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"tradingview_hook_not_found","message":"No TradingView link with that id.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#tradingview_hook_not_found"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The API is starting and has not loaded your keys yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}}}}},"/v1/tradingview/hooks/{hook_id}/disable":{"post":{"operationId":"disableTradingViewHook","summary":"Pause a TradingView link","description":"Its alerts are refused (link_paused) until it is resumed.","tags":["TradingView"],"x-pp-scope":"trade","x-pp-stability":"stable","x-pp-resource":"tradingview","x-pp-method":"disableHook","x-pp-retry-safe":true,"x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","tradingview_hook_not_found","insufficient_permission","temporarily_unavailable"],"parameters":[{"name":"hook_id","in":"path","required":true,"description":"The TradingView link.","schema":{"type":"string","example":"K7x2mQ9pLr4A"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/TradingViewHook"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The id is unknown, revoked, or belongs to another customer or environment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"tradingview_hook_not_found","message":"No TradingView link with that id.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#tradingview_hook_not_found"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"A service this call needs did not answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"server","code":"temporarily_unavailable","message":"This cannot be done right now. Try again in a moment.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#temporarily_unavailable"}}}}}}}},"/v1/tradingview/hooks/{hook_id}/enable":{"post":{"operationId":"enableTradingViewHook","summary":"Resume a TradingView link","tags":["TradingView"],"x-pp-scope":"trade","x-pp-stability":"stable","x-pp-resource":"tradingview","x-pp-method":"enableHook","x-pp-retry-safe":true,"x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","tradingview_hook_not_found","insufficient_permission","temporarily_unavailable"],"parameters":[{"name":"hook_id","in":"path","required":true,"description":"The TradingView link.","schema":{"type":"string","example":"K7x2mQ9pLr4A"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/TradingViewHook"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The id is unknown, revoked, or belongs to another customer or environment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"tradingview_hook_not_found","message":"No TradingView link with that id.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#tradingview_hook_not_found"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"A service this call needs did not answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"server","code":"temporarily_unavailable","message":"This cannot be done right now. Try again in a moment.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#temporarily_unavailable"}}}}}}}},"/v1/tradingview/parse":{"post":{"operationId":"parseTradingViewMessage","summary":"Read an alert message","description":"How an alert message would be read, sent nowhere: the action, sizes, prices, exits and market, and with a link what it would do now.","tags":["TradingView"],"x-pp-scope":"read","x-pp-stability":"stable","x-pp-resource":"tradingview","x-pp-method":"parse","x-pp-retry-safe":true,"x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","invalid_request","unknown_field","tradingview_hook_not_found"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TradingViewParseInput"},"example":{"message":"buy BTCUSD qty 0.01 tp 1% sl 61500"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/TradingViewParse"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"The request is malformed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"invalid_request","code":"invalid_request","message":"The request is not valid.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#invalid_request"}}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The id is unknown, revoked, or belongs to another customer or environment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"tradingview_hook_not_found","message":"No TradingView link with that id.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#tradingview_hook_not_found"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The API is starting and has not loaded your keys yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}}}}},"/v1/webhook-event-types":{"get":{"operationId":"listWebhookEventTypes","summary":"List event types","description":"Every event an endpoint can receive, and the group that brings it.","tags":["Webhooks"],"x-pp-scope":"read","x-pp-stability":"stable","x-pp-resource":"webhookEndpoints","x-pp-method":"eventTypes","x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEventType"}},"has_more":{"type":"boolean","description":"More items follow: pass next_cursor to get them.","example":false},"next_cursor":{"type":["string","null"],"description":"The cursor of the next page, or null on the last one.","example":null},"as_of":{"type":"integer","format":"int64","x-pp-unit":"ms","description":"When the oldest figure in the list was read.","example":1791460800000}},"required":["data","has_more","next_cursor","as_of"],"additionalProperties":false}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The API is starting and has not loaded your keys yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}}}}},"/v1/events/{event_id}":{"get":{"operationId":"getEvent","summary":"Get an event","description":"One event of the log, as the stream and the webhooks send it.","tags":["Events"],"x-pp-scope":"read","x-pp-stability":"stable","x-pp-resource":"events","x-pp-method":"get","x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","event_not_found"],"parameters":[{"name":"event_id","in":"path","required":true,"description":"The event.","schema":{"type":"string","example":"evt_01JAB7Q8XK4M2N5P7R9S3T5V7W"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Event"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The id is unknown, or older than the event log keeps.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The API is starting and has not loaded your keys yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}}}}},"/v1/accounts/{account_id}/fills":{"get":{"operationId":"listFills","summary":"List fills","description":"Every execution with its price and fee, newest first.","tags":["Fills"],"x-pp-scope":"read","x-pp-stability":"stable","x-pp-resource":"fills","x-pp-method":"list","x-pp-pagination":{"param":"cursor","items":"data","next":"next_cursor","has_more":"has_more","limit":"limit"},"x-pp-errors":["missing_api_key","invalid_api_key","expired_api_key","revoked_api_key","invalid_token","expired_token","revoked_token","wrong_resource","wrong_environment","ip_not_allowed","api_disabled","rate_limited","account_not_found","state_unavailable","invalid_parameter","invalid_cursor"],"parameters":[{"name":"account_id","in":"path","required":true,"description":"The account number.","schema":{"type":"string","example":"SANDBOX-00042-001"}},{"name":"market","in":"query","description":"Only this market.","schema":{"type":"string","example":"BTC-USD"}},{"name":"limit","in":"query","description":"Page size.","schema":{"type":"integer","minimum":1,"maximum":200,"default":50,"example":50}},{"name":"cursor","in":"query","description":"next_cursor from the previous page, with the same filters.","schema":{"type":"string","example":"eyJzIjoiZmlsbHMifQ.c2lnbmF0dXJl"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Fill"}},"has_more":{"type":"boolean","description":"More items follow: pass next_cursor to get them.","example":false},"next_cursor":{"type":["string","null"],"description":"The cursor of the next page, or null on the last one.","example":null},"as_of":{"type":"integer","format":"int64","x-pp-unit":"ms","description":"When the oldest figure in the list was read.","example":1791460800000}},"required":["data","has_more","next_cursor","as_of"],"additionalProperties":false}}}},"400":{"description":"A query or path parameter is out of range or the wrong kind.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"invalid_request","code":"invalid_parameter","message":"A parameter has a value this route does not take.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#invalid_parameter"}}}}},"401":{"description":"The request has no Authorization header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"403":{"description":"The key only works from the addresses you listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"404":{"description":"The account does not exist in this environment, or the key does not reach it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"not_found","code":"account_not_found","message":"No account with that id is reachable with this key.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":false,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_found"}}}}},"429":{"description":"A request budget is used up (details.scope says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"500":{"description":"An error we did not expect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"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"}}}}},"503":{"description":"The trading engine did not give a complete answer in time; nothing partial is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"engine","code":"state_unavailable","message":"The account's figures cannot be read right now.","request_id":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f","retryable":true,"doc_url":"https://docs.phoenixperpsfunding.com/reference/errors#state_unavailable"}}}}}}}}},"webhooks":{"order.created":{"post":{"summary":"An order rests on the engine (or a market order was taken).","x-pp-group":"orders","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Any 2xx answer within the timeout: delivered. Anything else: tried again later."}}}},"order.edited":{"post":{"summary":"An order changed in place (size or price).","x-pp-group":"orders","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Any 2xx answer within the timeout: delivered. Anything else: tried again later."}}}},"order.filled":{"post":{"summary":"An order filled.","x-pp-group":"orders","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Any 2xx answer within the timeout: delivered. Anything else: tried again later."}}}},"order.canceled":{"post":{"summary":"An order was canceled; cancel_reason says why.","x-pp-group":"orders","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Any 2xx answer within the timeout: delivered. Anything else: tried again later."}}}},"order.rejected":{"post":{"summary":"The engine refused an order; reject.code says why.","x-pp-group":"orders","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Any 2xx answer within the timeout: delivered. Anything else: tried again later."}}}},"order.expired":{"post":{"summary":"An order ended by its time in force (gtd, ioc, fok).","x-pp-group":"orders","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Any 2xx answer within the timeout: delivered. Anything else: tried again later."}}}},"fill.created":{"post":{"summary":"An execution, with its price and fee.","x-pp-group":"orders","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Any 2xx answer within the timeout: delivered. Anything else: tried again later."}}}},"position.opened":{"post":{"summary":"A position opened (or turned to the other side).","x-pp-group":"positions","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Any 2xx answer within the timeout: delivered. Anything else: tried again later."}}}},"position.changed":{"post":{"summary":"A position's size or entry price changed.","x-pp-group":"positions","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Any 2xx answer within the timeout: delivered. Anything else: tried again later."}}}},"position.closed":{"post":{"summary":"A position closed.","x-pp-group":"positions","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Any 2xx answer within the timeout: delivered. Anything else: tried again later."}}}},"strategy.created":{"post":{"summary":"A strategy started.","x-pp-group":"orders","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Any 2xx answer within the timeout: delivered. Anything else: tried again later."}}}},"strategy.leg_placed":{"post":{"summary":"A strategy placed an order.","x-pp-group":"orders","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Any 2xx answer within the timeout: delivered. Anything else: tried again later."}}}},"strategy.leg_modified":{"post":{"summary":"A strategy moved one of its orders (a trailing stop, break-even, a chase).","x-pp-group":"orders","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Any 2xx answer within the timeout: delivered. Anything else: tried again later."}}}},"strategy.leg_filled":{"post":{"summary":"An order of a strategy filled.","x-pp-group":"orders","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Any 2xx answer within the timeout: delivered. Anything else: tried again later."}}}},"strategy.leg_canceled":{"post":{"summary":"An order of a strategy was canceled.","x-pp-group":"orders","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Any 2xx answer within the timeout: delivered. Anything else: tried again later."}}}},"strategy.leg_rejected":{"post":{"summary":"The engine refused an order of a strategy.","x-pp-group":"orders","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Any 2xx answer within the timeout: delivered. Anything else: tried again later."}}}},"strategy.orphan_repaired":{"post":{"summary":"An exit filled past flat and the position it opened was closed at once.","x-pp-group":"orders","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Any 2xx answer within the timeout: delivered. Anything else: tried again later."}}}},"strategy.slice":{"post":{"summary":"A TWAP or VWAP slice was sent, carried or refused.","x-pp-group":"orders","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Any 2xx answer within the timeout: delivered. Anything else: tried again later."}}}},"strategy.triggered":{"post":{"summary":"A conditional order's price was reached: its order was sent.","x-pp-group":"orders","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Any 2xx answer within the timeout: delivered. Anything else: tried again later."}}}},"strategy.ended":{"post":{"summary":"A strategy ended; end_reason says why.","x-pp-group":"orders","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Any 2xx answer within the timeout: delivered. Anything else: tried again later."}}}},"tradingview.alert_executed":{"post":{"summary":"A TradingView alert placed its orders.","x-pp-group":"orders","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Any 2xx answer within the timeout: delivered. Anything else: tried again later."}}}},"tradingview.alert_refused":{"post":{"summary":"A TradingView alert was refused; reason says why.","x-pp-group":"orders","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Any 2xx answer within the timeout: delivered. Anything else: tried again later."}}}},"account.updated":{"post":{"summary":"An account's balance or status changed.","x-pp-group":"account","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Any 2xx answer within the timeout: delivered. Anything else: tried again later."}}}},"account.passed":{"post":{"summary":"An evaluation account passed.","x-pp-group":"account","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Any 2xx answer within the timeout: delivered. Anything else: tried again later."}}}},"account.failed":{"post":{"summary":"An account breached a rule.","x-pp-group":"account","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Any 2xx answer within the timeout: delivered. Anything else: tried again later."}}}},"account.payout_eligible":{"post":{"summary":"A funded account can request a payout.","x-pp-group":"account","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Any 2xx answer within the timeout: delivered. Anything else: tried again later."}}}},"account.disabled":{"post":{"summary":"An account was disabled.","x-pp-group":"account","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Any 2xx answer within the timeout: delivered. Anything else: tried again later."}}}},"account.removed":{"post":{"summary":"An account was removed.","x-pp-group":"account","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Any 2xx answer within the timeout: delivered. Anything else: tried again later."}}}},"key.loss_stop":{"post":{"summary":"A key reached its daily loss stop: its trading on the account is paused until the next day.","x-pp-group":"account","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Any 2xx answer within the timeout: delivered. Anything else: tried again later."}}}},"key.expiring":{"post":{"summary":"A key expires soon (api.keys.expiry_notice_days before its end), told on each account it reaches.","x-pp-group":"account","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Any 2xx answer within the timeout: delivered. Anything else: tried again later."}}}},"system.restarted":{"post":{"summary":"The trading engine restarted: its orders and positions were reset (one event per account the API was following).","x-pp-group":"account","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Any 2xx answer within the timeout: delivered. Anything else: tried again later."}}}},"risk.warning":{"post":{"summary":"An account came near a limit.","x-pp-group":"risk","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Any 2xx answer within the timeout: delivered. Anything else: tried again later."}}}},"risk.cleared":{"post":{"summary":"An account moved back from a limit.","x-pp-group":"risk","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Any 2xx answer within the timeout: delivered. Anything else: tried again later."}}}},"alert.triggered":{"post":{"summary":"A price alert fired: the market's price reached its level.","x-pp-group":"alerts","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Any 2xx answer within the timeout: delivered. Anything else: tried again later."}}}},"webhook.ping":{"post":{"summary":"A test sent from your dashboard or the API.","x-pp-group":null,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Any 2xx answer within the timeout: delivered. Anything else: tried again later."}}}}},"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"An API key (ppk_live_... on the live host, ppk_test_... on the sandbox host), or an app's access token from Sign in with Phoenix Perpetuals (ppo_live_..., ppo_test_...)."}},"schemas":{"Error":{"type":"object","description":"Every error has this shape.","properties":{"error":{"type":"object","properties":{"type":{"type":"string","enum":["invalid_request","authentication","permission","not_found","method","conflict","payload","rule_rejection","key_limit","rate_limit","server","engine"],"description":"The family of the error; it decides the HTTP status.","example":"not_found"},"code":{"type":"string","description":"The error code: match on this.","example":"account_not_found"},"message":{"type":"string","description":"A sentence for people. It may change; never match on it.","example":"No account with that id is reachable with this key."},"request_id":{"type":"string","description":"The id of the request; give it to support.","example":"req_0f9c2a7d8e1b4c6a9f3e5d7b1a2c4e6f"},"retryable":{"type":"boolean","description":"Whether the same request may succeed later.","example":false},"doc_url":{"type":"string","description":"Where this code is explained.","example":"https://docs.phoenixperpsfunding.com/reference/errors#account_not_found"},"details":{"description":"More about the problem: the fields at fault, a limit, where to go.","type":["object","array"]},"order_id":{"type":"string","description":"The order the error is about (an order the engine refused is kept, with this id).","example":"ord_01JAB7Q8XK4M2N5P7R9S3T5V7W"}},"required":["type","code","message","request_id","retryable","doc_url"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"Platform":{"type":"object","properties":{"environment":{"type":"string","enum":["live","sandbox"],"description":"The environment of the host you called.","example":"sandbox"},"version":{"type":"string","description":"The version of this API.","example":"1.0.0"},"server_time":{"type":"integer","format":"int64","x-pp-unit":"ms","description":"The time on the server.","example":1791460800000},"docs_url":{"type":"string","description":"The documentation.","example":"https://docs.phoenixperpsfunding.com"},"spec_url":{"type":"string","description":"This API as OpenAPI 3.1.","example":"https://sandbox-api.phoenixperpsfunding.com/v1/openapi.json"},"status":{"type":"object","properties":{"engine":{"type":"string","enum":["up","down"],"description":"Whether the trading engine is reachable.","example":"up"},"engine_started_at":{"type":["integer","null"],"format":"int64","x-pp-unit":"ms","description":"When the trading engine last started.","example":1791460800000},"market_data":{"type":"string","enum":["up","down"],"description":"Whether the market-data stream is live, with every price feed.","example":"up"},"webhooks":{"type":"string","enum":["up","down"],"description":"Whether outbound webhooks are being delivered.","example":"up"}},"required":["engine","engine_started_at","market_data","webhooks"],"additionalProperties":false}},"required":["environment","version","server_time","docs_url","spec_url","status"],"additionalProperties":false},"Status":{"type":"object","properties":{"environment":{"type":"string","enum":["live","sandbox"],"description":"The environment of the host you called.","example":"sandbox"},"api":{"type":"string","enum":["operational","disabled"],"description":"Whether this environment takes requests.","example":"operational"},"engine":{"type":"object","properties":{"connected":{"type":"boolean","description":"Whether the API is connected to the trading engine.","example":true},"started_at":{"type":["integer","null"],"format":"int64","x-pp-unit":"ms","description":"When the trading engine last started.","example":1791460800000}},"required":["connected","started_at"],"additionalProperties":false},"account_data":{"type":"object","properties":{"synced_at":{"type":["integer","null"],"format":"int64","x-pp-unit":"ms","description":"When your keys and accounts were last confirmed with the website.","example":1791460800000}},"required":["synced_at"],"additionalProperties":false},"market_data":{"type":"object","properties":{"live":{"type":"boolean","description":"Whether the market-data stream is live, with every price feed.","example":true},"checked_at":{"type":["integer","null"],"format":"int64","x-pp-unit":"ms","description":"When that was last checked.","example":1791460800000}},"required":["live","checked_at"],"additionalProperties":false},"features":{"type":"object","properties":{"stream":{"type":"boolean","description":"The account stream.","example":true},"market_data":{"type":"boolean","description":"Market data.","example":true},"webhooks":{"type":"boolean","description":"Webhooks.","example":true},"tradingview":{"type":"boolean","description":"TradingView alerts.","example":true},"mcp":{"type":"boolean","description":"AI assistants (MCP).","example":true}},"required":["stream","market_data","webhooks","tradingview","mcp"],"additionalProperties":false},"server_time":{"type":"integer","format":"int64","x-pp-unit":"ms","description":"The time on the server.","example":1791460800000}},"required":["environment","api","engine","account_data","market_data","features","server_time"],"additionalProperties":false},"Limits":{"type":"object","properties":{"environment":{"type":"string","enum":["live","sandbox"],"description":"The environment of the host you called.","example":"sandbox"},"rate":{"type":"object","description":"The request budgets. A request takes from every budget it belongs to.","properties":{"public_per_ip":{"type":"object","properties":{"per_min":{"type":"integer","description":"Requests a minute.","example":600},"burst":{"type":"integer","description":"Requests at once.","example":120}},"required":["per_min","burst"],"additionalProperties":false},"per_ip":{"type":"object","properties":{"per_min":{"type":"integer","description":"Requests a minute.","example":600},"burst":{"type":"integer","description":"Requests at once.","example":120}},"required":["per_min","burst"],"additionalProperties":false},"per_key_read":{"type":"object","properties":{"per_min":{"type":"integer","description":"Requests a minute.","example":600},"burst":{"type":"integer","description":"Requests at once.","example":120}},"required":["per_min","burst"],"additionalProperties":false},"per_key_trade":{"type":"object","properties":{"per_min":{"type":"integer","description":"Requests a minute.","example":600},"burst":{"type":"integer","description":"Requests at once.","example":120}},"required":["per_min","burst"],"additionalProperties":false},"per_account_trade":{"type":"object","properties":{"per_min":{"type":"integer","description":"Requests a minute.","example":600},"burst":{"type":"integer","description":"Requests at once.","example":120}},"required":["per_min","burst"],"additionalProperties":false},"per_customer":{"type":"object","properties":{"per_min":{"type":"integer","description":"Requests a minute.","example":600},"burst":{"type":"integer","description":"Requests at once.","example":120}},"required":["per_min","burst"],"additionalProperties":false},"bulk":{"type":"object","properties":{"per_min":{"type":"integer","description":"Requests a minute.","example":600},"burst":{"type":"integer","description":"Requests at once.","example":120}},"required":["per_min","burst"],"additionalProperties":false},"what_if":{"type":"object","properties":{"per_min":{"type":"integer","description":"Requests a minute.","example":600},"burst":{"type":"integer","description":"Requests at once.","example":120}},"required":["per_min","burst"],"additionalProperties":false}},"required":["public_per_ip","per_ip","per_key_read","per_key_trade","per_account_trade","per_customer","bulk","what_if"],"additionalProperties":false},"keys":{"type":"object","properties":{"per_environment":{"type":"integer","description":"Keys you may hold in each environment.","example":5},"ip_allowlist_max":{"type":"integer","description":"Addresses in a key's allowlist.","example":10},"expiry_max_days":{"type":"integer","description":"The longest a key may live, in days.","example":365}},"required":["per_environment","ip_allowlist_max","expiry_max_days"],"additionalProperties":false},"orders":{"type":"object","properties":{"max_working_per_account":{"type":"integer","description":"Working orders an account may hold.","example":50},"max_working_per_customer":{"type":"integer","description":"Working orders across your accounts.","example":200},"new_per_min_account":{"type":"integer","description":"New orders a minute on one account.","example":60},"new_per_day_account":{"type":"integer","description":"New orders a day on one account.","example":5000},"price_band_pct":{"type":"string","format":"decimal","description":"How far from the market price a priced order may be, in percent.","example":"25"},"quote_max_age_s":{"type":"integer","description":"The oldest price an order is checked against, in seconds.","example":10},"quote_max_age_slow_s":{"type":"integer","description":"The oldest unchanged price of a quiet market an order is checked against, while the price feed lives (other markets move), in seconds.","example":120},"gtd_min_seconds":{"type":"integer","description":"The nearest a gtd order may expire, in seconds from now.","example":5},"gtd_max_days":{"type":"integer","description":"The farthest, in days from now.","example":30}},"required":["max_working_per_account","max_working_per_customer","new_per_min_account","new_per_day_account","price_band_pct","quote_max_age_s","quote_max_age_slow_s","gtd_min_seconds","gtd_max_days"],"additionalProperties":false},"sandbox":{"type":"object","properties":{"accounts_for_life":{"type":"integer","description":"Sandbox accounts you may open, ever.","example":10},"start_balance":{"type":"string","format":"decimal","description":"The balance a sandbox account starts with.","example":"100000"},"parked_after_hours":{"type":"integer","description":"Hours without use before a sandbox account is parked.","example":72}},"required":["accounts_for_life","start_balance","parked_after_hours"],"additionalProperties":false},"strategies":{"type":"object","properties":{"per_account":{"type":"integer","description":"Running strategies an account may hold.","example":25},"programs_per_account":{"type":"integer","description":"Of those, programs (oco, twap, vwap, scaled, chase, conditional).","example":5},"legs_per_account":{"type":"integer","description":"Working orders of strategies on one account.","example":40},"per_customer":{"type":"integer","description":"Running strategies across your accounts.","example":100},"take_profits_per_position":{"type":"integer","description":"Take-profit legs on one position.","example":5},"stop_losses_per_position":{"type":"integer","description":"Stop-loss legs on one position.","example":3},"twap_min_minutes":{"type":"integer","description":"The shortest twap or vwap, in minutes.","example":5},"twap_max_minutes":{"type":"integer","description":"The longest twap or vwap, in minutes.","example":1440},"slice_min_seconds":{"type":"integer","description":"The shortest time between slices, in seconds.","example":30},"scaled_max_rungs":{"type":"integer","description":"The most limits in a scaled ladder.","example":10},"chase_enabled":{"type":"boolean","description":"Whether chase strategies may start.","example":true},"chase_max_minutes":{"type":"integer","description":"The longest a chase may run, in minutes.","example":60}},"required":["per_account","programs_per_account","legs_per_account","per_customer","take_profits_per_position","stop_losses_per_position","twap_min_minutes","twap_max_minutes","slice_min_seconds","scaled_max_rungs","chase_enabled","chase_max_minutes"],"additionalProperties":false},"alerts":{"type":"object","properties":{"armed_per_account":{"type":"integer","description":"Price alerts armed at once on one account.","example":25},"armed_per_customer":{"type":"integer","description":"Price alerts armed at once across your accounts.","example":100},"kept_days":{"type":"integer","description":"How long an alert that fired (or was disabled) stays listed, in days.","example":90}},"required":["armed_per_account","armed_per_customer","kept_days"],"additionalProperties":false},"body_max_bytes":{"type":"integer","description":"The largest request body.","example":16384},"page_limit":{"type":"object","properties":{"default":{"type":"integer","description":"Items a page holds by default.","example":50},"max":{"type":"integer","description":"The most a page may hold.","example":200}},"required":["default","max"],"additionalProperties":false}},"required":["environment","rate","keys","orders","strategies","alerts","body_max_bytes","page_limit"],"additionalProperties":false},"Market":{"type":"object","properties":{"market":{"type":"string","description":"A market id: the asset and USD; an option adds its venue or hours after a dot.","example":"BTC-USD"},"name":{"type":"string","description":"The market's name; for a currency, the pair its price is quoted in (JPY-USD: USD/JPY, yen per dollar).","example":"Bitcoin"},"status":{"type":"string","enum":["open","halted","closed"],"description":"Whether the market trades now.","example":"open"},"venue":{"type":["string","null"],"description":"The venue it trades on: its prices and fills are that venue's. Null for a currency on FX hours.","example":null},"trading_hours":{"type":"string","enum":["24/7","standard","fx"],"description":"When it trades: around the clock, its underlying market's sessions (Standard Market Hours, closed on weekends), or FX hours.","example":"24/7"},"option_of":{"type":["string","null"],"description":"For an option (the same asset on another venue, or on Standard Market Hours): its market. Null for a market.","example":null},"options":{"type":["array","null"],"items":{"type":"object","properties":{"market":{"type":"string","description":"A market id: the asset and USD; an option adds its venue or hours after a dot.","example":"BTC-USD"},"venue":{"type":["string","null"],"description":"Its venue.","example":null},"trading_hours":{"type":"string","enum":["24/7","standard","fx"],"description":"When it trades.","example":"24/7"}},"required":["market","venue","trading_hours"],"additionalProperties":false},"description":"The ways this asset can be traded, the market first, then its options: an account holds one of them at a time (market_option_held). Null when there is only the market."},"tick_size":{"type":"string","format":"decimal","description":"Prices are multiples of this.","example":"0.1"},"size_step":{"type":"string","format":"decimal","description":"Sizes are multiples of this, in the base asset.","example":"0.001"},"min_size":{"type":"string","format":"decimal","description":"The smallest order size (the size step). An order must also be worth at least min_notional.","example":"0.001"},"min_notional":{"type":["string","null"],"format":"decimal","description":"The smallest order value in USD: an order worth less is refused order_too_small.","example":"10"},"max_leverage":{"type":"integer","description":"The highest leverage on this market.","example":50},"fee_rate_pct":{"type":"string","format":"decimal","description":"The fee on each fill, in percent of its value.","example":"0.04"},"exposure_cap":{"type":["string","null"],"format":"decimal","description":"The most you may hold on this market across your accounts on the same rule, in USD.","example":"1000000"},"max_slippage_pct":{"type":["object","null"],"description":"How far from the price a market order may fill, in percent.","properties":{"default":{"type":["string","null"],"format":"decimal","description":"The slippage bound a market order gets when it names none.","example":"1"},"min":{"type":["string","null"],"format":"decimal","description":"The tightest bound an order may ask.","example":"0.05"},"max":{"type":["string","null"],"format":"decimal","description":"The widest bound an order may ask.","example":"5"}},"required":["default","min","max"],"additionalProperties":false}},"required":["market","name","status","venue","trading_hours","option_of","options","tick_size","size_step","min_size","min_notional","max_leverage","fee_rate_pct","exposure_cap","max_slippage_pct"],"additionalProperties":false},"MarketStats":{"type":"object","description":"A market's 24-hour figures and open interest. A figure not known yet is null.","properties":{"market":{"type":"string","description":"A market id: the asset and USD; an option adds its venue or hours after a dot.","example":"BTC-USD"},"last":{"type":["string","null"],"format":"decimal","description":"The last trade.","example":"63012.5"},"change_24h":{"type":["string","null"],"format":"decimal","description":"The change over 24 hours.","example":"880.5"},"change_24h_pct":{"type":["string","null"],"format":"decimal","description":"That change in percent.","example":"1.42"},"high_24h":{"type":["string","null"],"format":"decimal","description":"The highest in 24 hours.","example":"63500"},"low_24h":{"type":["string","null"],"format":"decimal","description":"The lowest in 24 hours.","example":"61800"},"volume_24h":{"type":["string","null"],"format":"decimal","description":"The size traded in 24 hours, in the base asset.","example":"2891.4"},"notional_volume_24h":{"type":["string","null"],"format":"decimal","description":"The value traded in 24 hours, in USD.","example":"182340112.50"},"open_interest":{"type":["string","null"],"format":"decimal","description":"The market's open interest: the size held open in positions, in the base asset.","example":"93801.41"},"notional_open_interest":{"type":["string","null"],"format":"decimal","description":"That open interest in USD, at the last price.","example":"5910412345.20"}},"required":["market","last","change_24h","change_24h_pct","high_24h","low_24h","volume_24h","notional_volume_24h","open_interest","notional_open_interest"],"additionalProperties":false},"Rule":{"type":["object","null"],"description":"The account's rule, as the trading engine enforces it.","properties":{"start_balance":{"type":"string","format":"decimal","description":"The balance the account started with.","example":"100000"},"daily_loss":{"type":["object","null"],"properties":{"amount":{"type":["string","null"],"format":"decimal","description":"The most the account may lose in a trading day, in USD.","example":"5000"},"pct":{"type":["string","null"],"format":"decimal","description":"The same limit in percent of its basis.","example":null},"basis":{"type":"string","enum":["peak_balance","start_balance","peak_equity","day_start_balance","day_start_equity"],"description":"What the day's loss is measured from.","example":"start_balance"},"on_breach":{"type":"string","enum":["fail_account","flatten","flatten_and_pause"],"description":"What happens when it is reached.","example":"fail_account"}},"required":["amount","pct","basis","on_breach"],"additionalProperties":false},"max_drawdown":{"type":["object","null"],"properties":{"amount":{"type":["string","null"],"format":"decimal","description":"The most the account may fall from its reference, in USD.","example":"10000"},"pct":{"type":["string","null"],"format":"decimal","description":"The same limit in percent.","example":null},"mode":{"type":"string","enum":["end_of_day","end_of_trade","static","intraday_equity"],"description":"How the reference moves: end_of_day and end_of_trade follow the highest balance, static stays at the start, intraday_equity follows the highest equity.","example":"end_of_day"}},"required":["amount","pct","mode"],"additionalProperties":false},"weekly_loss":{"type":["object","null"],"properties":{"amount":{"type":["string","null"],"format":"decimal","description":"The most the account may lose in a week, in USD.","example":null},"pct":{"type":["string","null"],"format":"decimal","description":"The same limit in percent.","example":null}},"required":["amount","pct"],"additionalProperties":false},"profit_target":{"type":["object","null"],"properties":{"amount":{"type":["string","null"],"format":"decimal","description":"The profit to reach, in USD.","example":"8000"},"pct":{"type":["string","null"],"format":"decimal","description":"The same target in percent.","example":null},"requires_flat":{"type":"boolean","description":"Positions must be closed when it is reached.","example":false}},"required":["amount","pct","requires_flat"],"additionalProperties":false},"min_trading_days":{"type":["integer","null"],"description":"Days with a trade the account needs.","example":3},"min_calendar_days":{"type":["integer","null"],"description":"Calendar days the account needs.","example":null},"consistency":{"type":["object","null"],"properties":{"amount":{"type":["string","null"],"format":"decimal","description":"The most one day may bring, in USD.","example":null},"pct":{"type":["string","null"],"format":"decimal","description":"The most one day may bring, in percent of the total.","example":null}},"required":["amount","pct"],"additionalProperties":false},"overnight_holding":{"type":"boolean","description":"Positions may stay open overnight.","example":true},"weekend_holding":{"type":"boolean","description":"Positions may stay open over the weekend.","example":true},"inactivity_days":{"type":["integer","null"],"description":"Days without a trade after which the account fails.","example":null}},"required":["start_balance","daily_loss","max_drawdown","weekly_loss","profit_target","min_trading_days","min_calendar_days","consistency","overnight_holding","weekend_holding","inactivity_days"],"additionalProperties":false},"Account":{"type":"object","properties":{"id":{"type":"string","description":"The account number.","example":"SANDBOX-00042-001"},"environment":{"type":"string","enum":["live","sandbox"],"description":"The environment the account lives in.","example":"sandbox"},"stage":{"type":"string","enum":["evaluation","funded","sandbox"],"description":"Where the account is in the programme.","example":"sandbox"},"status":{"type":"string","enum":["pending","active","passed","failed","closed","suspended"],"description":"pending: being opened; active: trading.","example":"active"},"product":{"type":["string","null"],"description":"The product it was bought as.","example":"Classic"},"tier":{"type":["string","null"],"description":"Its size as sold.","example":"$100K"},"start_balance":{"type":["string","null"],"format":"decimal","description":"The balance it started with.","example":"100000"},"balance":{"type":["string","null"],"format":"decimal","description":"The balance: closed trades and fees only.","example":"100000"},"rule":{"$ref":"#/components/schemas/Rule"},"payout_eligible":{"type":"boolean","description":"A payout may be requested now.","example":false},"parked":{"type":"boolean","description":"Sandbox only: parked after a while unused; it wakes the moment you use it.","example":false},"created_at":{"type":["integer","null"],"format":"int64","x-pp-unit":"ms","description":"When the account was made.","example":1791460800000}},"required":["id","environment","stage","status","product","tier","start_balance","balance","rule","payout_eligible","created_at"],"additionalProperties":false},"Limit":{"type":["object","null"],"description":"A loss limit and the room left to it.","properties":{"limit":{"type":"string","format":"decimal","description":"The limit, in USD.","example":"5000"},"floor":{"type":"string","format":"decimal","description":"The equity at which it is breached.","example":"95000"},"room":{"type":"string","format":"decimal","description":"How much more the account may lose before it.","example":"4200.5"},"used_pct":{"type":["string","null"],"format":"decimal","description":"How much of it is used, in percent.","example":"16"},"resets_at":{"type":"integer","format":"int64","x-pp-unit":"ms","description":"Daily loss only: when it resets (midnight New York).","example":1791460800000},"on_breach":{"type":"string","enum":["fail_account","flatten","flatten_and_pause"],"description":"Daily loss only: what happens when it is reached.","example":"fail_account"},"estimated":{"type":"boolean","description":"Daily loss only: the day's start is estimated (the engine does not publish it).","example":false},"mode":{"type":"string","enum":["end_of_day","end_of_trade","static","intraday_equity"],"description":"Max drawdown only: how the reference moves.","example":"end_of_day"},"at_least":{"type":"boolean","description":"Max drawdown only: the engine may hold a higher floor than shown (it follows equity highs).","example":false},"lifted":{"type":"boolean","description":"The rule no longer applies this limit (its cut-off was reached).","example":false}},"required":["lifted"],"additionalProperties":false},"Warning":{"type":"object","properties":{"code":{"type":"string","enum":["daily_loss_used","max_drawdown_used","liquidation_near","no_stop_loss","margin_used","order_without_position"],"description":"What it is about.","example":"daily_loss_used"},"level":{"type":"string","enum":["info","warning","critical"],"description":"How serious.","example":"warning"},"market":{"type":"string","description":"The market it is about.","example":"BTC-USD"},"value":{"type":"string","format":"decimal","description":"The figure behind it, in percent.","example":"76.5"}},"required":["code","level"],"additionalProperties":false},"AccountRisk":{"type":"object","properties":{"as_of":{"type":"integer","format":"int64","x-pp-unit":"ms","description":"When the oldest figure here was read.","example":1791460800000},"stale":{"type":"boolean","description":"Some figures are older than usual (the engine was busy).","example":false},"balance":{"type":"string","format":"decimal","description":"The balance.","example":"101000"},"equity":{"type":"string","format":"decimal","description":"The balance plus the open P&L at the market price.","example":"101500"},"unrealized_pnl":{"type":"string","format":"decimal","description":"The open P&L.","example":"500"},"pnl_today":{"type":"string","format":"decimal","description":"The equity change since midnight New York, open positions included: what the daily loss rule counts.","example":"650.2"},"realized_today":{"type":"string","format":"decimal","description":"The P&L closed today.","example":"150.2"},"fees_today":{"type":"string","format":"decimal","description":"The fees paid today.","example":"24.8"},"trades_today":{"type":"integer","description":"Trades closed today.","example":3},"margin_used":{"type":"string","format":"decimal","description":"The margin your positions hold.","example":"3100"},"margin_available":{"type":["string","null"],"format":"decimal","description":"What is left of the balance for new positions.","example":"97900"},"exposure":{"type":"object","properties":{"gross":{"type":"string","format":"decimal","description":"The value of every open position.","example":"31500"},"long":{"type":"string","format":"decimal","description":"The value of the long ones.","example":"31500"},"short":{"type":"string","format":"decimal","description":"The value of the short ones.","example":"0"},"effective_leverage":{"type":["string","null"],"format":"decimal","description":"Gross exposure over equity.","example":"0.3103"},"markets":{"type":"array","items":{"type":"object","properties":{"market":{"type":"string","description":"A market id: the asset and USD; an option adds its venue or hours after a dot.","example":"BTC-USD"},"notional":{"type":"string","format":"decimal","description":"The value held on it.","example":"31500"},"leverage":{"type":["string","null"],"format":"decimal","description":"That value over equity.","example":"0.3103"},"cap":{"type":["string","null"],"format":"decimal","description":"The exposure cap of the market.","example":"1000000"},"cap_used_pct":{"type":["string","null"],"format":"decimal","description":"How much of the cap is used, counting your other accounts on the same rule, in percent.","example":"3.15"}},"required":["market","notional","leverage","cap","cap_used_pct"],"additionalProperties":false},"description":"Per market, largest first."}},"required":["gross","long","short","effective_leverage","markets"],"additionalProperties":false},"daily_loss":{"$ref":"#/components/schemas/Limit"},"max_drawdown":{"$ref":"#/components/schemas/Limit"},"profit_target":{"type":["object","null"],"properties":{"goal_balance":{"type":"string","format":"decimal","description":"The balance that reaches it.","example":"108000"},"remaining":{"type":"string","format":"decimal","description":"Still to make.","example":"7000"},"progress_pct":{"type":["string","null"],"format":"decimal","description":"How far, in percent.","example":"12.5"},"requires_flat":{"type":"boolean","description":"Positions must be closed when it is reached.","example":false}},"required":["goal_balance","remaining","progress_pct","requires_flat"],"additionalProperties":false},"trading_days":{"type":"object","properties":{"count":{"type":["integer","null"],"description":"Days with a trade so far.","example":2},"required":{"type":["integer","null"],"description":"Days the rule needs.","example":3}},"required":["count","required"],"additionalProperties":false},"nearest_liquidation":{"type":["object","null"],"properties":{"market":{"type":"string","description":"A market id: the asset and USD; an option adds its venue or hours after a dot.","example":"BTC-USD"},"price":{"type":"string","format":"decimal","description":"Its liquidation price.","example":"56420.5"},"distance_pct":{"type":"string","format":"decimal","description":"How far the price is from it, in percent.","example":"10.44"}},"required":["market","price","distance_pct"],"additionalProperties":false},"trading_day_ends_at":{"type":"integer","format":"int64","x-pp-unit":"ms","description":"When the trading day ends (midnight New York).","example":1791460800000},"warnings":{"type":"array","items":{"$ref":"#/components/schemas/Warning"},"description":"What needs your attention, most serious first."}},"required":["as_of","stale","balance","equity","unrealized_pnl","pnl_today","realized_today","fees_today","trades_today","margin_used","margin_available","exposure","daily_loss","max_drawdown","profit_target","trading_days","nearest_liquidation","trading_day_ends_at","warnings"],"additionalProperties":false},"Progress":{"type":"object","properties":{"stage":{"type":"string","enum":["evaluation","funded","sandbox"],"description":"Where the account is in the programme.","example":"evaluation"},"objectives":{"type":"object","properties":{"profit_target":{"type":["object","null"],"properties":{"goal_balance":{"type":"string","format":"decimal","description":"The balance that reaches it.","example":"108000"},"remaining":{"type":"string","format":"decimal","description":"Still to make.","example":"7000"},"progress_pct":{"type":["string","null"],"format":"decimal","description":"How far, in percent.","example":"12.5"},"requires_flat":{"type":"boolean","description":"Positions must be closed when it is reached.","example":false},"status":{"type":"string","enum":["open","met"],"description":"Whether it is reached.","example":"open"}},"required":["goal_balance","remaining","progress_pct","requires_flat","status"],"additionalProperties":false},"min_trading_days":{"type":["object","null"],"properties":{"required":{"type":"integer","description":"Days the rule needs.","example":3},"count":{"type":["integer","null"],"description":"Days with a trade so far.","example":2},"status":{"type":"string","enum":["open","met"],"description":"Whether it is reached.","example":"open"}},"required":["required","count","status"],"additionalProperties":false},"min_calendar_days":{"type":["object","null"],"properties":{"required":{"type":"integer","description":"Calendar days the rule needs.","example":5},"count":{"type":"integer","description":"Calendar days so far.","example":4},"status":{"type":"string","enum":["open","met"],"description":"Whether it is reached.","example":"open"}},"required":["required","count","status"],"additionalProperties":false}},"required":["profit_target","min_trading_days","min_calendar_days"],"additionalProperties":false},"limits":{"type":"object","properties":{"daily_loss":{"$ref":"#/components/schemas/LimitStanding"},"max_drawdown":{"$ref":"#/components/schemas/LimitStanding"}},"required":["daily_loss","max_drawdown"],"additionalProperties":false},"payout":{"type":["object","null"],"properties":{"eligible":{"type":"boolean","description":"A payout may be requested now.","example":false},"available":{"type":"string","format":"decimal","description":"What may be paid out.","example":"0"},"min_payout":{"type":["string","null"],"format":"decimal","description":"The smallest payout.","example":"100"},"paid_out":{"type":"string","format":"decimal","description":"Paid out so far.","example":"0"}},"required":["eligible","available","min_payout","paid_out"],"additionalProperties":false},"as_of":{"type":"integer","format":"int64","x-pp-unit":"ms","description":"When the oldest figure here was read.","example":1791460800000}},"required":["stage","objectives","limits","payout","as_of"],"additionalProperties":false},"TradingPolicy":{"type":"object","properties":{"rule":{"$ref":"#/components/schemas/Rule"},"trading_day":{"type":"object","properties":{"timezone":{"type":"string","description":"The trading day runs midnight to midnight in this zone.","example":"America/New_York"},"ends_at":{"type":"integer","format":"int64","x-pp-unit":"ms","description":"When this one ends.","example":1791460800000}},"required":["timezone","ends_at"],"additionalProperties":false},"slippage_pct":{"type":"object","properties":{"default":{"type":["string","null"],"format":"decimal","description":"The bound a market order gets when it names none, in percent.","example":"1"},"min":{"type":["string","null"],"format":"decimal","description":"The tightest it may ask.","example":"0.05"},"max":{"type":["string","null"],"format":"decimal","description":"The widest it may ask.","example":"5"}},"required":["default","min","max"],"additionalProperties":false},"margin":{"type":"object","properties":{"default_mode":{"type":"string","enum":["isolated","cross"],"description":"The margin mode of a market you never set.","example":"isolated"},"maintenance_margin_pct":{"type":["string","null"],"format":"decimal","description":"The share of a position's margin kept as maintenance, in percent.","example":"0.5"}},"required":["default_mode","maintenance_margin_pct"],"additionalProperties":false},"orders":{"type":"object","properties":{"max_working_per_account":{"type":"integer","description":"Working orders the account may hold.","example":50},"new_per_min_account":{"type":"integer","description":"New orders a minute.","example":60},"price_band_pct":{"type":"string","format":"decimal","description":"How far from the market price a priced order may be, in percent.","example":"25"},"quote_max_age_s":{"type":"integer","description":"The oldest price an order is checked against, in seconds.","example":10},"quote_max_age_slow_s":{"type":"integer","description":"The oldest unchanged price of a quiet market an order is checked against, while the price feed lives (other markets move), in seconds.","example":120}},"required":["max_working_per_account","new_per_min_account","price_band_pct","quote_max_age_s","quote_max_age_slow_s"],"additionalProperties":false},"controls":{"type":"object","description":"The limits you set on the key.","properties":{"markets":{"type":"array","items":{"type":"string","description":"A market id.","example":"BTC-USD"},"description":"The markets the key may trade; empty: every market."},"reduce_only":{"type":"boolean","description":"The key may only reduce positions.","example":false},"max_order_usd":{"type":["string","null"],"format":"decimal","description":"The largest order the key may place, in USD.","example":"5000"},"max_position_usd":{"type":["string","null"],"format":"decimal","description":"The largest position the key may hold, in USD.","example":null},"daily_loss_usd":{"type":["string","null"],"format":"decimal","description":"The loss in a trading day at which the key stops trading the account.","example":"1000"}},"required":["markets","reduce_only","max_order_usd","max_position_usd","daily_loss_usd"],"additionalProperties":false},"budgets":{"type":"object","properties":{"read_per_min":{"type":"integer","description":"Reads a minute for this key.","example":600},"trade_per_min":{"type":"integer","description":"Trading calls a minute for this key.","example":120}},"required":["read_per_min","trade_per_min"],"additionalProperties":false},"as_of":{"type":"integer","format":"int64","x-pp-unit":"ms","description":"When the oldest figure here was read.","example":1791460800000}},"required":["rule","trading_day","slippage_pct","margin","orders","controls","budgets","as_of"],"additionalProperties":false},"EquityHistory":{"type":"object","properties":{"resolution":{"type":"string","enum":["trade","day"],"description":"One point per closed trade, or per trading day.","example":"trade"},"points":{"type":"array","items":{"type":"object","properties":{"time":{"type":"integer","format":"int64","x-pp-unit":"ms","description":"When.","example":1791460800000},"date":{"type":"string","description":"The trading day (New York), with resolution day.","example":"2026-10-07"},"balance":{"type":"string","format":"decimal","description":"The balance then.","example":"100951.6"}},"required":["time","balance"],"additionalProperties":false},"description":"Oldest first; the first point is the opening balance."},"live":{"type":"object","properties":{"time":{"type":["integer","null"],"format":"int64","x-pp-unit":"ms","description":"When the live figures were read.","example":1791460800000},"balance":{"type":"string","format":"decimal","description":"The balance now.","example":"101000"},"equity":{"type":"string","format":"decimal","description":"The equity now.","example":"101500"}},"required":["time","balance","equity"],"additionalProperties":false}},"required":["resolution","points","live"],"additionalProperties":false},"DailyResult":{"type":"object","properties":{"date":{"type":"string","description":"The trading day (midnight to midnight New York).","example":"2026-10-07"},"trades":{"type":"integer","description":"Trades closed that day.","example":2},"gross_pnl":{"type":"string","format":"decimal","description":"Their P&L before fees.","example":"1600"},"fees":{"type":"string","format":"decimal","description":"Their fees.","example":"72.9"},"pnl":{"type":"string","format":"decimal","description":"Their P&L after fees.","example":"1527.1"},"withdrawn":{"type":"string","format":"decimal","description":"Paid out that day.","example":"0"},"balance_end":{"type":["string","null"],"format":"decimal","description":"The balance at the day's end.","example":"101527.1"}},"required":["date","trades","gross_pnl","fees","pnl","withdrawn","balance_end"],"additionalProperties":false},"MarginSetting":{"type":"object","properties":{"market":{"type":"string","description":"A market id: the asset and USD; an option adds its venue or hours after a dot.","example":"BTC-USD"},"leverage":{"type":"integer","description":"The leverage new positions on this market get.","example":10},"margin_mode":{"type":"string","enum":["isolated","cross"],"description":"Isolated: each position holds its own margin. Cross: positions share the balance.","example":"isolated"},"max_leverage":{"type":["integer","null"],"description":"The highest this account may use on the market (its trading rule's). null: the market is not available on this account.","example":50},"source":{"type":"string","enum":["position","saved","default"],"description":"Where it comes from: the open position, your saved setting, or the market default.","example":"saved"},"locked":{"type":"boolean","description":"A position or a working order on the market: the mode cannot change now.","example":false}},"required":["market","leverage","margin_mode","max_leverage","source","locked"],"additionalProperties":false},"ExitLeg":{"type":"object","properties":{"order_id":{"type":"string","description":"The working order.","example":"ord_01JAB7Q8XK4M2N5P7R9S3T5V7W"},"type":{"type":"string","enum":["market","limit","stop_market","stop_limit","take_market","take_limit"],"description":"The order's type.","example":"stop_market"},"price":{"type":["string","null"],"format":"decimal","description":"Its trigger or limit price.","example":"61000"},"size":{"type":["string","null"],"format":"decimal","description":"Its size.","example":"0.5"}},"required":["order_id","type","price","size"],"additionalProperties":false},"Position":{"type":"object","properties":{"id":{"type":"string","description":"This position, while it stays open on the same side.","example":"pos_01JAB7Q8XK4M2N5P7R9S3T5V7W"},"market":{"type":"string","description":"A market id: the asset and USD; an option adds its venue or hours after a dot.","example":"BTC-USD"},"side":{"type":"string","enum":["long","short"],"description":"Long or short.","example":"long"},"size":{"type":"string","format":"decimal","description":"The size, in the base asset.","example":"0.5"},"entry_price":{"type":["string","null"],"format":"decimal","description":"The average entry price.","example":"62000"},"mark_price":{"type":["string","null"],"format":"decimal","description":"The market price it is valued at.","example":"63000"},"notional":{"type":["string","null"],"format":"decimal","description":"Its value at that price.","example":"31500"},"unrealized_pnl":{"type":["string","null"],"format":"decimal","description":"Its open P&L.","example":"500"},"leverage":{"type":"integer","description":"Its leverage.","example":10},"margin_mode":{"type":"string","enum":["isolated","cross"],"description":"Its margin mode.","example":"isolated"},"initial_margin":{"type":["string","null"],"format":"decimal","description":"The margin it took at entry.","example":"3100"},"added_margin":{"type":["string","null"],"format":"decimal","description":"Margin you added to it.","example":"0"},"margin":{"type":["string","null"],"format":"decimal","description":"What it holds of the balance.","example":"3100"},"liquidation":{"type":["object","null"],"properties":{"price":{"type":["string","null"],"format":"decimal","description":"The price at which it is liquidated; null when there is none or it depends on several positions.","example":"56420.5"},"distance_pct":{"type":["string","null"],"format":"decimal","description":"How far the market price is from it, in percent.","example":"10.44"},"account_wide":{"type":"boolean","description":"Cross margin on several markets: no single price, every one of them moves it.","example":false}},"required":["price","distance_pct","account_wide"],"additionalProperties":false},"breach_prices":{"type":"object","properties":{"daily_loss":{"type":["string","null"],"format":"decimal","description":"The price at which this position alone would breach the daily loss limit.","example":"52000.1"},"max_drawdown":{"type":["string","null"],"format":"decimal","description":"The price at which it alone would breach the max drawdown.","example":"43000.2"}},"required":["daily_loss","max_drawdown"],"additionalProperties":false},"exits":{"type":"object","properties":{"take_profit":{"type":"array","items":{"$ref":"#/components/schemas/ExitLeg"},"description":"Limit orders on the closing side."},"stop_loss":{"type":"array","items":{"$ref":"#/components/schemas/ExitLeg"},"description":"Stop orders on the closing side."}},"required":["take_profit","stop_loss"],"additionalProperties":false},"protected":{"type":"boolean","description":"At least one stop loss rests on it.","example":true},"opened_at":{"type":["integer","null"],"format":"int64","x-pp-unit":"ms","description":"When it opened.","example":1791460800000}},"required":["id","market","side","size","entry_price","mark_price","notional","unrealized_pnl","leverage","margin_mode","initial_margin","added_margin","margin","liquidation","breach_prices","exits","protected","opened_at"],"additionalProperties":false},"ClosedPosition":{"type":"object","properties":{"market":{"type":"string","description":"A market id: the asset and USD; an option adds its venue or hours after a dot.","example":"BTC-USD"},"side":{"type":"string","enum":["long","short"],"description":"Long or short.","example":"long"},"size":{"type":"string","format":"decimal","description":"The size closed.","example":"1.5"},"entry_price":{"type":["string","null"],"format":"decimal","description":"The average entry price.","example":"60000"},"exit_price":{"type":["string","null"],"format":"decimal","description":"The average exit price.","example":"61066.67"},"gross_pnl":{"type":"string","format":"decimal","description":"The P&L before fees.","example":"1600"},"fees":{"type":"string","format":"decimal","description":"The fees.","example":"72.9"},"pnl":{"type":"string","format":"decimal","description":"The P&L after fees.","example":"1527.1"},"opened_at":{"type":"integer","format":"int64","x-pp-unit":"ms","description":"When it opened.","example":1791460800000},"closed_at":{"type":"integer","format":"int64","x-pp-unit":"ms","description":"When it was fully closed.","example":1791460800000},"lots":{"type":"array","items":{"type":"object","properties":{"size":{"type":"string","format":"decimal","description":"The size.","example":"1"},"entry_price":{"type":["string","null"],"format":"decimal","description":"Entry.","example":"60000"},"exit_price":{"type":["string","null"],"format":"decimal","description":"Exit.","example":"61000"},"pnl":{"type":"string","format":"decimal","description":"P&L after fees.","example":"951.6"},"fees":{"type":"string","format":"decimal","description":"Fees.","example":"48.4"},"opened_at":{"type":["integer","null"],"format":"int64","x-pp-unit":"ms","description":"Opened.","example":1791460800000},"closed_at":{"type":"integer","format":"int64","x-pp-unit":"ms","description":"Closed.","example":1791460800000}},"required":["size","entry_price","exit_price","pnl","fees","opened_at","closed_at"],"additionalProperties":false},"description":"The pieces it was closed in."}},"required":["market","side","size","entry_price","exit_price","gross_pnl","fees","pnl","opened_at","closed_at","lots"],"additionalProperties":false},"Order":{"type":"object","properties":{"id":{"type":"string","description":"The order.","example":"ord_01JAB7Q8XK4M2N5P7R9S3T5V7W"},"client_order_id":{"type":["string","null"],"description":"Your own id for it, when it was placed through the API.","example":null},"account_id":{"type":"string","description":"The account number.","example":"SANDBOX-00042-001"},"market":{"type":"string","description":"A market id: the asset and USD; an option adds its venue or hours after a dot.","example":"BTC-USD"},"side":{"type":["string","null"],"enum":["buy","sell",null],"description":"The order's side; null for an order placed elsewhere before the API saw it.","example":"sell"},"type":{"type":["string","null"],"enum":["market","limit","stop_market","stop_limit","take_market","take_limit",null],"description":"The order's type.","example":"stop_market"},"status":{"type":"string","enum":["pending","working","filled","canceled","rejected","expired","unconfirmed"],"description":"unconfirmed: the engine has not confirmed its last state yet.","example":"working"},"size":{"type":["string","null"],"format":"decimal","description":"The size, in the base asset.","example":"0.5"},"filled_size":{"type":["string","null"],"format":"decimal","description":"How much filled.","example":"0"},"limit_price":{"type":["string","null"],"format":"decimal","description":"Its limit price.","example":null},"stop_price":{"type":["string","null"],"format":"decimal","description":"Its trigger price.","example":"61000"},"average_fill_price":{"type":["string","null"],"format":"decimal","description":"The average fill price.","example":null},"fee":{"type":["string","null"],"format":"decimal","description":"The fee its fill paid.","example":null},"reduce_only":{"type":["boolean","null"],"description":"It may only reduce a position; null when not known (placed elsewhere).","example":null},"time_in_force":{"type":"string","enum":["gtc","gtd","ioc","fok"],"description":"How long it rests.","example":"gtc"},"expires_at":{"type":["integer","null"],"format":"int64","x-pp-unit":"ms","description":"A gtd order: when it expires (it ends expired then); null otherwise.","example":null},"post_only":{"type":["boolean","null"],"description":"It may only rest, never fill at once; null when not known (placed elsewhere).","example":null},"source":{"type":"string","enum":["api","mcp","platform","strategy","tradingview","system"],"description":"Where it was placed: this API, an AI assistant (the MCP server), a trading platform, a strategy, a TradingView alert, or the system (a liquidation).","example":"platform"},"strategy_id":{"type":["string","null"],"description":"The strategy that placed it (source strategy).","example":null},"exits":{"type":["object","null"],"description":"Exits attached to it (orders placed through the API).","example":null},"cancel_reason":{"type":["string","null"],"enum":["user","cancel_all","flatten","close_all","position_closed","position_reversed","close_assist","oco","replaced","strategy","key_loss_stop","risk_rule","system_restart","external",null],"description":"Why it was canceled.","example":null},"reject":{"type":["object","null"],"properties":{"code":{"type":"string","description":"The error code.","example":"insufficient_margin"},"message":{"type":["string","null"],"description":"What happened.","example":null}},"required":["code","message"],"additionalProperties":false},"created_at":{"type":["integer","null"],"format":"int64","x-pp-unit":"ms","description":"When it was placed.","example":1791460800000},"filled_at":{"type":["integer","null"],"format":"int64","x-pp-unit":"ms","description":"When it filled.","example":null},"canceled_at":{"type":["integer","null"],"format":"int64","x-pp-unit":"ms","description":"When it was canceled.","example":null},"updated_at":{"type":["integer","null"],"format":"int64","x-pp-unit":"ms","description":"Its latest change.","example":1791460800000}},"required":["id","client_order_id","account_id","market","side","type","status","size","filled_size","limit_price","stop_price","average_fill_price","fee","reduce_only","time_in_force","expires_at","post_only","source","strategy_id","exits","cancel_reason","reject","created_at","filled_at","canceled_at"],"additionalProperties":false},"Fill":{"type":"object","properties":{"id":{"type":"string","description":"The fill.","example":"fil_01JAB7Q8XK4M2N5P7R9S3T5V7W"},"order_id":{"type":"string","description":"Its order.","example":"ord_01JAB7Q8XK4M2N5P7R9S3T5V7W"},"market":{"type":"string","description":"A market id: the asset and USD; an option adds its venue or hours after a dot.","example":"BTC-USD"},"side":{"type":["string","null"],"enum":["buy","sell",null],"description":"The side; null for an order placed elsewhere before the API saw it.","example":"buy"},"size":{"type":"string","format":"decimal","description":"The size filled.","example":"0.5"},"price":{"type":"string","format":"decimal","description":"The fill price.","example":"62000"},"fee":{"type":["string","null"],"format":"decimal","description":"Its fee.","example":"12.4"},"liquidation":{"type":"boolean","description":"A liquidation filled it.","example":false},"time":{"type":"integer","format":"int64","x-pp-unit":"ms","description":"When it filled.","example":1791460800000}},"required":["id","order_id","market","side","size","price","fee","liquidation","time"],"additionalProperties":false},"Me":{"type":"object","properties":{"credential":{"type":"object","properties":{"kind":{"type":"string","enum":["key","app"],"description":"What you called with: an API key, or an app you signed in to.","example":"key"},"id":{"type":"string","description":"The key's id (the part after ppk_test_ or ppk_live_), or the app access's id.","example":"7Kx2mQ9pLr4A"},"name":{"type":"string","description":"Its name (an app: the app's name).","example":"Momentum bot"},"environment":{"type":"string","enum":["live","sandbox"],"description":"Its environment.","example":"sandbox"},"access":{"type":"string","enum":["read","trade"],"description":"read: look only. trade: also place and cancel.","example":"trade"},"expires_at":{"type":["integer","null"],"format":"int64","x-pp-unit":"ms","description":"When it expires; null: never.","example":null},"created_at":{"type":["integer","null"],"format":"int64","x-pp-unit":"ms","description":"When it was made.","example":1791460800000}},"required":["kind","id","name","environment","access","expires_at","created_at"],"additionalProperties":false},"accounts":{"type":"array","items":{"type":"string","description":"The account number.","example":"SANDBOX-00042-001"},"description":"The accounts it reaches."},"account_scope":{"type":"string","enum":["all","selected"],"description":"all: every account of the environment, new ones too. selected: only those listed.","example":"all"},"controls":{"type":"object","description":"The limits you set on the key.","properties":{"markets":{"type":"array","items":{"type":"string","description":"A market id.","example":"BTC-USD"},"description":"The markets the key may trade; empty: every market."},"reduce_only":{"type":"boolean","description":"The key may only reduce positions.","example":false},"max_order_usd":{"type":["string","null"],"format":"decimal","description":"The largest order the key may place, in USD.","example":"5000"},"max_position_usd":{"type":["string","null"],"format":"decimal","description":"The largest position the key may hold, in USD.","example":null},"daily_loss_usd":{"type":["string","null"],"format":"decimal","description":"The loss in a trading day at which the key stops trading the account.","example":"1000"}},"required":["markets","reduce_only","max_order_usd","max_position_usd","daily_loss_usd"],"additionalProperties":false},"budgets":{"type":"object","properties":{"read_per_min":{"type":"integer","description":"Reads a minute for this key.","example":600},"trade_per_min":{"type":"integer","description":"Trading calls a minute for this key.","example":120}},"required":["read_per_min","trade_per_min"],"additionalProperties":false},"assistant":{"type":["object","null"],"description":"Through the MCP server (an AI assistant): how its trades are confirmed and its budget. Null for any other call.","properties":{"confirm_trades":{"type":"boolean","description":"Each trade is shown first and placed only when repeated with its confirmation (preview, then confirm).","example":true},"confirm_seconds":{"type":"integer","description":"How long a preview's confirmation holds, in seconds.","example":120},"budget":{"type":"object","description":"The AI assistant's own budget, on top of the others.","properties":{"reads_per_min":{"type":"integer","description":"Reads a minute.","example":120},"writes_per_min":{"type":"integer","description":"Trading calls a minute.","example":6},"writes_per_hour":{"type":"integer","description":"Trading calls an hour.","example":60}},"required":["reads_per_min","writes_per_min","writes_per_hour"],"additionalProperties":false}},"required":["confirm_trades","confirm_seconds","budget"],"additionalProperties":false}},"required":["credential","accounts","account_scope","controls","budgets","assistant"],"additionalProperties":false},"CreateOrder":{"type":"object","description":"A new order.","properties":{"market":{"type":"string","description":"A market id: the asset and USD; an option adds its venue or hours after a dot.","example":"BTC-USD"},"side":{"type":"string","enum":["buy","sell"],"description":"The order's side.","example":"buy"},"type":{"type":"string","enum":["market","limit","stop_market","stop_limit"],"description":"market: now, at the best price within your worst price. limit: at your price or better. stop_market: a market order once the last price reaches the stop. stop_limit: a limit once the last price reaches the stop.","example":"limit"},"size":{"type":["string","number"],"format":"decimal","description":"The size, in the base asset: a multiple of the market's size step. Give size or notional_usd.","example":"0.5"},"notional_usd":{"type":["string","number"],"format":"decimal","description":"The size as a value in USD, rounded down to the size step.","example":"1000"},"limit_price":{"type":["string","number"],"format":"decimal","description":"The limit price (limit and stop_limit): a multiple of the tick size.","example":"62000"},"stop_price":{"type":["string","number"],"format":"decimal","description":"The trigger price (stop_market and stop_limit).","example":"61000"},"worst_price":{"type":["string","number"],"format":"decimal","description":"Market orders: the worst price you accept. Give worst_price or max_slippage_pct.","example":"62500"},"max_slippage_pct":{"type":["string","number"],"format":"decimal","description":"Market orders: how far from the best price you accept, in percent (the default and bounds are in GET /v1/markets).","example":"0.5"},"reduce_only":{"type":"boolean","description":"It may only reduce or close your position, never open or add to one.","example":false},"post_only":{"type":"boolean","description":"Limit orders: refused if it would fill at once.","example":false},"time_in_force":{"type":"string","enum":["gtc","gtd","ioc","fok"],"description":"gtc: until canceled. gtd: until expires_at. ioc and fok: fill now or end (a fill is always the whole order). Default: ioc for market orders, gtc otherwise.","example":"gtc"},"expires_at":{"type":"integer","format":"int64","x-pp-unit":"ms","description":"With gtd: when it ends, from orders.gtd_min_seconds to orders.gtd_max_days ahead (GET /v1/limits).","example":1791460800000},"client_order_id":{"type":"string","description":"Your own id for the order: unique in this environment, 1 to 64 letters, digits and . _ : -","example":"momentum-0142"},"exits":{"$ref":"#/components/schemas/OrderExits"}},"required":["market","side","type"],"additionalProperties":false},"OrderExits":{"type":"object","description":"Exits placed when the order fills: the stop-loss for the filled size first, then the take-profits. From then on they are the position's exits. An empty object removes them.","properties":{"take_profit":{"type":"array","items":{"type":"object","properties":{"price":{"type":["string","number"],"format":"decimal","description":"An exact price.","example":"64000"},"distance":{"type":["string","number"],"format":"decimal","description":"A price difference from the fill price.","example":"1000"},"percent":{"type":["string","number"],"format":"decimal","description":"A percent of the fill price.","example":"1.5"},"size_pct":{"type":["string","number"],"format":"decimal","description":"Its share of the filled size, in percent (absent: the take-profits split it evenly).","example":"50"}},"additionalProperties":false},"description":"Limit orders on the profit side, each at price, or at distance or percent from the fill."},"stop_loss":{"type":["object","null"],"description":"A stop on the loss side, at price, or at distance or percent from the fill; it may trail and move to break-even (as in a position's exits).","properties":{"price":{"type":["string","number"],"format":"decimal","description":"An exact price.","example":"64000"},"distance":{"type":["string","number"],"format":"decimal","description":"A price difference from the fill price.","example":"1000"},"percent":{"type":["string","number"],"format":"decimal","description":"A percent of the fill price.","example":"1.5"},"type":{"type":"string","enum":["stop_market","stop_limit"],"description":"The stop's type (default stop_market).","example":"stop_market"},"limit_offset_ticks":{"type":"integer","minimum":1,"description":"stop_limit: how many ticks past the stop its limit sits.","example":5},"trail":{"type":"object","description":"As a position's exits take it: { distance } or { percent }, with activation_price to start only once the price reaches it.","properties":{"distance":{"type":["string","number"],"format":"decimal","description":"How far behind the best price.","example":"500"},"percent":{"type":["string","number"],"format":"decimal","description":"How far behind, in percent of the best price.","example":"1.5"},"activation_price":{"type":["string","number"],"format":"decimal","description":"Start once the price reaches this.","example":"64000"}},"additionalProperties":false,"example":{"distance":"500"}},"break_even":{"type":"object","description":"As a position's exits take it: one of trigger_distance, trigger_percent, trigger_price, and offset_ticks.","properties":{"trigger_distance":{"type":["string","number"],"format":"decimal","description":"How far from the entry.","example":"300"},"trigger_percent":{"type":["string","number"],"format":"decimal","description":"How far from the entry, in percent.","example":"0.5"},"trigger_price":{"type":["string","number"],"format":"decimal","description":"Or this price.","example":"63500"},"offset_ticks":{"type":"integer","minimum":0,"description":"Ticks beyond the entry, on the profit side.","example":2}},"additionalProperties":false,"example":{"trigger_distance":"300"}}},"additionalProperties":false}},"required":[],"additionalProperties":false},"CreateStrategy":{"type":"object","description":"A new strategy. trailing_stop and break_even act on the position's exits: the answer is that exits strategy.","properties":{"type":{"type":"string","enum":["trailing_stop","break_even","oco","twap","vwap","scaled","chase","conditional"],"description":"trailing_stop: a stop-loss that follows the price. break_even: the stop-losses move to the entry once the price has gone your way far enough. oco: two orders, the first fill cancels the other. twap, vwap: an order in market slices over time (vwap sized by yesterday's volume over the same hours). scaled: a ladder of limits. chase: a limit that follows the bid or ask. conditional: an order sent once a price is reached, on this market (a buy when the price falls to trigger_price, a sell when it rises) or on another one (trigger_market).","example":"trailing_stop"},"market":{"type":"string","description":"A market id: the asset and USD; an option adds its venue or hours after a dot.","example":"BTC-USD"},"side":{"type":"string","enum":["buy","sell"],"description":"The order's side.","example":"buy"},"size":{"type":["string","number"],"format":"decimal","description":"trailing_stop: its size (absent: what the stop-losses leave of the position). twap, vwap, scaled, chase, conditional: the whole size.","example":"0.5"},"distance":{"type":["string","number"],"format":"decimal","description":"trailing_stop: how far behind the best price (or percent).","example":"500"},"percent":{"type":["string","number"],"format":"decimal","description":"trailing_stop: how far behind, in percent of the best price.","example":"1.5"},"activation_price":{"type":["string","number"],"format":"decimal","description":"trailing_stop: start once the price reaches this (until then, initial_stop_price rests, or nothing).","example":"64000"},"initial_stop_price":{"type":["string","number"],"format":"decimal","description":"trailing_stop: where the stop rests until the trail moves it (absent: from the price now).","example":"62000"},"replace_stops":{"type":"boolean","description":"trailing_stop: cancel the position's other stop-losses first.","example":false},"trigger_distance":{"type":["string","number"],"format":"decimal","description":"break_even: how far from the entry the price must go.","example":"300"},"trigger_percent":{"type":["string","number"],"format":"decimal","description":"break_even: the same, in percent of the entry.","example":"0.5"},"trigger_price":{"type":["string","number"],"format":"decimal","description":"break_even: or once the price reaches this. conditional: the level that sends the order (the trigger market's price; its tick).","example":"63500"},"trigger_market":{"type":"string","description":"conditional: the market whose price is watched (absent: this market). Any market we list.","example":"BTC-USD"},"trigger_direction":{"type":"string","enum":["above","below"],"description":"conditional, with another trigger_market: send the order once it trades at or above trigger_price, or at or below it. On this market it is set by the side and not given.","example":"above"},"order_type":{"type":"string","enum":["market","limit"],"description":"conditional: the order it sends (default market).","example":"market"},"limit_price":{"type":["string","number"],"format":"decimal","description":"conditional: the limit of its order, with order_type limit.","example":"61000"},"expires_at":{"type":"integer","format":"int64","x-pp-unit":"ms","description":"conditional: until when it waits for its price (default and longest: the gtd maximum, see GET /v1/limits). Its order, once sent, stands on its own.","example":1791460800000},"offset_ticks":{"type":"integer","minimum":0,"description":"break_even: ticks beyond the entry, on the profit side. chase: ticks behind the bid (buy) or ask (sell).","example":2},"orders":{"type":"array","items":{"type":"object","properties":{"side":{"type":"string","enum":["buy","sell"],"description":"The order's side.","example":"buy"},"type":{"type":"string","enum":["limit","stop_market","stop_limit"],"description":"Two orders that rest.","example":"limit"},"size":{"type":["string","number"],"format":"decimal","description":"Its size.","example":"0.5"},"limit_price":{"type":["string","number"],"format":"decimal","description":"Its limit price.","example":"61000"},"stop_price":{"type":["string","number"],"format":"decimal","description":"Its stop price.","example":"64500"},"post_only":{"type":"boolean","description":"Refused if it would fill at once.","example":false},"reduce_only":{"type":"boolean","description":"It may only reduce your position.","example":false}},"required":["side","type","size"],"additionalProperties":false},"description":"oco: the two orders."},"exits":{"$ref":"#/components/schemas/OrderExits"},"duration_minutes":{"type":"integer","description":"twap, vwap: how long the schedule runs (bounds in the runner settings, see GET /v1/limits).","example":60},"interval_seconds":{"type":"integer","description":"twap, vwap: time between slices; at most half the duration. Default: 60 (within those bounds).","example":120},"randomize":{"type":"boolean","description":"twap, vwap: vary each slice's time and size a little (the sizes still add up to size).","example":false},"reduce_only":{"type":"boolean","description":"twap, vwap, scaled, chase, conditional: only reduce your position (a twap ends when the position is closed).","example":false},"max_price":{"type":["string","number"],"format":"decimal","description":"twap, vwap (buy): slices wait while the price is above this. chase (buy): its cap.","example":"64000"},"min_price":{"type":["string","number"],"format":"decimal","description":"twap, vwap (sell): slices wait while the price is below this. chase (sell): its floor.","example":"62000"},"max_slippage_pct":{"type":["string","number"],"format":"decimal","description":"twap, vwap: each slice's slippage budget, in percent. conditional: its market order's.","example":"0.5"},"start_price":{"type":["string","number"],"format":"decimal","description":"scaled: the first rung.","example":"62000"},"end_price":{"type":["string","number"],"format":"decimal","description":"scaled: the last rung.","example":"61000"},"rungs":{"type":"integer","minimum":2,"description":"scaled: how many limits (at most the runner setting).","example":5},"distribution":{"type":"string","enum":["flat","ascending","descending"],"description":"scaled: equal sizes, growing toward end_price, or shrinking.","example":"flat"},"post_only":{"type":"boolean","description":"scaled: each rung refused if it would fill at once.","example":false},"all_or_none":{"type":"boolean","description":"scaled: one rung refused cancels the others.","example":false},"allow_marketable":{"type":"boolean","description":"scaled: rungs through the price may fill at once (refused otherwise, rung_would_fill).","example":false},"max_minutes":{"type":"integer","minimum":1,"description":"chase: how long it follows the price.","example":30},"on_expiry":{"type":"string","enum":["cancel","market"],"description":"chase: at max_minutes, cancel it, or send what is left at the market.","example":"cancel"},"allow_cross":{"type":"boolean","description":"chase: it may rest through the last price (it would then fill at once).","example":false},"client_strategy_id":{"type":"string","description":"Your own id for the strategy (oco, twap, vwap, scaled, chase, conditional): unique in this environment.","example":"grid-07"}},"required":["type","market"],"additionalProperties":false},"ModifyOrder":{"type":"object","description":"What to change: at least one field. The order keeps its place in the engine (changed in place, never canceled and placed again).","properties":{"size":{"type":["string","number"],"format":"decimal","description":"The new size.","example":"0.4"},"limit_price":{"type":["string","number"],"format":"decimal","description":"The new limit price.","example":"61900"},"stop_price":{"type":["string","number"],"format":"decimal","description":"The new trigger price.","example":"60800"}},"required":[],"additionalProperties":false},"ClosePosition":{"type":"object","description":"What to close.","properties":{"size":{"type":["string","number"],"format":"decimal","description":"How much to close; absent: the whole position.","example":"0.25"},"client_order_id":{"type":"string","description":"Your own id for the close order (a partial close).","example":"close-0007"}},"required":[],"additionalProperties":false},"CancelAll":{"type":"object","description":"Optional: only this market.","properties":{"market":{"type":"string","description":"A market id: the asset and USD; an option adds its venue or hours after a dot.","example":"BTC-USD"}},"required":[],"additionalProperties":false},"MarginSettingInput":{"type":"object","description":"The market's setting. The mode cannot change while a position or a working order is open on the market.","properties":{"margin_mode":{"type":"string","enum":["isolated","cross"],"description":"isolated: the position has its own margin. cross: positions share the account's balance.","example":"isolated"},"leverage":{"type":"integer","description":"A whole number from 1 to the market's max_leverage.","example":5}},"required":["margin_mode","leverage"],"additionalProperties":false},"MarginSettingResult":{"type":"object","properties":{"market":{"type":"string","description":"A market id: the asset and USD; an option adds its venue or hours after a dot.","example":"BTC-USD"},"margin_mode":{"type":"string","enum":["isolated","cross"],"description":"The margin mode.","example":"isolated"},"leverage":{"type":"integer","description":"The leverage.","example":5}},"required":["market","margin_mode","leverage"],"additionalProperties":false},"WhatIf":{"type":"object","properties":{"result":{"type":"string","enum":["would_fill","would_rest","would_reject"],"description":"What the order would do now: fill at once, rest, or be refused (reject says why).","example":"would_fill"},"reject":{"type":["object","null"],"properties":{"code":{"type":"string","description":"The error code it would get.","example":"insufficient_margin"},"message":{"type":["string","null"],"description":"What it means.","example":null},"details":{"description":"More about it.","type":["object","array"]}},"required":["code","message"],"additionalProperties":false},"market":{"type":"string","description":"A market id: the asset and USD; an option adds its venue or hours after a dot.","example":"BTC-USD"},"side":{"type":"string","enum":["buy","sell"],"description":"The order's side.","example":"buy"},"type":{"type":"string","enum":["market","limit","stop_market","stop_limit"],"description":"The order's type.","example":"market"},"size":{"type":["string","null"],"format":"decimal","description":"Its size (after a notional_usd is rounded to the size step).","example":"0.5"},"execution":{"type":["object","null"],"properties":{"marketable":{"type":"boolean","description":"It would fill at once.","example":true},"expected_price":{"type":"string","format":"decimal","description":"The price it would fill at (at once) or rest at.","example":"63010"},"worst_price":{"type":["string","null"],"format":"decimal","description":"A market order's worst price.","example":"63640.1"}},"required":["marketable","expected_price","worst_price"],"additionalProperties":false},"notional":{"type":["string","null"],"format":"decimal","description":"Its value in USD.","example":"31505"},"fee":{"type":["string","null"],"format":"decimal","description":"The fee its fill would pay.","example":"12.60"},"margin":{"type":["object","null"],"properties":{"mode":{"type":"string","enum":["isolated","cross"],"description":"The margin mode the position would use.","example":"isolated"},"leverage":{"type":"integer","description":"The leverage it would use.","example":10},"required":{"type":"string","format":"decimal","description":"The margin the order needs.","example":"3150.50"},"available_before":{"type":["string","null"],"format":"decimal","description":"The margin available now.","example":"90000.00"},"available_after":{"type":["string","null"],"format":"decimal","description":"What would remain available.","example":"86849.50"}},"required":["mode","leverage","required","available_before","available_after"],"additionalProperties":false},"position_after":{"type":["object","null"],"properties":{"size":{"type":"string","format":"decimal","description":"The position's size after the fill.","example":"1.000"},"side":{"type":["string","null"],"enum":["long","short",null],"description":"Its side; null when flat.","example":"long"},"average_price":{"type":["string","null"],"format":"decimal","description":"Its average price.","example":"62505.0"}},"required":["size","side","average_price"],"additionalProperties":false},"exposure":{"type":["object","null"],"properties":{"cap":{"type":"string","format":"decimal","description":"The market's exposure cap across your accounts of this product.","example":"1000000.00"},"open_before":{"type":"string","format":"decimal","description":"Your open value on the market now.","example":"31000.00"},"room_after":{"type":"string","format":"decimal","description":"What would remain under the cap.","example":"937495.00"}},"required":["cap","open_before","room_after"],"additionalProperties":false}},"required":["result","reject","market","side","type","size","execution","notional","fee","margin","position_after","exposure"],"additionalProperties":false},"Event":{"type":"object","properties":{"id":{"type":"string","description":"The event; pass it as after (GET /v1/events) or resume (the stream) to continue from it.","example":"evt_01JAB7Q8XK4M2N5P7R9S3T5V7W"},"type":{"type":"string","enum":["order.created","order.edited","order.filled","order.canceled","order.rejected","order.expired","fill.created","position.opened","position.changed","position.closed","strategy.created","strategy.leg_placed","strategy.leg_modified","strategy.leg_filled","strategy.leg_canceled","strategy.leg_rejected","strategy.orphan_repaired","strategy.slice","strategy.triggered","strategy.ended","tradingview.alert_executed","tradingview.alert_refused","account.updated","account.passed","account.failed","account.payout_eligible","account.disabled","account.removed","key.loss_stop","key.expiring","system.restarted","risk.warning","risk.cleared","alert.triggered"],"description":"What happened (GET /v1/webhook-event-types says what each type means).","example":"order.filled"},"account_id":{"type":"string","description":"The account number.","example":"SANDBOX-00042-001"},"time":{"type":"integer","format":"int64","x-pp-unit":"ms","description":"When it happened.","example":1791460800000},"source":{"type":"string","enum":["api","mcp","platform","engine","strategy","tradingview"],"description":"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.","example":"api"},"data":{"type":"object","description":"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.","example":{"order":{"id":"ord_01JAB7Q8XK4M2N5P7R9S3T5V7W","status":"filled"}}}},"required":["id","type","account_id","time","source","data"],"additionalProperties":false},"WebhookPayload":{"type":"object","description":"What a json webhook endpoint receives: the event as GET /v1/events shows it, with the endpoint's API version and environment.","properties":{"id":{"type":"string","description":"The event; pass it as after (GET /v1/events) or resume (the stream) to continue from it.","example":"evt_01JAB7Q8XK4M2N5P7R9S3T5V7W"},"type":{"type":"string","enum":["order.created","order.edited","order.filled","order.canceled","order.rejected","order.expired","fill.created","position.opened","position.changed","position.closed","strategy.created","strategy.leg_placed","strategy.leg_modified","strategy.leg_filled","strategy.leg_canceled","strategy.leg_rejected","strategy.orphan_repaired","strategy.slice","strategy.triggered","strategy.ended","tradingview.alert_executed","tradingview.alert_refused","account.updated","account.passed","account.failed","account.payout_eligible","account.disabled","account.removed","key.loss_stop","key.expiring","system.restarted","risk.warning","risk.cleared","alert.triggered","webhook.ping"],"description":"What happened; webhook.ping is a test.","example":"order.filled"},"account_id":{"type":"string","description":"The account number (none on webhook.ping).","example":"SANDBOX-00042-001"},"time":{"type":"integer","format":"int64","x-pp-unit":"ms","description":"When it happened.","example":1791460800000},"source":{"type":"string","enum":["api","mcp","platform","engine","strategy","tradingview"],"description":"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.","example":"api"},"data":{"type":"object","description":"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.","example":{"order":{"id":"ord_01JAB7Q8XK4M2N5P7R9S3T5V7W","status":"filled"}}},"api_version":{"type":"string","description":"The API version the endpoint receives.","example":"v1"},"environment":{"type":"string","enum":["live","sandbox"],"description":"The environment of the endpoint and the account.","example":"sandbox"},"test":{"type":"boolean","description":"A test (webhook.ping) or a delivery resent as one.","example":true}},"required":["id","type","time","source","data","api_version","environment"],"additionalProperties":false},"ExitsLeg":{"type":"object","properties":{"id":{"type":"string","description":"The leg: an order of this API, also listed under the account's orders.","example":"ord_01JAB7Q8XK4M2N5P7R9S3T5V7W"},"group":{"type":"string","enum":["take_profit","stop_loss"],"description":"take_profit: a limit on the profit side. stop_loss: a stop on the loss side.","example":"stop_loss"},"type":{"type":"string","enum":["limit","stop_market","stop_limit"],"description":"take_profit legs are limits; stop_loss legs are stop_market or stop_limit.","example":"stop_market"},"status":{"type":"string","enum":["pending","working","filled","canceled","rejected","expired","unconfirmed","waiting"],"description":"The order's status; waiting: a stop-loss not placed yet (it waits for its activation price or its break-even).","example":"working"},"size":{"type":"string","format":"decimal","description":"Its size.","example":"0.5"},"price":{"type":["string","null"],"format":"decimal","description":"The take-profit price, or the stop price.","example":"61000"},"limit_price":{"type":["string","null"],"format":"decimal","description":"The limit of a stop_limit leg.","example":null},"trail":{"type":["object","null"],"description":"A trailing stop-loss: how it follows the price.","properties":{"distance":{"type":["string","null"],"format":"decimal","description":"How far behind the best price (or null: percent).","example":"500"},"percent":{"type":["string","null"],"format":"decimal","description":"How far behind, in percent of the best price (or null: distance).","example":null},"activation_price":{"type":["string","null"],"format":"decimal","description":"It starts once the price reaches this; null: from the start.","example":null},"active":{"type":"boolean","description":"It follows the price now (its activation price was reached, or it had none).","example":true},"best_price":{"type":["string","null"],"format":"decimal","description":"The best price since it started, which the stop follows.","example":"64250"}},"required":["distance","percent","activation_price","active","best_price"],"additionalProperties":false},"break_even":{"type":["object","null"],"description":"A stop-loss moved to the entry price once the price has gone your way far enough.","properties":{"trigger_distance":{"type":["string","null"],"format":"decimal","description":"How far from the entry the price must go (or null: another trigger).","example":"300"},"trigger_percent":{"type":["string","null"],"format":"decimal","description":"The same, in percent of the entry.","example":null},"trigger_price":{"type":["string","null"],"format":"decimal","description":"Or once the price reaches this.","example":null},"offset_ticks":{"type":"integer","description":"Ticks beyond the entry, on the profit side.","example":2},"done":{"type":"boolean","description":"The stop-loss was moved to the entry already.","example":false}},"required":["trigger_distance","trigger_percent","trigger_price","offset_ticks","done"],"additionalProperties":false}},"required":["id","group","type","status","size","price","limit_price","trail","break_even"],"additionalProperties":false},"Exits":{"type":"object","properties":{"account_id":{"type":"string","description":"The account number.","example":"SANDBOX-00042-001"},"market":{"type":"string","description":"A market id: the asset and USD; an option adds its venue or hours after a dot.","example":"BTC-USD"},"strategy_id":{"type":["string","null"],"description":"The strategy that keeps these exits (type exits); null when there are none.","example":"stg_01JAB7Q8XK4M2N5P7R9S3T5V7W"},"position":{"type":["object","null"],"description":"The open position; null when flat.","properties":{"side":{"type":"string","enum":["long","short"],"description":"Long or short.","example":"long"},"size":{"type":"string","format":"decimal","description":"Its size.","example":"0.5"}},"required":["side","size"],"additionalProperties":false},"take_profit":{"type":"array","items":{"$ref":"#/components/schemas/ExitsLeg"},"description":"The take-profit legs: together at most the position."},"stop_loss":{"type":"array","items":{"$ref":"#/components/schemas/ExitsLeg"},"description":"The stop-loss legs: together at most the position."},"resize_with_position":{"type":"boolean","description":"The legs grow with the position, keeping their share of it (rounded down to the size step).","example":true}},"required":["account_id","market","strategy_id","position","take_profit","stop_loss","resize_with_position"],"additionalProperties":false},"ExitsBatch":{"type":"object","description":"The take-profit and stop-loss legs of a position, changed together.","properties":{"expected_position":{"type":["object","null"],"description":"The position you saw: { side, size }, or null.","properties":{"side":{"type":"string","enum":["long","short"],"description":"Long or short.","example":"long"},"size":{"type":["string","number"],"format":"decimal","description":"Its size.","example":"0.5"}},"required":["side","size"],"additionalProperties":false},"expected_exits":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"A leg.","example":"ord_01JAB7Q8XK4M2N5P7R9S3T5V7W"},"size":{"type":["string","number"],"format":"decimal","description":"Its size.","example":"0.5"},"price":{"type":["string","number","null"],"format":"decimal","description":"Its price; null for a stop-loss that waits (as GET exits shows it).","example":"61000"}},"required":["id","size","price"],"additionalProperties":false},"description":"Every leg you saw (an empty list when there were none): if anything differs now, nothing is done and the answer is 409 exits_changed with the state now."},"operations":{"type":"array","items":{"type":"object","properties":{"op":{"type":"string","enum":["place","modify","cancel"],"description":"What to do.","example":"place"},"id":{"type":"string","description":"modify, cancel: the leg.","example":"ord_01JAB7Q8XK4M2N5P7R9S3T5V7W"},"group":{"type":"string","enum":["take_profit","stop_loss"],"description":"place: the group of the new leg.","example":"stop_loss"},"type":{"type":"string","enum":["limit","stop_market","stop_limit"],"description":"place: limit for a take-profit (the default); stop_market (the default) or stop_limit for a stop-loss.","example":"stop_market"},"price":{"type":["string","number"],"format":"decimal","description":"The take-profit price, or the stop price.","example":"61000"},"limit_price":{"type":["string","number"],"format":"decimal","description":"The limit of a stop_limit leg.","example":"60900"},"size":{"type":["string","number"],"format":"decimal","description":"The size; absent on a place: what the group leaves of the position.","example":"0.5"},"trail":{"type":["object","null"],"description":"A stop-loss that follows the price: { distance } (a price difference) or { percent }, with activation_price to start only once the price reaches it. Without a price and an activation price it starts from the price now. null removes it.","properties":{"distance":{"type":["string","number"],"format":"decimal","description":"How far behind the best price.","example":"500"},"percent":{"type":["string","number"],"format":"decimal","description":"How far behind, in percent of the best price.","example":"1.5"},"activation_price":{"type":["string","number"],"format":"decimal","description":"Start once the price reaches this.","example":"64000"}},"additionalProperties":false,"example":{"distance":"500"}},"break_even":{"type":["object","null"],"description":"Move the stop-loss to the entry price (plus offset_ticks) once the price has gone your way by trigger_distance, trigger_percent or to trigger_price. Without a price, the stop is placed only then. null removes it.","properties":{"trigger_distance":{"type":["string","number"],"format":"decimal","description":"How far from the entry.","example":"300"},"trigger_percent":{"type":["string","number"],"format":"decimal","description":"How far from the entry, in percent.","example":"0.5"},"trigger_price":{"type":["string","number"],"format":"decimal","description":"Or this price.","example":"63500"},"offset_ticks":{"type":"integer","minimum":0,"description":"Ticks beyond the entry, on the profit side.","example":2}},"additionalProperties":false,"example":{"trigger_distance":"300","offset_ticks":2}},"clear":{"type":"array","items":{"type":"string","enum":["trail","break_even"]},"description":"modify: the settings to remove from a stop-loss (the same as sending them null).","example":["trail"]}},"required":["op"],"additionalProperties":false},"description":"Applied in this order: cancels, changes, then new legs (stop-losses first). An engine refusal stops the batch: 422 exit_operation_failed says what each operation did."},"resize_with_position":{"type":"boolean","description":"The legs grow with the position (default true).","example":true}},"required":["expected_position","expected_exits","operations"],"additionalProperties":false},"Strategy":{"type":"object","properties":{"id":{"type":"string","description":"The strategy.","example":"stg_01JAB7Q8XK4M2N5P7R9S3T5V7W"},"client_strategy_id":{"type":["string","null"],"description":"Your own id for it.","example":null},"account_id":{"type":"string","description":"The account number.","example":"SANDBOX-00042-001"},"type":{"type":"string","enum":["exits","bracket","oco","twap","vwap","scaled","chase","conditional"],"description":"exits: a position's take-profit and stop-loss legs. bracket: an order with exits once it fills. oco: two orders, the first fill cancels the other. twap, vwap: an order in slices over time. scaled: a ladder of limits. chase: a limit that follows the price. conditional: an order sent once a price is reached.","example":"exits"},"market":{"type":"string","description":"A market id: the asset and USD; an option adds its venue or hours after a dot.","example":"BTC-USD"},"side":{"type":["string","null"],"enum":["buy","sell",null],"description":"The side of its orders (exits: the closing side).","example":"sell"},"status":{"type":"string","enum":["waiting","working","completed","canceled","ended"],"description":"waiting: armed, nothing placed yet. working: running. completed: done as asked. canceled: you ended it. ended: it stopped for end_reason.","example":"working"},"end_reason":{"type":["string","null"],"enum":["take_profit","stop_loss","filled","position_closed","position_reversed","canceled_by_user","external","key_revoked","account_closed","engine_restart","child_rejected","price_bound","expired",null],"description":"Why it stopped.","example":null},"params":{"type":"object","description":"What it was created with.","example":{"resize_with_position":true}},"progress":{"type":"object","description":"How far it is (by type).","example":{}},"orders":{"type":"array","items":{"$ref":"#/components/schemas/Order"},"description":"Every order it placed, oldest first."},"created_at":{"type":"integer","format":"int64","x-pp-unit":"ms","description":"When it was created.","example":1791460800000},"updated_at":{"type":"integer","format":"int64","x-pp-unit":"ms","description":"Its latest change.","example":1791460800000},"ended_at":{"type":["integer","null"],"format":"int64","x-pp-unit":"ms","description":"When it stopped.","example":null}},"required":["id","client_strategy_id","account_id","type","market","side","status","end_reason","params","progress","orders","created_at","updated_at","ended_at"],"additionalProperties":false},"WebhookEndpoint":{"type":"object","properties":{"id":{"type":"string","description":"The endpoint.","example":"whk_01JAB7Q8XK4M2N5P7R9S3T5V7W"},"url":{"type":["string","null"],"description":"Its address: the host and the start of the path (never whole: chat addresses carry tokens).","example":"hooks.example.com/phoenix/in"},"format":{"type":"string","enum":["json","discord","slack","telegram"],"description":"json: the signed event. discord, slack, telegram: a chat message.","example":"json"},"events":{"type":"array","items":{"type":"string","enum":["orders","positions","account","risk","alerts"],"description":"A group of events.","example":"orders"},"description":"The groups it receives (see GET /v1/webhook-event-types)."},"status":{"type":"string","enum":["active","paused","disabled"],"description":"disabled: we stopped after failures in a row; turn it on again from your dashboard.","example":"active"},"api_version":{"type":"string","description":"The version its events are written in.","example":"v1"},"environment":{"type":"string","enum":["live","sandbox"],"description":"Its environment: it receives that environment's events only.","example":"sandbox"}},"required":["id","url","format","events","status","api_version","environment"],"additionalProperties":false},"WebhookDelivery":{"type":"object","properties":{"id":{"type":"string","description":"The delivery.","example":"dlv_01JAB7Q8XK4M2N5P7R9S3T5V7W"},"endpoint_id":{"type":"string","description":"Its endpoint.","example":"whk_01JAB7Q8XK4M2N5P7R9S3T5V7W"},"event_id":{"type":"string","description":"The event sent (the same id when it is sent again).","example":"evt_01JAB7Q8XK4M2N5P7R9S3T5V7W"},"event_type":{"type":"string","description":"The event's type.","example":"order.filled"},"account_id":{"type":["string","null"],"description":"Its account.","example":"SANDBOX-00042-001"},"test":{"type":"boolean","description":"A test.","example":false},"status":{"type":"string","enum":["pending","delivering","delivered","failed","canceled"],"description":"pending: waiting for its next try. failed: every try failed. canceled: the endpoint was disabled or deleted.","example":"delivered"},"attempts":{"type":"array","items":{"type":"object","properties":{"attempt":{"type":"integer","description":"Which try.","example":1},"at":{"type":"integer","format":"int64","x-pp-unit":"ms","description":"When.","example":1791460800000},"http_status":{"type":["integer","null"],"description":"What your endpoint answered; null when it could not be reached.","example":200},"error":{"type":["string","null"],"description":"Why it failed, when it did (timeout, redirect, private_address, http_500, ...).","example":null},"duration_ms":{"type":["integer","null"],"description":"How long it took.","example":182},"response":{"type":["string","null"],"description":"The start of the answer (up to 512 bytes).","example":null}},"required":["attempt","at","http_status","error","duration_ms","response"],"additionalProperties":false},"description":"Every try, oldest first."},"next_attempt_at":{"type":["integer","null"],"format":"int64","x-pp-unit":"ms","description":"When it is tried again.","example":null},"created_at":{"type":"integer","format":"int64","x-pp-unit":"ms","description":"When it was queued.","example":1791460800000},"delivered_at":{"type":["integer","null"],"format":"int64","x-pp-unit":"ms","description":"When your endpoint took it.","example":null}},"required":["id","endpoint_id","event_id","event_type","account_id","test","status","attempts","next_attempt_at","created_at","delivered_at"],"additionalProperties":false},"WebhookEventType":{"type":"object","properties":{"type":{"type":"string","description":"The type.","example":"order.filled"},"group":{"type":["string","null"],"enum":["orders","positions","account","risk","alerts",null],"description":"The group that receives it; null: every endpoint (the test).","example":"orders"},"description":{"type":"string","description":"What it means.","example":"An order filled."}},"required":["type","group","description"],"additionalProperties":false},"DeletedEndpoint":{"type":"object","properties":{"id":{"type":"string","description":"The endpoint.","example":"whk_01JAB7Q8XK4M2N5P7R9S3T5V7W"},"deleted":{"type":"boolean","description":"It was deleted.","example":true}},"required":["id","deleted"],"additionalProperties":false},"TradingViewHook":{"type":"object","properties":{"id":{"type":"string","description":"The link.","example":"K7x2mQ9pLr4A"},"name":{"type":"string","description":"Its name.","example":"BTC breakout"},"account_id":{"type":"string","description":"The account number.","example":"SANDBOX-00042-001"},"environment":{"type":"string","enum":["live","sandbox"],"description":"Its environment.","example":"sandbox"},"status":{"type":"string","enum":["active","paused"],"description":"paused: alerts are refused (link_paused).","example":"active"},"markets":{"type":"array","items":{"type":"string","description":"A market id: the asset and USD; an option adds its venue or hours after a dot.","example":"BTC-USD"},"description":"The markets it may trade; empty: every market."},"reduce_only":{"type":"boolean","description":"It may only reduce positions.","example":false},"max_order_usd":{"type":["string","null"],"format":"decimal","description":"Its largest order, in USD.","example":null},"max_position_usd":{"type":["string","null"],"format":"decimal","description":"Its largest position, in USD.","example":null},"daily_loss_usd":{"type":["string","null"],"format":"decimal","description":"Its daily loss stop: no new position once today's loss reaches it.","example":null},"sizing":{"type":"object","properties":{"mode":{"type":"string","enum":["from_alert","qty","usd","pct_balance"],"description":"from_alert: the size the alert gives. qty, usd, pct_balance: the link's own.","example":"from_alert"},"value":{"type":["string","null"],"format":"decimal","description":"The link's size, in its mode's unit.","example":null}},"required":["mode","value"],"additionalProperties":false},"position_mode":{"type":"string","enum":["signal","add","target"],"description":"signal: an opposite alert reverses, a repeat is skipped. add: a repeat adds. target: the strategy's position size is followed.","example":"signal"}},"required":["id","name","account_id","environment","status","markets","reduce_only","max_order_usd","max_position_usd","daily_loss_usd","sizing","position_mode"],"additionalProperties":false},"TradingViewAlert":{"type":"object","properties":{"id":{"type":"string","description":"The alert.","example":"tva_01JAB7Q8XK4M2N5P7R9S3T5V7W"},"hook_id":{"type":"string","description":"Its link.","example":"K7x2mQ9pLr4A"},"account_id":{"type":"string","description":"The account number.","example":"SANDBOX-00042-001"},"status":{"type":"string","enum":["processing","placed","partial","dry_run","duplicate","skipped","refused","failed","rate_limited"],"description":"What it did.","example":"placed"},"reason":{"type":["string","null"],"description":"Why it placed nothing (or not all): a reason code.","example":null},"reason_text":{"type":["string","null"],"description":"That reason in words.","example":null},"format":{"type":["string","null"],"description":"How the message was read: universal, pickmytrade, traderspost, pineconnector, text.","example":"universal"},"market":{"type":["string","null"],"description":"The market it named.","example":"BTC-USD"},"action":{"type":["string","null"],"description":"Its action.","example":"buy"},"message":{"type":["string","null"],"description":"The message as kept (credentials masked).","example":null},"sender":{"type":["string","null"],"description":"The sender's address, its end masked.","example":"52.89.214.x"},"plan":{"type":["object","null"],"description":"What it was to do: { legs } or { skip } or { refuse }.","example":null},"results":{"type":"array","items":{"type":"object","description":"One leg: its kind, status, order and code."},"description":"What each leg did."},"details":{"type":["object","null"],"description":"More about a refusal.","example":null},"duplicate_of":{"type":["string","null"],"description":"The alert this one repeats.","example":null},"repeat_count":{"type":"integer","description":"Refusals folded into this row (rate limits).","example":1},"received_at":{"type":"integer","format":"int64","x-pp-unit":"ms","description":"When it came.","example":1791460800000},"finished_at":{"type":["integer","null"],"format":"int64","x-pp-unit":"ms","description":"When it was done.","example":null}},"required":["id","hook_id","account_id","status","reason","reason_text","format","market","action","message","sender","plan","results","details","duplicate_of","repeat_count","received_at","finished_at"],"additionalProperties":false},"TradingViewParseInput":{"type":"object","description":"A message to read, sent nowhere.","properties":{"message":{"type":"string","description":"The alert's message, as TradingView would send it.","example":"{\"action\":\"buy\",\"symbol\":\"BTC-USD\",\"qty\":\"0.01\",\"tp_pct\":\"1.5\"}"},"hook_id":{"type":"string","description":"A link: the plan is then worked out on its account and settings, as of now.","example":"K7x2mQ9pLr4A"}},"required":["message"],"additionalProperties":false},"TradingViewParse":{"type":"object","properties":{"ok":{"type":"boolean","description":"It reads, and names a market we offer.","example":true},"code":{"type":["string","null"],"description":"Why not, when it does not.","example":null},"field":{"type":["string","null"],"description":"The field at fault.","example":null},"message":{"type":["string","null"],"description":"What went wrong.","example":null},"signal":{"type":["object","null"],"description":"The message as read: action, side, sizes, prices, exits.","example":{"action":"buy","qty":0.01}},"market":{"type":["string","null"],"description":"The market it names (ALL for every market).","example":"BTC-USD"},"suggestion":{"type":["string","null"],"description":"The market meant, when the ticker names one we offer only scaled.","example":null},"plan":{"type":["object","null"],"description":"With hook_id: what the alert would do now ({ legs } / { skip } / { refuse }).","example":null}},"required":["ok","code","field","message","signal","market","suggestion","plan"],"additionalProperties":false},"DeletedHook":{"type":"object","properties":{"id":{"type":"string","description":"The link.","example":"K7x2mQ9pLr4A"},"deleted":{"type":"boolean","description":"It was revoked: its address answers 404 from now on.","example":true}},"required":["id","deleted"],"additionalProperties":false},"PriceAlert":{"type":"object","description":"A level on a market, told once when the price reaches it (alert.triggered: the account stream, webhooks, GET /v1/events). It never places or changes an order.","properties":{"id":{"type":"string","description":"The alert.","example":"alr_01JAB7Q8XK4M2N5P7R9S3T5V7W"},"account_id":{"type":"string","description":"The account number.","example":"SANDBOX-00042-001"},"market":{"type":"string","description":"A market id: the asset and USD; an option adds its venue or hours after a dot.","example":"BTC-USD"},"price":{"type":"string","format":"decimal","description":"Its level.","example":"120000"},"condition":{"type":"string","enum":["above","below"],"description":"above: it fires once the price reaches the level from below; below: from above. Set from the price when the level was set.","example":"above"},"note":{"type":["string","null"],"description":"Your note, sent with it.","example":"breakout"},"status":{"type":"string","enum":["armed","triggered","disabled"],"description":"armed: it waits for its level. triggered: it fired (rearm arms it again). disabled: its account or market went away before it fired.","example":"armed"},"price_source":{"type":"string","enum":["last"],"description":"The price it watches: the market's last trade (the middle of the book until there is one), the price trailing stops follow.","example":"last"},"trigger_price":{"type":["string","null"],"format":"decimal","description":"The price it fired at.","example":null},"triggered_at":{"type":["integer","null"],"format":"int64","x-pp-unit":"ms","description":"When it fired.","example":null},"disabled_reason":{"type":["string","null"],"enum":["account_removed","market_removed",null],"description":"Why it was disabled.","example":null},"created_at":{"type":"integer","format":"int64","x-pp-unit":"ms","description":"When it was set.","example":1791460800000},"updated_at":{"type":"integer","format":"int64","x-pp-unit":"ms","description":"Its latest change.","example":1791460800000}},"required":["id","account_id","market","price","condition","note","status","price_source","trigger_price","triggered_at","disabled_reason","created_at","updated_at"],"additionalProperties":false},"CreatePriceAlert":{"type":"object","description":"A new price alert. Its condition (above or below) is set from the price now.","properties":{"market":{"type":"string","description":"A market id: the asset and USD; an option adds its venue or hours after a dot.","example":"BTC-USD"},"price":{"type":["string","number"],"format":"decimal","description":"The level; not the price now.","example":"120000"},"note":{"type":"string","description":"Your note (at most 280 characters).","example":"breakout"}},"required":["market","price"],"additionalProperties":false},"ChangePriceAlert":{"type":"object","description":"What to change on an armed alert: at least one field.","properties":{"price":{"type":["string","number"],"format":"decimal","description":"A new level; its condition is set again from the price now.","example":"121000"},"note":{"type":["string","null"],"description":"A new note; null removes it.","example":"breakout"}},"required":[],"additionalProperties":false},"DeletedAlert":{"type":"object","properties":{"id":{"type":"string","description":"The alert.","example":"alr_01JAB7Q8XK4M2N5P7R9S3T5V7W"},"deleted":{"type":"boolean","description":"It was deleted.","example":true}},"required":["id","deleted"],"additionalProperties":false},"RestrictedCountry":{"type":"object","properties":{"code":{"type":"string","description":"The country, ISO 3166-1 alpha-2.","example":"US"},"name":{"type":"string","description":"Its name in English.","example":"United States"}},"required":["code","name"],"additionalProperties":false},"CancelAllResult":{"type":"object","properties":{"account_id":{"type":"string","description":"The account number.","example":"SANDBOX-00042-001"},"market":{"type":["string","null"],"description":"The market, or null for every market.","example":"BTC-USD"},"canceled":{"type":"integer","description":"How many working orders were canceled.","example":3}},"required":["account_id","market","canceled"],"additionalProperties":false},"FlattenResult":{"type":"object","properties":{"account_id":{"type":"string","description":"The account number.","example":"SANDBOX-00042-001"},"orders_canceled":{"type":"integer","description":"How many working orders were canceled.","example":2},"closes":{"type":"array","items":{"$ref":"#/components/schemas/Order"},"description":"The orders that closed the positions."}},"required":["account_id","orders_canceled","closes"],"additionalProperties":false},"AccountRiskOrNull":{"type":["object","null"],"properties":{"as_of":{"type":"integer","format":"int64","x-pp-unit":"ms","description":"When the oldest figure here was read.","example":1791460800000},"stale":{"type":"boolean","description":"Some figures are older than usual (the engine was busy).","example":false},"balance":{"type":"string","format":"decimal","description":"The balance.","example":"101000"},"equity":{"type":"string","format":"decimal","description":"The balance plus the open P&L at the market price.","example":"101500"},"unrealized_pnl":{"type":"string","format":"decimal","description":"The open P&L.","example":"500"},"pnl_today":{"type":"string","format":"decimal","description":"The equity change since midnight New York, open positions included: what the daily loss rule counts.","example":"650.2"},"realized_today":{"type":"string","format":"decimal","description":"The P&L closed today.","example":"150.2"},"fees_today":{"type":"string","format":"decimal","description":"The fees paid today.","example":"24.8"},"trades_today":{"type":"integer","description":"Trades closed today.","example":3},"margin_used":{"type":"string","format":"decimal","description":"The margin your positions hold.","example":"3100"},"margin_available":{"type":["string","null"],"format":"decimal","description":"What is left of the balance for new positions.","example":"97900"},"exposure":{"type":"object","properties":{"gross":{"type":"string","format":"decimal","description":"The value of every open position.","example":"31500"},"long":{"type":"string","format":"decimal","description":"The value of the long ones.","example":"31500"},"short":{"type":"string","format":"decimal","description":"The value of the short ones.","example":"0"},"effective_leverage":{"type":["string","null"],"format":"decimal","description":"Gross exposure over equity.","example":"0.3103"},"markets":{"type":"array","items":{"type":"object","properties":{"market":{"type":"string","description":"A market id: the asset and USD; an option adds its venue or hours after a dot.","example":"BTC-USD"},"notional":{"type":"string","format":"decimal","description":"The value held on it.","example":"31500"},"leverage":{"type":["string","null"],"format":"decimal","description":"That value over equity.","example":"0.3103"},"cap":{"type":["string","null"],"format":"decimal","description":"The exposure cap of the market.","example":"1000000"},"cap_used_pct":{"type":["string","null"],"format":"decimal","description":"How much of the cap is used, counting your other accounts on the same rule, in percent.","example":"3.15"}},"required":["market","notional","leverage","cap","cap_used_pct"],"additionalProperties":false},"description":"Per market, largest first."}},"required":["gross","long","short","effective_leverage","markets"],"additionalProperties":false},"daily_loss":{"$ref":"#/components/schemas/Limit"},"max_drawdown":{"$ref":"#/components/schemas/Limit"},"profit_target":{"type":["object","null"],"properties":{"goal_balance":{"type":"string","format":"decimal","description":"The balance that reaches it.","example":"108000"},"remaining":{"type":"string","format":"decimal","description":"Still to make.","example":"7000"},"progress_pct":{"type":["string","null"],"format":"decimal","description":"How far, in percent.","example":"12.5"},"requires_flat":{"type":"boolean","description":"Positions must be closed when it is reached.","example":false}},"required":["goal_balance","remaining","progress_pct","requires_flat"],"additionalProperties":false},"trading_days":{"type":"object","properties":{"count":{"type":["integer","null"],"description":"Days with a trade so far.","example":2},"required":{"type":["integer","null"],"description":"Days the rule needs.","example":3}},"required":["count","required"],"additionalProperties":false},"nearest_liquidation":{"type":["object","null"],"properties":{"market":{"type":"string","description":"A market id: the asset and USD; an option adds its venue or hours after a dot.","example":"BTC-USD"},"price":{"type":"string","format":"decimal","description":"Its liquidation price.","example":"56420.5"},"distance_pct":{"type":"string","format":"decimal","description":"How far the price is from it, in percent.","example":"10.44"}},"required":["market","price","distance_pct"],"additionalProperties":false},"trading_day_ends_at":{"type":"integer","format":"int64","x-pp-unit":"ms","description":"When the trading day ends (midnight New York).","example":1791460800000},"warnings":{"type":"array","items":{"$ref":"#/components/schemas/Warning"},"description":"What needs your attention, most serious first."}},"required":["as_of","stale","balance","equity","unrealized_pnl","pnl_today","realized_today","fees_today","trades_today","margin_used","margin_available","exposure","daily_loss","max_drawdown","profit_target","trading_days","nearest_liquidation","trading_day_ends_at","warnings"],"additionalProperties":false,"description":"The live risk; null while the account is being opened."},"AccountDetail":{"type":"object","properties":{"id":{"type":"string","description":"The account number.","example":"SANDBOX-00042-001"},"environment":{"type":"string","enum":["live","sandbox"],"description":"The environment the account lives in.","example":"sandbox"},"stage":{"type":"string","enum":["evaluation","funded","sandbox"],"description":"Where the account is in the programme.","example":"sandbox"},"status":{"type":"string","enum":["pending","active","passed","failed","closed","suspended"],"description":"pending: being opened; active: trading.","example":"active"},"product":{"type":["string","null"],"description":"The product it was bought as.","example":"Classic"},"tier":{"type":["string","null"],"description":"Its size as sold.","example":"$100K"},"start_balance":{"type":["string","null"],"format":"decimal","description":"The balance it started with.","example":"100000"},"balance":{"type":["string","null"],"format":"decimal","description":"The balance: closed trades and fees only.","example":"100000"},"rule":{"$ref":"#/components/schemas/Rule"},"payout_eligible":{"type":"boolean","description":"A payout may be requested now.","example":false},"parked":{"type":"boolean","description":"Sandbox only: parked after a while unused; it wakes the moment you use it.","example":false},"created_at":{"type":["integer","null"],"format":"int64","x-pp-unit":"ms","description":"When the account was made.","example":1791460800000},"risk":{"$ref":"#/components/schemas/AccountRiskOrNull"}},"required":["id","environment","stage","status","product","tier","start_balance","balance","rule","payout_eligible","created_at","risk"],"additionalProperties":false},"LimitStanding":{"type":["object","null"],"properties":{"limit":{"type":"string","format":"decimal","description":"The limit, in USD.","example":"5000"},"floor":{"type":"string","format":"decimal","description":"The equity at which it is breached.","example":"95000"},"room":{"type":"string","format":"decimal","description":"How much more the account may lose before it.","example":"4200.5"},"used_pct":{"type":["string","null"],"format":"decimal","description":"How much of it is used, in percent.","example":"16"},"resets_at":{"type":"integer","format":"int64","x-pp-unit":"ms","description":"Daily loss only: when it resets (midnight New York).","example":1791460800000},"on_breach":{"type":"string","enum":["fail_account","flatten","flatten_and_pause"],"description":"Daily loss only: what happens when it is reached.","example":"fail_account"},"estimated":{"type":"boolean","description":"Daily loss only: the day's start is estimated (the engine does not publish it).","example":false},"mode":{"type":"string","enum":["end_of_day","end_of_trade","static","intraday_equity"],"description":"Max drawdown only: how the reference moves.","example":"end_of_day"},"at_least":{"type":"boolean","description":"Max drawdown only: the engine may hold a higher floor than shown (it follows equity highs).","example":false},"lifted":{"type":"boolean","description":"The rule no longer applies this limit (its cut-off was reached).","example":false},"status":{"type":"string","enum":["ok","warning","critical","breached"],"description":"Where it stands.","example":"ok"}},"required":["lifted","status"],"additionalProperties":false}},"x-pp-error-codes":[{"code":"invalid_request","status":400,"type":"invalid_request","retryable":false,"meaning":"The request is malformed.","action":"Fix what details names."},{"code":"invalid_parameter","status":400,"type":"invalid_request","retryable":false,"meaning":"A query or path parameter is out of range or the wrong kind.","action":"Use a value the reference lists for it."},{"code":"unknown_field","status":400,"type":"invalid_request","retryable":false,"meaning":"The request carries something this route does not know, or a parameter twice.","action":"Remove what details lists."},{"code":"invalid_cursor","status":400,"type":"invalid_request","retryable":false,"meaning":"The cursor was changed, or it belongs to another list or filter.","action":"Pass next_cursor exactly as the previous page gave it, with the same filters."},{"code":"invalid_json","status":400,"type":"invalid_request","retryable":false,"meaning":"The body could not be read as JSON, or it is nested too deep.","action":"Send a JSON object."},{"code":"missing_api_key","status":401,"type":"authentication","retryable":false,"meaning":"The request has no Authorization header.","action":"Send Authorization: Bearer with your key."},{"code":"invalid_api_key","status":401,"type":"authentication","retryable":false,"meaning":"The key is mistyped, unknown, or not sent as a Bearer token.","action":"Copy the key again from your dashboard."},{"code":"expired_api_key","status":401,"type":"authentication","retryable":false,"meaning":"The key was made with an end date that has passed.","action":"Make a new key in your dashboard."},{"code":"revoked_api_key","status":401,"type":"authentication","retryable":false,"meaning":"The key was revoked, by you or by our team.","action":"Make a new key in your dashboard."},{"code":"invalid_token","status":401,"type":"authentication","retryable":false,"meaning":"The token is mistyped, unknown, or not sent as a Bearer token.","action":"Sign in to the app again."},{"code":"expired_token","status":401,"type":"authentication","retryable":false,"meaning":"Access tokens of AI assistants last an hour; any app's access ends on its end date.","action":"Refresh the token, or sign in to the app again."},{"code":"revoked_token","status":401,"type":"authentication","retryable":false,"meaning":"The access was ended, by you, by a new password, or by our team.","action":"Sign in to the app again."},{"code":"wrong_resource","status":401,"type":"authentication","retryable":false,"meaning":"An app's token works only on the host it was asked for (details.expected_resource names this one).","action":"Sign in again asking for this host."},{"code":"wrong_environment","status":401,"type":"authentication","retryable":false,"meaning":"A live key was sent to the sandbox host, or a sandbox key to the live host.","action":"Call the host named in details.expected_host."},{"code":"ip_not_allowed","status":403,"type":"permission","retryable":false,"meaning":"The key only works from the addresses you listed.","action":"Call from a listed address, or add this one in your dashboard."},{"code":"insufficient_permission","status":403,"type":"permission","retryable":false,"meaning":"A read key was used for a trading call.","action":"Use a key with trade access."},{"code":"api_disabled","status":403,"type":"permission","retryable":false,"meaning":"API access is not open to you, or it was suspended.","action":"Contact support."},{"code":"invalid_size_step","status":400,"type":"invalid_request","retryable":false,"meaning":"The size must be a whole number of size steps.","action":"Use one of the sizes in details.nearest."},{"code":"invalid_price_tick","status":400,"type":"invalid_request","retryable":false,"meaning":"Prices must be whole ticks.","action":"Use one of the prices in details.nearest."},{"code":"price_out_of_band","status":422,"type":"rule_rejection","retryable":false,"meaning":"Limit and stop prices must stay within a band around the last price (details.band_pct).","action":"Bring the price closer to the market."},{"code":"stop_already_triggered","status":422,"type":"rule_rejection","retryable":false,"meaning":"A stop must be above the last price for a buy, below it for a sell.","action":"Use a market or limit order, or move the stop."},{"code":"post_only_would_fill","status":422,"type":"rule_rejection","retryable":false,"meaning":"A post-only limit must rest: its price is already through the market.","action":"Move the price, or drop post_only."},{"code":"limit_inside_spread","status":422,"type":"rule_rejection","retryable":false,"meaning":"A limit already through the last price fills at once at the best price, which is beyond your limit here (it sits inside the spread).","action":"Move the limit past the best price, or wait for the market."},{"code":"order_too_small","status":422,"type":"rule_rejection","retryable":false,"meaning":"Orders below a minimum value are refused (details.min_notional_usd).","action":"Place a larger order."},{"code":"working_order_cap","status":422,"type":"rule_rejection","retryable":false,"meaning":"Working orders per account and per customer are capped (details).","action":"Cancel some, then try again."},{"code":"client_order_id_conflict","status":409,"type":"conflict","retryable":false,"meaning":"Your client_order_id is unique per environment; the order that has it is in order_id.","action":"Use a new client_order_id, or read the existing order."},{"code":"order_not_working","status":409,"type":"conflict","retryable":false,"meaning":"It filled, was canceled or ended before your request (details.status).","action":"Read the order to see its state."},{"code":"idempotency_key_reused","status":400,"type":"invalid_request","retryable":false,"meaning":"The same key came with a different body.","action":"Use a new Idempotency-Key for a new action."},{"code":"json_too_deep","status":400,"type":"invalid_request","retryable":false,"meaning":"A JSON body may hold objects and lists up to details.max_depth levels.","action":"Send a flatter body."},{"code":"operation_in_progress","status":409,"type":"conflict","retryable":true,"meaning":"A retry came while the first was not finished.","action":"Retry after the Retry-After header."},{"code":"key_market_not_allowed","status":422,"type":"key_limit","retryable":false,"meaning":"The key is limited to some markets (details.markets).","action":"Use a key that may trade it, or change the key's markets."},{"code":"key_reduce_only","status":422,"type":"key_limit","retryable":false,"meaning":"The key is reduce-only: every order it places must be reduce_only.","action":"Set reduce_only, or use another key."},{"code":"key_max_order_notional","status":422,"type":"key_limit","retryable":false,"meaning":"The key has a largest order value (details.max_order_usd).","action":"Place a smaller order."},{"code":"key_max_position_notional","status":422,"type":"key_limit","retryable":false,"meaning":"The key has a largest position value (details.max_position_usd).","action":"Place a smaller order."},{"code":"key_loss_stop_active","status":422,"type":"key_limit","retryable":false,"meaning":"Trading with the key is stopped on the account until the next trading day.","action":"Wait for the next trading day (details.unlocks_at)."},{"code":"insufficient_margin","status":422,"type":"rule_rejection","retryable":false,"meaning":"The order needs more margin than is available (details).","action":"Place a smaller order, lower the leverage, or close positions."},{"code":"exposure_cap_exceeded","status":422,"type":"rule_rejection","retryable":false,"meaning":"Your open value on a market, across your accounts of the same product, is capped.","action":"Place a smaller order."},{"code":"reduce_only_violation","status":422,"type":"rule_rejection","retryable":false,"meaning":"A reduce-only order may only reduce or close a position.","action":"Check the position's side and size."},{"code":"slippage_exceeded","status":422,"type":"rule_rejection","retryable":false,"meaning":"The best price was beyond worst_price (or max_slippage_pct) when the order arrived.","action":"Allow more slippage, or use a limit order."},{"code":"no_price","status":503,"type":"engine","retryable":true,"meaning":"The market has no price to fill against yet.","action":"Retry after the Retry-After header."},{"code":"stale_quote","status":503,"type":"engine","retryable":true,"meaning":"The latest price is too old to trade against.","action":"Retry after the Retry-After header."},{"code":"market_closed","status":422,"type":"rule_rejection","retryable":false,"meaning":"The market does not trade now.","action":"Try again when it opens."},{"code":"market_not_offered","status":422,"type":"rule_rejection","retryable":false,"meaning":"The market is not offered for new positions.","action":"Choose another market."},{"code":"market_option_held","status":422,"type":"rule_rejection","retryable":false,"meaning":"An account trades an asset on one of its markets (venue or trading hours) at a time; it holds a position or working orders on another (details.held_market).","action":"Close that position and its orders first, or trade details.held_market."},{"code":"weekend_close","status":422,"type":"rule_rejection","retryable":false,"meaning":"A market on Standard Market Hours or FX hours closes its positions 15 minutes before its weekend close and opens none until it reopens.","action":"Reduce or close only, or trade its 24/7 market."},{"code":"market_halted","status":422,"type":"rule_rejection","retryable":false,"meaning":"Trading in the market is stopped for now.","action":"Try again later."},{"code":"position_liquidating","status":422,"type":"rule_rejection","retryable":false,"meaning":"A position in liquidation takes no new order.","action":"Wait until it is closed."},{"code":"account_paused","status":422,"type":"rule_rejection","retryable":false,"meaning":"A trading rule paused the account (details.until when known).","action":"Wait until it resumes."},{"code":"account_not_tradable","status":422,"type":"rule_rejection","retryable":false,"meaning":"The account passed, failed, or was closed (details.reason).","action":"Use another account."},{"code":"insufficient_balance","status":422,"type":"rule_rejection","retryable":false,"meaning":"The account balance does not cover this.","action":"Reduce the order."},{"code":"margin_mode_locked","status":409,"type":"conflict","retryable":false,"meaning":"A position or working order is open on the market.","action":"Close them, then change the mode."},{"code":"margin_rejected","status":422,"type":"rule_rejection","retryable":false,"meaning":"The trading engine did not take this mode or leverage for the market now.","action":"Read the market and your position, then try other settings."},{"code":"invalid_leverage","status":400,"type":"invalid_request","retryable":false,"meaning":"Leverage is a whole number from 1 to the market's max_leverage (details).","action":"Choose a leverage within it."},{"code":"liquidation_risk","status":422,"type":"rule_rejection","retryable":false,"meaning":"The change would move the liquidation price beyond the market.","action":"Choose a lower leverage or keep more margin."},{"code":"position_not_isolated","status":409,"type":"conflict","retryable":false,"meaning":"Only an isolated position has its own margin to change.","action":"Switch the market to isolated first."},{"code":"engine_busy","status":503,"type":"engine","retryable":true,"meaning":"The engine is under load and took nothing.","action":"Retry after the Retry-After header."},{"code":"order_rejected","status":422,"type":"rule_rejection","retryable":false,"meaning":"The engine refused the order for a reason without its own code.","action":"Check the order, or contact support with the request id."},{"code":"exits_changed","status":409,"type":"conflict","retryable":false,"meaning":"The position or its take-profit and stop-loss legs are not the ones your request was built on (a fill, a trim, another call).","action":"Build the batch again from details.exits, which is the state now."},{"code":"exit_operation_failed","status":422,"type":"rule_rejection","retryable":false,"meaning":"The engine refused one operation part way through the batch.","action":"details.results says what each operation did and details.exits what is in place now."},{"code":"exit_would_fill","status":422,"type":"rule_rejection","retryable":false,"meaning":"A take-profit must be on the profit side of the last price: above it for a long position, below it for a short one.","action":"Use a price beyond the last price, or close the position instead."},{"code":"exits_exceed_position","status":422,"type":"rule_rejection","retryable":false,"meaning":"The take-profit legs together, or the stop-loss legs together, would be more than the position.","action":"Make each group at most the position size (details.position_size)."},{"code":"exit_leg_cap","status":422,"type":"rule_rejection","retryable":false,"meaning":"A position holds a limited number of take-profit and of stop-loss legs.","action":"Cancel or merge a leg first (details.max)."},{"code":"strategy_limit","status":422,"type":"rule_rejection","retryable":false,"meaning":"A limit on running strategies or resting legs was reached (details.scope).","action":"End or cancel a strategy first."},{"code":"strategy_not_active","status":409,"type":"conflict","retryable":false,"meaning":"Only a waiting or working strategy can be canceled.","action":"Read it again: its status and end_reason say how it ended."},{"code":"strategy_not_found","status":404,"type":"not_found","retryable":false,"meaning":"The id is unknown, or belongs to another account or environment.","action":"List the account's strategies to find it."},{"code":"client_strategy_id_conflict","status":409,"type":"conflict","retryable":false,"meaning":"Your id for a strategy is unique in its environment.","action":"Use another id, or read the existing one (details.strategy_id)."},{"code":"webhook_endpoint_not_found","status":404,"type":"not_found","retryable":false,"meaning":"The id is unknown, or belongs to another customer or environment.","action":"List your endpoints to find it."},{"code":"tradingview_hook_not_found","status":404,"type":"not_found","retryable":false,"meaning":"The id is unknown, revoked, or belongs to another customer or environment.","action":"List your TradingView links to find it."},{"code":"tradingview_alert_not_found","status":404,"type":"not_found","retryable":false,"meaning":"The id is unknown, or older than the alert log keeps.","action":"List the link's alerts to find it."},{"code":"webhook_endpoint_not_active","status":409,"type":"conflict","retryable":false,"meaning":"Tests and resends go to active endpoints only.","action":"Turn it on again (enable, or your dashboard), then try again."},{"code":"delivery_not_found","status":404,"type":"not_found","retryable":false,"meaning":"The id is unknown, or older than the delivery log keeps.","action":"List the endpoint's deliveries to find it."},{"code":"event_not_found","status":404,"type":"not_found","retryable":false,"meaning":"The id is unknown, or older than the event log keeps.","action":"List the events (GET /v1/events) to find it."},{"code":"rung_would_fill","status":422,"type":"rule_rejection","retryable":false,"meaning":"A limit of a scaled order is through the last price, so it would fill at once instead of resting.","action":"Move the ladder away from the price, or send allow_marketable true."},{"code":"trigger_already_met","status":422,"type":"rule_rejection","retryable":false,"meaning":"A conditional waits for its price: on its own market a buy's level must be below the price and a sell's above it; on another market the price must not be beyond the level already (details.last_price).","action":"Place the order now, or move trigger_price."},{"code":"alert_not_found","status":404,"type":"not_found","retryable":false,"meaning":"The id is unknown or deleted, or belongs to another account or environment.","action":"List the account's alerts to find it."},{"code":"alert_limit","status":422,"type":"rule_rejection","retryable":false,"meaning":"Armed alerts are capped per account and across your accounts (details.scope, details.max).","action":"Delete an alert, or wait for one to fire."},{"code":"alert_at_price","status":422,"type":"rule_rejection","retryable":false,"meaning":"An alert fires when the price reaches its level from one side; a level at the price now has none (details.last_price).","action":"Set a level above or below the price."},{"code":"alert_not_armed","status":409,"type":"conflict","retryable":false,"meaning":"Only an armed alert moves; one that fired or was disabled must be armed again first (details.status).","action":"Rearm it, then move it."},{"code":"strategy_type_disabled","status":403,"type":"permission","retryable":false,"meaning":"The strategy type is switched off on the platform.","action":"Use another type, or try again later."},{"code":"account_not_found","status":404,"type":"not_found","retryable":false,"meaning":"The account does not exist in this environment, or the key does not reach it.","action":"List your accounts with GET /v1/accounts."},{"code":"market_not_found","status":404,"type":"not_found","retryable":false,"meaning":"The market is not offered.","action":"List the markets with GET /v1/markets."},{"code":"order_not_found","status":404,"type":"not_found","retryable":false,"meaning":"The order is not on this account.","action":"List the account's orders."},{"code":"position_not_found","status":404,"type":"not_found","retryable":false,"meaning":"The account holds nothing on that market now.","action":"List the open positions."},{"code":"route_not_found","status":404,"type":"not_found","retryable":false,"meaning":"The path does not exist on this host.","action":"Check the path against the reference."},{"code":"method_not_allowed","status":405,"type":"method","retryable":false,"meaning":"The path exists, with other methods (see the Allow header).","action":"Use a method the Allow header lists."},{"code":"payload_too_large","status":413,"type":"payload","retryable":false,"meaning":"The body is over the size limit.","action":"Send a smaller body."},{"code":"uri_too_long","status":414,"type":"payload","retryable":false,"meaning":"The URL is over the length limit.","action":"Shorten the query."},{"code":"unsupported_media_type","status":415,"type":"payload","retryable":false,"meaning":"A body was sent without Content-Type: application/json.","action":"Send JSON with that header."},{"code":"sandbox_limit_reached","status":409,"type":"conflict","retryable":false,"meaning":"Each customer may open a fixed number of sandbox accounts, ever.","action":"Keep using the ones you have."},{"code":"account_not_ready","status":409,"type":"conflict","retryable":true,"meaning":"The account exists but is not open on the trading engine yet.","action":"Retry after the Retry-After header."},{"code":"sandbox_opening","status":409,"type":"conflict","retryable":true,"meaning":"The account was reserved and is being opened.","action":"Retry after the Retry-After header."},{"code":"idempotency_key_required","status":400,"type":"invalid_request","retryable":false,"meaning":"Calls that create something need a key that makes a retry safe.","action":"Send Idempotency-Key with a new unique value per action."},{"code":"invalid_idempotency_key","status":400,"type":"invalid_request","retryable":false,"meaning":"The key is empty, too long, or has characters it cannot.","action":"Send 1 to 128 printable characters."},{"code":"rate_limited","status":429,"type":"rate_limit","retryable":true,"meaning":"A request budget is used up (details.scope says which).","action":"Wait for Retry-After, then spread your requests."},{"code":"not_ready","status":503,"type":"engine","retryable":true,"meaning":"The API is starting and has not loaded your keys yet.","action":"Retry after the Retry-After header."},{"code":"state_unavailable","status":503,"type":"engine","retryable":true,"meaning":"The trading engine did not give a complete answer in time; nothing partial is returned.","action":"Retry after the Retry-After header."},{"code":"engine_unavailable","status":503,"type":"engine","retryable":true,"meaning":"The trading engine did not answer.","action":"Retry after the Retry-After header."},{"code":"limiter_unavailable","status":503,"type":"server","retryable":true,"meaning":"The rate limiter is unavailable, so nothing passes unmeasured.","action":"Retry after the Retry-After header."},{"code":"sandbox_disabled","status":503,"type":"engine","retryable":false,"meaning":"Sandbox accounts are not being opened.","action":"Try again later."},{"code":"environment_disabled","status":503,"type":"engine","retryable":false,"meaning":"This host takes no requests at the moment.","action":"Check GET /v1/status."},{"code":"temporarily_unavailable","status":503,"type":"server","retryable":true,"meaning":"A service this call needs did not answer.","action":"Retry after the Retry-After header."},{"code":"capacity","status":503,"type":"engine","retryable":true,"meaning":"The API is busy.","action":"Retry after the Retry-After header."},{"code":"internal_error","status":500,"type":"server","retryable":true,"meaning":"An error we did not expect.","action":"Retry; if it lasts, contact support with the request id."}]},"x-key-prefixes":{"live":"ppk_live_","sandbox":"ppk_test_"}}