> ## Documentation Index
> Fetch the complete documentation index at: https://docs.myfundedperpetuals.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Cancel all working orders

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



## OpenAPI

````yaml /openapi.yaml post /v1/accounts/{account_id}/cancel-all-orders
openapi: 3.1.0
info:
  title: MyFundedPerps API (Beta)
  version: 1.0.0
  description: >-
    The developer API is in beta. Breaking changes may be introduced at any
    time. Programmatic access to MyFundedPerps paper-trading challenge accounts.
    API trades use the same real order books and simulated execution engine as
    the web trading interface. Every response carries an `X-Request-Id` header
    for support and log correlation.
  contact:
    url: https://myfundedperpetuals.com/support
servers:
  - url: https://developers.myfundedperpetuals.com
    description: Live
  - url: https://sandbox.myfundedperpetuals.com
    description: Sandbox (test keys and sandbox accounts only)
security:
  - bearerAuth: []
tags:
  - name: General
  - name: Authentication
  - name: Accounts
  - name: Markets
  - name: Positions
  - name: Orders
  - name: Fills
  - name: Strategy Orders
paths:
  /v1/accounts/{account_id}/cancel-all-orders:
    post:
      tags:
        - Accounts
        - Orders
      summary: 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.
      operationId: cancelAllAccountOrders
      parameters:
        - $ref: '#/components/parameters/AccountId'
        - $ref: '#/components/parameters/IdempotencyKey'
      responses:
        '200':
          description: Completed operation replay.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CancelAllOrdersEnvelope'
        '201':
          description: Operation completed for the first time.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CancelAllOrdersEnvelope'
        '202':
          description: >-
            A bounded slice completed. Retry with the same idempotency key after
            Retry-After.
          headers:
            Retry-After:
              $ref: '#/components/headers/RetryAfter'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CancelAllOrdersEnvelope'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
        '503':
          description: >-
            A complete bounded working-order snapshot is temporarily
            unavailable.
          headers:
            Retry-After:
              $ref: '#/components/headers/RetryAfter'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
components:
  parameters:
    AccountId:
      name: account_id
      in: path
      required: true
      schema:
        type: string
    IdempotencyKey:
      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
  schemas:
    CancelAllOrdersEnvelope:
      type: object
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/CancelAllOrdersOperation'
    ErrorEnvelope:
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/Error'
    CancelAllOrdersOperation:
      type: object
      required:
        - id
        - operation
        - account_id
        - status
        - total_count
        - succeeded_count
        - failed_count
        - results
        - created_at
      properties:
        id:
          type: string
        operation:
          type: string
          const: cancel_all_orders
        account_id:
          type: string
        status:
          type: string
          enum:
            - running
            - completed
        total_count:
          type: integer
          minimum: 0
          maximum: 200
        succeeded_count:
          type: integer
          minimum: 0
          maximum: 200
        failed_count:
          type: integer
          minimum: 0
          maximum: 200
        results:
          type: array
          maxItems: 200
          items:
            type: object
            required:
              - order_id
              - status
            properties:
              order_id:
                type: string
              status:
                type: string
                enum:
                  - canceled
                  - queued
                  - failed
              queued:
                type: boolean
              failure_code:
                type: string
        created_at:
          type: number
        completed_at:
          type: number
    Error:
      type: object
      required:
        - code
        - message
        - request_id
      properties:
        code:
          type: string
        message:
          type: string
        request_id:
          type: string
          format: uuid
        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:
            $ref: '#/components/schemas/ValidationIssue'
    ValidationIssue:
      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.
        issue:
          type: string
  headers:
    RetryAfter:
      description: Seconds to wait before retrying.
      schema:
        type: integer
        minimum: 1
    RequestId:
      description: Stable identifier for support and log correlation.
      schema:
        type: string
        format: uuid
  responses:
    BadRequest:
      description: >-
        Invalid request. Validation failures list every offending field in
        `error.details`.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    Unauthorized:
      description: Missing, invalid, or revoked API key.
      headers:
        WWW-Authenticate:
          schema:
            type: string
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    Forbidden:
      description: The API key is valid but does not allow this operation.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    NotFound:
      description: Resource not found or not owned by the authenticated user.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    Conflict:
      description: >-
        The request conflicts with current state, an idempotency record, or a
        client order ID.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    RateLimited:
      description: A per-key, per-IP, or deployment request budget is exhausted.
      headers:
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
  securitySchemes:
    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.

````