banks2ff/firefly-iii-api/docs/RulesApi.md

241 lines
9.0 KiB
Markdown
Raw Permalink Normal View History

# \RulesApi
All URIs are relative to *https://demo.firefly-iii.org/api*
Method | HTTP request | Description
------------- | ------------- | -------------
[**delete_rule**](RulesApi.md#delete_rule) | **DELETE** /v1/rules/{id} | Delete an rule.
[**fire_rule**](RulesApi.md#fire_rule) | **POST** /v1/rules/{id}/trigger | Fire the rule on your transactions.
[**get_rule**](RulesApi.md#get_rule) | **GET** /v1/rules/{id} | Get a single rule.
[**list_rule**](RulesApi.md#list_rule) | **GET** /v1/rules | List all rules.
[**store_rule**](RulesApi.md#store_rule) | **POST** /v1/rules | Store a new rule
[**test_rule**](RulesApi.md#test_rule) | **GET** /v1/rules/{id}/test | Test which transactions would be hit by the rule. No changes will be made.
[**update_rule**](RulesApi.md#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](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## 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<i64>**](i64.md)> | 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](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## 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**](RuleSingle.md)
### Authorization
[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/vnd.api+json, application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## 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**](RuleArray.md)
### Authorization
[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/vnd.api+json, application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## 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**](RuleStore.md) | 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**](RuleSingle.md)
### Authorization
[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#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]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## 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<i64>**](i64.md)> | 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**](TransactionArray.md)
### Authorization
[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/vnd.api+json, application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## 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**](RuleUpdate.md) | 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**](RuleSingle.md)
### Authorization
[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#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]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)