Skip to content
StatusSupportDashboard

Get request status

data.get_status(strrequest_id, DataGetStatusParams**kwargs) -> DataGetStatusResponse
GET/v1/data/{namespace}/requests/{requestId}

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

ParametersExpand Collapse
namespace: str

The namespace the data was ingested into

request_id: str

The request ID returned from the Add endpoint

ReturnsExpand Collapse

Response containing request status and processed output data.

One of the following:
class DataGetRequestAddOutput:
data: List[DataGetRequestAddOutputData]
id: str

Object identifier from the ingested data

output: Optional[DataGetRequestAddOutputDataOutput]
actions: List[Optional[object]]
fields: Dict[str, Optional[object]]
labels: List[DataGetRequestAddOutputDataOutputLabel]
label: str
url: str
metadata: Optional[Dict[str, Optional[object]]]
namespace: str
request_id: str
status: Literal["queued", "uploading", "ingesting", 2 more]

Current processing status of the request

One of the following:
"queued"
"uploading"
"ingesting"
"succeeded"
"failed"
class DataGetRequestImportOutput:
data_count: int
minimum0
data_expires_at: str
data_url: str
namespace: str
request_id: str
status: Literal["queued", "uploading", "ingesting", 2 more]

Current processing status of the request

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

Get request status

import os
from safetykit import Safetykit

client = Safetykit(
    api_key=os.environ.get("SAFETYKIT_API_KEY"),  # This is the default and can be omitted
)
response = client.data.get_status(
    request_id="requestId",
    namespace="namespace",
)
print(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"
}