Skip to content
StatusSupportDashboard

Request a new decision

client.decisions.create(DecisionCreateParams { content, type, metadata } body, RequestOptionsoptions?): DecisionCreateResponse { decision_id, metadata, type }
post/v1/decisions

Submit content for review and receive a decision ID to track the results. The decision is processed asynchronously.

ParametersExpand Collapse
body: DecisionCreateParams { content, type, metadata }
content: Record<string, string | number | boolean | Array<string> | null>

The data to be reviewed. The structure depends on the type of content.

Accepts one of the following:
string
number
boolean
Array<string>
type: string

The type of content to review

metadata?: Record<string, string | number | boolean | null>

Customer metadata as key-value pairs

Accepts one of the following:
string
number
boolean
ReturnsExpand Collapse
DecisionCreateResponse { decision_id, metadata, type }

Response containing the decision ID

decision_id: string

Unique identifier for the decision

metadata: Record<string, string | number | boolean | null>

Customer metadata as key-value pairs

Accepts one of the following:
string
number
boolean
type: string

Type of content to review

Request a new decision
import Safetykit from 'safetykit';

const client = new Safetykit({
  apiKey: process.env['SAFETYKIT_API_KEY'], // This is the default and can be omitted
});

const decision = await client.decisions.create({
  content: { url: 'https://www.example.com/products/42' },
  type: 'product_review',
});

console.log(decision.decision_id);
{
  "decision_id": "content_01h2m7qdmdjckc30e1mnq6xqfd",
  "metadata": {},
  "type": "product_review"
}
Returns Examples
{
  "decision_id": "content_01h2m7qdmdjckc30e1mnq6xqfd",
  "metadata": {},
  "type": "product_review"
}