update customer vetting rule.md
Update Customer Vetting Rule
Authentication
Include your Access-Token and x-api-key in the header of your requests.
Permissions
The external-api-update-compliance-rules permission is required to access this endpoint.
To retrieve the customer_rule_id before updating, use the List Customer Compliance Rules endpoint, which requires the external-api-compliance-rules permission.
Endpoint
URL: https://api.genlogs.io/customer-compliance-rules/{customer_rule_id}
Method: PATCH
Updates the status and/or parameter values of an existing customer compliance rule. At least one of status or param_values must be provided.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
customer_rule_id |
string (UUID) | Yes | Unique identifier of the customer compliance rule to update. |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
status |
string | No* | Rule status. Allowed values: enabled, disabled. |
param_values |
object | No* | Rule configuration values used during carrier evaluation. |
* At least one of status or param_values must be provided.
Observed by GenLogs Validation
When updating the Observed by GenLogs rule, param_values is strictly validated before the update is processed.
Validation applies only to this external API endpoint. Internal GenLogs UI/API update flows are not affected.
date_interval
Must be a supported interval value:
1_day7_days14_days1_month3_months6_months12_months18_months2_years3_years4_plus_years
decision_matrix
Must follow this structure:
{% code expandable="true" %}
{"false": "<value>","true": "<value>"}
{% endcode %}
Rules:
- Only allowed keys:
false,true falsemust berevieworfailtruemust bepass- No extra keys are allowed
Valid combinations:
false |
true |
|---|---|
review |
pass |
fail |
pass |
fail_message
Must be a strict boolean (true or false).
Rejected examples:
"false"(string)0(number)
pass_message
Must be a strict boolean (true or false).
Rejected examples:
"true"(string)1(number)
Request Examples
Update status only
{% code overflow="wrap" %}
curl --location --request PATCH 'https://api.genlogs.io/customer-compliance-rules/{id}' \
--header 'access-token: <your-api-token>' \
--header 'x-api-key: <your-x-api-key>' \
--header 'Content-Type: application/json' \
--data '{
"status": "enabled"
}'
{% endcode %}
Update Observed by GenLogs rule — review when not observed
{% code overflow="wrap" %}
curl --location --request PATCH 'https://api.genlogs.io/customer-compliance-rules/{id}' \
--header 'access-token: <your-api-token>' \
--header 'x-api-key: <your-x-api-key>' \
--header 'Content-Type: application/json' \
--data '{
"status": "enabled",
"param_values": {
"date_interval": "1_month",
"decision_matrix": {
"false": "review",
"true": "pass"
},
"fail_message": false,
"pass_message": true
}
}'
{% endcode %}
Responses
| Status | Description |
|---|---|
200 OK |
Customer compliance rule updated successfully. |
400 Bad Request |
Invalid request body, missing required fields, or invalid param_values. |
401 Unauthorized |
Authentication credentials are missing or invalid. |
403 Forbidden |
User does not have the required permission. |
404 Not Found |
Customer compliance rule does not exist. |
500 Internal Server Error |
Server error while processing the request. |
Response Body
200 OK
{% code overflow="wrap" %}
{
"message": "Success! The customer rule has been updated.",
"status_code": 200
}
{% endcode %}
400 Bad Request
Returned when:
- Neither
statusnorparam_valuesis provided param_valuescontains invalid Observed by GenLogs values
Missing update fields
{% code overflow="wrap" %}
{
"message": "At least status or param_values must be provided for update"
}
{% endcode %}
Invalid date_interval
{% code expandable="true" %}
{
"detail": "Invalid param_values for Observed by GenLogs: param_values.date_interval: Value error, Unsupported date interval: last_week"
}
{% endcode %}
Invalid decision_matrix value
{% code expandable="true" %}
{
"detail": "Invalid param_values for Observed by GenLogs: param_values.decision_matrix.false: Input should be 'review' or 'fail'"
}
{% endcode %}
Invalid decision_matrix combination
{% code expandable="true" %}
{
"detail": "Invalid param_values for Observed by GenLogs: param_values.decision_matrix.true: Input should be 'pass'"
}
{% endcode %}
Non-boolean message flags
{% code expandable="true" %}
{
"detail": "Invalid param_values for Observed by GenLogs: param_values.fail_message: Input should be a valid boolean"
}
{% endcode %}
401 Unauthorized
{% code expandable="true" %}
{
"detail": {"message": "Token is missing","subcode": "TOKEN_MISSING"}
}
{% endcode %}
403 Forbidden
{% code expandable="true" %}
{
"detail": "User does not have the required permissions to access this resource"
}
{% endcode %}
404 Not Found
{% code expandable="true" %}
{
"message": "Customer rule id: {id} not found"
}
{% endcode %}
Update customer compliance rule
Updates the status and/or parameter values of an existing customer compliance rule. At least one of `status` or `param_values` must be provided. The authenticated company must have vetting access permissions.