curl -X POST https://platform.streampixel.io/api/v1/projects/distribute-file \
-H "Content-Type: application/json" \
-d '{
"projectId": "664f1a2b3c4d5e6f7a8b9c0d",
"uploadId": "665a2b3c4d5e6f7a8b9c0e1f",
"apiKey": "your-api-key",
"userId": "663d0a1b2c3e4f5a6b7c8d9e"
}'
const response = await fetch(
'https://platform.streampixel.io/api/v1/projects/distribute-file',
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
projectId: '664f1a2b3c4d5e6f7a8b9c0d',
uploadId: '665a2b3c4d5e6f7a8b9c0e1f',
apiKey: 'your-api-key',
userId: '663d0a1b2c3e4f5a6b7c8d9e',
}),
}
);
const data = await response.json();
console.log(data);
import requests
response = requests.post(
'https://platform.streampixel.io/api/v1/projects/distribute-file',
json={
'projectId': '664f1a2b3c4d5e6f7a8b9c0d',
'uploadId': '665a2b3c4d5e6f7a8b9c0e1f',
'apiKey': 'your-api-key',
'userId': '663d0a1b2c3e4f5a6b7c8d9e',
}
)
print(response.json())
{
"success": true,
"uploadId": "665a2b3c4d5e6f7a8b9c0e1f",
"region": "US-East-1",
"message": "File distribution triggered successfully"
}
{
"message": "Unauthorized: Invalid API Key"
}
{
"message": "File not found in project"
}
{
"message": "Rate limit exceeded. Try again in 117 seconds."
}
Distribute File API
Push an uploaded build to Streampixel’s streaming servers. Only needed when autoRelease is false or for re-distribution.
POST
/
api
/
v1
/
projects
/
distribute-file
curl -X POST https://platform.streampixel.io/api/v1/projects/distribute-file \
-H "Content-Type: application/json" \
-d '{
"projectId": "664f1a2b3c4d5e6f7a8b9c0d",
"uploadId": "665a2b3c4d5e6f7a8b9c0e1f",
"apiKey": "your-api-key",
"userId": "663d0a1b2c3e4f5a6b7c8d9e"
}'
const response = await fetch(
'https://platform.streampixel.io/api/v1/projects/distribute-file',
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
projectId: '664f1a2b3c4d5e6f7a8b9c0d',
uploadId: '665a2b3c4d5e6f7a8b9c0e1f',
apiKey: 'your-api-key',
userId: '663d0a1b2c3e4f5a6b7c8d9e',
}),
}
);
const data = await response.json();
console.log(data);
import requests
response = requests.post(
'https://platform.streampixel.io/api/v1/projects/distribute-file',
json={
'projectId': '664f1a2b3c4d5e6f7a8b9c0d',
'uploadId': '665a2b3c4d5e6f7a8b9c0e1f',
'apiKey': 'your-api-key',
'userId': '663d0a1b2c3e4f5a6b7c8d9e',
}
)
print(response.json())
{
"success": true,
"uploadId": "665a2b3c4d5e6f7a8b9c0e1f",
"region": "US-East-1",
"message": "File distribution triggered successfully"
}
{
"message": "Unauthorized: Invalid API Key"
}
{
"message": "File not found in project"
}
{
"message": "Rate limit exceeded. Try again in 117 seconds."
}
Push an uploaded build to Streampixel’s streaming servers manually.
If you uploaded with
autoRelease: true (the default), builds are distributed automatically after approval — you don’t need this endpoint. Use it only when autoRelease is false or when you want to re-distribute a previous build (e.g., rolling back to an older version).Distribution is asynchronous. A
200 response means the process has been triggered, not completed. Use webhooks to track when distribution finishes.Prerequisites
- The build has been uploaded via the Upload File API.
- The build has finished processing and has a valid URL.
- Your project is enabled (not disabled by an admin).
- You have a valid API key.
Request body
string
required
Your Streampixel API key.
string
required
The ID of the account that owns the project.
string
required
The project the build belongs to.
string
required
The
uploadId returned by the Upload File API. Must belong to the specified projectId.Response
boolean
true when distribution was triggered.string
Echoes the
uploadId you sent — the build that was distributed.string
The project’s configured region the build was routed to —
US-East-1, Europe, or the Asia-Pacific default.string
Human-readable status —
"File distribution triggered successfully".curl -X POST https://platform.streampixel.io/api/v1/projects/distribute-file \
-H "Content-Type: application/json" \
-d '{
"projectId": "664f1a2b3c4d5e6f7a8b9c0d",
"uploadId": "665a2b3c4d5e6f7a8b9c0e1f",
"apiKey": "your-api-key",
"userId": "663d0a1b2c3e4f5a6b7c8d9e"
}'
const response = await fetch(
'https://platform.streampixel.io/api/v1/projects/distribute-file',
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
projectId: '664f1a2b3c4d5e6f7a8b9c0d',
uploadId: '665a2b3c4d5e6f7a8b9c0e1f',
apiKey: 'your-api-key',
userId: '663d0a1b2c3e4f5a6b7c8d9e',
}),
}
);
const data = await response.json();
console.log(data);
import requests
response = requests.post(
'https://platform.streampixel.io/api/v1/projects/distribute-file',
json={
'projectId': '664f1a2b3c4d5e6f7a8b9c0d',
'uploadId': '665a2b3c4d5e6f7a8b9c0e1f',
'apiKey': 'your-api-key',
'userId': '663d0a1b2c3e4f5a6b7c8d9e',
}
)
print(response.json())
{
"success": true,
"uploadId": "665a2b3c4d5e6f7a8b9c0e1f",
"region": "US-East-1",
"message": "File distribution triggered successfully"
}
{
"message": "Unauthorized: Invalid API Key"
}
{
"message": "File not found in project"
}
{
"message": "Rate limit exceeded. Try again in 117 seconds."
}
How distribution works
1
Validation
Streampixel verifies your API key, project ownership, and that the file exists.
2
Region routing
The build is routed to your project’s configured region.
3
Queued
The distribution task is added to the processing queue.
4
Streaming servers
The build is pushed to servers and becomes available for streaming.
Supported regions
| Region | Description |
|---|---|
US-East-1 | United States (East) |
Europe | Europe |
| Asia-Pacific | Asia Pacific (default for any other region value) |
The response echoes the project’s stored
region value. Routing is by exact match: US-East-1 and Europe go to their regional queues; every other value falls through to Asia-Pacific.Rate limiting
This endpoint is rate-limited to 1 request per 2 minutes per user (not per project). If you manage multiple projects, the limit applies across all of them.
Automated pipeline with webhooks
Combine webhooks and this endpoint for a controlled CI/CD flow:1
Upload with autoRelease: false
Submit the build via the Upload File API with
autoRelease: false.2
Listen for build.approved
Subscribe to webhook events.
3
Run your validation
On approval, run any internal checks (smoke tests, asset scans, etc.).
4
Call this endpoint
Distribute the build by calling
POST /projects/distribute-file.5
Confirm distribution
Listen for
build.distributing to confirm the rollout started.- Node.js
- Python
const express = require('express');
const app = express();
app.use(express.json());
const API_KEY = process.env.STREAMPIXEL_API_KEY;
const USER_ID = process.env.STREAMPIXEL_USER_ID;
app.post('/webhooks/streampixel', async (req, res) => {
const { event, projectId, uploadId } = req.body;
if (event === 'build.approved') {
console.log(`Build ${uploadId} approved. Distributing...`);
await fetch(
'https://platform.streampixel.io/api/v1/projects/distribute-file',
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ projectId, uploadId, apiKey: API_KEY, userId: USER_ID }),
}
);
}
res.status(200).json({ received: true });
});
app.listen(3000);
from flask import Flask, request, jsonify
import requests
import os
app = Flask(__name__)
API_KEY = os.environ['STREAMPIXEL_API_KEY']
USER_ID = os.environ['STREAMPIXEL_USER_ID']
@app.route('/webhooks/streampixel', methods=['POST'])
def handle_webhook():
payload = request.get_json()
if payload.get('event') == 'build.approved':
print(f"Build {payload['uploadId']} approved. Distributing...")
requests.post(
'https://platform.streampixel.io/api/v1/projects/distribute-file',
json={
'projectId': payload['projectId'],
'uploadId': payload['uploadId'],
'apiKey': API_KEY,
'userId': USER_ID,
}
)
return jsonify({"received": True}), 200
if __name__ == '__main__':
app.run(port=3000)
Troubleshooting
| Problem | Solution |
|---|---|
Unauthorized: Invalid API Key | Regenerate your API key from the dashboard Settings page. |
Access denied | Verify you own the project and it isn’t disabled. |
File not found in project | Double-check the uploadId — it must belong to the specified project. |
File has no URL | The upload is still processing. Wait for it to complete before distributing. |
Rate limit exceeded | Wait the indicated seconds before retrying (limit: 1 req / 2 min / user). |
| Triggered but not live | Distribution is async. Use webhooks to track status. |
Next steps
Listen for webhooks
Track distribution events in real time.
Upload File API
The endpoint that produces the
uploadId you pass here.