Add parts
streams.add_parts(strnamespace, StreamAddPartsParams**kwargs) -> StreamAddPartsResponse
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.
Parameters
namespace: str
The namespace to ingest stream data into
id: str
Returns
Add parts
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.streams.add_parts(
namespace="namespace",
id="YOUR_STREAM_ID",
data=[{
"type": "audio_url",
"timestamp": "2026-03-10T18:54:20+00:00",
"url": "https://example.com/234039.mp3",
}],
)
print(response.request_id){
"requestId": "req_01h2m7qdmdjckc30e1mnq6xqfd",
"status": "accepted"
}Returns Examples
{
"requestId": "req_01h2m7qdmdjckc30e1mnq6xqfd",
"status": "accepted"
}