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

# Delete intent-rule draft version

> Delete one unpublished intent-rule draft version.

Deletes one draft version of an intent rule. The route only deletes versions
with `status: "DRAFT"`; published and archived versions stay in the rule's
version history.

> [!NOTE]
>
> This endpoint supports intent rules only. Business Rules are published
> immediately and do not have draft versions.

> [!WARNING]
>
> Deleting a draft removes it from normal version-history reads. It does not
> change the rule's current published version or its agent assignments.

## Headers

**Authorization** `string` *required*

Bearer token containing your Fini workspace API key. Format: `Bearer fini_...`
The key needs `write` scope.

## Path parameters

**id** `string` *required*

Intent-rule ID.

**versionId** `string` *required*

Exact draft version ID to delete.

## Response

Returns `204 No Content` when the delete succeeds. The response body is empty.

```bash cURL theme={null}
curl --request DELETE \
  --url 'https://api-prod.usefini.com/v2/hc-rules/4f5ef695-d03b-4d56-8fef-7f2bd5c17ef3/versions/v3/public' \
  --header 'Authorization: Bearer fini_your_api_key'
```

```javascript Node.js theme={null}
const ruleId = "4f5ef695-d03b-4d56-8fef-7f2bd5c17ef3";
const versionId = "v3";

const response = await fetch(
  `https://api-prod.usefini.com/v2/hc-rules/${ruleId}/versions/${versionId}/public`,
  {
    method: "DELETE",
    headers: {
      Authorization: "Bearer fini_your_api_key",
    },
  }
);

if (!response.ok) {
  throw new Error(`Delete failed: ${response.status}`);
}
```

```python Python theme={null}
import requests

rule_id = "4f5ef695-d03b-4d56-8fef-7f2bd5c17ef3"
version_id = "v3"
response = requests.delete(
    f"https://api-prod.usefini.com/v2/hc-rules/{rule_id}/versions/{version_id}/public",
    headers={"Authorization": "Bearer fini_your_api_key"},
)
response.raise_for_status()
```

```text 204 No Content theme={null}
```

## Errors

> [accordion] 401 Unauthorized
>
> The API key is missing, malformed, revoked, or invalid.

> [accordion] 403 Forbidden
>
> The API key does not include `write` scope.

> [accordion] 404 Not Found
>
> The rule, version, or draft does not exist in your workspace, or the version
> is not a draft.


## Related topics

- [Overview](https://docs.usefini.com/en/api-reference/intent-rules.md)
- [Restore intent-rule version as draft](https://docs.usefini.com/en/api-reference/restore-rule-version-as-draft.md)
- [Publish intent-rule draft](https://docs.usefini.com/en/api-reference/publish-rule-draft.md)


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