Skip to content
StatusSupportDashboard

Get request status and inline results

GET/v1/data/{namespace}/requests/{requestId}

Retrieve the status of a data ingestion request and, once complete, return processed objects inline. If the processed output exceeds the 5 MiB inline response limit, this endpoint returns an error instructing you to use the download endpoint instead.

Path ParametersExpand Collapse
namespace: string

The namespace the data was ingested into

requestId: string

The request ID returned when the ingest request was created

ReturnsExpand Collapse
data: array of object { id, output, url, metadata }
id: string

Object identifier from the ingested data

output: object { actions, fields, labels }
actions: array of unknown
fields: map[unknown]
labels: array of object { label }
label: string
url: string
metadata: optional map[unknown]
namespace: string
request_id: string
status: "queued" or "uploading" or "ingesting" or 2 more

Current processing status of the request

One of the following:
"queued"
"uploading"
"ingesting"
"succeeded"
"failed"

Get request status and inline results

curl https://api.safetykit.com/v1/data/$NAMESPACE/requests/$REQUEST_ID \
    -H "Authorization: Bearer $SAFETYKIT_API_KEY"
{
  "data": [
    {
      "id": "item-001",
      "output": {
        "actions": [
          {}
        ],
        "fields": {},
        "labels": [
          {
            "label": "illegal_drugs.violation"
          },
          {
            "label": "hazardous.violation"
          }
        ]
      },
      "url": "https://app.safetykit.com/...",
      "metadata": {
        "internal-ref": "bar"
      }
    }
  ],
  "namespace": "products",
  "request_id": "request_01KHSKHQSYJN4A5P7RRVEXHWE9",
  "status": "succeeded"
}
Returns Examples
{
  "data": [
    {
      "id": "item-001",
      "output": {
        "actions": [
          {}
        ],
        "fields": {},
        "labels": [
          {
            "label": "illegal_drugs.violation"
          },
          {
            "label": "hazardous.violation"
          }
        ]
      },
      "url": "https://app.safetykit.com/...",
      "metadata": {
        "internal-ref": "bar"
      }
    }
  ],
  "namespace": "products",
  "request_id": "request_01KHSKHQSYJN4A5P7RRVEXHWE9",
  "status": "succeeded"
}