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

# deleteApiVersion

> Starts deleting a version and returns `DELETE_STARTED` at once; the version's applications are archived. The teardown runs in the background: follow `ApiVersion.state` until `DELETED` (after a hard delete the version is gone instead). Fails with `ValidationError` while a publish is running.



**mutation** `deleteApiVersion(input: DeleteApiVersionInput!): DeleteApiVersionPayload!`

## Arguments

**`input`**: `DeleteApiVersionInput!` (required)

## Returns

`DeleteApiVersionPayload!`

**`apiVersionState`**: `ApiVersionState`

---

**`errors`**: `[DeleteApiVersionError!]`

## Examples

```graphql Mutation
mutation DeleteApiVersion($input: DeleteApiVersionInput!) {
  deleteApiVersion(input: $input) {
    apiVersionState
    errors {
      __typename
      ... on GraphQlError {
        code
        details {
          __typename
        }
        message
      }
    }
  }
}
```

```json Variables
{
  "input": {
    "input": {
      "destinationId": "id",
      "hardDelete": true,
      "id": "id"
    }
  }
}
```

```json Response
{
  "data": {
    "deleteApiVersion": {
      "apiVersionState": "NEW",
      "errors": [
        {
          "__typename": "GraphQlError",
          "code": "string",
          "details": [
            {
              "__typename": "KeyValuePairOfStringAndString"
            }
          ],
          "message": "string"
        }
      ]
    }
  }
}
```


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