Skip to content
StatusSupportDashboard

Get request status

client.data.getStatus(stringrequestID, DataGetStatusParams { namespace } params, RequestOptionsoptions?): DataGetStatusResponse
get/v1/data/{namespace}/requests/{requestId}

Retrieve status on data ingestion request. Supports both add and import requests.

ParametersExpand Collapse
requestID: string

The request ID returned from the Add endpoint

params: DataGetStatusParams { namespace }
namespace: string

The namespace the data was ingested into

ReturnsExpand Collapse
DataGetStatusResponse = DataGetRequestAddOutput { data, namespace, request_id, status } | DataGetRequestImportOutput { data_count, data_expires_at, data_url, 3 more }

Response containing request status and processed output data.

Accepts one of the following:
DataGetRequestAddOutput { data, namespace, request_id, status }
data: Array<Data>
id: string

Object identifier from the ingested data

output: Output | null
actions: Array<unknown>
fields: Record<string, unknown>
labels: Array<Label>
label: string
url: string
metadata?: Record<string, unknown>
namespace: string
request_id: string
status: "queued" | "uploading" | "ingesting" | 2 more

Current processing status of the request

Accepts one of the following:
"queued"
"uploading"
"ingesting"
"succeeded"
"failed"
DataGetRequestImportOutput { data_count, data_expires_at, data_url, 3 more }
data_count: number
minimum0
data_expires_at: string
data_url: string
namespace: string
request_id: string
status: "queued" | "uploading" | "ingesting" | 2 more

Current processing status of the request

Accepts one of the following:
"queued"
"uploading"
"ingesting"
"succeeded"
"failed"
Get request status
import Safetykit from 'safetykit';

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

const response = await client.data.getStatus('requestId', { namespace: 'namespace' });

console.log(response);
{
  "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"
}