Skip to main content
PATCH
/
api
/
buckets
/
{id}
{
  "bucket_rules": [
    {}
  ],
  "rule_id": 123,
  "rule_setting": {},
  "activate_rule": true,
  "last_timestamp": "<string>",
  "modified_by": {
    "id": 123
  },
  "created_by": {
    "id": 123
  }
}
In order to change the configurable parameters for a rule in a bucket, two parameters will be required: rule_id as used previously to detail the rule that will be updated, and rule_setting. rule_setting is a JSON object that will be specific to each given rule id. Thus, it should be aligned with the rule id to be updated.

Example

You may also change the activation and the settings of a rule at the same time by providing the necessary fields that you wish to update. For instance, you can use the following response body to change part of a rule’s parameter and turn on the rule at the same time.
{
     "rule_id": 3,
     "rule_setting": {
         "beneficiary_count_exceeds": 5,
         "lookback_days": 3
     },
     "activate_rule":"True"
}

List of rule_setting

The list of rule_setting based on each rules are as follows:
Rule 1: Parameters
{
     "transaction_count_exceeds": 2,
     "amount_less_than": 2000,
     "lookback_days": 3
}
Rule 2: Parameters
{
     "transaction_count_exceeds": 2,
     "lookback_days": 3
}
Rule 3: Parameters
{
     "beneficiary_count_exceeds": 2,
     "lookback_days": 3
}
Rule 4: Parameters
{
     "sender_count_exceeds": 2,
     "lookback_days": 3
}
Rule 5: Parameters
{
     "aggregated_amount_exceeds": 3000,
     "lookback_days": 30
}
Rule 6: Parameters
{
     "lookback_days": 3,
     "lookback_months_to_determine_baseline": 12,
     "amount_exceed_baseline_by_number_of_times": 10
}
Rule 7 & 8 have no rule parameters!
Rule 9: Parameters
{
     "aggregated_withdrawal_exceeds": 1000,
     "lookback_days": 30
}
Rule 10: Parameters
{
     "aggregated_deposit_exceeds": 1000,
     "lookback_days": 30
}
Rule 11 has no rule parameters!
Rule 12: Parameters
{
    "aggregated_amount_exceeds": 3000
}
Rule 13: Parameters
{
     "lookback_days": 3,
     "lookback_months_to_determine_baseline": 12,
     "amount_exceed_baseline_by_number_of_times": 10
}
Rule 14: Parameters
{
     "aggregated_amount_exceeds": 5000,
     "minimum_transaction_count": 10,
     "lookback_days": 5
}
Rule 15: Parameters
{
     "aggregated_amount_exceeds": 5000,
     "minimum_transaction_count": 10,
     "lookback_days": 5
}
Rule 16: Parameters
{
    "lookback_days": 3,
    "lookback_months_to_determine_baseline": 1,
    "transaction_count_exceed_baseline_by_number_of_times": 20
}
Rule 17 has no rule parameters!
Sample HTTP Request (All Rule 6 Parameters)
HTTP Method: PATCH
URL: {{base_url}}/api/buckets/{bucket_id}
Request Body:
e.g

{
     "rule_id": 6,
     "rule_setting": {
         "lookback_days": 3,
         "lookback_months_to_determine_baseline": 12,
         "amount_exceed_baseline_by_number_of_times": 10
     }
}
Note: The keys used as part of the “rule_setting” JSON will need to be aligned with those highlighted above in respect to each Rule. Otherwise, the following response will be provided with status code 400.
Expected Response Code: 400
Response Body: JSON Object
e.g

{
     "Input Key [aggregated_amount_exceedss] used to set variables for Rule 12 is incorrect. Please check again."
}
You can also update a part of the rule’s parameters by providing the relevant keys that you would like to use to update the rule. For instance, to update only the aggregated_amount_exceeds. You can provide the following request body. Sample HTTP Request (Partial Rule 12 Parameters)
{
     "rule_id":12,
     "rule_setting": {
         "aggregated_amount_exceeds": 10000
     }
}
By doing so, only the aggregated amount exceeds parameter for Rule 12 will be updated for the given bucket. The other fields “variance percent” and “lookback days” will remain unchanged.

Authorizations

Authorization
string
header
required

JWT token obtained from AWS Cognito or custom authentication service

Path Parameters

id
integer
required

A unique integer value identifying this bucket.

Body

A ModelSerializer that takes an additional fields argument that controls which fields should be displayed.

name
string
Required string length: 1 - 255
active_indicator
boolean
description
string
rule_id
integer
rule_setting
object
activate_rule
boolean

Response

200 - application/json

Bucket updated successfully.

bucket_rules
object[]

List of bucket rules.

Rule object

rule_id
integer

Rule ID.

rule_setting
object

Rule settings.

activate_rule
boolean

Activate rule.

last_timestamp
string

Last timestamp.

modified_by
object
created_by
object