Skip to main content
POST
/
pixelStripeApi
/
projects
/
distribute-file
curl -X POST https://api.streampixel.io/pixelStripeApi/projects/distribute-file \
  -H "Content-Type: application/json" \
  -d '{
    "projectId": "664f1a2b3c4d5e6f7a8b9c0d",
    "uploadId": "665a2b3c4d5e6f7a8b9c0e1f",
    "apiKey": "your-api-key",
    "userId": "663d0a1b2c3e4f5a6b7c8d9e"
  }'
{
  "message": "Distribution triggered"
}

Documentation Index

Fetch the complete documentation index at: https://docs.streampixel.io/llms.txt

Use this file to discover all available pages before exploring further.

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

apiKey
string
required
Your Streampixel API key.
userId
string
required
The ID of the account that owns the project.
projectId
string
required
The project the build belongs to.
uploadId
string
required
The uploadId returned by the Upload File API. Must belong to the specified projectId.

Response

message
string
Status of the distribution request (e.g., "Distribution triggered").
curl -X POST https://api.streampixel.io/pixelStripeApi/projects/distribute-file \
  -H "Content-Type: application/json" \
  -d '{
    "projectId": "664f1a2b3c4d5e6f7a8b9c0d",
    "uploadId": "665a2b3c4d5e6f7a8b9c0e1f",
    "apiKey": "your-api-key",
    "userId": "663d0a1b2c3e4f5a6b7c8d9e"
  }'
{
  "message": "Distribution triggered"
}

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

RegionDescription
us-east-1United States (East)
europeEurope
asia-pacificAsia Pacific (default)

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.
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://api.streampixel.io/pixelStripeApi/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);

Troubleshooting

ProblemSolution
Unauthorized: Invalid API KeyRegenerate your API key from the dashboard Settings page.
Access deniedVerify you own the project and it isn’t disabled.
File not found in projectDouble-check the uploadId — it must belong to the specified project.
File has no URLThe upload is still processing. Wait for it to complete before distributing.
Rate limit exceededWait the indicated seconds before retrying (limit: 1 req / 2 min / user).
Triggered but not liveDistribution 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.