Takes one bounded snapshot of every open position and submits one reduce-only market close for each target. Closes use the same 2.5% maximum-slippage policy as Close All in the trading terminal. The response reports each submitted or rejected child order. Repeating the request with the same idempotency key resumes or replays the original snapshot, even when positions have since closed.
API key beginning with fp_live_ (live keys, served at developers.myfundedperpetuals.com) or fp_test_ (test keys, served at sandbox.myfundedperpetuals.com). A key presented on the other host is rejected with 401 and a message naming the correct host.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"MyFundedPerps Documentation","description":"Product guides, settings reference, and developer API documentation for MyFundedPerps.","colors":{"primary":"#1FA66D","light":"#36CF8F","dark":"#178154"},"logo":{"light":"https://mintcdn.com/my-funded-perps/4fIdVX54Kxh8hflY/logo-light.svg?fit=max\u0026auto=format\u0026n=4fIdVX54Kxh8hflY\u0026q=85\u0026s=cebe735a42f06ca5d2e4b567f53ed8af","dark":"https://mintcdn.com/my-funded-perps/4fIdVX54Kxh8hflY/logo-dark.svg?fit=max\u0026auto=format\u0026n=4fIdVX54Kxh8hflY\u0026q=85\u0026s=ea7bd47667966a4236f2ac14e298a94e","href":"https://myfundedperpetuals.com"},"favicon":"https://mintcdn.com/my-funded-perps/rdzqjiFhppEo_sEz/icon.svg?fit=max\u0026auto=format\u0026n=rdzqjiFhppEo_sEz\u0026q=85\u0026s=363c05a1c553e09ac5d1de9004defc84","appearance":{"default":"system"},"navbar":{"links":[{"href":"https://myfundedperpetuals.com/trade","label":"Trading Platform"}],"primary":{"type":"button","label":"Create API Key","href":"https://myfundedperpetuals.com/settings?section=api-keys"}},"footer":{"socials":{"website":"https://myfundedperpetuals.com"}},"search":{"prompt":"Search rules, guides, and API..."},"seo":{"organization":{"name":"MyFundedPerps","url":"https://myfundedperpetuals.com","sameAs":["https://x.com/MyFundedPerps","https://www.instagram.com/myfundedperps_/","https://github.com/MyFundedPerps"]},"indexing":"navigable"},"integrations":{"telemetry":{"enabled":true}},"contextual":{"options":["copy","view","chatgpt","claude","cursor","vscode"],"display":"header"},"markdown":{"schema":true},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"my-funded-perps","hasAudioNarration":false,"actualSubdomain":"my-funded-perps","customDomains":["docs.myfundedperpetuals.com"],"gitSource":{"type":"github","owner":"myfundedperps","repo":"myfundedperps","deployBranch":"main","contentDirectory":"apps/docs","isPrivate":true,"mountPath":"","label":""},"chroma":{"latestBuiltDeploymentHistoryId":"6addb1ea3f04217bb3716be8","collectionId":"43492e86-d554-4325-a712-f46b76557d58","liveDeploymentHistoryId":"6addb1ea3f04217bb3716be8","schemaVersion":"v3"},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6ade88236f6ff5358664aa6f","clientVersion":"0.0.3966","searchFilterCounts":[{"language":"default","tag":"Developers Guide","count":50},{"language":"default","tag":"Buyers Guide","count":40},{"language":"default","tag":"REST Reference","count":37},{"language":"default","tag":"Guides","count":19},{"language":"default","tag":"Developer API (Beta)","count":13},{"language":"default","tag":"Settings","count":13},{"language":"default","tag":"Accounts","count":9},{"language":"default","tag":"Strategy Orders","count":8},{"language":"default","tag":"Challenge Lifecycle","count":7},{"language":"default","tag":"Orders","count":6}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"isAtlas":false,"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"api-reference/accounts/close-all-open-positions","slug":"/api-reference/accounts/close-all-open-positions","pageMetadata":{"title":"Close all open positions","description":"Takes one bounded snapshot of every open position and submits one reduce-only market close for each target. Closes use the same 2.5% maximum-slippage policy as Close All in the trading terminal. The response reports each submitted or rejected child order. Repeating the request with the same idempotency key resumes or replays the original snapshot, even when positions have since closed.","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/accounts/{account_id}/close-all-positions","href":"/api-reference/accounts/close-all-open-positions","autogeneratedByOpenApi":true},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Takes one bounded snapshot of every open position and submits one reduce-only market close for each target. Closes use the same 2.5% maximum-slippage policy as Close All in the trading terminal. The response reports each submitted or rejected child order. Repeating the request with the same idempotency key resumes or replays the original snapshot, even when positions have since closed.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Close all open positions","description":"Takes one bounded snapshot of every open position and submits one reduce-only market close for each target. Closes use the same 2.5% maximum-slippage policy as Close All in the trading terminal. The response reports each submitted or rejected child order. Repeating the request with the same idempotency key resumes or replays the original snapshot, even when positions have since closed.","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/accounts/{account_id}/close-all-positions","href":"/api-reference/accounts/close-all-open-positions","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"operationId":"closeAllAccountPositions","summary":"Close all open positions","description":"Takes one bounded snapshot of every open position and submits one reduce-only market close for each target. Closes use the same 2.5% maximum-slippage policy as Close All in the trading terminal. The response reports each submitted or rejected child order. Repeating the request with the same idempotency key resumes or replays the original snapshot, even when positions have since closed.","tags":["Accounts","Positions"],"parameters":["f5a7ef67-b5e2-49e8-9758-945b85e49c48","2b2a85ed-ada0-47a0-a518-f68292b54834"],"responses":{"200":"1a1f0fbd-bdf6-47bc-b504-bed821c9a365","201":"15af2dd8-2754-4a53-94ad-6b0de02f769d","202":"2c1b4619-eef6-43e3-811a-8d0ed0f0ab8c","400":"1c1805b3-5356-4e7c-a35c-62b3db35a6dd","401":"a7046342-5724-42bf-bc2c-297d423c7433","403":"dc15d56c-b7f9-4fbe-b2f8-c3b16858dee0","404":"87a34375-9fa0-43a2-9c36-81d0cf9573b4","409":"ca130cc4-df76-45ef-b050-77e49189bad1","429":"c136333b-79b3-4b5c-bb34-f9478b065554","503":"2ced2077-29c8-4152-838f-b15b317bd062"},"method":"post","type":"path","servers":["0bce700c-8f47-4d28-93c4-8c6a54f774e1","2fbded66-8dd6-4643-8b01-0e3f9d2ff197"],"security":["fcd3d2ac-ab78-48dc-85b7-d9c96875d7e0"],"path":"/v1/accounts/{account_id}/close-all-positions","baseUrlOptions":["https://developers.myfundedperpetuals.com","https://sandbox.myfundedperpetuals.com"],"title":"Close all open positions","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{"f5a7ef67-b5e2-49e8-9758-945b85e49c48":{"name":"account_id","in":"path","required":true,"schema":{"type":"string","isRequired":true,"uniqueKey":"","typeLabel":"string"}},"2b2a85ed-ada0-47a0-a518-f68292b54834":{"name":"Idempotency-Key","in":"header","required":true,"description":"Unique printable key for this intended operation. Reuse it only for an identical retry.","schema":{"type":"string","minLength":1,"maxLength":128,"isRequired":true,"description":"Unique printable key for this intended operation. Reuse it only for an identical retry.","uniqueKey":"","typeLabel":"string"}}},"responses":{"1a1f0fbd-bdf6-47bc-b504-bed821c9a365":{"description":"Completed operation replay.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","operation","account_id","status","total_count","succeeded_count","failed_count","results","created_at"],"properties":{"id":{"type":"string","isRequired":true,"uniqueKey":"data.id","typeLabel":"string"},"operation":{"type":"string","const":"close_all_positions","isRequired":true,"uniqueKey":"data.operation","typeLabel":"string"},"account_id":{"type":"string","isRequired":true,"uniqueKey":"data.account_id","typeLabel":"string"},"status":{"type":"string","enum":["running","completed"],"isRequired":true,"uniqueKey":"data.status","typeLabel":"enum\u003cstring>"},"total_count":{"type":"integer","minimum":0,"maximum":100,"isRequired":true,"uniqueKey":"data.total_count","typeLabel":"integer"},"succeeded_count":{"type":"integer","minimum":0,"maximum":100,"isRequired":true,"uniqueKey":"data.succeeded_count","typeLabel":"integer"},"failed_count":{"type":"integer","minimum":0,"maximum":100,"isRequired":true,"uniqueKey":"data.failed_count","typeLabel":"integer"},"results":{"type":"array","maxItems":100,"items":{"type":"object","required":["position_id","status"],"properties":{"position_id":{"type":"string","isRequired":true,"uniqueKey":"data.results.items.[INDEX].position_id","typeLabel":"string"},"status":{"type":"string","enum":["submitted","failed"],"isRequired":true,"uniqueKey":"data.results.items.[INDEX].status","typeLabel":"enum\u003cstring>"},"order":{"type":"object","required":["id","account_id","market_id","provider","symbol","coin","type","mode","side","size","expected_price","leverage","margin_mode","reduce_only","status","requested_at"],"properties":{"id":{"type":"string","isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.id","typeLabel":"string"},"account_id":{"type":"string","isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.account_id","typeLabel":"string"},"market_id":{"type":"string","isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.market_id","typeLabel":"string"},"provider":{"type":"string","isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.provider","typeLabel":"string"},"symbol":{"type":"string","isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.symbol","typeLabel":"string"},"coin":{"type":"string","isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.coin","typeLabel":"string"},"type":{"type":"string","enum":["market","limit","stop_market","stop_limit","take_market","take_limit","take_profit","liquidation","close_out"],"isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.type","typeLabel":"enum\u003cstring>"},"mode":{"type":"string","enum":["market","limit","chase","stop_market","stop_limit","take_market","take_limit","take_profit","conditional","liquidation","close_out"],"isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.mode","typeLabel":"enum\u003cstring>"},"side":{"type":"string","enum":["buy","sell"],"isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.side","typeLabel":"enum\u003cstring>"},"size":{"type":"number","description":"This order's quantity in base-asset units. On a filled order it is the executed quantity of that fill. On a working order that has partially filled, it is the remaining quantity.","isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.size","typeLabel":"number"},"expected_price":{"type":"number","isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.expected_price","typeLabel":"number"},"leverage":{"type":"number","isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.leverage","typeLabel":"number"},"margin_mode":{"type":"string","enum":["cross","isolated"],"isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.margin_mode","typeLabel":"enum\u003cstring>"},"reduce_only":{"type":"boolean","isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.reduce_only","typeLabel":"boolean"},"status":{"type":"string","enum":["pending","filled","rejected","expired","resting","canceled"],"isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.status","typeLabel":"enum\u003cstring>"},"requested_at":{"type":"number","isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.requested_at","typeLabel":"number"},"client_order_id":{"type":"string","description":"Caller-assigned order identity, when supplied at placement.","uniqueKey":"data.results.items.[INDEX].order.client_order_id","typeLabel":"string"},"initial_size":{"type":"number","description":"Quantity originally requested when the order was placed. Read it with filled_size on the partial_fill_root_order_id order to track a partially filled placement's progress.","uniqueKey":"data.results.items.[INDEX].order.initial_size","typeLabel":"number"},"filled_size":{"type":"number","description":"Cumulative quantity filled by fragments split from this order, each of which appears as its own filled order with partial_fill_root_order_id set to this order. It stays 0 on an order that filled in one execution, so use size for a fill's executed quantity.","uniqueKey":"data.results.items.[INDEX].order.filled_size","typeLabel":"number"},"fill_price":{"type":"number","description":"On a filled order, the execution price of size.","uniqueKey":"data.results.items.[INDEX].order.fill_price","typeLabel":"number"},"trigger_price":{"type":"number","uniqueKey":"data.results.items.[INDEX].order.trigger_price","typeLabel":"number"},"limit_price":{"type":"number","uniqueKey":"data.results.items.[INDEX].order.limit_price","typeLabel":"number"},"notional":{"type":"number","description":"On a filled order, size multiplied by fill_price, in USD.","uniqueKey":"data.results.items.[INDEX].order.notional","typeLabel":"number"},"fee":{"type":"number","description":"Trading fee charged for this fill, in USD.","uniqueKey":"data.results.items.[INDEX].order.fee","typeLabel":"number"},"realized_pnl":{"type":"number","description":"P\u0026L realized by the portion of this fill that reduced or closed a position, in USD, before fee. 0 on a fill that only opened or increased a position.","uniqueKey":"data.results.items.[INDEX].order.realized_pnl","typeLabel":"number"},"time_in_force":{"type":"string","enum":["gtc","ioc","fok","gtd"],"uniqueKey":"data.results.items.[INDEX].order.time_in_force","typeLabel":"enum\u003cstring>"},"gtd_expires_at":{"type":"number","uniqueKey":"data.results.items.[INDEX].order.gtd_expires_at","typeLabel":"number"},"attached_take_profit_price":{"type":"number","uniqueKey":"data.results.items.[INDEX].order.attached_take_profit_price","typeLabel":"number"},"attached_stop_loss_price":{"type":"number","uniqueKey":"data.results.items.[INDEX].order.attached_stop_loss_price","typeLabel":"number"},"chase_offset":{"type":"number","uniqueKey":"data.results.items.[INDEX].order.chase_offset","typeLabel":"number"},"chase_cap_price":{"type":"number","uniqueKey":"data.results.items.[INDEX].order.chase_cap_price","typeLabel":"number"},"trigger_market_id":{"type":"string","uniqueKey":"data.results.items.[INDEX].order.trigger_market_id","typeLabel":"string"},"trigger_direction":{"type":"string","enum":["above","below"],"uniqueKey":"data.results.items.[INDEX].order.trigger_direction","typeLabel":"enum\u003cstring>"},"triggered_at":{"type":"number","description":"Millisecond timestamp of the most recent resting-to-pending execution attempt.","uniqueKey":"data.results.items.[INDEX].order.triggered_at","typeLabel":"number"},"stop_triggered_at":{"type":"number","description":"Millisecond timestamp when a conditional limit entered its limit leg. Absent while its trigger is still armed; once present it remains set.","uniqueKey":"data.results.items.[INDEX].order.stop_triggered_at","typeLabel":"number"},"cancel_requested_at":{"type":"number","description":"Millisecond timestamp of cancellation intent. An in-flight execution may still fill before cancellation settles.","uniqueKey":"data.results.items.[INDEX].order.cancel_requested_at","typeLabel":"number"},"oco_sibling_order_id":{"type":"string","description":"Paired TP or SL order. Fills retire matching size from the sibling; explicitly canceling one leg unlinks the survivor.","uniqueKey":"data.results.items.[INDEX].order.oco_sibling_order_id","typeLabel":"string"},"take_profit_order_id":{"type":"string","description":"On an entry with an attached take-profit, the exit order its fill created.","uniqueKey":"data.results.items.[INDEX].order.take_profit_order_id","typeLabel":"string"},"stop_loss_order_id":{"type":"string","description":"On an entry with an attached stop-loss, the exit order its fill created.","uniqueKey":"data.results.items.[INDEX].order.stop_loss_order_id","typeLabel":"string"},"parent_order_id":{"type":"string","description":"On an exit created by an entry's attached take-profit or stop-loss, the entry order that created it.","uniqueKey":"data.results.items.[INDEX].order.parent_order_id","typeLabel":"string"},"bracket_role":{"type":"string","enum":["take_profit","stop_loss"],"description":"Which attached exit this order is. Present together with parent_order_id.","uniqueKey":"data.results.items.[INDEX].order.bracket_role","typeLabel":"enum\u003cstring>"},"target_position_id":{"type":"string","uniqueKey":"data.results.items.[INDEX].order.target_position_id","typeLabel":"string"},"liquidity_role":{"type":"string","enum":["maker","taker"],"uniqueKey":"data.results.items.[INDEX].order.liquidity_role","typeLabel":"enum\u003cstring>"},"partial_of_order_id":{"type":"string","uniqueKey":"data.results.items.[INDEX].order.partial_of_order_id","typeLabel":"string"},"partial_fill_root_order_id":{"type":"string","uniqueKey":"data.results.items.[INDEX].order.partial_fill_root_order_id","typeLabel":"string"},"twap_order_id":{"type":"string","uniqueKey":"data.results.items.[INDEX].order.twap_order_id","typeLabel":"string"},"scaled_order_id":{"type":"string","uniqueKey":"data.results.items.[INDEX].order.scaled_order_id","typeLabel":"string"},"reject_reason":{"type":"string","uniqueKey":"data.results.items.[INDEX].order.reject_reason","typeLabel":"string"},"reject_rule_id":{"type":"string","uniqueKey":"data.results.items.[INDEX].order.reject_rule_id","typeLabel":"string"},"cancel_reason":{"type":"string","description":"Why a canceled order was canceled: user, oco, reduce_only, replaced, liquidation, expired, account_closed, trading_restricted, venue_policy, or copy. New values may be added. Absent on orders canceled before this field was added.","uniqueKey":"data.results.items.[INDEX].order.cancel_reason","typeLabel":"string"},"position_side_after":{"type":"string","enum":["long","short","flat"],"description":"On a filled order, the side of the account's position in this market after the fill.","uniqueKey":"data.results.items.[INDEX].order.position_side_after","typeLabel":"enum\u003cstring>"},"position_size_after":{"type":"number","description":"On a filled order, the size of the account's position in this market after the fill, in base-asset units. 0 when flat.","uniqueKey":"data.results.items.[INDEX].order.position_size_after","typeLabel":"number"},"settled_at":{"type":"number","uniqueKey":"data.results.items.[INDEX].order.settled_at","typeLabel":"number"},"canceled_at":{"type":"number","uniqueKey":"data.results.items.[INDEX].order.canceled_at","typeLabel":"number"}},"uniqueKey":"data.results.items.[INDEX].order","typeLabel":"object"},"failure_code":{"type":"string","uniqueKey":"data.results.items.[INDEX].failure_code","typeLabel":"string"},"rule_id":{"type":"string","uniqueKey":"data.results.items.[INDEX].rule_id","typeLabel":"string"}},"uniqueKey":"data.results.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"data.results","typeLabel":"object[]"},"created_at":{"type":"number","isRequired":true,"uniqueKey":"data.created_at","typeLabel":"number"},"completed_at":{"type":"number","uniqueKey":"data.completed_at","typeLabel":"number"}},"isRequired":true,"uniqueKey":"data","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"data":{"id":"\u003cstring>","operation":"close_all_positions","account_id":"\u003cstring>","status":"running","total_count":50,"succeeded_count":50,"failed_count":50,"results":[{"position_id":"\u003cstring>","status":"submitted","order":{"id":"\u003cstring>","account_id":"\u003cstring>","market_id":"\u003cstring>","provider":"\u003cstring>","symbol":"\u003cstring>","coin":"\u003cstring>","type":"market","mode":"market","side":"buy","size":123,"expected_price":123,"leverage":123,"margin_mode":"cross","reduce_only":true,"status":"pending","requested_at":123,"client_order_id":"\u003cstring>","initial_size":123,"filled_size":123,"fill_price":123,"trigger_price":123,"limit_price":123,"notional":123,"fee":123,"realized_pnl":123,"time_in_force":"gtc","gtd_expires_at":123,"attached_take_profit_price":123,"attached_stop_loss_price":123,"chase_offset":123,"chase_cap_price":123,"trigger_market_id":"\u003cstring>","trigger_direction":"above","triggered_at":123,"stop_triggered_at":123,"cancel_requested_at":123,"oco_sibling_order_id":"\u003cstring>","take_profit_order_id":"\u003cstring>","stop_loss_order_id":"\u003cstring>","parent_order_id":"\u003cstring>","bracket_role":"take_profit","target_position_id":"\u003cstring>","liquidity_role":"maker","partial_of_order_id":"\u003cstring>","partial_fill_root_order_id":"\u003cstring>","twap_order_id":"\u003cstring>","scaled_order_id":"\u003cstring>","reject_reason":"\u003cstring>","reject_rule_id":"\u003cstring>","cancel_reason":"\u003cstring>","position_side_after":"long","position_size_after":123,"settled_at":123,"canceled_at":123},"failure_code":"\u003cstring>","rule_id":"\u003cstring>"}],"created_at":123,"completed_at":123}}}},"exampleType":"generated"}},"exampleType":"generated"},"15af2dd8-2754-4a53-94ad-6b0de02f769d":{"description":"Operation completed for the first time.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","operation","account_id","status","total_count","succeeded_count","failed_count","results","created_at"],"properties":{"id":{"type":"string","isRequired":true,"uniqueKey":"data.id","typeLabel":"string"},"operation":{"type":"string","const":"close_all_positions","isRequired":true,"uniqueKey":"data.operation","typeLabel":"string"},"account_id":{"type":"string","isRequired":true,"uniqueKey":"data.account_id","typeLabel":"string"},"status":{"type":"string","enum":["running","completed"],"isRequired":true,"uniqueKey":"data.status","typeLabel":"enum\u003cstring>"},"total_count":{"type":"integer","minimum":0,"maximum":100,"isRequired":true,"uniqueKey":"data.total_count","typeLabel":"integer"},"succeeded_count":{"type":"integer","minimum":0,"maximum":100,"isRequired":true,"uniqueKey":"data.succeeded_count","typeLabel":"integer"},"failed_count":{"type":"integer","minimum":0,"maximum":100,"isRequired":true,"uniqueKey":"data.failed_count","typeLabel":"integer"},"results":{"type":"array","maxItems":100,"items":{"type":"object","required":["position_id","status"],"properties":{"position_id":{"type":"string","isRequired":true,"uniqueKey":"data.results.items.[INDEX].position_id","typeLabel":"string"},"status":{"type":"string","enum":["submitted","failed"],"isRequired":true,"uniqueKey":"data.results.items.[INDEX].status","typeLabel":"enum\u003cstring>"},"order":{"type":"object","required":["id","account_id","market_id","provider","symbol","coin","type","mode","side","size","expected_price","leverage","margin_mode","reduce_only","status","requested_at"],"properties":{"id":{"type":"string","isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.id","typeLabel":"string"},"account_id":{"type":"string","isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.account_id","typeLabel":"string"},"market_id":{"type":"string","isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.market_id","typeLabel":"string"},"provider":{"type":"string","isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.provider","typeLabel":"string"},"symbol":{"type":"string","isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.symbol","typeLabel":"string"},"coin":{"type":"string","isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.coin","typeLabel":"string"},"type":{"type":"string","enum":["market","limit","stop_market","stop_limit","take_market","take_limit","take_profit","liquidation","close_out"],"isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.type","typeLabel":"enum\u003cstring>"},"mode":{"type":"string","enum":["market","limit","chase","stop_market","stop_limit","take_market","take_limit","take_profit","conditional","liquidation","close_out"],"isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.mode","typeLabel":"enum\u003cstring>"},"side":{"type":"string","enum":["buy","sell"],"isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.side","typeLabel":"enum\u003cstring>"},"size":{"type":"number","description":"This order's quantity in base-asset units. On a filled order it is the executed quantity of that fill. On a working order that has partially filled, it is the remaining quantity.","isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.size","typeLabel":"number"},"expected_price":{"type":"number","isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.expected_price","typeLabel":"number"},"leverage":{"type":"number","isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.leverage","typeLabel":"number"},"margin_mode":{"type":"string","enum":["cross","isolated"],"isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.margin_mode","typeLabel":"enum\u003cstring>"},"reduce_only":{"type":"boolean","isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.reduce_only","typeLabel":"boolean"},"status":{"type":"string","enum":["pending","filled","rejected","expired","resting","canceled"],"isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.status","typeLabel":"enum\u003cstring>"},"requested_at":{"type":"number","isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.requested_at","typeLabel":"number"},"client_order_id":{"type":"string","description":"Caller-assigned order identity, when supplied at placement.","uniqueKey":"data.results.items.[INDEX].order.client_order_id","typeLabel":"string"},"initial_size":{"type":"number","description":"Quantity originally requested when the order was placed. Read it with filled_size on the partial_fill_root_order_id order to track a partially filled placement's progress.","uniqueKey":"data.results.items.[INDEX].order.initial_size","typeLabel":"number"},"filled_size":{"type":"number","description":"Cumulative quantity filled by fragments split from this order, each of which appears as its own filled order with partial_fill_root_order_id set to this order. It stays 0 on an order that filled in one execution, so use size for a fill's executed quantity.","uniqueKey":"data.results.items.[INDEX].order.filled_size","typeLabel":"number"},"fill_price":{"type":"number","description":"On a filled order, the execution price of size.","uniqueKey":"data.results.items.[INDEX].order.fill_price","typeLabel":"number"},"trigger_price":{"type":"number","uniqueKey":"data.results.items.[INDEX].order.trigger_price","typeLabel":"number"},"limit_price":{"type":"number","uniqueKey":"data.results.items.[INDEX].order.limit_price","typeLabel":"number"},"notional":{"type":"number","description":"On a filled order, size multiplied by fill_price, in USD.","uniqueKey":"data.results.items.[INDEX].order.notional","typeLabel":"number"},"fee":{"type":"number","description":"Trading fee charged for this fill, in USD.","uniqueKey":"data.results.items.[INDEX].order.fee","typeLabel":"number"},"realized_pnl":{"type":"number","description":"P\u0026L realized by the portion of this fill that reduced or closed a position, in USD, before fee. 0 on a fill that only opened or increased a position.","uniqueKey":"data.results.items.[INDEX].order.realized_pnl","typeLabel":"number"},"time_in_force":{"type":"string","enum":["gtc","ioc","fok","gtd"],"uniqueKey":"data.results.items.[INDEX].order.time_in_force","typeLabel":"enum\u003cstring>"},"gtd_expires_at":{"type":"number","uniqueKey":"data.results.items.[INDEX].order.gtd_expires_at","typeLabel":"number"},"attached_take_profit_price":{"type":"number","uniqueKey":"data.results.items.[INDEX].order.attached_take_profit_price","typeLabel":"number"},"attached_stop_loss_price":{"type":"number","uniqueKey":"data.results.items.[INDEX].order.attached_stop_loss_price","typeLabel":"number"},"chase_offset":{"type":"number","uniqueKey":"data.results.items.[INDEX].order.chase_offset","typeLabel":"number"},"chase_cap_price":{"type":"number","uniqueKey":"data.results.items.[INDEX].order.chase_cap_price","typeLabel":"number"},"trigger_market_id":{"type":"string","uniqueKey":"data.results.items.[INDEX].order.trigger_market_id","typeLabel":"string"},"trigger_direction":{"type":"string","enum":["above","below"],"uniqueKey":"data.results.items.[INDEX].order.trigger_direction","typeLabel":"enum\u003cstring>"},"triggered_at":{"type":"number","description":"Millisecond timestamp of the most recent resting-to-pending execution attempt.","uniqueKey":"data.results.items.[INDEX].order.triggered_at","typeLabel":"number"},"stop_triggered_at":{"type":"number","description":"Millisecond timestamp when a conditional limit entered its limit leg. Absent while its trigger is still armed; once present it remains set.","uniqueKey":"data.results.items.[INDEX].order.stop_triggered_at","typeLabel":"number"},"cancel_requested_at":{"type":"number","description":"Millisecond timestamp of cancellation intent. An in-flight execution may still fill before cancellation settles.","uniqueKey":"data.results.items.[INDEX].order.cancel_requested_at","typeLabel":"number"},"oco_sibling_order_id":{"type":"string","description":"Paired TP or SL order. Fills retire matching size from the sibling; explicitly canceling one leg unlinks the survivor.","uniqueKey":"data.results.items.[INDEX].order.oco_sibling_order_id","typeLabel":"string"},"take_profit_order_id":{"type":"string","description":"On an entry with an attached take-profit, the exit order its fill created.","uniqueKey":"data.results.items.[INDEX].order.take_profit_order_id","typeLabel":"string"},"stop_loss_order_id":{"type":"string","description":"On an entry with an attached stop-loss, the exit order its fill created.","uniqueKey":"data.results.items.[INDEX].order.stop_loss_order_id","typeLabel":"string"},"parent_order_id":{"type":"string","description":"On an exit created by an entry's attached take-profit or stop-loss, the entry order that created it.","uniqueKey":"data.results.items.[INDEX].order.parent_order_id","typeLabel":"string"},"bracket_role":{"type":"string","enum":["take_profit","stop_loss"],"description":"Which attached exit this order is. Present together with parent_order_id.","uniqueKey":"data.results.items.[INDEX].order.bracket_role","typeLabel":"enum\u003cstring>"},"target_position_id":{"type":"string","uniqueKey":"data.results.items.[INDEX].order.target_position_id","typeLabel":"string"},"liquidity_role":{"type":"string","enum":["maker","taker"],"uniqueKey":"data.results.items.[INDEX].order.liquidity_role","typeLabel":"enum\u003cstring>"},"partial_of_order_id":{"type":"string","uniqueKey":"data.results.items.[INDEX].order.partial_of_order_id","typeLabel":"string"},"partial_fill_root_order_id":{"type":"string","uniqueKey":"data.results.items.[INDEX].order.partial_fill_root_order_id","typeLabel":"string"},"twap_order_id":{"type":"string","uniqueKey":"data.results.items.[INDEX].order.twap_order_id","typeLabel":"string"},"scaled_order_id":{"type":"string","uniqueKey":"data.results.items.[INDEX].order.scaled_order_id","typeLabel":"string"},"reject_reason":{"type":"string","uniqueKey":"data.results.items.[INDEX].order.reject_reason","typeLabel":"string"},"reject_rule_id":{"type":"string","uniqueKey":"data.results.items.[INDEX].order.reject_rule_id","typeLabel":"string"},"cancel_reason":{"type":"string","description":"Why a canceled order was canceled: user, oco, reduce_only, replaced, liquidation, expired, account_closed, trading_restricted, venue_policy, or copy. New values may be added. Absent on orders canceled before this field was added.","uniqueKey":"data.results.items.[INDEX].order.cancel_reason","typeLabel":"string"},"position_side_after":{"type":"string","enum":["long","short","flat"],"description":"On a filled order, the side of the account's position in this market after the fill.","uniqueKey":"data.results.items.[INDEX].order.position_side_after","typeLabel":"enum\u003cstring>"},"position_size_after":{"type":"number","description":"On a filled order, the size of the account's position in this market after the fill, in base-asset units. 0 when flat.","uniqueKey":"data.results.items.[INDEX].order.position_size_after","typeLabel":"number"},"settled_at":{"type":"number","uniqueKey":"data.results.items.[INDEX].order.settled_at","typeLabel":"number"},"canceled_at":{"type":"number","uniqueKey":"data.results.items.[INDEX].order.canceled_at","typeLabel":"number"}},"uniqueKey":"data.results.items.[INDEX].order","typeLabel":"object"},"failure_code":{"type":"string","uniqueKey":"data.results.items.[INDEX].failure_code","typeLabel":"string"},"rule_id":{"type":"string","uniqueKey":"data.results.items.[INDEX].rule_id","typeLabel":"string"}},"uniqueKey":"data.results.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"data.results","typeLabel":"object[]"},"created_at":{"type":"number","isRequired":true,"uniqueKey":"data.created_at","typeLabel":"number"},"completed_at":{"type":"number","uniqueKey":"data.completed_at","typeLabel":"number"}},"isRequired":true,"uniqueKey":"data","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"data":{"id":"\u003cstring>","operation":"close_all_positions","account_id":"\u003cstring>","status":"running","total_count":50,"succeeded_count":50,"failed_count":50,"results":[{"position_id":"\u003cstring>","status":"submitted","order":{"id":"\u003cstring>","account_id":"\u003cstring>","market_id":"\u003cstring>","provider":"\u003cstring>","symbol":"\u003cstring>","coin":"\u003cstring>","type":"market","mode":"market","side":"buy","size":123,"expected_price":123,"leverage":123,"margin_mode":"cross","reduce_only":true,"status":"pending","requested_at":123,"client_order_id":"\u003cstring>","initial_size":123,"filled_size":123,"fill_price":123,"trigger_price":123,"limit_price":123,"notional":123,"fee":123,"realized_pnl":123,"time_in_force":"gtc","gtd_expires_at":123,"attached_take_profit_price":123,"attached_stop_loss_price":123,"chase_offset":123,"chase_cap_price":123,"trigger_market_id":"\u003cstring>","trigger_direction":"above","triggered_at":123,"stop_triggered_at":123,"cancel_requested_at":123,"oco_sibling_order_id":"\u003cstring>","take_profit_order_id":"\u003cstring>","stop_loss_order_id":"\u003cstring>","parent_order_id":"\u003cstring>","bracket_role":"take_profit","target_position_id":"\u003cstring>","liquidity_role":"maker","partial_of_order_id":"\u003cstring>","partial_fill_root_order_id":"\u003cstring>","twap_order_id":"\u003cstring>","scaled_order_id":"\u003cstring>","reject_reason":"\u003cstring>","reject_rule_id":"\u003cstring>","cancel_reason":"\u003cstring>","position_side_after":"long","position_size_after":123,"settled_at":123,"canceled_at":123},"failure_code":"\u003cstring>","rule_id":"\u003cstring>"}],"created_at":123,"completed_at":123}}}},"exampleType":"generated"}},"exampleType":"generated"},"2c1b4619-eef6-43e3-811a-8d0ed0f0ab8c":{"description":"One close target or cooldown attempt completed. Retry with the same idempotency key after Retry-After.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","operation","account_id","status","total_count","succeeded_count","failed_count","results","created_at"],"properties":{"id":{"type":"string","isRequired":true,"uniqueKey":"data.id","typeLabel":"string"},"operation":{"type":"string","const":"close_all_positions","isRequired":true,"uniqueKey":"data.operation","typeLabel":"string"},"account_id":{"type":"string","isRequired":true,"uniqueKey":"data.account_id","typeLabel":"string"},"status":{"type":"string","enum":["running","completed"],"isRequired":true,"uniqueKey":"data.status","typeLabel":"enum\u003cstring>"},"total_count":{"type":"integer","minimum":0,"maximum":100,"isRequired":true,"uniqueKey":"data.total_count","typeLabel":"integer"},"succeeded_count":{"type":"integer","minimum":0,"maximum":100,"isRequired":true,"uniqueKey":"data.succeeded_count","typeLabel":"integer"},"failed_count":{"type":"integer","minimum":0,"maximum":100,"isRequired":true,"uniqueKey":"data.failed_count","typeLabel":"integer"},"results":{"type":"array","maxItems":100,"items":{"type":"object","required":["position_id","status"],"properties":{"position_id":{"type":"string","isRequired":true,"uniqueKey":"data.results.items.[INDEX].position_id","typeLabel":"string"},"status":{"type":"string","enum":["submitted","failed"],"isRequired":true,"uniqueKey":"data.results.items.[INDEX].status","typeLabel":"enum\u003cstring>"},"order":{"type":"object","required":["id","account_id","market_id","provider","symbol","coin","type","mode","side","size","expected_price","leverage","margin_mode","reduce_only","status","requested_at"],"properties":{"id":{"type":"string","isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.id","typeLabel":"string"},"account_id":{"type":"string","isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.account_id","typeLabel":"string"},"market_id":{"type":"string","isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.market_id","typeLabel":"string"},"provider":{"type":"string","isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.provider","typeLabel":"string"},"symbol":{"type":"string","isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.symbol","typeLabel":"string"},"coin":{"type":"string","isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.coin","typeLabel":"string"},"type":{"type":"string","enum":["market","limit","stop_market","stop_limit","take_market","take_limit","take_profit","liquidation","close_out"],"isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.type","typeLabel":"enum\u003cstring>"},"mode":{"type":"string","enum":["market","limit","chase","stop_market","stop_limit","take_market","take_limit","take_profit","conditional","liquidation","close_out"],"isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.mode","typeLabel":"enum\u003cstring>"},"side":{"type":"string","enum":["buy","sell"],"isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.side","typeLabel":"enum\u003cstring>"},"size":{"type":"number","description":"This order's quantity in base-asset units. On a filled order it is the executed quantity of that fill. On a working order that has partially filled, it is the remaining quantity.","isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.size","typeLabel":"number"},"expected_price":{"type":"number","isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.expected_price","typeLabel":"number"},"leverage":{"type":"number","isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.leverage","typeLabel":"number"},"margin_mode":{"type":"string","enum":["cross","isolated"],"isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.margin_mode","typeLabel":"enum\u003cstring>"},"reduce_only":{"type":"boolean","isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.reduce_only","typeLabel":"boolean"},"status":{"type":"string","enum":["pending","filled","rejected","expired","resting","canceled"],"isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.status","typeLabel":"enum\u003cstring>"},"requested_at":{"type":"number","isRequired":true,"uniqueKey":"data.results.items.[INDEX].order.requested_at","typeLabel":"number"},"client_order_id":{"type":"string","description":"Caller-assigned order identity, when supplied at placement.","uniqueKey":"data.results.items.[INDEX].order.client_order_id","typeLabel":"string"},"initial_size":{"type":"number","description":"Quantity originally requested when the order was placed. Read it with filled_size on the partial_fill_root_order_id order to track a partially filled placement's progress.","uniqueKey":"data.results.items.[INDEX].order.initial_size","typeLabel":"number"},"filled_size":{"type":"number","description":"Cumulative quantity filled by fragments split from this order, each of which appears as its own filled order with partial_fill_root_order_id set to this order. It stays 0 on an order that filled in one execution, so use size for a fill's executed quantity.","uniqueKey":"data.results.items.[INDEX].order.filled_size","typeLabel":"number"},"fill_price":{"type":"number","description":"On a filled order, the execution price of size.","uniqueKey":"data.results.items.[INDEX].order.fill_price","typeLabel":"number"},"trigger_price":{"type":"number","uniqueKey":"data.results.items.[INDEX].order.trigger_price","typeLabel":"number"},"limit_price":{"type":"number","uniqueKey":"data.results.items.[INDEX].order.limit_price","typeLabel":"number"},"notional":{"type":"number","description":"On a filled order, size multiplied by fill_price, in USD.","uniqueKey":"data.results.items.[INDEX].order.notional","typeLabel":"number"},"fee":{"type":"number","description":"Trading fee charged for this fill, in USD.","uniqueKey":"data.results.items.[INDEX].order.fee","typeLabel":"number"},"realized_pnl":{"type":"number","description":"P\u0026L realized by the portion of this fill that reduced or closed a position, in USD, before fee. 0 on a fill that only opened or increased a position.","uniqueKey":"data.results.items.[INDEX].order.realized_pnl","typeLabel":"number"},"time_in_force":{"type":"string","enum":["gtc","ioc","fok","gtd"],"uniqueKey":"data.results.items.[INDEX].order.time_in_force","typeLabel":"enum\u003cstring>"},"gtd_expires_at":{"type":"number","uniqueKey":"data.results.items.[INDEX].order.gtd_expires_at","typeLabel":"number"},"attached_take_profit_price":{"type":"number","uniqueKey":"data.results.items.[INDEX].order.attached_take_profit_price","typeLabel":"number"},"attached_stop_loss_price":{"type":"number","uniqueKey":"data.results.items.[INDEX].order.attached_stop_loss_price","typeLabel":"number"},"chase_offset":{"type":"number","uniqueKey":"data.results.items.[INDEX].order.chase_offset","typeLabel":"number"},"chase_cap_price":{"type":"number","uniqueKey":"data.results.items.[INDEX].order.chase_cap_price","typeLabel":"number"},"trigger_market_id":{"type":"string","uniqueKey":"data.results.items.[INDEX].order.trigger_market_id","typeLabel":"string"},"trigger_direction":{"type":"string","enum":["above","below"],"uniqueKey":"data.results.items.[INDEX].order.trigger_direction","typeLabel":"enum\u003cstring>"},"triggered_at":{"type":"number","description":"Millisecond timestamp of the most recent resting-to-pending execution attempt.","uniqueKey":"data.results.items.[INDEX].order.triggered_at","typeLabel":"number"},"stop_triggered_at":{"type":"number","description":"Millisecond timestamp when a conditional limit entered its limit leg. Absent while its trigger is still armed; once present it remains set.","uniqueKey":"data.results.items.[INDEX].order.stop_triggered_at","typeLabel":"number"},"cancel_requested_at":{"type":"number","description":"Millisecond timestamp of cancellation intent. An in-flight execution may still fill before cancellation settles.","uniqueKey":"data.results.items.[INDEX].order.cancel_requested_at","typeLabel":"number"},"oco_sibling_order_id":{"type":"string","description":"Paired TP or SL order. Fills retire matching size from the sibling; explicitly canceling one leg unlinks the survivor.","uniqueKey":"data.results.items.[INDEX].order.oco_sibling_order_id","typeLabel":"string"},"take_profit_order_id":{"type":"string","description":"On an entry with an attached take-profit, the exit order its fill created.","uniqueKey":"data.results.items.[INDEX].order.take_profit_order_id","typeLabel":"string"},"stop_loss_order_id":{"type":"string","description":"On an entry with an attached stop-loss, the exit order its fill created.","uniqueKey":"data.results.items.[INDEX].order.stop_loss_order_id","typeLabel":"string"},"parent_order_id":{"type":"string","description":"On an exit created by an entry's attached take-profit or stop-loss, the entry order that created it.","uniqueKey":"data.results.items.[INDEX].order.parent_order_id","typeLabel":"string"},"bracket_role":{"type":"string","enum":["take_profit","stop_loss"],"description":"Which attached exit this order is. Present together with parent_order_id.","uniqueKey":"data.results.items.[INDEX].order.bracket_role","typeLabel":"enum\u003cstring>"},"target_position_id":{"type":"string","uniqueKey":"data.results.items.[INDEX].order.target_position_id","typeLabel":"string"},"liquidity_role":{"type":"string","enum":["maker","taker"],"uniqueKey":"data.results.items.[INDEX].order.liquidity_role","typeLabel":"enum\u003cstring>"},"partial_of_order_id":{"type":"string","uniqueKey":"data.results.items.[INDEX].order.partial_of_order_id","typeLabel":"string"},"partial_fill_root_order_id":{"type":"string","uniqueKey":"data.results.items.[INDEX].order.partial_fill_root_order_id","typeLabel":"string"},"twap_order_id":{"type":"string","uniqueKey":"data.results.items.[INDEX].order.twap_order_id","typeLabel":"string"},"scaled_order_id":{"type":"string","uniqueKey":"data.results.items.[INDEX].order.scaled_order_id","typeLabel":"string"},"reject_reason":{"type":"string","uniqueKey":"data.results.items.[INDEX].order.reject_reason","typeLabel":"string"},"reject_rule_id":{"type":"string","uniqueKey":"data.results.items.[INDEX].order.reject_rule_id","typeLabel":"string"},"cancel_reason":{"type":"string","description":"Why a canceled order was canceled: user, oco, reduce_only, replaced, liquidation, expired, account_closed, trading_restricted, venue_policy, or copy. New values may be added. Absent on orders canceled before this field was added.","uniqueKey":"data.results.items.[INDEX].order.cancel_reason","typeLabel":"string"},"position_side_after":{"type":"string","enum":["long","short","flat"],"description":"On a filled order, the side of the account's position in this market after the fill.","uniqueKey":"data.results.items.[INDEX].order.position_side_after","typeLabel":"enum\u003cstring>"},"position_size_after":{"type":"number","description":"On a filled order, the size of the account's position in this market after the fill, in base-asset units. 0 when flat.","uniqueKey":"data.results.items.[INDEX].order.position_size_after","typeLabel":"number"},"settled_at":{"type":"number","uniqueKey":"data.results.items.[INDEX].order.settled_at","typeLabel":"number"},"canceled_at":{"type":"number","uniqueKey":"data.results.items.[INDEX].order.canceled_at","typeLabel":"number"}},"uniqueKey":"data.results.items.[INDEX].order","typeLabel":"object"},"failure_code":{"type":"string","uniqueKey":"data.results.items.[INDEX].failure_code","typeLabel":"string"},"rule_id":{"type":"string","uniqueKey":"data.results.items.[INDEX].rule_id","typeLabel":"string"}},"uniqueKey":"data.results.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"data.results","typeLabel":"object[]"},"created_at":{"type":"number","isRequired":true,"uniqueKey":"data.created_at","typeLabel":"number"},"completed_at":{"type":"number","uniqueKey":"data.completed_at","typeLabel":"number"}},"isRequired":true,"uniqueKey":"data","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"data":{"id":"\u003cstring>","operation":"close_all_positions","account_id":"\u003cstring>","status":"running","total_count":50,"succeeded_count":50,"failed_count":50,"results":[{"position_id":"\u003cstring>","status":"submitted","order":{"id":"\u003cstring>","account_id":"\u003cstring>","market_id":"\u003cstring>","provider":"\u003cstring>","symbol":"\u003cstring>","coin":"\u003cstring>","type":"market","mode":"market","side":"buy","size":123,"expected_price":123,"leverage":123,"margin_mode":"cross","reduce_only":true,"status":"pending","requested_at":123,"client_order_id":"\u003cstring>","initial_size":123,"filled_size":123,"fill_price":123,"trigger_price":123,"limit_price":123,"notional":123,"fee":123,"realized_pnl":123,"time_in_force":"gtc","gtd_expires_at":123,"attached_take_profit_price":123,"attached_stop_loss_price":123,"chase_offset":123,"chase_cap_price":123,"trigger_market_id":"\u003cstring>","trigger_direction":"above","triggered_at":123,"stop_triggered_at":123,"cancel_requested_at":123,"oco_sibling_order_id":"\u003cstring>","take_profit_order_id":"\u003cstring>","stop_loss_order_id":"\u003cstring>","parent_order_id":"\u003cstring>","bracket_role":"take_profit","target_position_id":"\u003cstring>","liquidity_role":"maker","partial_of_order_id":"\u003cstring>","partial_fill_root_order_id":"\u003cstring>","twap_order_id":"\u003cstring>","scaled_order_id":"\u003cstring>","reject_reason":"\u003cstring>","reject_rule_id":"\u003cstring>","cancel_reason":"\u003cstring>","position_side_after":"long","position_size_after":123,"settled_at":123,"canceled_at":123},"failure_code":"\u003cstring>","rule_id":"\u003cstring>"}],"created_at":123,"completed_at":123}}}},"exampleType":"generated"}},"exampleType":"generated"},"1c1805b3-5356-4e7c-a35c-62b3db35a6dd":{"description":"Invalid request. Validation failures list every offending field in `error.details`.","headers":{"X-Request-Id":{"description":"Stable identifier for support and log correlation.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","request_id"],"properties":{"code":{"type":"string","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"request_id":{"type":"string","format":"uuid","isRequired":true,"uniqueKey":"error.request_id","typeLabel":"string\u003cuuid>"},"details":{"type":"array","description":"Present on request-validation failures, with one entry per invalid field so a request can be fixed in one pass.","items":{"type":"object","required":["field","issue"],"properties":{"field":{"type":"string","description":"Wire name of the offending request field, such as `size` or `operations[2].price`. The value `body` refers to the whole payload.","isRequired":true,"uniqueKey":"error.details.items.[INDEX].field","typeLabel":"string"},"issue":{"type":"string","isRequired":true,"uniqueKey":"error.details.items.[INDEX].issue","typeLabel":"string"}},"uniqueKey":"error.details.items.[INDEX]","typeLabel":"object"},"uniqueKey":"error.details","typeLabel":"object[]"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"\u003cstring>","message":"\u003cstring>","request_id":"3c90c3cc-0d44-4b50-8888-8dd25736052a","details":[{"field":"\u003cstring>","issue":"\u003cstring>"}]}}}},"exampleType":"generated"}},"exampleType":"generated"},"a7046342-5724-42bf-bc2c-297d423c7433":{"description":"Missing, invalid, or revoked API key.","headers":{"WWW-Authenticate":{"schema":{"type":"string"}},"X-Request-Id":{"description":"Stable identifier for support and log correlation.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","request_id"],"properties":{"code":{"type":"string","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"request_id":{"type":"string","format":"uuid","isRequired":true,"uniqueKey":"error.request_id","typeLabel":"string\u003cuuid>"},"details":{"type":"array","description":"Present on request-validation failures, with one entry per invalid field so a request can be fixed in one pass.","items":{"type":"object","required":["field","issue"],"properties":{"field":{"type":"string","description":"Wire name of the offending request field, such as `size` or `operations[2].price`. The value `body` refers to the whole payload.","isRequired":true,"uniqueKey":"error.details.items.[INDEX].field","typeLabel":"string"},"issue":{"type":"string","isRequired":true,"uniqueKey":"error.details.items.[INDEX].issue","typeLabel":"string"}},"uniqueKey":"error.details.items.[INDEX]","typeLabel":"object"},"uniqueKey":"error.details","typeLabel":"object[]"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"\u003cstring>","message":"\u003cstring>","request_id":"3c90c3cc-0d44-4b50-8888-8dd25736052a","details":[{"field":"\u003cstring>","issue":"\u003cstring>"}]}}}},"exampleType":"generated"}},"exampleType":"generated"},"dc15d56c-b7f9-4fbe-b2f8-c3b16858dee0":{"description":"The API key is valid but does not allow this operation.","headers":{"X-Request-Id":{"description":"Stable identifier for support and log correlation.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","request_id"],"properties":{"code":{"type":"string","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"request_id":{"type":"string","format":"uuid","isRequired":true,"uniqueKey":"error.request_id","typeLabel":"string\u003cuuid>"},"details":{"type":"array","description":"Present on request-validation failures, with one entry per invalid field so a request can be fixed in one pass.","items":{"type":"object","required":["field","issue"],"properties":{"field":{"type":"string","description":"Wire name of the offending request field, such as `size` or `operations[2].price`. The value `body` refers to the whole payload.","isRequired":true,"uniqueKey":"error.details.items.[INDEX].field","typeLabel":"string"},"issue":{"type":"string","isRequired":true,"uniqueKey":"error.details.items.[INDEX].issue","typeLabel":"string"}},"uniqueKey":"error.details.items.[INDEX]","typeLabel":"object"},"uniqueKey":"error.details","typeLabel":"object[]"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"\u003cstring>","message":"\u003cstring>","request_id":"3c90c3cc-0d44-4b50-8888-8dd25736052a","details":[{"field":"\u003cstring>","issue":"\u003cstring>"}]}}}},"exampleType":"generated"}},"exampleType":"generated"},"87a34375-9fa0-43a2-9c36-81d0cf9573b4":{"description":"Resource not found or not owned by the authenticated user.","headers":{"X-Request-Id":{"description":"Stable identifier for support and log correlation.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","request_id"],"properties":{"code":{"type":"string","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"request_id":{"type":"string","format":"uuid","isRequired":true,"uniqueKey":"error.request_id","typeLabel":"string\u003cuuid>"},"details":{"type":"array","description":"Present on request-validation failures, with one entry per invalid field so a request can be fixed in one pass.","items":{"type":"object","required":["field","issue"],"properties":{"field":{"type":"string","description":"Wire name of the offending request field, such as `size` or `operations[2].price`. The value `body` refers to the whole payload.","isRequired":true,"uniqueKey":"error.details.items.[INDEX].field","typeLabel":"string"},"issue":{"type":"string","isRequired":true,"uniqueKey":"error.details.items.[INDEX].issue","typeLabel":"string"}},"uniqueKey":"error.details.items.[INDEX]","typeLabel":"object"},"uniqueKey":"error.details","typeLabel":"object[]"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"\u003cstring>","message":"\u003cstring>","request_id":"3c90c3cc-0d44-4b50-8888-8dd25736052a","details":[{"field":"\u003cstring>","issue":"\u003cstring>"}]}}}},"exampleType":"generated"}},"exampleType":"generated"},"ca130cc4-df76-45ef-b050-77e49189bad1":{"description":"The request conflicts with current state, an idempotency record, or a client order ID.","headers":{"X-Request-Id":{"description":"Stable identifier for support and log correlation.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","request_id"],"properties":{"code":{"type":"string","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"request_id":{"type":"string","format":"uuid","isRequired":true,"uniqueKey":"error.request_id","typeLabel":"string\u003cuuid>"},"details":{"type":"array","description":"Present on request-validation failures, with one entry per invalid field so a request can be fixed in one pass.","items":{"type":"object","required":["field","issue"],"properties":{"field":{"type":"string","description":"Wire name of the offending request field, such as `size` or `operations[2].price`. The value `body` refers to the whole payload.","isRequired":true,"uniqueKey":"error.details.items.[INDEX].field","typeLabel":"string"},"issue":{"type":"string","isRequired":true,"uniqueKey":"error.details.items.[INDEX].issue","typeLabel":"string"}},"uniqueKey":"error.details.items.[INDEX]","typeLabel":"object"},"uniqueKey":"error.details","typeLabel":"object[]"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"\u003cstring>","message":"\u003cstring>","request_id":"3c90c3cc-0d44-4b50-8888-8dd25736052a","details":[{"field":"\u003cstring>","issue":"\u003cstring>"}]}}}},"exampleType":"generated"}},"exampleType":"generated"},"c136333b-79b3-4b5c-bb34-f9478b065554":{"description":"The per-IP request limit or an account-wide operation budget is exhausted.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer","minimum":1}},"X-Request-Id":{"description":"Stable identifier for support and log correlation.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","request_id"],"properties":{"code":{"type":"string","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"request_id":{"type":"string","format":"uuid","isRequired":true,"uniqueKey":"error.request_id","typeLabel":"string\u003cuuid>"},"details":{"type":"array","description":"Present on request-validation failures, with one entry per invalid field so a request can be fixed in one pass.","items":{"type":"object","required":["field","issue"],"properties":{"field":{"type":"string","description":"Wire name of the offending request field, such as `size` or `operations[2].price`. The value `body` refers to the whole payload.","isRequired":true,"uniqueKey":"error.details.items.[INDEX].field","typeLabel":"string"},"issue":{"type":"string","isRequired":true,"uniqueKey":"error.details.items.[INDEX].issue","typeLabel":"string"}},"uniqueKey":"error.details.items.[INDEX]","typeLabel":"object"},"uniqueKey":"error.details","typeLabel":"object[]"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"\u003cstring>","message":"\u003cstring>","request_id":"3c90c3cc-0d44-4b50-8888-8dd25736052a","details":[{"field":"\u003cstring>","issue":"\u003cstring>"}]}}}},"exampleType":"generated"}},"exampleType":"generated"},"2ced2077-29c8-4152-838f-b15b317bd062":{"description":"A complete bounded open-position snapshot is temporarily unavailable.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","request_id"],"properties":{"code":{"type":"string","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"request_id":{"type":"string","format":"uuid","isRequired":true,"uniqueKey":"error.request_id","typeLabel":"string\u003cuuid>"},"details":{"type":"array","description":"Present on request-validation failures, with one entry per invalid field so a request can be fixed in one pass.","items":{"type":"object","required":["field","issue"],"properties":{"field":{"type":"string","description":"Wire name of the offending request field, such as `size` or `operations[2].price`. The value `body` refers to the whole payload.","isRequired":true,"uniqueKey":"error.details.items.[INDEX].field","typeLabel":"string"},"issue":{"type":"string","isRequired":true,"uniqueKey":"error.details.items.[INDEX].issue","typeLabel":"string"}},"uniqueKey":"error.details.items.[INDEX]","typeLabel":"object"},"uniqueKey":"error.details","typeLabel":"object[]"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"\u003cstring>","message":"\u003cstring>","request_id":"3c90c3cc-0d44-4b50-8888-8dd25736052a","details":[{"field":"\u003cstring>","issue":"\u003cstring>"}]}}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"fcd3d2ac-ab78-48dc-85b7-d9c96875d7e0":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"MyFundedPerps API key","description":"API key beginning with `fp_live_` (live keys, served at developers.myfundedperpetuals.com) or `fp_test_` (test keys, served at sandbox.myfundedperpetuals.com). A key presented on the other host is rejected with `401` and a message naming the correct host.","scopes":[],"schemeName":"bearerAuth"}}},"servers":{"0bce700c-8f47-4d28-93c4-8c6a54f774e1":{"url":"https://developers.myfundedperpetuals.com","description":"Live"},"2fbded66-8dd6-4643-8b01-0e3f9d2ff197":{"url":"https://sandbox.myfundedperpetuals.com","description":"Sandbox (test keys and sandbox accounts only)"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","bearerFormat":"MyFundedPerps API key","description":"API key beginning with `fp_live_` (live keys, served at developers.myfundedperpetuals.com) or `fp_test_` (test keys, served at sandbox.myfundedperpetuals.com). A key presented on the other host is rejected with `401` and a message naming the correct host.","scopes":[],"schemeName":"bearerAuth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"API key beginning with `fp_live_` (live keys, served at developers.myfundedperpetuals.com) or `fp_test_` (test keys, served at sandbox.myfundedperpetuals.com). A key presented on the other host is rejected with `401` and a message naming the correct host.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"}]},"originalFileLocation":"openapi.yaml"},"subdomain":"my-funded-perps","siteName":"MyFundedPerps Documentation","title":"Close all open positions - MyFundedPerps Documentation","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-24T23:54:12.685Z","originalFileLocation":"api-reference/accounts/close-all-open-positions.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Takes one bounded snapshot of every open position and submits one reduce-only market close for each target. Closes use the same 2.5% maximum-slippage policy as Close All in the trading terminal. The response reports each submitted or rejected child order. Repeating the request with the same idempotency key resumes or replays the original snapshot, even when positions have since closed.\">\u003cmeta data-mint-head name=\"application-name\" content=\"MyFundedPerps Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/my-funded-perps/REd-2uzEhUdc4sEx/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/my-funded-perps/REd-2uzEhUdc4sEx/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/my-funded-perps/REd-2uzEhUdc4sEx/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/my-funded-perps/REd-2uzEhUdc4sEx/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/my-funded-perps/REd-2uzEhUdc4sEx/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/my-funded-perps/REd-2uzEhUdc4sEx/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/my-funded-perps/REd-2uzEhUdc4sEx/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/my-funded-perps/REd-2uzEhUdc4sEx/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/my-funded-perps/REd-2uzEhUdc4sEx/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Close all open positions - MyFundedPerps Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Takes one bounded snapshot of every open position and submits one reduce-only market close for each target. Closes use the same 2.5% maximum-slippage policy as Close All in the trading terminal. The response reports each submitted or rejected child order. Repeating the request with the same idempotency key resumes or replays the original snapshot, even when positions have since closed.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"MyFundedPerps Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.myfundedperpetuals.com/api-reference/accounts/close-all-open-positions\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://my-funded-perps.mintlify.app/_mintlify/api/og/v2?division=Accounts\u0026amp;title=Close+all+open+positions\u0026amp;description=Takes+one+bounded+snapshot+of+every+open+position+and+submits+one+reduce-only+market+close+for+each+target.+Closes+use+the+same+2.5%25+maximum-slippage+policy+as+\u0026amp;theme=94835aa0e5a522f6511ee5ac\u0026amp;signature=dda895f79de81f8dcc965fc48175fab6d798edf4c219d3bdcca482e21d67fee3\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Close all open positions - MyFundedPerps Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Takes one bounded snapshot of every open position and submits one reduce-only market close for each target. Closes use the same 2.5% maximum-slippage policy as Close All in the trading terminal. The response reports each submitted or rejected child order. Repeating the request with the same idempotency key resumes or replays the original snapshot, even when positions have since closed.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://my-funded-perps.mintlify.app/_mintlify/api/og/v2?division=Accounts\u0026amp;title=Close+all+open+positions\u0026amp;description=Takes+one+bounded+snapshot+of+every+open+position+and+submits+one+reduce-only+market+close+for+each+target.+Closes+use+the+same+2.5%25+maximum-slippage+policy+as+\u0026amp;theme=94835aa0e5a522f6511ee5ac\u0026amp;signature=dda895f79de81f8dcc965fc48175fab6d798edf4c219d3bdcca482e21d67fee3\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/my-funded-perps/REd-2uzEhUdc4sEx/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"MyFundedPerps Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#1FA66D\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.myfundedperpetuals.com/api-reference/accounts/close-all-open-positions\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/accounts/close-all-open-positions.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://myfundedperpetuals.com/#organization\",\"name\":\"MyFundedPerps\",\"url\":\"https://myfundedperpetuals.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/my-funded-perps/4fIdVX54Kxh8hflY/logo-light.svg?fit=max\u0026auto=format\u0026n=4fIdVX54Kxh8hflY\u0026q=85\u0026s=cebe735a42f06ca5d2e4b567f53ed8af\"},\"sameAs\":[\"https://x.com/MyFundedPerps\",\"https://www.instagram.com/myfundedperps_/\",\"https://github.com/MyFundedPerps\"]},{\"@type\":\"WebSite\",\"@id\":\"https://docs.myfundedperpetuals.com#website\",\"name\":\"MyFundedPerps Documentation\",\"url\":\"https://docs.myfundedperpetuals.com\",\"publisher\":{\"@id\":\"https://myfundedperpetuals.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.myfundedperpetuals.com/api-reference/accounts/close-all-open-positions#webpage\",\"url\":\"https://docs.myfundedperpetuals.com/api-reference/accounts/close-all-open-positions\",\"name\":\"Close all open positions\",\"description\":\"Takes one bounded snapshot of every open position and submits one reduce-only market close for each target. Closes use the same 2.5% maximum-slippage policy as Close All in the trading terminal. The response reports each submitted or rejected child order. Repeating the request with the same idempotency key resumes or replays the original snapshot, even when positions have since closed.\",\"dateModified\":\"2026-10-24T23:54:12.685Z\",\"isPartOf\":{\"@id\":\"https://docs.myfundedperpetuals.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.myfundedperpetuals.com/api-reference/accounts/close-all-open-positions#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.myfundedperpetuals.com/api-reference/accounts/close-all-open-positions#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"REST Reference\",\"item\":\"https://docs.myfundedperpetuals.com/api-reference\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Accounts\",\"item\":\"https://docs.myfundedperpetuals.com/api-reference/accounts/list-visible-copy-trading-groups\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Close all open positions\",\"item\":\"https://docs.myfundedperpetuals.com/api-reference/accounts/close-all-open-positions\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.myfundedperpetuals.com/api-reference/accounts/close-all-open-positions#apireference\",\"headline\":\"Close all open positions\",\"name\":\"Close all open positions\",\"description\":\"Takes one bounded snapshot of every open position and submits one reduce-only market close for each target. Closes use the same 2.5% maximum-slippage policy as Close All in the trading terminal. The response reports each submitted or rejected child order. Repeating the request with the same idempotency key resumes or replays the original snapshot, even when positions have since closed.\",\"url\":\"https://docs.myfundedperpetuals.com/api-reference/accounts/close-all-open-positions\",\"mainEntityOfPage\":{\"@id\":\"https://docs.myfundedperpetuals.com/api-reference/accounts/close-all-open-positions#webpage\"},\"dateModified\":\"2026-10-24T23:54:12.685Z\",\"publisher\":{\"@id\":\"https://myfundedperpetuals.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.myfundedperpetuals.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"MyFundedPerps Documentation\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"MyFundedPerps Documentation","nav":{"global":null,"tabs":[{"tab":"Buyers Guide","pages":[{"title":"Buyers Guide","href":""}]},{"tab":"Developers Guide","groups":[{"group":"Developer API (Beta)","pages":[{"title":"Quickstart","href":"/quickstart"},{"title":"API capabilities","href":"/api-capabilities"},{"title":"Command-Line Interface","href":"/cli"},{"title":"MCP Server","href":"/mcp-server"},{"title":"Trading with the API","href":"/trading-with-api"},{"title":"Account trading policy","href":"/trading-policy"},{"title":"Market data streaming","href":"/market-streaming"},{"title":"Account streaming","href":"/account-streaming"},{"title":"Authentication","href":"/authentication"},{"title":"Sandbox and test keys","href":"/sandbox"},{"title":"Idempotency","href":"/idempotency"},{"title":"Pagination","href":"/pagination"},{"title":"Errors and Rate Limits","href":"/errors-and-rate-limits"}]},{"group":"REST Reference","pages":[{"title":"API Reference","href":"/api-reference"},{"group":"Accounts","pages":[{"title":"List visible copy trading groups","deprecated":null,"version":null,"openapi":"/openapi.yaml get /v1/copy-trading","href":"/api-reference/accounts/list-visible-copy-trading-groups"},{"title":"Save copy trading groups","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/copy-trading","href":"/api-reference/accounts/save-copy-trading-groups"},{"title":"Disable a copy trading group","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/copy-trading/{config_id}/disable","href":"/api-reference/accounts/disable-a-copy-trading-group"},{"title":"Acknowledge a completed copy stop","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/accounts/{account_id}/acknowledge-copy-stop","href":"/api-reference/accounts/acknowledge-a-completed-copy-stop"},{"title":"List challenge accounts","deprecated":null,"version":null,"openapi":"/openapi.yaml get /v1/accounts","href":"/api-reference/accounts/list-challenge-accounts"},{"title":"Get a challenge account","deprecated":null,"version":null,"openapi":"/openapi.yaml get /v1/accounts/{account_id}","href":"/api-reference/accounts/get-a-challenge-account"},{"title":"Get effective account trading policy","deprecated":null,"version":null,"openapi":"/openapi.yaml get /v1/accounts/{account_id}/trading-policy","href":"/api-reference/accounts/get-effective-account-trading-policy"},{"title":"Cancel all working orders","description":"Takes one bounded snapshot of the account's ordinary resting orders and armed trigger orders, then cancels or queues cancellation for every target. In-flight market orders and TWAP, VWAP, or scaled parent orders are not included. Repeating the request with the same idempotency key resumes or replays the original snapshot.","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/accounts/{account_id}/cancel-all-orders","href":"/api-reference/accounts/cancel-all-working-orders"},{"title":"Close all open positions","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/accounts/{account_id}/close-all-positions","href":"/api-reference/accounts/close-all-open-positions"}]},{"group":"General","pages":[{"title":"Get API information","description":null,"deprecated":null,"version":null,"openapi":"/openapi.yaml get /v1","href":"/api-reference/general/get-api-information"},{"title":"List restricted countries","deprecated":null,"version":null,"openapi":"/openapi.yaml get /v1/restricted-countries","href":"/api-reference/general/list-restricted-countries"}]},{"group":"Authentication","pages":[{"title":"Exchange a CLI authorization code","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/auth/cli/token","href":"/api-reference/authentication/exchange-a-cli-authorization-code"},{"title":"Revoke the presented CLI session","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/auth/cli/revoke","href":"/api-reference/authentication/revoke-the-presented-cli-session"}]},{"group":"Markets","pages":[{"title":"List tradable markets","deprecated":null,"version":null,"openapi":"/openapi.yaml get /v1/markets","href":"/api-reference/markets/list-tradable-markets"},{"title":"Get a tradable market","deprecated":null,"version":null,"openapi":"/openapi.yaml get /v1/markets/{market_id}","href":"/api-reference/markets/get-a-tradable-market"},{"title":"Get an execution quote","deprecated":null,"version":null,"openapi":"/openapi.yaml get /v1/markets/{market_id}/quote","href":"/api-reference/markets/get-an-execution-quote"}]},{"group":"Positions","pages":[{"title":"List open positions","deprecated":null,"version":null,"openapi":"/openapi.yaml get /v1/positions","href":"/api-reference/positions/list-open-positions"},{"title":"Get a position","deprecated":null,"version":null,"openapi":"/openapi.yaml get /v1/positions/{position_id}","href":"/api-reference/positions/get-a-position"},{"title":"Close part or all of a position","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/positions/{position_id}/close","href":"/api-reference/positions/close-part-or-all-of-a-position"},{"title":"Atomically update position TP/SL orders","deprecated":null,"version":null,"openapi":"/openapi.yaml put /v1/positions/{position_id}/exit-orders","href":"/api-reference/positions/atomically-update-position-tpsl-orders"},{"title":"Set the position's extra isolated margin","deprecated":null,"version":null,"openapi":"/openapi.yaml put /v1/positions/{position_id}/isolated-margin","href":"/api-reference/positions/set-the-positions-extra-isolated-margin"}]},{"group":"Orders","pages":[{"title":"List recent orders","deprecated":null,"version":null,"openapi":"/openapi.yaml get /v1/orders","href":"/api-reference/orders/list-recent-orders"},{"title":"Place a standard or advanced order","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/orders","href":"/api-reference/orders/place-a-standard-or-advanced-order"},{"title":"Get an order","deprecated":null,"version":null,"openapi":"/openapi.yaml get /v1/orders/{order_id}","href":"/api-reference/orders/get-an-order"},{"title":"Cancel a working order","deprecated":null,"version":null,"openapi":"/openapi.yaml delete /v1/orders/{order_id}","href":"/api-reference/orders/cancel-a-working-order"},{"title":"Modify a working order","deprecated":null,"version":null,"openapi":"/openapi.yaml patch /v1/orders/{order_id}","href":"/api-reference/orders/modify-a-working-order"},{"title":"Update TP/SL attached to a resting limit or stop entry","deprecated":null,"version":null,"openapi":"/openapi.yaml put /v1/orders/{order_id}/attached-exits","href":"/api-reference/orders/update-tpsl-attached-to-a-resting-limit-or-stop-entry"}]},{"group":"Fills","pages":[{"title":"List fills in settlement order","deprecated":null,"version":null,"openapi":"/openapi.yaml get /v1/fills","href":"/api-reference/fills/list-fills-in-settlement-order"}]},{"group":"Strategy Orders","pages":[{"title":"List active or historical TWAP and VWAP orders","deprecated":null,"version":null,"openapi":"/openapi.yaml get /v1/twap-orders","href":"/api-reference/strategy-orders/list-active-or-historical-twap-and-vwap-orders"},{"title":"Create a TWAP or VWAP order","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/twap-orders","href":"/api-reference/strategy-orders/create-a-twap-or-vwap-order"},{"title":"Get a TWAP or VWAP order","deprecated":null,"version":null,"openapi":"/openapi.yaml get /v1/twap-orders/{twap_order_id}","href":"/api-reference/strategy-orders/get-a-twap-or-vwap-order"},{"title":"Stop future TWAP or VWAP slices","deprecated":null,"version":null,"openapi":"/openapi.yaml delete /v1/twap-orders/{twap_order_id}","href":"/api-reference/strategy-orders/stop-future-twap-or-vwap-slices"},{"title":"List scaled-order parents","deprecated":null,"version":null,"openapi":"/openapi.yaml get /v1/scaled-orders","href":"/api-reference/strategy-orders/list-scaled-order-parents"},{"title":"Create a scaled price ladder","deprecated":null,"version":null,"openapi":"/openapi.yaml post /v1/scaled-orders","href":"/api-reference/strategy-orders/create-a-scaled-price-ladder"},{"title":"Get a scaled order and its rungs","deprecated":null,"version":null,"openapi":"/openapi.yaml get /v1/scaled-orders/{scaled_order_id}","href":"/api-reference/strategy-orders/get-a-scaled-order-and-its-rungs"},{"title":"Cancel a scaled order and its working rungs","deprecated":null,"version":null,"openapi":"/openapi.yaml delete /v1/scaled-orders/{scaled_order_id}","href":"/api-reference/strategy-orders/cancel-a-scaled-order-and-its-working-rungs"}]}]}]}]},"title":"Close all open positions - MyFundedPerps Documentation","buildId":"dpl_cadrRc5H9XQiJQbDFN5mcYRs2PAj","deploymentId":"dpl_cadrRc5H9XQiJQbDFN5mcYRs2PAj","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-DKJwRUt2.js","utils-CWD_VS3u.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-oFjciODD.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-C76WsxC3.js","snippetPresets-DvPMxpX_.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-CuNQfndH.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-BVFpVUoF.js","shallow-t59Jg5Kr.js","getApiPlaygroundDisplay-C_JZ4amX.js","CodeSnippet-CLRDnx_h.js","CodeSnippets-C2myU4kc.js","Page-7TwLLapg.js","getPastedJson-B-JaVXw7.js","icon-BA-iDhH3.js","MethodPill-D4qZABFp.js","DuplicateIcon-THIDKO1O.js","createIcon-CYYJwgFd.js","DynamicMarkdown-UGQuxDKp.js","SectionHeading-jYELb23h.js","axios-vUo_bRtp.js","Markdown-DKsLa3wy.js","clsx-CefdjKz2.js","lib--scc4DXi.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-BaREnp3o.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-sgx_0XzF.js"]}