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

# Delete agent version API

> Delete a Bolna voice agent version that isn't live. Past calls on it keep their data.

Deletes a version and every save under its name. It's no longer listed, readable or callable, and its name becomes free to use again.

Executions that ran on the version keep their transcripts, recordings and data.

> [!WARNING]
>
> Delete returns `409` while the version can't be deleted yet:
>
> * **It's live.** [Make another version live](https://www.bolna.ai/docs/api-reference/agent/v2/versions/set_current.md) first, then delete it. Message: `The live version can't be deleted. Make another version live first.`
> * **It's in the split of an [A/B batch](https://www.bolna.ai/docs/agents/ab-testing.md#split-a-batch) that hasn't finished.** Stop the batch or let it finish first. Message: `This version is in an A/B test on a batch that hasn't finished. Stop or finish that batch first.`
> * **A workflow call that has been accepted but hasn't connected yet is waiting on a save of it**, for example one held until calling hours. Take the version out of the workflow's [A/B test](https://www.bolna.ai/docs/workflows/ab-testing.md#deleting-a-version-in-a-test) and let those calls connect first. Message: `This version has workflow calls waiting to be placed. Take it out of the workflow and let those calls connect first.`


## OpenAPI

````yaml DELETE /v2/agent/{agent_id}/versions/{agent_version_id}
openapi: 3.1.0
info:
  title: Bolna API
  description: >-
    Use and leverage Bolna Voice AI using APIs through HTTP requests from any
    language in your applications and workflows.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.bolna.ai
    description: Production server
security:
  - bearerAuth: []
tags:
  - name: SIP trunks
    description: >-
      Bring-your-own-carrier SIP trunks, their gateways, carrier IPs and
      numbers.
paths:
  /v2/agent/{agent_id}/versions/{agent_version_id}:
    delete:
      description: >-
        Delete a version that isn't live. Past calls that ran on it keep their
        data. The live version can't be deleted, and neither can a version in
        the A/B split of a batch that hasn't finished, or one that a workflow
        call which has been accepted but hasn't connected yet is waiting on.
      parameters:
        - in: path
          name: agent_id
          required: true
          description: The agent's `id`
          schema:
            type: string
            format: uuid
        - in: path
          name: agent_version_id
          required: true
          description: >-
            The version's `id`, from [List agent
            versions](/api-reference/agent/v2/versions/list)
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Version deleted
          content:
            application/json:
              example:
                message: Agent version deleted successfully
        '404':
          description: Agent or version not found
          content:
            application/json:
              example:
                message: Agent version not found
        '409':
          description: >-
            The version is live, is in the A/B split of a batch that hasn't
            finished, or has workflow calls waiting to connect
          content:
            application/json:
              examples:
                live:
                  summary: The version is live
                  value:
                    message: >-
                      The live version can't be deleted. Make another version
                      live first.
                batch:
                  summary: The version is in an unfinished A/B batch
                  value:
                    message: >-
                      This version is in an A/B test on a batch that hasn't
                      finished. Stop or finish that batch first.
                workflow:
                  summary: Workflow calls are waiting on the version
                  value:
                    message: >-
                      This version has workflow calls waiting to be placed. Take
                      it out of the workflow and let those calls connect first.
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

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