Policy Results

This endpoint lists the policy results that were evaluated for a business per the policies defined on your account

When a business goes through Middesk, the status of the business will automatically be set to either "approved" or "rejected" if the business meets the criteria of one of the policies defined for your account.

This endpoint will return a business's policy results which show when a business was evaluated. If the business was auto-approved or auto-rejected based off of the rules an account has enabled, there will be policy result(s) with the matched set to true. If the business was not auto-approved or auto-rejected, there will be policy result(s) with the matched field set to false.

Response returned

PropertyTypeDescription
objectstringThe type of object returned (in this case, "list")
datapolicy_result[]The policy results for the business (see below for fields included)
urlstringURL the resource was fetched from

Items in the data array will include these fields:

PropertyTypeDescription
objectstringA definition of the type of object returned (in this case, "policy_result")
idstring
resultstringResult of the policy decision (approved, rejected, or review)
business_idstringThe ID of the business the policy is evaluating
created_attimestamp
namestringName of the policy
matchedbooleanTrue if the policy was applied and false otherwise
detailsobjectDetails about the insights that the policy evaluated and whether they were matched or not
policy_action_resultspolicy_action_result[]The policy action results for the business (see below for fields included). Each object specifies if we were able to execute a particular action on a matched policy (and if not, why not).

Items in the policy action results array will include these fields:

PropertyTypeDescription
objectstringA definition of the type of object returned (in this case, "policy_action_result")
idstring
executedbooleanIf the action was successfully executed or not
detailsobjectDetails on why the action could not be executed. Note that all policies with "decision" as a policy action will include an insight field of status with status: "in_review. This is a necessary state for the business to be in to match a decision policy, so we automatically add it to all policies that contain that action.
policy_actionobjectThe policy action that this policy action result describes
policy_action.idid
policy_action.action_typestringThe type of action (ex. auto_decision)
policy_action.optionsobjectThe options associated with the action (ex. { "decision": "approve" })
policy_action.policy_version_idstring

These settings can be changed by visiting the Settings page for Policies.

{
	"object": "list",
	"data": [
    {
			"object": "policy_result",
			"id": "0af5caf6-a8e4-431c-8d0a-4618ae8a1028",
			"result": "approved",
			"business_id": "76feb8ec-c33d-4295-8e65-1d0476e26eef",
			"created_at": "2023-04-04T22:23:35.432Z",
			"matched": false,
			"name": "Rejection Policy",
			"details": {
				"insight_state": {
					"name": {
						"match": true,
						"status": "verified"
					},
					"status": {
						"match": false,
						"status": "approved"
					}
				},
				"mismatched_rules": [
        	"status"
        ]
			},
      "policy_action_results": []
		},
		{
			"object": "policy_result",
			"id": "0af5caf6-a8e4-431c-8d0a-4618ae8a2054",
			"result": "approved",
			"business_id": "76feb8ec-c33d-4295-8e65-1d0476e26eef",
			"created_at": "2023-04-04T22:23:35.432Z",
			"matched": true,
			"name": "Approval Policy",
			"details": {
				"insight_state": {
					"name": {
						"match": true,
						"status": "verified"
					},
					"address_verification": {
						"match": true,
						"status": "verified"
					}
				},
				"mismatched_rules": []
			},
      "policy_action_results": [
      	{
					"object": "policy_action_result",
					"id": "936d73d6-aa5c-44bc-86b9-d98b255b16fa",
					"details": null,
					"executed": true,
					"policy_action": {
						"id": "c232ad85-9a70-4292-baea-575fcb6e4a1d",
						"action_type": "auto_decision",
						"options": {
							"decision": "approve"
						},
						"policy_version_id": "7b1e539f-b622-4615-ba1b-5fd4c1436e0c"
					}
				}
      ]
		}
	],
	"url": "https://api.middesk.com/v1/businesses/76feb8ec-c33d-4295-8e65-1d0476e26eef/policy_results"
}
Language
Credentials
Header