Retrieve details for a business rule

GET /api/business-rules/{id}

Success: 200 OK

Overview

Retrieves one business rule with its full configuration: the trigger that fires it, its actions, the conditions that select an action, and the results each action produces.

Read this alongside List all business rules, which gives you the ids but omits everything below isActive.

How a rule behaves at runtime, which is what the nested structure encodes: when the trigger fires for a member, the rule's conditional actions — those with isDefault false — are tested in ascending priority, then ascending id, and the first one whose conditions the member matches is picked. If none match, or the rule has no conditional actions, the default action is used instead. Exactly one action runs per rule per event, and then every entry in that action's results executes.

Endpoint

GET {base_url}/api/business-rules/{id}

{base_url} is the environment URL issued to your integration. See Authenticating with Gladstone APIs.

Path parameters

NameTypeRequiredDescription
idinteger (int32)YesThe rule to retrieve, as returned in [].id by List all business rules. An id that does not exist returns 404.

Sample request

cURL
curl -X GET '{base_url}/api/business-rules/{id}' \
  -H 'Authorization: Bearer {accessToken}' \
  -H 'X-Use-SSO: true'

Response fields

FieldTypeDescription
idinteger (int32)The rule's identifier — the same value you sent in the path.
descriptionstringThe rule's own description, as entered by whoever configured it. Rules have no separate name, so this is what identifies the rule to a human.
isActivebooleanWhether the rule runs. Only active rules run when their trigger fires; an inactive rule is still returned in full here but its actions never execute.
triggerobjectThe platform event that fires this rule. Exactly one per rule. Several rules may share a trigger, and when it fires every active one of them runs — they are not mutually exclusive.
trigger.idinteger (int32)The trigger's identifier. Always a positive integer.
trigger.namestringThe trigger's name. This is the value the list endpoint returns as [].name, which is why that field looks like a rule name but is not one.
trigger.descriptionstringA longer description of the event, for display.
actionsarray of objectThe candidate responses to the trigger. Only one of them runs each time the rule fires — see the selection order in the Overview — so this array is a set of alternatives, not a list of steps.
actions[].descriptionstringThe action's description. Always populated: it is a required field when a rule is created or updated.
actions[].priorityinteger (int32)The order in which conditional actions are tested, lowest first; ties are broken by the action's internal id. Ignored for the default action.
actions[].isDefaultbooleantrue marks the fallback used when no conditional action matches the member, in which case conditions and priority carry no weight. false marks a conditional action, which runs only if the member matches all of its conditions. If several actions are flagged default, the one with the lowest internal id wins.
actions[].conditionsarray of objectTests the member must satisfy for this action to be chosen. Empty for a default action. Keep the count per action small — every conditional action adds a separate check each time the trigger fires.
actions[].conditions[].fieldNamestringThe field tested, drawn from the platform's list of permitted condition fields. Arbitrary names cannot be used: only fields configured as condition fields are accepted.
actions[].conditions[].tableNamestringThe table fieldName belongs to. Conditions can span member, booking and financial data, which is why a rule can test things far from the triggering event.
actions[].conditions[].conditionalstringThe comparison operator. One of =, <>, >, <, >=, <=, IN, NOT IN, LIKE, NOT LIKE — anything else is rejected when the rule is saved.
actions[].conditions[].valuestringThe value compared against, always carried as a string regardless of the field's underlying type. Never null: it is required when a rule is saved.
actions[].resultsarray of objectWhat the action actually does. Unlike actions, these are not alternatives — every result of the selected action runs. Never empty: an action must have at least one result to be saved.
actions[].results[].typestringThe kind of result. email and webhook are recognised, matched case-insensitively, and these determine which of templates and webhooks is populated.
actions[].results[].templatesarray of integerIds of the email templates sent by this result. Populated only when type is email; null for any other type, not an empty array.
actions[].results[].webhooksarray of integerIds of the webhooks called by this result. Populated only when type is webhook; null for any other type, not an empty array.
actions[].results[].descriptionstringThe description of the result's type, taken from the action-type configuration rather than entered per result. Two results of the same type therefore share a description.

Sample response

200 OK
{
  "id": 12345,
  "description": "string",
  "isActive": true,
  "trigger": {
    "id": 12345,
    "name": "string",
    "description": "string"
  },
  "actions": [
    {
      "description": "string",
      "priority": 1,
      "isDefault": true,
      "conditions": [
        {
          "fieldName": "string",
          "tableName": "string",
          "conditional": "string",
          "value": "string"
        }
      ],
      "results": [
        {
          "type": "string",
          "templates": [
            1
          ],
          "webhooks": [
            1
          ],
          "description": "string"
        }
      ]
    }
  ]
}

Errors

StatusMeaningWhen
404Not foundNo rule with that id exists: Business Rule Id {id} doesn't exist.
500Internal server errorAn unexpected server-side failure while reading the rule. The response is a bare 500 with no body. A permissions problem also surfaces here rather than as a clearer error.

This page as markdown · All pages · llms.txt