--- title: Adding and Updating Data | SafetyKit description: Ingest single objects or small batches and update existing objects with stable IDs. --- Use [`POST /v1/data/{namespace}`](/api/resources/data/methods/add/index.md) to send single objects or small batches in arrays. This endpoint is the fastest way to integrate ongoing production traffic where objects arrive continuously. Using a stable `id` is important for: - matching webhook outputs to your internal records - re-processing when object data changes - maintaining object history in one identity ## Add data - [ TypeScript](#tab-panel-5) - [ Python](#tab-panel-6) - [ cURL](#tab-panel-7) ``` import Safetykit from "safetykit"; const client = new Safetykit({ apiKey: process.env.SAFETYKIT_API_KEY, }); const response = await client.data.ingest("products", { data: [ { id: "product_12345", title: "Ceramic Mug", description: "Handmade mug, 12oz", images: ["https://example.com/mug.jpg"], price: 24.0, }, ], }); console.log(response.requestId); ``` ``` from safetykit import Safetykit client = Safetykit(api_key="sk_your_api_key") response = client.data.ingest("products", { "data": [ { "id": "product_12345", "title": "Ceramic Mug", "description": "Handmade mug, 12oz", "images": ["https://example.com/mug.jpg"], "price": 24.0, } ] }) print(response.request_id) ``` Terminal window ``` curl -X POST "https://api.safetykit.com/v1/data/products" \ -H "Authorization: Bearer sk_your_api_key" \ -H "Content-Type: application/json" \ -d '{ "data": [ { "id": "product_12345", "title": "Ceramic Mug", "description": "Handmade mug, 12oz", "images": ["https://example.com/mug.jpg"], "price": 24.0 } ] }' ``` ## Update data (upsert behavior) To update an object, send the same `id` again. The service will treat it as a new evaluation for that entity identity, which keeps your latest state and decisions aligned. ``` { "data": { "id": "product_12345", "title": "Ceramic Mug - Updated", "price": 28.0 } } ``` ## Request shape - `data` accepts either a single object or an array - configure `schema` separately via [`PUT /v1/data/{namespace}/settings`](/api/resources/data/methods/updateSettings/index.md) - each object in `data` must include an `id` In most integrations, you should persist both `id` and `requestId` from each call so you can reconcile webhook events, monitor replay jobs, and debug edge cases quickly. For large imports, see [Adding Data in Batches](/using-data-api/adding-data-in-batches/index.md). For copy-paste starter code, see [Implementation Snippets](/using-data-api/implementation-snippets/index.md).