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

# Cancel a nest

> Cancels the nest for this `RequestId`.

- **Quote nest:** stops the in-progress sub-nest and runs none of the rest. The quote then completes as normal, with the groups that were not nested reported as aborted.
- **2D nest, running:** stops it early. It completes as normal with the best layout found so far, delivered to your `ResultsWebhookUri`.
- **2D nest, waiting for a free slot:** it is removed before it starts and its status becomes `Failed` ("Cancelled before it started").

A nest that has finished, or one submitted with `AutomaticallyStartNesting` false and not yet started, cannot be cancelled. 1D nests cannot be cancelled once running.

**Body**

- `RequestId` — the nest to cancel.



## OpenAPI

````yaml /openapi.json post /v1/nesting/abort
openapi: 3.0.0
info:
  title: NestAPI
  version: '1.0'
servers:
  - description: Staging
    url: https://dev.api.nestapi.com
security: []
tags:
  - name: account
    description: API key and account management
  - name: admin
  - name: ApiAdmin
  - name: auth
  - name: billing
  - name: fairness
    description: >-
      Per-customer nesting-minutes fairness config, weights and usage (requires
      an Admin API key)
  - name: importer
  - name: nesting
    description: Submit nesting jobs, retrieve results and exports
  - name: plan
  - name: proxy
  - name: public
    description: Health check and public utility endpoints
  - name: subscriptionstatus
paths:
  /v1/nesting/abort:
    parameters:
      - $ref: '#/components/parameters/Accept'
    post:
      tags:
        - nesting
      summary: Cancel a nest
      description: >-
        Cancels the nest for this `RequestId`.


        - **Quote nest:** stops the in-progress sub-nest and runs none of the
        rest. The quote then completes as normal, with the groups that were not
        nested reported as aborted.

        - **2D nest, running:** stops it early. It completes as normal with the
        best layout found so far, delivered to your `ResultsWebhookUri`.

        - **2D nest, waiting for a free slot:** it is removed before it starts
        and its status becomes `Failed` ("Cancelled before it started").


        A nest that has finished, or one submitted with
        `AutomaticallyStartNesting` false and not yet started, cannot be
        cancelled. 1D nests cannot be cancelled once running.


        **Body**


        - `RequestId` — the nest to cancel.
      operationId: AbortNesting
      parameters:
        - name: RequestId
          in: query
          x-nullable: false
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AbortNesting'
      responses:
        '200':
          description: The nest was cancelled, or a reason it could not be.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NestingAborted'
        '401':
          description: API key is missing or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NestingAborted'
      deprecated: false
      security:
        - Bearer: []
components:
  parameters:
    Accept:
      name: Accept
      in: header
      description: Accept Header
      required: true
      schema:
        type: string
        enum:
          - application/json
  schemas:
    AbortNesting:
      title: AbortNesting
      properties:
        RequestId:
          type: string
          nullable: false
      description: AbortNesting
      type: object
    NestingAborted:
      title: NestingAborted
      properties:
        Success:
          description: '`true` if the nest was cancelled.'
          type: boolean
          nullable: false
        ErrorReason:
          description: Why the abort failed when `Success` is `false`; otherwise null.
          type: string
      description: NestingAborted
      type: object
  securitySchemes:
    Bearer:
      type: apiKey
      name: Authorization
      in: header

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.