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

# Delete a workflow

> DELETE /v1/workflows/{id}

A soft delete. Runs it already produced stay readable — a deleted workflow must not take its own history with it.


## OpenAPI

````yaml openapi.json DELETE /v1/workflows/{id}
openapi: 3.0.0
info:
  title: Infery Gateway
  description: >-
    Infery Inference Gateway — OpenAI-compatible API for LLMs, embeddings,
    images, audio, and video
  version: '1.0'
  contact: {}
servers:
  - url: https://api.infery.ai
    description: Production
  - url: http://localhost:3001
    description: Local
security: []
tags: []
paths:
  /v1/workflows/{id}:
    delete:
      tags:
        - Workflows
      summary: Soft-delete workflow
      description: >-
        Marks the workflow deleted. The row and its versions stay in the
        database, but every route treats it as gone: it disappears from the
        list, `GET /v1/workflows/{id}` 404s, and ITS RUNS BECOME UNREADABLE TOO
        — a share on a run does not survive its workflow being deleted.
        In-flight runs are NOT cancelled and are still billed; cancel them first
        if that is what you want. There is no undelete through this API.
        Requires EDIT access.
      operationId: PipelinesController_delete[0]
      parameters:
        - name: id
          required: true
          in: path
          description: Workflow UUID.
          schema:
            example: b0e9f2a4-2b1a-4c7d-9a3e-1f5c8d2e4b60
            type: string
      responses:
        '200':
          description: Soft-deleted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PipelineDeletedDto'
        '401':
          description: Unauthorized — invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '403':
          description: >-
            Visible to this caller, but read-only for them
            (`pipeline_forbidden`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '404':
          description: No such workflow in this workspace, or not visible to this caller.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
      security:
        - ApiKey: []
components:
  schemas:
    PipelineDeletedDto:
      type: object
      properties:
        id:
          type: string
          description: The workflow that was soft-deleted.
          example: b0e9f2a4-2b1a-4c7d-9a3e-1f5c8d2e4b60
        deleted:
          type: boolean
          description: >-
            Always `true` — the route either soft-deletes and returns this, or
            throws.
          example: true
      required:
        - id
        - deleted
    ErrorResponseDto:
      type: object
      properties:
        error:
          description: >-
            The error envelope. Every non-2xx response from this API has this
            shape, so a client can parse failures without branching on the
            endpoint.
          allOf:
            - $ref: '#/components/schemas/ErrorDetailDto'
      required:
        - error
    ErrorDetailDto:
      type: object
      properties:
        message:
          type: string
          example: Model not found
          description: Human-readable error message
        type:
          type: string
          example: invalid_request_error
          description: Error category
          enum:
            - invalid_request_error
            - authentication_error
            - permission_error
            - quota_exceeded
            - rate_limit_error
            - server_error
        code:
          type: string
          example: model_not_found
          nullable: true
          description: >-
            Stable machine-readable error code. Branch on this rather than on
            `message`, which is prose and may be reworded.
        param:
          type: string
          example: model
          nullable: true
          description: >-
            Name of the request parameter that triggered the error. `null` when
            the error is not attributable to one field.
        job_id:
          type: string
          example: job_1hR9xTPZqK4mVLc2nJ7fY5wB
          description: >-
            Handle to work that is ALREADY RUNNING AND ALREADY BILLED, present
            on the few errors that carry one. When it is here, this is not a
            failure to retry — retrying pays twice. Collect the result from `GET
            /v1/images/jobs/{job_id}`, which serves every durable media job
            regardless of modality.


            Two situations produce it. A media generation that outruns the
            gateway's wait answers `504` with `code: "job_timeout"` and keeps
            working. And `POST /v1/audio/speech` answers **500** with `code:
            "artifact_unreadable"` when the speech was generated and settled but
            could not be read back from storage — the audio exists and is paid
            for; only this response failed.


            Declared here rather than per-endpoint because the rule is about the
            FIELD, not the status: if this is present, there is a paid-for
            result to collect. It was undeclared until now, so a client
            generated from this document could not see the one field that
            recovers money already spent.
      required:
        - message
        - type
        - code
        - param
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: Authorization
      description: 'API key in format: Bearer inf_***'

````