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

# Cancel Deployment Route



## OpenAPI

````yaml /openapi.json post /api/v1/deploy/{deployment_id}/cancel
openapi: 3.1.0
info:
  title: Trajectory API
  version: 0.1.0
servers:
  - url: https://api.trajectory.ai
security: []
paths:
  /api/v1/deploy/{deployment_id}/cancel:
    post:
      tags:
        - deployments
      summary: Cancel Deployment Route
      operationId: cancelDeployment
      parameters:
        - name: deployment_id
          in: path
          required: true
          schema:
            type: string
            title: Deployment Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Deployment'
        default:
          $ref: '#/components/responses/ApiErrorResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    Deployment:
      properties:
        deployment_id:
          type: string
          title: Deployment Id
          description: Deployment row id.
        model_slug:
          type: string
          title: Model Slug
          description: Human-readable slug this deployment serves under.
        model_slug_id:
          type: string
          title: Model Slug Id
          description: Id of the slug this deployment serves under.
        status:
          $ref: '#/components/schemas/DeploymentLifecycleStatus'
          description: >-
            Lifecycle state; MERGING covers the whole pipeline, so treat it as
            in flight.
        role:
          $ref: '#/components/schemas/DeploymentRole'
          description: Whether this is the production or a test deployment.
        is_active:
          type: boolean
          title: Is Active
          description: True when this deployment currently answers for the slug.
        model_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Model Id
          description: Merged model backing this deployment; null until the merge lands.
        playground_endpoint_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Playground Endpoint Url
          description: Per-deployment URL a test checkpoint is reachable at.
        base_model_slug:
          anyOf:
            - type: string
            - type: 'null'
          title: Base Model Slug
          description: >-
            Base model trained from, via models -> checkpoints; null until the
            merge lands.
        checkpoint_step:
          anyOf:
            - type: integer
            - type: 'null'
          title: Checkpoint Step
          description: Training step of the deployed checkpoint; null until it resolves.
        output_speed:
          anyOf:
            - $ref: '#/components/schemas/OutputSpeed'
            - type: 'null'
          description: Output-speed tier requested; null only if this predates the column.
        expected_concurrency:
          anyOf:
            - $ref: '#/components/schemas/ExpectedConcurrency'
            - type: 'null'
          description: Concurrency level requested; null only if this predates the column.
        merge_xid:
          anyOf:
            - type: string
            - type: 'null'
          title: Merge Xid
          description: XID of the krun job that is merging the checkpoint weights.
        deploy_xid:
          anyOf:
            - type: string
            - type: 'null'
          title: Deploy Xid
          description: XID of the krun job that is deploying the merged model.
        created_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Created By
          description: Email of the user who requested this deployment.
        completed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Completed At
          description: >-
            When the deployment first became DEPLOYED; unlike updated_at, later
            promote/demote transitions never overwrite this.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: When the deployment was requested.
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
          description: Last lifecycle transition; null until the row first moves.
        failure:
          anyOf:
            - $ref: '#/components/schemas/AsyncFailure'
            - type: 'null'
          description: Structured failure when status is FAILED.
      type: object
      required:
        - deployment_id
        - model_slug
        - model_slug_id
        - status
        - role
        - is_active
        - created_at
      title: Deployment
      description: Spanner-backed deployment lifecycle row for the platform UI.
    DeploymentLifecycleStatus:
      type: string
      enum:
        - PENDING
        - MERGING
        - DEPLOYING
        - DEPLOYED
        - FAILED
      title: DeploymentLifecycleStatus
      description: Spanner deployment row status.
    DeploymentRole:
      type: string
      enum:
        - production
        - test
      title: DeploymentRole
    OutputSpeed:
      type: string
      enum:
        - normal
        - turbo
      title: OutputSpeed
      description: 'Which GPU tier a deployment runs on: H100 (normal) or B200 (turbo).'
    ExpectedConcurrency:
      type: string
      enum:
        - low
        - medium
        - high
      title: ExpectedConcurrency
      description: Traffic level a deployment is sized for; picks its replica count.
    AsyncFailure:
      properties:
        type:
          type: string
          title: Type
          description: Stable category used for exception mapping.
        code:
          type: string
          title: Code
          description: Stable programmatic reason for the asynchronous failure.
        message:
          type: string
          title: Message
          description: Human-readable explanation for this failure occurrence.
        context:
          additionalProperties: true
          type: object
          title: Context
          description: Machine-readable values specific to this failure code.
      type: object
      required:
        - type
        - code
        - message
      title: AsyncFailure
    ApiErrorEnvelope:
      properties:
        error:
          $ref: '#/components/schemas/ApiErrorBody'
      required:
        - error
      title: ApiErrorEnvelope
      type: object
    ApiErrorBody:
      properties:
        type:
          $ref: '#/components/schemas/ErrorType'
        code:
          title: Code
          type: string
        message:
          type: string
          title: Message
        param:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Param
        doc_url:
          type: string
          title: Doc Url
        context:
          additionalProperties: true
          title: Context
          type: object
      required:
        - type
        - code
        - message
        - doc_url
        - context
      title: ApiErrorBody
      type: object
    ErrorType:
      enum:
        - invalid_request_error
        - authentication_error
        - permission_error
        - conflict_error
        - rate_limit_error
        - dependency_error
        - api_error
      title: ErrorType
      type: string
  responses:
    ApiErrorResponse:
      description: >-
        Common API error. Possible codes: `authentication_required`,
        `permission_denied`, `validation_error`, `rate_limited`,
        `internal_error`, `service_unavailable`.
      headers:
        X-Request-ID:
          $ref: '#/components/headers/RequestId'
        Trajectory-Should-Retry:
          $ref: '#/components/headers/TrajectoryShouldRetry'
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorEnvelope'
  headers:
    RequestId:
      schema:
        type: string
    TrajectoryShouldRetry:
      schema:
        type: boolean
    RetryAfter:
      schema:
        type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Organization API key

````