banks2ff/firefly-iii-api/docs/RulesApi.md
Jacob Kiers f0b8df90b9 Initial commit
This is definitely not functional yet.

Signed-off-by: Jacob Kiers <code@kiers.eu>
2024-10-04 20:31:39 +02:00

9.0 KiB

\RulesApi

All URIs are relative to https://demo.firefly-iii.org/api

Method HTTP request Description
delete_rule DELETE /v1/rules/{id} Delete an rule.
fire_rule POST /v1/rules/{id}/trigger Fire the rule on your transactions.
get_rule GET /v1/rules/{id} Get a single rule.
list_rule GET /v1/rules List all rules.
store_rule POST /v1/rules Store a new rule
test_rule GET /v1/rules/{id}/test Test which transactions would be hit by the rule. No changes will be made.
update_rule PUT /v1/rules/{id} Update existing rule.

delete_rule

delete_rule(id, x_trace_id) Delete an rule.

Delete an rule.

Parameters

Name Type Description Required Notes
id String The ID of the rule. [required]
x_trace_id Option<uuid::Uuid> Unique identifier associated with this request.

Return type

(empty response body)

Authorization

firefly_iii_auth, local_bearer_auth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

fire_rule

fire_rule(id, x_trace_id, start, end, accounts_left_square_bracket_right_square_bracket) Fire the rule on your transactions.

Fire the rule group on your transactions. Changes will be made by the rules in the group! Limit the result if you want to.

Parameters

Name Type Description Required Notes
id String The ID of the rule. [required]
x_trace_id Option<uuid::Uuid> Unique identifier associated with this request.
start Option<String> A date formatted YYYY-MM-DD, to limit the transactions the actions will be applied to. If the start date is not present, it will be set to one year ago. If you use this field, both the start date and the end date must be present.
end Option<String> A date formatted YYYY-MM-DD, to limit the transactions the actions will be applied to. If the end date is not present, it will be set to today. If you use this field, both the start date and the end date must be present.
accounts_left_square_bracket_right_square_bracket Option<Vec> Limit the triggering of the rule to these asset accounts or liabilities. Only asset accounts and liabilities will be accepted. Other types will be silently dropped.

Return type

(empty response body)

Authorization

firefly_iii_auth, local_bearer_auth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_rule

models::RuleSingle get_rule(id, x_trace_id) Get a single rule.

Get a single rule.

Parameters

Name Type Description Required Notes
id String The ID of the object. [required]
x_trace_id Option<uuid::Uuid> Unique identifier associated with this request.

Return type

models::RuleSingle

Authorization

firefly_iii_auth, local_bearer_auth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.api+json, application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

list_rule

models::RuleArray list_rule(x_trace_id, limit, page) List all rules.

List all rules.

Parameters

Name Type Description Required Notes
x_trace_id Option<uuid::Uuid> Unique identifier associated with this request.
limit Option<i32> Number of items per page. The default pagination is per 50 items.
page Option<i32> Page number. The default pagination is per 50 items.

Return type

models::RuleArray

Authorization

firefly_iii_auth, local_bearer_auth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.api+json, application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

store_rule

models::RuleSingle store_rule(rule_store, x_trace_id) Store a new rule

Creates a new rule. The data required can be submitted as a JSON body or as a list of parameters.

Parameters

Name Type Description Required Notes
rule_store RuleStore JSON array or key=value pairs with the necessary rule information. See the model for the exact specifications. [required]
x_trace_id Option<uuid::Uuid> Unique identifier associated with this request.

Return type

models::RuleSingle

Authorization

firefly_iii_auth, local_bearer_auth

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/vnd.api+json, application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

test_rule

models::TransactionArray test_rule(id, x_trace_id, start, end, accounts_left_square_bracket_right_square_bracket) Test which transactions would be hit by the rule. No changes will be made.

Test which transactions would be hit by the rule. No changes will be made. Limit the result if you want to.

Parameters

Name Type Description Required Notes
id String The ID of the rule. [required]
x_trace_id Option<uuid::Uuid> Unique identifier associated with this request.
start Option<String> A date formatted YYYY-MM-DD, to limit the transactions the test will be applied to. Both the start date and the end date must be present.
end Option<String> A date formatted YYYY-MM-DD, to limit the transactions the test will be applied to. Both the start date and the end date must be present.
accounts_left_square_bracket_right_square_bracket Option<Vec> Limit the testing of the rule to these asset accounts or liabilities. Only asset accounts and liabilities will be accepted. Other types will be silently dropped.

Return type

models::TransactionArray

Authorization

firefly_iii_auth, local_bearer_auth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.api+json, application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update_rule

models::RuleSingle update_rule(id, rule_update, x_trace_id) Update existing rule.

Update existing rule.

Parameters

Name Type Description Required Notes
id String The ID of the object. [required]
rule_update RuleUpdate JSON array with updated rule information. See the model for the exact specifications. [required]
x_trace_id Option<uuid::Uuid> Unique identifier associated with this request.

Return type

models::RuleSingle

Authorization

firefly_iii_auth, local_bearer_auth

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/vnd.api+json, application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]