Skip to content
StatusSupportDashboard

Add data

data.add(strnamespace, DataAddParams**kwargs) -> DataAddResponse
POST/v1/data/{namespace}

Add data to a namespace. This method returns immediately; data is processed asynchronously.

ParametersExpand Collapse
namespace: str

The namespace to ingest data into

data: Data

A data object to ingest. Must have an id field. All other fields are flexible and can any JSON types.

One of the following:
class DataDataObject:

A data object to ingest. Must have an id field. All other fields are flexible and can any JSON types.

id: str

Unique identifier for this data object. This should be a meaningful identifier in the customer's system, as it is the main way to search for specific items between systems.

Iterable[DataDataObjectArray]

Array of data objects to ingest.

id: str

Unique identifier for this data object. This should be a meaningful identifier in the customer's system, as it is the main way to search for specific items between systems.

ReturnsExpand Collapse
class DataAddResponse:

Response confirming data was accepted for asynchronous processing. The requestId can be used for debugging and tracking.

request_id: str

Unique identifier for tracking this request. Data processing happens asynchronously after this response.

status: Literal["accepted"]

Request was accepted for processing

Add data

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.add(
    namespace="namespace",
    data={
        "id": "user-12345"
    },
)
print(response.request_id)
{
  "requestId": "req_01h2m7qdmdjckc30e1mnq6xqfd",
  "status": "accepted"
}
Returns Examples
{
  "requestId": "req_01h2m7qdmdjckc30e1mnq6xqfd",
  "status": "accepted"
}