---
title: "Update existing rule."
method: PUT
path: "/v1/rules/{id}"
tags: ["rules"]
---

# Update existing rule.

`PUT /v1/rules/{id}`

## Request

- Base URL: `https://demo.firefly-iii.org/api`
- URL: `https://demo.firefly-iii.org/api/v1/rules/{id}`
- Auth: one of:
  - OAuth 2
    - Authorization code: `https://demo.firefly-iii.org/oauth/authorize`
    - Token URL: `https://demo.firefly-iii.org/oauth/token`
  - HTTP bearer

Update existing rule.

## Path parameters

- `id` string, required

## Headers

- `X-Trace-Id` string, uuid

## Request body

- RuleUpdate
  - `title` string, string
  - `description` string, string
  - `rule_group_id` string, string: ID of the rule group under which the rule must be stored. Either this field or rule_group_title is mandatory.
  - `order` integer
  - `trigger` 'store-journal' | 'update-journal' | 'manual-activation', string: Which action is necessary for the rule to fire? Use either store-journal, update-journal or manual-activation.
  - `active` boolean: Whether or not the rule is even active. Default is true.
  - `strict` boolean: If the rule is set to be strict, ALL triggers must hit in order for the rule to fire. Otherwise, just one is enough. Default value is true.
  - `stop_processing` boolean: If this value is true and the rule is triggered, other rules after this one in the group will be skipped. Default value is false.
  - `triggers` RuleTriggerUpdate[]
    - `type` 'from_account_starts' | 'from_account_ends' | 'from_account_is' | 'from_account_contains' | 'to_account_starts' | 'to_account_ends' | 'to_account_is' | 'to_account_contains' | 'amount_less' | 'amount_exactly' | 'amount_more' | 'description_starts' | 'description_ends' | 'description_contains' | 'description_is' | 'transaction_type' | 'category_is' | 'budget_is' | 'tag_is' | 'currency_is' | 'has_attachments' | 'has_no_category' | 'has_any_category' | 'has_no_budget' | 'has_any_budget' | 'has_no_tag' | 'has_any_tag' | 'notes_contains' | 'notes_starts' | 'notes_end' | 'notes_are' | 'no_notes' | 'any_notes' | 'source_account_is' | 'destination_account_is' | 'source_account_starts', string: The type of thing this trigger responds to. A limited set is possible
    - `value` string, string: The accompanying value the trigger responds to. This value is often mandatory, but this depends on the trigger. If the rule trigger is something like 'has any tag', submit the string 'true'.
    - `order` integer: Order of the trigger
    - `active` boolean: If the trigger is active.
    - `stop_processing` boolean: When true, other triggers will not be checked if this trigger was triggered.
  - `actions` RuleActionUpdate[]
    - `type` 'user_action' | 'set_category' | 'clear_category' | 'set_budget' | 'clear_budget' | 'add_tag' | 'remove_tag' | 'remove_all_tags' | 'set_description' | 'append_description' | 'prepend_description' | 'set_source_account' | 'set_destination_account' | 'set_notes' | 'append_notes' | 'prepend_notes' | 'clear_notes' | 'link_to_bill' | 'convert_withdrawal' | 'convert_deposit' | 'convert_transfer' | 'delete_transaction', string: The type of thing this action will do. A limited set is possible.
    - `value` string, string, nullable: The accompanying value the action will set, change or update. Can be empty, but for some types this value is mandatory.
    - `order` integer: Order of the action
    - `active` boolean: If the action is active.
    - `stop_processing` boolean: When true, other actions will not be fired after this action has fired.

## Response `200`

Updated rule stored, result in response

