---
title: "Update a rule"
method: PATCH
path: "/v1/erp/payouts/rules/{id}"
tags: ["Rule"]
---

# Update a rule

`PATCH /v1/erp/payouts/rules/{id}`

## Request

- Base URL: `https://api.cardda.com`
- URL: `https://api.cardda.com/v1/erp/payouts/rules/{id}`
- Auth: HTTP bearer

Updates a rule's attributes, constraints, and effects. `applicable_model` is ignored on
update (immutable after creation).

## Parameters

- `#/paths/~1v1~1erp~1payouts~1rules/get/parameters/0` (unresolved $ref)
- `#/paths/~1v1~1erp~1payouts~1rules~1%7Bid%7D/get/parameters/1` (unresolved $ref)

## Request body

- Schema (unresolved $ref)

## Response `200`

The updated rule.

- Rule: An automation rule that applies categorization or approval effects to payables (or purchase orders) matching its constraints.
  - `id` string, uuid, required
  - `name` string
  - `user_id` string: The user that created the rule.
  - `company_id` string, uuid, required
  - `constraints` object, nullable: The JSON constraint tree that determines which records the rule matches.
  - `enabled` boolean
  - `inheritable` boolean: Whether child companies in the corporate group inherit this rule.
  - `applicable_model` string: Target model bucket the rule applies to. Defaults to `tradables` (payables). Set once at creation and immutable thereafter.
  - `hidden` boolean
  - `overrides_rule_id` string, uuid, nullable
  - `inherit_override` boolean
  - `created_at` string, date-time
  - `updated_at` string, date-time
  - `attribute_change_effects` object[]
    - `id` string, uuid
    - `target_attribute` string
    - `target_value` string
  - `custom_column_change_effects` object[]
    - `id` string, uuid
    - `target_custom_column_id` string, uuid
    - `target_value` string
  - `reviewer_assigner_effects` object[]: Approval effects that assign reviewers. Present only for approval rules.
    - `id` string, uuid
    - `reviewer_user_id` string
    - `reviewer_order` integer
  - `related_partners` object[]: Business partners referenced by the rule's constraints. Included only in the `show` response (via the `related_partners` method).

## Other responses

- `401`: Unauthorized
- `404`: Rule not found
- `422`: Unprocessable Entity

---

[API](https://skmtc.dev/cardda/apis/erp-api.md) - [All operations](https://skmtc.dev/cardda/apis/erp-api/llms.txt) - [OpenAPI document](https://skmtc.dev/cardda/apis/erp-api/revisions/0730ed26bc3c?raw)
