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

# Cancel an exit

> Aborts an in-progress emergency exit while it is still safe to do so—before its final transaction has been broadcast. Exit transactions are ordered topologically and only the final one moves the VTXO on-chain, so an exit can still be canceled even after its shared ancestor transactions are in the mempool or a block. Canceling leaves the VTXO spendable, so a fresh exit can be started for it later. Before canceling, the endpoint verifies directly against the chain that the final transaction hasn't been broadcast; nothing is rebroadcast in the process. Canceling an already-canceled exit succeeds as a no-op, so retries are safe. Note the daemon auto-progresses exits at the cadence defined by `SLOW_INTERVAL`, so cancel promptly once an exit reaches a state you no longer wish to pursue.



## OpenAPI

````yaml https://gitlab.com/ark-bitcoin/bark/-/raw/master/bark-rest/openapi.json post /api/v1/exits/cancel/{vtxo_id}
openapi: 3.1.0
info:
  title: barkd REST API
  description: >-
    A simple REST API for barkd, a wallet daemon for integrating bitcoin
    payments into your app over HTTP. Supports self-custodial Lightning, Ark,
    and on-chain out of the box.


    barkd is a long-running daemon best suited for always-on or
    high-connectivity environments like nodes, servers, desktops, and
    point-of-sale terminals.


    All endpoints return JSON. Amounts are denominated in satoshis.
  contact:
    name: Second Team
    email: hello@second.tech
  license:
    name: MIT
    identifier: MIT
  version: 0.6.0
servers: []
security:
  - bearer: []
tags:
  - name: boards
    description: Move on-chain bitcoin onto the Ark protocol.
  - name: exits
    description: Move bitcoin back on-chain without server cooperation.
  - name: fees
    description: Estimate fees for wallet operations before executing them.
  - name: history
    description: Inspect and annotate wallet movement history.
  - name: lightning
    description: Create Lightning invoices and track receives.
  - name: onchain
    description: Manage barkd's on-chain bitcoin wallet.
  - name: wallet
    description: Manage Ark balances and VTXOs, send payments via Ark, LN, and on-chain.
  - name: bitcoin
    description: Query bitcoin network data.
  - name: notifications
    description: Receive real-time notifications from barkd.
paths:
  /api/v1/exits/cancel/{vtxo_id}:
    post:
      tags:
        - exits
      summary: Cancel an exit
      description: >-
        Aborts an in-progress emergency exit while it is still safe to do
        so—before its final transaction has been broadcast. Exit transactions
        are ordered topologically and only the final one moves the VTXO
        on-chain, so an exit can still be canceled even after its shared
        ancestor transactions are in the mempool or a block. Canceling leaves
        the VTXO spendable, so a fresh exit can be started for it later. Before
        canceling, the endpoint verifies directly against the chain that the
        final transaction hasn't been broadcast; nothing is rebroadcast in the
        process. Canceling an already-canceled exit succeeds as a no-op, so
        retries are safe. Note the daemon auto-progresses exits at the cadence
        defined by `SLOW_INTERVAL`, so cancel promptly once an exit reaches a
        state you no longer wish to pursue.
      operationId: exit_cancel
      parameters:
        - name: vtxo_id
          in: path
          description: The VTXO whose unilateral exit should be canceled
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Exit canceled successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExitCancelResponse'
        '400':
          description: >-
            The VTXO ID is invalid, or the exit can no longer be canceled
            because its final transaction has already been broadcast
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestError'
        '404':
          description: The VTXO has no exit
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerError'
components:
  schemas:
    ExitCancelResponse:
      type: object
      required:
        - message
      properties:
        message:
          type: string
    BadRequestError:
      type: object
      required:
        - message
      properties:
        message:
          type: string
    NotFoundError:
      type: object
      required:
        - resources
        - message
      properties:
        message:
          type: string
        resources:
          type: array
          items:
            type: string
    InternalServerError:
      type: object
      required:
        - message
      properties:
        message:
          type: string
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: AuthToken
      description: Base64url-encoded auth token

````