---
title: "Delete a categorization rule"
method: DELETE
path: "/books/rule/{ruleId}"
tags: ["Books"]
---

# Delete a categorization rule

`DELETE /books/rule/{ruleId}`

## Request

- Base URL: `https://api.mercury.com/api/v1`
- URL: `https://api.mercury.com/api/v1/books/rule/{ruleId}`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/mercurytechnologies/apis/mercury-api/docs/books/rule/:ruleId/delete.ts> (a function with typed inputs; its response is checked against the schema)

Deletes one categorization rule of a Books instance by ID, so it no longer categorizes transactions from now on. Ledgers, i.e. general ledger (GL) accounts, that the rule already applied to transactions stay in place; deleting a rule does not un-categorize anything. Only rules that getBooksCategorizationRules returns can be deleted; any other ID, including the organization's other automation rules that Books doesn't show, is a 404. To find rule IDs, use getBooksCategorizationRules. Returns no content on success, and 404 otherwise.

## Path parameters

- `ruleId` string, uuid, required: The ID of the categorization rule, as returned by getBooksCategorizationRules.

## Query parameters

- `booksId` string, uuid: The Books instance to act on. Must be the token organization's own instance, which it defaults to.

## Response `204`

## Other responses

- `400`: Invalid `booksId`
- `404`: `ruleId` not found

## Changes

- **2026-11-03** `95c77a617769`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/mercurytechnologies/apis/mercury-api/changes/books/rule/:ruleId/delete.md)

---

[API](https://skmtc.dev/mercurytechnologies/apis/mercury-api.md) - [All operations](https://skmtc.dev/mercurytechnologies/apis/mercury-api/llms.txt) - [OpenAPI document](https://skmtc.dev/mercurytechnologies/apis/mercury-api/revisions/95c77a617769?raw)
