The same sweep is available over WebSocket as cancelAllOrders on the Order Management Stream, so capital can be released from whichever connection is still up. See Releasing Capital on Disconnect for when to use which.
Open orders the sweep did not queue a cancel for. Present only when the queue refused part-way.
Show child attributes
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Rails Trading Developer API Documentation","colors":{"primary":"#0D9373","light":"#07C983","dark":"#0D9373"},"logo":{"light":"https://mintcdn.com/railsxyz/XTasO28fw_2bd6Tp/logo/light.svg?fit=max\u0026auto=format\u0026n=XTasO28fw_2bd6Tp\u0026q=85\u0026s=562d1517f28bb695fb280b18dd4310a4","dark":"https://mintcdn.com/railsxyz/XTasO28fw_2bd6Tp/logo/dark.svg?fit=max\u0026auto=format\u0026n=XTasO28fw_2bd6Tp\u0026q=85\u0026s=2dc52a8a93c85cb2edae7edc4f009831"},"favicon":"https://mintcdn.com/railsxyz/XTasO28fw_2bd6Tp/favicon.svg?fit=max\u0026auto=format\u0026n=XTasO28fw_2bd6Tp\u0026q=85\u0026s=508a9eb467ddd29d6d1034598ada1654","api":{"openapi":["latest/openapi/auth.json","latest/perps/openapi/account.json","latest/perps/openapi/order.json","latest/perps/openapi/market.json","latest/options/openapi/options.json","latest/options/openapi/matching.json"],"asyncapi":["latest/perps/asyncapi/perps-ws.yaml","latest/perps/asyncapi/test-public-stream.yaml","latest/perps/asyncapi/test-authenticated-stream.yaml","latest/options/asyncapi/options-ws.yaml"]},"navbar":{"links":[{"href":"https://help.rails.xyz/","label":"Support"}]},"footer":{"socials":{"website":"https://rails.xyz/","twitter":"https://twitter.com/rails_xyz","linkedin":"https://www.linkedin.com/company/railsxyz"}},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"railsxyz","hasAudioNarration":false,"actualSubdomain":"railsxyz","customDomains":["docs.rails.xyz"],"gitSource":{"type":"github","owner":"rails-xyz","repo":"api-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae36fd43a4fef2dda4dde4e","collectionId":"e2ab590b-e599-4c8f-9f05-825300a7e383","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae36fd43a4fef2dda4dde4e"},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae36fd43a4fef2dda4dde4e","clientVersion":"0.0.4044","searchFilterCounts":[{"language":"default","tag":"Options","count":44},{"language":"default","tag":"Perpetuals","count":42},{"language":"default","tag":"HTTP API Reference","count":29},{"language":"default","tag":"Get Started","count":25},{"language":"default","tag":"Guides","count":24},{"language":"default","tag":"WebSocket API Reference","count":18},{"language":"default","tag":"User Account","count":10},{"language":"default","tag":"Go SDK","count":9},{"language":"default","tag":"Formulas","count":9},{"language":"default","tag":"Market Data","count":7}]},"assistantConfig":{},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"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":"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":"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":"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":"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":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","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":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","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},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"custom.css","content":".flex.flex-col.gap-8:not(.isolate)+#pagination{margin-top:3.5rem}.bindings-schema [title=expiration] [data-component-part=field-required-pill],.bindings-schema [title=sessionId] [data-component-part=field-required-pill],.bindings-schema [title=strike] [data-component-part=field-required-pill],.bindings-schema [title=type] [data-component-part=field-required-pill],[data-testid=api-playground-modal] [title=expiration] [data-component-part=field-required-pill],[data-testid=api-playground-modal] [title=sessionId] [data-component-part=field-required-pill],[data-testid=api-playground-modal] [title=strike] [data-component-part=field-required-pill],[data-testid=api-playground-modal] [title=type] [data-component-part=field-required-pill]{display:none!important}@media (prefers-color-scheme:dark){[data-main-title]{color:#f0f0f0!important}[data-subtitle]{color:#d0d0d0!important}[data-quickstart-title]{color:#f0f0f0!important}[data-card]{background:#1f1f1f!important;border-color:#3f3f3f!important}[data-card]:hover{border-color:#0d9373!important;box-shadow:0 4px 16px rgba(13,147,115,.3)!important}[data-card-title],[data-card]{color:#f0f0f0!important}[data-card-desc]{color:#d0d0d0!important}[data-card-icon]{background:#1f1f1f!important}}.dark [data-main-title]{color:#f0f0f0!important}.dark [data-subtitle]{color:#d0d0d0!important}.dark [data-quickstart-title]{color:#f0f0f0!important}.dark [data-card]{background:#1f1f1f!important;border-color:#3f3f3f!important}.dark [data-card]:hover{border-color:#0d9373!important;box-shadow:0 4px 16px rgba(13,147,115,.3)!important}.dark [data-card-title],.dark [data-card]{color:#f0f0f0!important}.dark [data-card-desc]{color:#d0d0d0!important}.dark [data-card-icon]{background:#1f1f1f!important}.dark [data-install-copy],.dark [data-install]{border-color:#3f3f3f!important;color:#f0f0f0!important}.dark [data-install]{background:#1f1f1f!important}.dark [data-install-copy]{background:#2a2a2a!important}.dark [data-install] a{color:#07c983!important}"}],"page":{"pagePath":"latest/options/rest-api/cancel-all-orders","slug":"/latest/options/rest-api/cancel-all-orders","pageMetadata":{"title":"Cancel All Orders","description":"Queue a cancel for every open order, or every open order in one contract.","openapi":"POST /v1/matching/orders/cancel-all","href":"/latest/options/rest-api/cancel-all-orders"},"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: \"Queue a cancel for every open order, or every open order in one contract.\"\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{jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,..._provideComponents(),...props.components};return _jsxs(_components.p,{children:[`The same sweep is available over WebSocket as `,_jsx(_components.code,{children:`cancelAllOrders`}),` on the `,_jsx(_components.a,{href:`/latest/options/websocket-api/order-management-stream`,children:`Order Management Stream`}),`, so capital can be released from whichever connection is still up. See `,_jsx(_components.a,{href:`/latest/websocket-session#releasing-capital-on-disconnect`,children:`Releasing Capital on Disconnect`}),` for when to use which.`]})}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":"Cancel All Orders","description":"Queue a cancel for every open order, or every open order in one contract.","openapi":"POST /v1/matching/orders/cancel-all","href":"/latest/options/rest-api/cancel-all-orders"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"summary":"Cancel All Orders","operationId":"cancelAllOptionsOrders","description":"Queue a cancel for every open order, or every open order in one contract.","requestBody":"f3f1e956-87d3-418a-b196-3d90b61bf284","responses":{"202":"de546794-4d5b-4589-852d-567ae6fad6ee","400":"354ce791-f88b-444e-aa91-e029e54b4208","401":"3af3e644-6380-49a9-b7da-77eebd740131","403":"51932b14-c36b-4a05-a078-32ee7724a11c","429":"6e91bc0e-7b08-46bf-bc12-23358aa9d24d","502":"5cd003fe-c445-4558-b638-050a1f3ad90f","504":"aa439f8e-55e6-4931-8bf0-e46f6bbe3a29"},"method":"post","type":"path","servers":["b319409d-8041-4b70-9b27-a4b04576f069"],"security":["debb604f-ea80-444c-84a1-2f3901a06269"],"path":"/v1/matching/orders/cancel-all","baseUrlOptions":["https://api-options.sandbox.rails.xyz"],"title":"Cancel All Orders","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"clientRequestId":{"type":"string","format":"uuid","x-go-type":"string","description":"Client-generated UUID for correlation.","uniqueKey":"clientRequestId","typeLabel":"string\u003cuuid>"},"contract":{"type":"string","description":"Contract name. Omit to cancel every open order.","uniqueKey":"contract","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"example":{"clientRequestId":"c0a0d2d0-6b1e-4f3a-8d2b-5e7f9a1b2c3d","contract":"BTC-7FEB26-100000-C"},"examples":{"Example":{"title":"Example","value":{"clientRequestId":"c0a0d2d0-6b1e-4f3a-8d2b-5e7f9a1b2c3d","contract":"BTC-7FEB26-100000-C"}}},"exampleType":"examples"}},"exampleType":"examples"},"responses":{"de546794-4d5b-4589-852d-567ae6fad6ee":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"string","description":"Always `cancelAll`.","isRequired":true,"uniqueKey":"action","typeLabel":"string"},"clientRequestId":{"type":"string","format":"uuid","x-go-type":"string","description":"Client-generated UUID for correlation.","isRequired":true,"uniqueKey":"clientRequestId","typeLabel":"string\u003cuuid>"},"count":{"type":"integer","description":"Number of cancels queued.","isRequired":true,"uniqueKey":"count","typeLabel":"integer"},"cancels":{"type":"array","description":"One entry per queued cancel, newest first.","items":{"type":"object","properties":{"queued":{"type":"boolean","description":"Always `true`.","isRequired":true,"uniqueKey":"cancels.items.[INDEX].queued","typeLabel":"boolean"},"accepted":{"type":"boolean","description":"Always `false`.","isRequired":true,"uniqueKey":"cancels.items.[INDEX].accepted","typeLabel":"boolean"},"action":{"type":"string","description":"Always `cancel`.","isRequired":true,"uniqueKey":"cancels.items.[INDEX].action","typeLabel":"string"},"contract":{"type":"string","description":"Contract name.","isRequired":true,"uniqueKey":"cancels.items.[INDEX].contract","typeLabel":"string"},"orderId":{"type":"string","description":"Unique identifier for the order.","isRequired":true,"uniqueKey":"cancels.items.[INDEX].orderId","typeLabel":"string"},"body":{"type":"string","description":"Always `order queued, pending acceptance`.","uniqueKey":"cancels.items.[INDEX].body","typeLabel":"string"},"messageId":{"type":"string","description":"Identifier assigned to the queued request.","uniqueKey":"cancels.items.[INDEX].messageId","typeLabel":"string"},"clientRequestId":{"type":"string","description":"Client-generated UUID for correlation.","uniqueKey":"cancels.items.[INDEX].clientRequestId","typeLabel":"string"}},"required":["queued","accepted","action","contract","orderId"],"uniqueKey":"cancels.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"cancels","typeLabel":"object[]"},"contract":{"type":"string","description":"Contract name. Absent when every contract was swept.","uniqueKey":"contract","typeLabel":"string"},"unqueued":{"type":"array","description":"Open orders the sweep did not queue a cancel for. Present only when the queue refused part-way.","items":{"type":"object","properties":{"orderId":{"type":"string","description":"Unique identifier for the order.","isRequired":true,"uniqueKey":"unqueued.items.[INDEX].orderId","typeLabel":"string"},"contract":{"type":"string","description":"Contract name.","isRequired":true,"uniqueKey":"unqueued.items.[INDEX].contract","typeLabel":"string"}},"required":["orderId","contract"],"uniqueKey":"unqueued.items.[INDEX]","typeLabel":"object"},"uniqueKey":"unqueued","typeLabel":"object[]"}},"required":["action","clientRequestId","count","cancels"],"uniqueKey":"","typeLabel":"object"},"example":{"action":"cancelAll","clientRequestId":"c0a0d2d0-6b1e-4f3a-8d2b-5e7f9a1b2c3d","contract":"BTC-7FEB26-100000-C","count":2,"cancels":[{"queued":true,"accepted":false,"body":"order queued, pending acceptance","action":"cancel","messageId":"1770000000000-0","clientRequestId":"2b6c8e1a-0d4f-4e7b-9c3a-1f5d7e9b0a2c","contract":"BTC-7FEB26-100000-C","orderId":"01JRQM8H5XYZABCDEFGHJKMNPQ"},{"queued":true,"accepted":false,"body":"order queued, pending acceptance","action":"cancel","messageId":"1770000000000-1","clientRequestId":"7d3e5f1b-2a4c-4b6d-8e0f-9a1b3c5d7e9f","contract":"BTC-7FEB26-100000-C","orderId":"01JRQM8H5XYZABCDEFGHJKMNPR"}]},"examples":{"Example":{"title":"Example","value":{"action":"cancelAll","clientRequestId":"c0a0d2d0-6b1e-4f3a-8d2b-5e7f9a1b2c3d","contract":"BTC-7FEB26-100000-C","count":2,"cancels":[{"queued":true,"accepted":false,"body":"order queued, pending acceptance","action":"cancel","messageId":"1770000000000-0","clientRequestId":"2b6c8e1a-0d4f-4e7b-9c3a-1f5d7e9b0a2c","contract":"BTC-7FEB26-100000-C","orderId":"01JRQM8H5XYZABCDEFGHJKMNPQ"},{"queued":true,"accepted":false,"body":"order queued, pending acceptance","action":"cancel","messageId":"1770000000000-1","clientRequestId":"7d3e5f1b-2a4c-4b6d-8e0f-9a1b3c5d7e9f","contract":"BTC-7FEB26-100000-C","orderId":"01JRQM8H5XYZABCDEFGHJKMNPR"}]}}},"exampleType":"examples"}},"exampleType":"examples"},"354ce791-f88b-444e-aa91-e029e54b4208":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","description":"An object containing error details.","properties":{"slug":{"type":"string","description":"A short string identifier for the error type.","isRequired":true,"uniqueKey":"error.slug","typeLabel":"string"},"code":{"type":"string","description":"A string code representing the error.","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"}},"required":["slug","code"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"},"message":{"type":"string","description":"A human-readable message describing the error.","isRequired":true,"uniqueKey":"message","typeLabel":"string"}},"required":["error","message"],"uniqueKey":"","typeLabel":"object"},"example":{"error":{"slug":"BAD_REQUEST","code":"SYS-0006"},"message":"clientRequestId must be a UUID"},"examples":{"Example":{"title":"Example","value":{"error":{"slug":"BAD_REQUEST","code":"SYS-0006"},"message":"clientRequestId must be a UUID"}}},"exampleType":"examples"}},"exampleType":"examples"},"3af3e644-6380-49a9-b7da-77eebd740131":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","description":"An object containing error details.","properties":{"slug":{"type":"string","description":"A short string identifier for the error type.","isRequired":true,"uniqueKey":"error.slug","typeLabel":"string"},"code":{"type":"string","description":"A string code representing the error.","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"}},"required":["slug","code"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"},"message":{"type":"string","description":"A human-readable message describing the error.","isRequired":true,"uniqueKey":"message","typeLabel":"string"}},"required":["error","message"],"uniqueKey":"","typeLabel":"object"},"example":{"error":{"slug":"UNAUTHORIZED","code":"SYS-0001"},"message":"unauthorized"},"examples":{"Example":{"title":"Example","value":{"error":{"slug":"UNAUTHORIZED","code":"SYS-0001"},"message":"unauthorized"}}},"exampleType":"examples"}},"exampleType":"examples"},"51932b14-c36b-4a05-a078-32ee7724a11c":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","description":"An object containing error details.","properties":{"slug":{"type":"string","description":"A short string identifier for the error type.","isRequired":true,"uniqueKey":"error.slug","typeLabel":"string"},"code":{"type":"string","description":"A string code representing the error.","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"}},"required":["slug","code"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"},"message":{"type":"string","description":"A human-readable message describing the error.","isRequired":true,"uniqueKey":"message","typeLabel":"string"}},"required":["error","message"],"uniqueKey":"","typeLabel":"object"},"example":{"error":{"slug":"FORBIDDEN","code":"SYS-0008"},"message":"read-only token cannot create orders"},"examples":{"Example":{"title":"Example","value":{"error":{"slug":"FORBIDDEN","code":"SYS-0008"},"message":"read-only token cannot create orders"}}},"exampleType":"examples"}},"exampleType":"examples"},"6e91bc0e-7b08-46bf-bc12-23358aa9d24d":{"description":"","headers":{"Retry-After":{"description":"Number of seconds to wait before making another request (429 responses only).","required":true,"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","description":"An object containing error details.","properties":{"slug":{"type":"string","description":"A short string identifier for the error type.","isRequired":true,"uniqueKey":"error.slug","typeLabel":"string"},"code":{"type":"string","description":"A string code representing the error.","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"}},"required":["slug","code"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"},"message":{"type":"string","description":"A human-readable message describing the error.","isRequired":true,"uniqueKey":"message","typeLabel":"string"},"retry_after_seconds":{"type":"integer","description":"Seconds to wait before retrying; the same value as the `Retry-After` header.","isRequired":true,"uniqueKey":"retry_after_seconds","typeLabel":"integer"},"remaining":{"type":"number","format":"double","description":"Requests left in the current window.","isRequired":true,"uniqueKey":"remaining","typeLabel":"number\u003cdouble>"},"key":{"type":"string","description":"Identifier of the limit the request was charged against.","uniqueKey":"key","typeLabel":"string"}},"required":["error","message","retry_after_seconds","remaining"],"uniqueKey":"","typeLabel":"object"},"example":{"error":{"slug":"TOO_MANY_REQUESTS","code":"SYS-0003"},"message":"rate limit exceeded","key":"options-read-orders","retry_after_seconds":3,"remaining":0},"examples":{"Example":{"title":"Example","value":{"error":{"slug":"TOO_MANY_REQUESTS","code":"SYS-0003"},"message":"rate limit exceeded","key":"options-read-orders","retry_after_seconds":3,"remaining":0}}},"exampleType":"examples"}},"exampleType":"examples"},"5cd003fe-c445-4558-b638-050a1f3ad90f":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","description":"An object containing error details.","properties":{"slug":{"type":"string","description":"A short string identifier for the error type.","isRequired":true,"uniqueKey":"error.slug","typeLabel":"string"},"code":{"type":"string","description":"A string code representing the error.","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"}},"required":["slug","code"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"},"message":{"type":"string","description":"A human-readable message describing the error.","isRequired":true,"uniqueKey":"message","typeLabel":"string"}},"required":["error","message"],"uniqueKey":"","typeLabel":"object"},"example":{"error":{"slug":"SERVICE_UNAVAILABLE","code":"SYS-0004"},"message":"matching service unavailable"},"examples":{"Example":{"title":"Example","value":{"error":{"slug":"SERVICE_UNAVAILABLE","code":"SYS-0004"},"message":"matching service unavailable"}}},"exampleType":"examples"}},"exampleType":"examples"},"aa439f8e-55e6-4931-8bf0-e46f6bbe3a29":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","description":"An object containing error details.","properties":{"slug":{"type":"string","description":"A short string identifier for the error type.","isRequired":true,"uniqueKey":"error.slug","typeLabel":"string"},"code":{"type":"string","description":"A string code representing the error.","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"}},"required":["slug","code"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"},"message":{"type":"string","description":"A human-readable message describing the error.","isRequired":true,"uniqueKey":"message","typeLabel":"string"}},"required":["error","message"],"uniqueKey":"","typeLabel":"object"},"example":{"error":{"slug":"SERVICE_UNAVAILABLE","code":"SYS-0004"},"message":"matching service timed out"},"examples":{"Example":{"title":"Example","value":{"error":{"slug":"SERVICE_UNAVAILABLE","code":"SYS-0004"},"message":"matching service timed out"}}},"exampleType":"examples"}},"exampleType":"examples"}},"security":{"debb604f-ea80-444c-84a1-2f3901a06269":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","scopes":[],"schemeName":"bearerAuth"}}},"servers":{"b319409d-8041-4b70-9b27-a4b04576f069":{"url":"https://api-options.sandbox.rails.xyz"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","bearerFormat":"JWT","scopes":[],"schemeName":"bearerAuth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Bearer authentication header of the form `Bearer \u003ctoken>`, where `\u003ctoken>` is your auth token.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"}]},"originalFileLocation":"latest/options/openapi/matching.json"},"subdomain":"railsxyz","siteName":"Rails Trading Developer API Documentation","title":"Cancel All Orders - Rails Trading Developer API Documentation","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-09-17T16:55:42.261Z","originalFileLocation":"latest/options/rest-api/cancel-all-orders.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=\"Queue a cancel for every open order, or every open order in one contract.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Rails Trading Developer API 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/railsxyz/uzRYRjCG6Wh2I4zS/_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/railsxyz/uzRYRjCG6Wh2I4zS/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/railsxyz/uzRYRjCG6Wh2I4zS/_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/railsxyz/uzRYRjCG6Wh2I4zS/_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/railsxyz/uzRYRjCG6Wh2I4zS/_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/railsxyz/uzRYRjCG6Wh2I4zS/_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/railsxyz/uzRYRjCG6Wh2I4zS/_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/railsxyz/uzRYRjCG6Wh2I4zS/_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/railsxyz/uzRYRjCG6Wh2I4zS/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Cancel All Orders - Rails Trading Developer API Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Queue a cancel for every open order, or every open order in one contract.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Rails Trading Developer API Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.rails.xyz/latest/options/rest-api/cancel-all-orders\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://railsxyz.mintlify.app/_mintlify/api/og/v2?division=Orders\u0026amp;title=Cancel+All+Orders\u0026amp;description=Queue+a+cancel+for+every+open+order%2C+or+every+open+order+in+one+contract.\u0026amp;theme=328cc55faa8e33363fe01ff9\u0026amp;signature=79ecb6efe10764e9e6661cb304449af9c0eaca488c00945032e1d4a6f3ccc610\">\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=\"Cancel All Orders - Rails Trading Developer API Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Queue a cancel for every open order, or every open order in one contract.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://railsxyz.mintlify.app/_mintlify/api/og/v2?division=Orders\u0026amp;title=Cancel+All+Orders\u0026amp;description=Queue+a+cancel+for+every+open+order%2C+or+every+open+order+in+one+contract.\u0026amp;theme=328cc55faa8e33363fe01ff9\u0026amp;signature=79ecb6efe10764e9e6661cb304449af9c0eaca488c00945032e1d4a6f3ccc610\">\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/railsxyz/uzRYRjCG6Wh2I4zS/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Rails Trading Developer API Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0D9373\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.rails.xyz/latest/options/rest-api/cancel-all-orders\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/latest/options/rest-api/cancel-all-orders.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.rails.xyz/#organization\",\"name\":\"Rails Trading Developer API Documentation\",\"url\":\"https://docs.rails.xyz\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/railsxyz/XTasO28fw_2bd6Tp/logo/light.svg?fit=max\u0026auto=format\u0026n=XTasO28fw_2bd6Tp\u0026q=85\u0026s=562d1517f28bb695fb280b18dd4310a4\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.rails.xyz#website\",\"name\":\"Rails Trading Developer API Documentation\",\"url\":\"https://docs.rails.xyz\",\"publisher\":{\"@id\":\"https://docs.rails.xyz/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.rails.xyz/latest/options/rest-api/cancel-all-orders#webpage\",\"url\":\"https://docs.rails.xyz/latest/options/rest-api/cancel-all-orders\",\"name\":\"Cancel All Orders\",\"description\":\"Queue a cancel for every open order, or every open order in one contract.\",\"dateModified\":\"2026-09-17T16:55:42.261Z\",\"isPartOf\":{\"@id\":\"https://docs.rails.xyz#website\"},\"breadcrumb\":{\"@id\":\"https://docs.rails.xyz/latest/options/rest-api/cancel-all-orders#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.rails.xyz/latest/options/rest-api/cancel-all-orders#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"HTTP API Reference\",\"item\":\"https://docs.rails.xyz/latest/options/rest-api/get-expirations\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Orders\",\"item\":\"https://docs.rails.xyz/latest/options/rest-api/create-order\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Cancel All Orders\",\"item\":\"https://docs.rails.xyz/latest/options/rest-api/cancel-all-orders\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.rails.xyz/latest/options/rest-api/cancel-all-orders#apireference\",\"headline\":\"Cancel All Orders\",\"name\":\"Cancel All Orders\",\"description\":\"Queue a cancel for every open order, or every open order in one contract.\",\"url\":\"https://docs.rails.xyz/latest/options/rest-api/cancel-all-orders\",\"mainEntityOfPage\":{\"@id\":\"https://docs.rails.xyz/latest/options/rest-api/cancel-all-orders#webpage\"},\"dateModified\":\"2026-09-17T16:55:42.261Z\",\"publisher\":{\"@id\":\"https://docs.rails.xyz/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.rails.xyz#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Rails Trading Developer API Documentation\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Rails Trading Developer API Documentation","nav":{"global":null,"tabs":[{"tab":"Home","icon":"house","pages":[{"title":"Home","href":""}]},{"tab":"Get Started","icon":"rocket","pages":[{"title":"Get Started","href":"/latest/introduction"}]},{"tab":"Perpetuals","icon":"chart-line","pages":[{"title":"Perpetuals","href":"/latest/perps/guides/overview"}]},{"tab":"Options","icon":"layer-group","groups":[{"group":"Guides","pages":[{"title":"Overview","href":"/latest/options/guides/overview"},{"title":"Instruments \u0026 Symbols","href":"/latest/options/guides/instruments-and-symbols"},{"title":"Market Data","href":"/latest/options/guides/market-data"},{"title":"Pricing \u0026 Greeks","href":"/latest/options/guides/pricing-and-greeks"},{"title":"Order Lifecycle","href":"/latest/options/guides/order-lifecycle"},{"title":"Positions \u0026 Account","href":"/latest/options/guides/positions-and-account"},{"title":"Margin \u0026 Liquidation","href":"/latest/options/guides/margin-and-liquidation"},{"title":"Settlement \u0026 Expiry","href":"/latest/options/guides/settlement-and-expiry"},{"title":"Rate Limits","href":"/latest/options/guides/rate-limits"},{"title":"Error Codes","href":"/latest/options/guides/error-codes"},{"title":"FAQs","href":"/latest/options/guides/faqs"}]},{"group":"Formulas","pages":[{"title":"Pricing \u0026 Greeks","href":"/latest/options/formulas/pricing-and-greeks"},{"title":"Margin \u0026 Fees","href":"/latest/options/formulas/margin-and-fees"},{"title":"Position Metrics","href":"/latest/options/formulas/position-metrics"},{"title":"Account Equity \u0026 Balances","href":"/latest/options/formulas/account-balance"},{"title":"Settlement","href":"/latest/options/formulas/settlement"}]},{"group":"Go SDK","pages":[{"title":"Quickstart","href":"/latest/options/go-sdk/quickstart"},{"title":"Orders","href":"/latest/options/go-sdk/orders"},{"title":"Streams \u0026 Account","href":"/latest/options/go-sdk/streams-and-account"}]},{"group":"WebSocket API Reference","pages":[{"title":"Overview","href":"/latest/options/websocket-api/overview"},{"title":"Common Requests","asyncapi":"latest/options/asyncapi/options-ws.yaml commonRequests","href":"/latest/options/websocket-api/common-requests"},{"title":"Order Management Stream","asyncapi":"latest/options/asyncapi/options-ws.yaml orderManagementStream","href":"/latest/options/websocket-api/order-management-stream"},{"title":"Contracts Stream","asyncapi":"latest/options/asyncapi/options-ws.yaml contractsStream","href":"/latest/options/websocket-api/contracts-stream"},{"title":"Quotes Stream","asyncapi":"latest/options/asyncapi/options-ws.yaml quotesStream","href":"/latest/options/websocket-api/quotes-stream"},{"title":"Order Book Stream","asyncapi":"latest/options/asyncapi/options-ws.yaml publicOrderBookStream","href":"/latest/options/websocket-api/order-book-stream"},{"title":"Public Trades Stream","asyncapi":"latest/options/asyncapi/options-ws.yaml publicTradesStream","href":"/latest/options/websocket-api/public-trades-stream"},{"title":"Positions Stream","asyncapi":"latest/options/asyncapi/options-ws.yaml positionsStream","href":"/latest/options/websocket-api/positions-stream"},{"title":"Open Orders Stream","asyncapi":"latest/options/asyncapi/options-ws.yaml openOrdersStream","href":"/latest/options/websocket-api/open-orders-stream"},{"title":"Recent Orders Stream","asyncapi":"latest/options/asyncapi/options-ws.yaml recentOrdersStream","href":"/latest/options/websocket-api/recent-orders-stream"},{"title":"Account Summary Stream","asyncapi":"latest/options/asyncapi/options-ws.yaml accountSummaryStream","href":"/latest/options/websocket-api/account-summary-stream"},{"title":"Settlements Stream","asyncapi":"latest/options/asyncapi/options-ws.yaml settlementsStream","href":"/latest/options/websocket-api/settlements-stream"}]},{"group":"HTTP API Reference","pages":[{"group":"Market Data","pages":[{"title":"Get Expirations","openapi":"GET /v1/contracts/markets/{market}/expirations","href":"/latest/options/rest-api/get-expirations"},{"title":"Get Contracts","openapi":"GET /v1/contracts/markets/{market}/expirations/{expiry}/contracts","href":"/latest/options/rest-api/get-contracts"}]},{"group":"Orders","pages":[{"title":"Create Order","openapi":"POST /v1/matching/orders/create","href":"/latest/options/rest-api/create-order"},{"title":"Modify Order","openapi":"POST /v1/matching/orders/modify","href":"/latest/options/rest-api/modify-order"},{"title":"Cancel Order","description":"Cancel an open order.","openapi":"POST /v1/matching/orders/cancel","href":"/latest/options/rest-api/cancel-order"},{"title":"Cancel All Orders","openapi":"POST /v1/matching/orders/cancel-all","href":"/latest/options/rest-api/cancel-all-orders"},{"title":"Get Open Orders","description":"Retrieve your resting orders.","openapi":"GET /v1/matching/orders/open","href":"/latest/options/rest-api/get-open-orders"},{"title":"Get Order Status","openapi":"GET /v1/matching/orders/{orderId}","href":"/latest/options/rest-api/get-order-status"}]},{"group":"User Account","pages":[{"title":"Get Account Summary","openapi":"GET /v1/account/summary","href":"/latest/options/rest-api/get-account-summary"},{"title":"Get Positions","openapi":"GET /v1/account/positions","href":"/latest/options/rest-api/get-account-positions"},{"title":"Get Recent Orders","openapi":"GET /v1/account/orders","href":"/latest/options/rest-api/get-account-orders"},{"title":"Get Account Deposits","openapi":"GET /v1/account/deposits","href":"/latest/options/rest-api/get-account-deposits"},{"title":"Get Account Withdrawals","openapi":"GET /v1/account/withdrawals","href":"/latest/options/rest-api/get-account-withdrawals"}]}]}]}]},"basePath":"","title":"Cancel All Orders - Rails Trading Developer API Documentation","buildId":"dpl_DeHjVRGfFnhYQwHnfC2pjeXXv8h9","deploymentId":"dpl_DeHjVRGfFnhYQwHnfC2pjeXXv8h9","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-CS552b7R.js","utils-DDTCYAF2.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-De8ttokP.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-DrwRDvAh.js","snippetPresets-DtAN0nWx.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-D5rWArI6.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-O2i12wsz.js","shallow-DV8xABTt.js","getApiPlaygroundDisplay-DBZ0B5Jx.js","CodeSnippet-BVi0tPUX.js","CodeSnippets-CqASbIwY.js","Page-m07pfKpT.js","getPastedJson-DG9vsMS8.js","icon-CXzRSCr8.js","MethodPill-BdKVtEuX.js","DuplicateIcon-CZlmBrJI.js","createIcon-biFEUKPL.js","DynamicMarkdown-B54_zNBF.js","SectionHeading-DwwHK3Pt.js","axios-vUo_bRtp.js","Markdown-DfhCTwyA.js","clsx-xpJZXxdP.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-BTZUMDnx.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-DqdKa2R4.js"]}