Skip to content
StatusSupportDashboard

Get decision results

get/v1/decisions/{decision_id}

Retrieve the results of a previously submitted decision by its ID.

Path ParametersExpand Collapse
decision_id: string

The decision ID to retrieve

ReturnsExpand Collapse
decision_id: string

Unique identifier for the decision

decision_status: "SUCCESS" or "PENDING" or "ERROR" or "CANCELLED"

Status of the decision

Accepts one of the following:
"SUCCESS"
"PENDING"
"ERROR"
"CANCELLED"
labels: array of object { applied, explanation, name }

Labels assigned during the decision process

applied: boolean

Whether or not the label was applied in this decision

explanation: string

An explanation of why the label was applied or not applied

name: string

The name of the label

metadata: map[string or number or boolean]

Customer metadata as key-value pairs

Accepts one of the following:
UnionMember0 = string
UnionMember1 = number
UnionMember2 = boolean
result: string

The result of the policy (possible values are determined by the policy)

policy_id: optional string

Policy ID used for this decision

policy_version: optional string

Policy version used for this decision

Get decision results
curl https://api.safetykit.com/v1/decisions/$DECISION_ID \
    -H "Authorization: Bearer $SAFETYKIT_API_KEY"
{
  "decision_id": "content_01h2m7qdmdjckc30e1mnq6xqfd",
  "decision_status": "SUCCESS",
  "labels": [
    {
      "applied": true,
      "explanation": "The product is stated to be a Burberry item, a well-known brand",
      "name": "Counterfeit brands"
    },
    {
      "applied": false,
      "explanation": "The product is a handbag, and does not contain any illegal drugs",
      "name": "Illegal drugs"
    }
  ],
  "metadata": {},
  "result": "violating",
  "policy_id": "policy_id",
  "policy_version": "policy_version"
}
Returns Examples
{
  "decision_id": "content_01h2m7qdmdjckc30e1mnq6xqfd",
  "decision_status": "SUCCESS",
  "labels": [
    {
      "applied": true,
      "explanation": "The product is stated to be a Burberry item, a well-known brand",
      "name": "Counterfeit brands"
    },
    {
      "applied": false,
      "explanation": "The product is a handbag, and does not contain any illegal drugs",
      "name": "Illegal drugs"
    }
  ],
  "metadata": {},
  "result": "violating",
  "policy_id": "policy_id",
  "policy_version": "policy_version"
}