- RuleSingle
  - `data` RuleRead, required
    - `type` string, string, required: Immutable value
    - `id` string, string, required
    - `attributes` Rule, required
      - `created_at` string, date-time
      - `updated_at` string, date-time
      - `title` string, string, required
      - `description` string, string
      - `rule_group_id` string, string, required: ID of the rule group under which the rule must be stored. Either this field or rule_group_title is mandatory.
      - `rule_group_title` string, string: Title of the rule group under which the rule must be stored. Either this field or rule_group_id is mandatory.
      - `order` integer
      - `trigger` 'store-journal' | 'update-journal' | 'manual-activation', string, required: Which action is necessary for the rule to fire? Use either store-journal, update-journal or manual-activation.
      - `active` boolean: Whether or not the rule is even active. Default is true.
      - `strict` boolean: If the rule is set to be strict, ALL triggers must hit in order for the rule to fire. Otherwise, just one is enough. Default value is true.
      - `stop_processing` boolean: If this value is true and the rule is triggered, other rules after this one in the group will be skipped. Default value is false.
      - `triggers` RuleTrigger[], required
        - `id` string, string
        - `created_at` string, date-time
        - `updated_at` string, date-time
        - `type` 'from_account_starts' | 'from_account_ends' | 'from_account_is' | 'from_account_contains' | 'to_account_starts' | 'to_account_ends' | 'to_account_is' | 'to_account_contains' | 'amount_less' | 'amount_exactly' | 'amount_more' | 'description_starts' | 'description_ends' | 'description_contains' | 'description_is' | 'transaction_type' | 'category_is' | 'budget_is' | 'tag_is' | 'currency_is' | 'has_attachments' | 'has_no_category' | 'has_any_category' | 'has_no_budget' | 'has_any_budget' | 'has_no_tag' | 'has_any_tag' | 'notes_contains' | 'notes_starts' | 'notes_end' | 'notes_are' | 'no_notes' | 'any_notes' | 'source_account_is' | 'destination_account_is' | 'source_account_starts', string, required: The type of thing this trigger responds to. A limited set is possible
        - `value` string, string, required: The accompanying value the trigger responds to. This value is often mandatory, but this depends on the trigger.
        - `prohibited` boolean: If 'prohibited' is true, this rule trigger will be negated. 'Description is' will become 'Description is NOT' etc.
        - `order` integer: Order of the trigger
        - `active` boolean: If the trigger is active. Defaults to true.
        - `stop_processing` boolean: When true, other triggers will not be checked if this trigger was triggered. Defaults to false.
      - `actions` RuleAction[], required
        - `id` string, string
        - `created_at` string, date-time
        - `updated_at` string, date-time
        - `type` 'user_action' | 'set_category' | 'clear_category' | 'set_budget' | 'clear_budget' | 'add_tag' | 'remove_tag' | 'remove_all_tags' | 'set_description' | 'append_description' | 'prepend_description' | 'set_source_account' | 'set_destination_account' | 'set_notes' | 'append_notes' | 'prepend_notes' | 'clear_notes' | 'link_to_bill' | 'convert_withdrawal' | 'convert_deposit' | 'convert_transfer' | 'delete_transaction', string, required: The type of thing this action will do. A limited set is possible.
        - `value` string, string, nullable, required: The accompanying value the action will set, change or update. Can be empty, but for some types this value is mandatory.
        - `order` integer: Order of the action
        - `active` boolean: If the action is active. Defaults to true.
        - `stop_processing` boolean: When true, other actions will not be fired after this action has fired. Defaults to false.
    - `links` ObjectLink, required
      - `0` object
        - `rel` string, string
        - `uri` string, string
      - `self` string, uri

## Other responses

- `400`: Bad request
- `401`: Unauthenticated
- `404`: Page not found
- `422`: Validation error. The body will have the exact details.
- `500`: Internal exception

---

[API](https://skmtc.dev/firefly-iii/apis/firefly-iii-api-v6-5-1.md) - [All operations](https://skmtc.dev/firefly-iii/apis/firefly-iii-api-v6-5-1/llms.txt) - [OpenAPI document](https://skmtc.dev/firefly-iii/apis/firefly-iii-api-v6-5-1/revisions/d60bf328844a?raw)
