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

# Cancel deployment

> Cancels a provider deployment when available and marks the run as `CANCELED`.



## OpenAPI

````yaml https://raw.githubusercontent.com/InsForge/InsForge/main/openapi/deployments.yaml post /api/deployments/{id}/cancel
openapi: 3.0.3
info:
  title: Insforge Deployments API
  version: 1.0.0
  description: >-
    Frontend deployment sessions, source uploads, environment variables, and
    custom domains.
servers: []
security: []
paths:
  /api/deployments/{id}/cancel:
    post:
      tags:
        - Admin
      summary: Cancel deployment
      description: >-
        Cancels a provider deployment when available and marks the run as
        `CANCELED`.
      parameters:
        - $ref: '#/components/parameters/DeploymentId'
      responses:
        '200':
          description: Deployment canceled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteResponse'
        '401':
          description: Unauthorized
        '403':
          description: Admin access required
        '404':
          $ref: '#/components/responses/Error'
        '429':
          $ref: '#/components/responses/Error'
        '500':
          $ref: '#/components/responses/Error'
      security:
        - bearerAuth: []
        - apiKey: []
components:
  parameters:
    DeploymentId:
      name: id
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Deployment run ID.
  schemas:
    DeleteResponse:
      type: object
      required:
        - success
        - message
      properties:
        success:
          type: boolean
        message:
          type: string
    ErrorResponse:
      type: object
      required:
        - error
        - message
        - statusCode
      properties:
        error:
          type: string
          description: Error code for programmatic handling.
        message:
          type: string
          description: Human-readable error message.
        statusCode:
          type: integer
        nextActions:
          type: string
          description: Suggested action to resolve the error.
  responses:
    Error:
      description: Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Project admin JWT or an API key passed as a Bearer token.
    apiKey:
      type: apiKey
      in: header
      name: x-api-key

````