Skip to content
StatusSupportDashboard
Using the Data API

Receiving Results

Handle asynchronous Data API outputs via webhooks.

SafetyKit sends object-level results through webhooks after processing completes. This gives you near real-time decisions without requiring your ingest path to block until analysis is finished.

For object-level Data API completion, subscribe to workflow.succeeded.

{
"type": "workflow.succeeded",
"namespace": "products",
"id": "product_12345",
"request_id": "req_01h2m7qdmdjckc30e1mnq6xqfd",
"output": {
"actions": [],
"labels": [{ "label": "policy.example_violation" }],
"fields": {
"confidence": 0.92
}
}
}

When receiving webhook events:

  1. Verify webhook signatures.
  2. Filter by type and namespace.
  3. Use id to map results to your records – this is the original id provided when the object was ingested.
  4. Persist labels, fields and actions for downstream use.

If webhook delivery is delayed or temporarily unavailable, you can reconcile outputs with GET /v1/data/{namespace}/requests/{requestId}.

if (event.type === "workflow.succeeded" && event.namespace === "products") {
const { id, output } = event;
await handleReviewDecision(id, output);
}

You can also subscribe to workflow.failed for failure lifecycle events, depending on how your workflow is configured.

See Webhooks Introduction and Verifying Signatures for setup and security guidance.