Rules
List Rules
List business rules for the current tenant.
Optionally filter by instance_id or active status.
Owen F4 (inherited-default reads): non-admins see rows where
customer_id == user.customer_id OR customer_id IS NULL
(tenant-default rules are inherited by every customer). Tenant
admins see every rule in the tenant.
"Round up the usual suspects." — Captain Renault, Casablanca
In: header
Query Parameters
falseHeader Parameters
Response Body
curl -X GET "https://loading/v1/rules?instance_id=497f6eca-6276-4993-bfeb-53cbbbba6f08&active_only=false" \ -H "X-Api-Key: string"[
{
"actions": [
{}
],
"conditions": [
{}
],
"cooldown_seconds": 0,
"created_at": "2019-08-24T14:15:22Z",
"customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",
"description": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"instance_id": "06587974-2dbe-4e10-8bf9-38cce0f5a366",
"is_active": true,
"last_triggered_at": "2019-08-24T14:15:22Z",
"name": "string",
"priority": 0,
"rule_key": "string",
"tenant_id": "34f5c98e-f430-457b-a812-92637d0c6fd0",
"trigger_count": 0,
"trigger_event": "string",
"updated_at": "2019-08-24T14:15:22Z"
}
]{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}Create Rule
Create a new business rule.
Requires admin role. Validates trigger event, conditions, and actions.
Owen-locked strict-write contract: non-admin + customer_id=None is rejected. Tenant-default rules are admin-only. The list/read side honors inherited-default semantics (own + NULL visible), but writes stay strict so a within-customer admin can't mint fan-out rules.
"There are two types of people in this world: those with rules, and those who dig. You dig." — The Good, the Bad and the Ugly (paraphrased)
In: header
Header Parameters
1 <= items3000 <= valueNULL = tenant-wide, set = customer-specific
true1 <= length <= 20000 <= valueOverride key — same key suppresses tenant rule
Response Body
curl -X POST "https://loading/v1/rules" \ -H "X-Api-Key: string" \ -H "Content-Type: application/json" \ -d '{ "name": "string", "trigger_event": "string" }'{
"actions": [
{}
],
"conditions": [
{}
],
"cooldown_seconds": 0,
"created_at": "2019-08-24T14:15:22Z",
"customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",
"description": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"instance_id": "06587974-2dbe-4e10-8bf9-38cce0f5a366",
"is_active": true,
"last_triggered_at": "2019-08-24T14:15:22Z",
"name": "string",
"priority": 0,
"rule_key": "string",
"tenant_id": "34f5c98e-f430-457b-a812-92637d0c6fd0",
"trigger_count": 0,
"trigger_event": "string",
"updated_at": "2019-08-24T14:15:22Z"
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}List Replayable Services
List services registered for approval replay.
The frontend uses this to populate the require_approval service picker.
Response Body
curl -X GET "https://loading/v1/rules/replayable-services"[
{}
]List Trigger Types
List all available trigger event types and their payload schemas.
The frontend uses this to populate the trigger selector and build dynamic condition forms.
"Choose wisely." — Grail Knight, Indiana Jones and the Last Crusade
Response Body
curl -X GET "https://loading/v1/rules/trigger-types"[
{
"description": "string",
"event": "string",
"label": "string",
"payload_fields": [
{}
]
}
]Get Rule
Get a specific business rule by ID.
Owen F6 (inherited-default read): non-admins can read tenant- default rules (customer_id IS NULL) since those rules apply to them anyway. Other-customer rows still 403. Tenant admins read everything in the tenant.
"Elementary, my dear Watson." — Sherlock Holmes (never actually said it)
In: header
Path Parameters
uuidHeader Parameters
Response Body
curl -X GET "https://loading/v1/rules/497f6eca-6276-4993-bfeb-53cbbbba6f08" \ -H "X-Api-Key: string"{
"actions": [
{}
],
"conditions": [
{}
],
"cooldown_seconds": 0,
"created_at": "2019-08-24T14:15:22Z",
"customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",
"description": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"instance_id": "06587974-2dbe-4e10-8bf9-38cce0f5a366",
"is_active": true,
"last_triggered_at": "2019-08-24T14:15:22Z",
"name": "string",
"priority": 0,
"rule_key": "string",
"tenant_id": "34f5c98e-f430-457b-a812-92637d0c6fd0",
"trigger_count": 0,
"trigger_event": "string",
"updated_at": "2019-08-24T14:15:22Z"
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}Update Rule
Update an existing business rule.
Requires admin role. Only provided fields are updated.
Owen-locked strict-write: non-admin cannot mutate tenant-default rules even though they can READ them (inherited-default). "Improvise, adapt, overcome." — Bear Grylls (about updating rules on the fly)
In: header
Path Parameters
uuidHeader Parameters
Response Body
curl -X PATCH "https://loading/v1/rules/497f6eca-6276-4993-bfeb-53cbbbba6f08" \ -H "X-Api-Key: string" \ -H "Content-Type: application/json" \ -d '{}'{
"actions": [
{}
],
"conditions": [
{}
],
"cooldown_seconds": 0,
"created_at": "2019-08-24T14:15:22Z",
"customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",
"description": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"instance_id": "06587974-2dbe-4e10-8bf9-38cce0f5a366",
"is_active": true,
"last_triggered_at": "2019-08-24T14:15:22Z",
"name": "string",
"priority": 0,
"rule_key": "string",
"tenant_id": "34f5c98e-f430-457b-a812-92637d0c6fd0",
"trigger_count": 0,
"trigger_event": "string",
"updated_at": "2019-08-24T14:15:22Z"
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}Delete Rule
Delete a business rule.
Requires admin role. Gone forever — no soft delete. Strict-write: non-admin cannot delete tenant-default rules. "Hasta la vista, baby." — T-800, Terminator 2
In: header
Path Parameters
uuidHeader Parameters
Response Body
curl -X DELETE "https://loading/v1/rules/497f6eca-6276-4993-bfeb-53cbbbba6f08" \ -H "X-Api-Key: string"{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}Test Rule
Dry-run test a rule against a sample payload.
Evaluates conditions but does NOT execute actions. Strict-write boundary — non-admin cannot dry-run a tenant-default rule.
"This is a test. This is only a test." — Emergency Broadcast System
In: header
Path Parameters
uuidHeader Parameters
Sample event payload to test against
Empty Object
Response Body
curl -X POST "https://loading/v1/rules/497f6eca-6276-4993-bfeb-53cbbbba6f08/test" \ -H "X-Api-Key: string" \ -H "Content-Type: application/json" \ -d '{ "payload": {} }'{
"actions_that_would_fire": [
{}
],
"all_conditions_met": true,
"condition_results": [
{}
],
"rule_id": "728c1541-d6d1-4290-9a53-cdf01dd32d60",
"rule_name": "string"
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}