Skip to content
StatusSupportDashboard

Add parts

client.streams.addParts(stringnamespace, StreamAddPartsParams { id, data } body, RequestOptionsoptions?): StreamAddPartsResponse { requestId, status }
POST/v1/streams/{namespace}/parts

Append a list of parts to a stream by the stream identifier. The stream does not need to be created beforehand. This method returns immediately; parts are processed asynchronously.

ParametersExpand Collapse
namespace: string

The namespace to ingest stream data into

body: StreamAddPartsParams { id, data }
id: string
data: Array<AudioURL { timestamp, type, url } | FrameImageURL { timestamp, type, url } | ChatMessage { sender_display_name, sender_id, text, 2 more } | Transcript { text, timestamp, type, speaker } >
One of the following:
AudioURL { timestamp, type, url }
timestamp: string
type: "audio_url"
url: string
FrameImageURL { timestamp, type, url }
timestamp: string
type: "frame_image_url"
url: string
ChatMessage { sender_display_name, sender_id, text, 2 more }
sender_display_name: string
sender_id: string
text: string
timestamp: string
type: "chat_message"
Transcript { text, timestamp, type, speaker }
text: string
timestamp: string
type: "transcript"
speaker?: string | null
ReturnsExpand Collapse
StreamAddPartsResponse { requestId, status }

Stream ingestion request accepted for asynchronous processing.

requestId: string
status: "accepted"

Add parts

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.streams.addParts('namespace', {
  id: 'YOUR_STREAM_ID',
  data: [
    {
      type: 'audio_url',
      timestamp: '2026-03-10T18:54:20+00:00',
      url: 'https://example.com/234039.mp3',
    },
  ],
});

console.log(response.requestId);
{
  "requestId": "req_01h2m7qdmdjckc30e1mnq6xqfd",
  "status": "accepted"
}
Returns Examples
{
  "requestId": "req_01h2m7qdmdjckc30e1mnq6xqfd",
  "status": "accepted"
}