Manage live streams

Manage your live streams with the FastPix API. Retrieve stream details, update configurations, control stream states, and more.

After you create a live stream, you can manage it throughout its lifecycle. This guide shows you how to retrieve stream information, monitor performance, update settings, and control stream availability.


View all your streams

You can retrieve a list of all live streams in your account. This is useful when you need to:

  • Display streams in a dashboard
  • Monitor multiple broadcasts
  • Find a specific stream by its properties

The API returns streams in pages, letting you control how many results you see at once.

How to get all streams

Use the Get all live streams endpoint:

curl -X GET 'https://api.fastpix.io/v1/live/streams?limit=10&offset=1&orderBy=asc' \
   --user {ACCESS_TOKEN_ID}:{SECRET_KEY} \
   -H 'accept: application/json'

This request returns up to 10 streams, sorted by creation date (newest first).

Response:

{
  "success": true,
  "data": [
    {
      "streamId": "ab0437a52a31c6db3fcd8d6a1cfc7a29",
      "streamKey": "f8fbb83caded4083e6df5c5517ba5598kab0437a52a31c6db3fcd8d6a1cfc7a29",
      "srtSecret": "4ffd3e3d562f85bacb03bc302a379aa2kab0437a52a31c6db3fcd8d6a1cfc7a29",
      "trial": false,
      "status": "idle",
      "maxResolution": "1080p",
      "maxDuration": 28800,
      "createdAt": "2025-11-25T09:46:38.323193Z",
      "reconnectWindow": 60,
      "enableRecording": true,
      "enableDvrMode": false,
      "mediaPolicy": "public",
      "metadata": {
        "livestream_name": "fastpix_livestream"
      },
      "lowLatency": false,
      "closedCaptions": false,
      "playbackIds": [
        {
          "id": "95d16915-254f-4ff4-b9dd-ecd47e1fe836",
          "accessPolicy": "public"
        }
      ],
      "srtPlaybackResponse": {
        "srtPlaybackStreamId": "playab0437a52a31c6db3fcd8d6a1cfc7a29",
        "srtPlaybackSecret": "78bd3e8c87a9408437ff581fe6c56378kab0437a52a31c6db3fcd8d6a1cfc7a29"
      }
    },
    {
      "streamId": "cb0bc8a04c18973bc9fd86d1686cbcb0",
      "streamKey": "f9ee48aeb74960fd2df973da7d00ba4fkcb0bc8a04c18973bc9fd86d1686cbcb0",
      "srtSecret": "5b85862b798d0a9f1221724cb1641dd1kcb0bc8a04c18973bc9fd86d1686cbcb0",
      "trial": false,
      "status": "idle",
      "maxResolution": "1080p",
      "maxDuration": 28800,
      "createdAt": "2025-11-25T09:47:51.284165Z",
      "reconnectWindow": 60,
      "enableRecording": true,
      "enableDvrMode": false,
      "mediaPolicy": "public",
      "metadata": {
        "livestream_name": "fastpix_livestream"
      },
      "lowLatency": false,
      "closedCaptions": false,
      "playbackIds": [
        {
          "id": "9f330a89-0b3c-4caf-9c1e-dd995f147af1",
          "accessPolicy": "public"
        }
      ],
      "srtPlaybackResponse": {
        "srtPlaybackStreamId": "playcb0bc8a04c18973bc9fd86d1686cbcb0",
        "srtPlaybackSecret": "5240dd1125ee673179bbc33623db63e0kcb0bc8a04c18973bc9fd86d1686cbcb0"
      }
    },
    {
      "streamId": "37cbd41b434f6889a89bfdba329e84a2",
      "streamKey": "15417a296a9f9a29f0c6880d9ccd7112k37cbd41b434f6889a89bfdba329e84a2",
      "srtSecret": "a4a6ad1a2d1766102887e04e41da7304k37cbd41b434f6889a89bfdba329e84a2",
      "trial": false,
      "status": "idle",
      "maxResolution": "1080p",
      "maxDuration": 28800,
      "createdAt": "2025-11-25T10:52:24.969676Z",
      "reconnectWindow": 60,
      "enableRecording": true,
      "enableDvrMode": false,
      "mediaPolicy": "public",
      "metadata": {
        "livestream_name": "fastpix_livestream"
      },
      "lowLatency": false,
      "closedCaptions": false,
      "playbackIds": [
        {
          "id": "d2d520c7-75db-43f8-9ed8-da36542e657d",
          "accessPolicy": "public"
        }
      ],
      "srtPlaybackResponse": {
        "srtPlaybackStreamId": "play37cbd41b434f6889a89bfdba329e84a2",
        "srtPlaybackSecret": "dfe57e2655539a21714206138699fa67k37cbd41b434f6889a89bfdba329e84a2"
      }
    }
  ],
  "pagination": {
    "totalRecords": 3,
    "currentOffset": 1,
    "offsetCount": 1
  }
}

The response includes:

  • success: Whether the request succeeded
  • data: Array of stream objects with basic information
  • pagination: Total count and current page information

Customize your results

You can adjust these parameters:

  • limit: How many streams to return (default: 10)
  • offset: How many streams to skip, useful for pagination (default: 0)
  • orderBy: Sort order—asc for oldest first or desc for newest first (default: desc)

Monitor stream viewers

Track how viewers engage with your streams by retrieving viewership analytics. This helps you understand:

  • How many people are watching your stream
  • Where your viewers are located
  • How long viewers stayed
  • Peak viewership moments

How to get stream viewers

Use the Get stream views endpoint with your stream ID:

curl -X GET 'https://api.fastpix.io/v1/live/streams/streamId/viewer-count' \
   --user {ACCESS_TOKEN_ID}:{SECRET_KEY} \
   -H 'accept: application/json'

Replace streamId with your stream's unique identifier.

Response:

{
  "success": true,
  "data": {
    "views": 20
  }
}

Understanding the response

The data object includes the total number of views for the specified stream.

data.views — The total number of times the stream has been viewed.


Get detailed stream information

When you need complete information about a specific stream—including streamKey, srtSecret, playback URLs, and configuration—retrieve the full stream details.

When to get stream details

Get stream details when you need to:

  • Start a broadcast (you need the stream key)
  • Share playback URLs with viewers
  • Check the current stream status
  • Review stream configuration

How to get stream details

Use the Get stream by ID endpoint:

curl -X GET 'https://api.fastpix.io/v1/live/streams/streamId' \
   --user {ACCESS_TOKEN_ID}:{SECRET_KEY} \
   -H 'accept: application/json'

Replace streamId with your stream's unique identifier.

Response:

{
  "success": true,
  "data": {
    "streamId": "847b8ec830da90e4cc2ac68a5ab4fcad",
    "streamKey": "e32ddec87bbc628ede9c5d2e1b3bfb78k847b8ec830da90e4cc2ac68a5ab4fcad",
    "srtSecret": "ac4d9f80796414e9ce8e03636c92252ek847b8ec830da90e4cc2ac68a5ab4fcad",
    "trial": false,
    "status": "idle",
    "maxResolution": "1080p",
    "maxDuration": 28800,
    "createdAt": "2025-11-27T06:23:55.650918Z",
    "reconnectWindow": 60,
    "enableRecording": true,
    "enableDvrMode": false,
    "mediaPolicy": "public",
    "lowLatency": false,
    "closedCaptions": false,
    "playbackIds": [
      {
        "id": "251601ff-ec1a-47aa-97d2-f29f09c71536",
        "accessPolicy": "public"
      }
    ],
    "srtPlaybackResponse": {
      "srtPlaybackStreamId": "play847b8ec830da90e4cc2ac68a5ab4fcad",
      "srtPlaybackSecret": "82e27db9d8b15415f84d4201453ebc8ck847b8ec830da90e4cc2ac68a5ab4fcad"
    }
  }
}

Understanding the response

The response includes:

  • streamKey: Use this with your broadcasting software to start streaming
  • srtSecret: Required if you're using the SRT protocol
  • status: Current state—idle (ready to stream), preparing (ingesting signal but not fully live) active (currently streaming), or disabled (not accepting broadcasts)
  • playbackIds: URLs where viewers can watch your stream
  • reconnectWindow: How long (in seconds) FastPix waits for reconnection after a disconnect
  • enableRecording: Whether the stream is being recorded

Keep your stream key and secrets secure—anyone with these credentials can broadcast to your stream.


Update stream settings

Modify your stream's configuration to change how it behaves. You can update settings before or during a broadcast.

What you can update

You can change:

  • Custom metadata: Labels, descriptions, categories, or any information that helps you organize streams
  • Reconnect window: How long FastPix waits for your broadcasting software to reconnect after a disconnect

When to update metadata

Update metadata to:

  • Add descriptive labels after creating a stream
  • Change the stream title or category
  • Add tracking information for your own systems

When to adjust the reconnect window

The reconnect window controls how FastPix handles disconnections. Adjust it based on your needs:

  • Shorter window (30-60 seconds): For stable networks where you want streams to end quickly if something goes wrong
  • Longer window (120-300 seconds): For unreliable networks where you expect temporary interruptions

How to update a stream

Use the Update stream endpoint:

curl -X PATCH 'https://api.fastpix.io/v1/live/streams/streamId' \
  --user {ACCESS_TOKEN_ID}:{SECRET_KEY} \
  -H 'accept: application/json' \
  -H 'content-type: application/json' \
  -d '{
  "metadata": {
    "live_streaming": "tech"
  },
  "reconnectWindow": 60
}'

Replace streamId with your stream's unique identifier.

Response:

{
  "success": true,
  "data": {
    "streamId": "a439a24026f5e3e54d52344fc52deca0",
    "streamKey": "04473d1d474464a5fe349825ab3746acka439a24026f5e3e54d52344fc52deca0",
    "srtSecret": "906f55bdb212db25604246ad995e9f85ka439a24026f5e3e54d52344fc52deca0",
    "trial": false,
    "status": "idle",
    "maxResolution": "1080p",
    "maxDuration": 28800,
    "createdAt": "2025-11-27T09:29:10.158842Z",
    "reconnectWindow": 60,
    "enableRecording": true,
    "enableDvrMode": false,
    "mediaPolicy": "public",
    "metadata": {
      "live_streaming": "tech"
    },
    "lowLatency": false,
    "closedCaptions": false,
    "playbackIds": [
      {
        "id": "0ef2ceb0-4873-4276-b219-9259e8754533",
        "accessPolicy": "public"
      }
    ],
    "srtPlaybackResponse": {
      "srtPlaybackStreamId": "playa439a24026f5e3e54d52344fc52deca0",
      "srtPlaybackSecret": "d77215e35b6ff36d13c1dfa37f5b5ae4ka439a24026f5e3e54d52344fc52deca0"
    }
  }
}

The response confirms your updates and shows the current stream configuration.


Control stream availability

You can control whether a stream accepts broadcasts by enabling or disabling it. This gives you control over when streaming is allowed.

Disable a stream

Disabling a stream prevents new broadcasts without deleting the stream configuration. Disable streams to:

  • Temporarily suspend streaming during maintenance
  • Prevent unauthorized broadcasts during off-hours
  • Stop streaming while keeping the configuration for future use

How to disable a stream

Use the Disable stream endpoint:

curl -X PUT 'https://api.fastpix.io/v1/live/streams/streamId/live-disable' \
   --user {ACCESS_TOKEN_ID}:{SECRET_KEY} \
   -H 'accept: application/json'

Replace streamId with your stream's unique identifier.

Response:

{
  "success": true
}

Important: If the stream is currently active, disabling it immediately ends the broadcast and disconnects all viewers.


Enable a stream

Enabling a stream makes it available for broadcasting. Enable streams when you want to:

  • Reactivate a stream after temporary suspension
  • Restore stream access after enabling the stream

Note: You can enable a stream only when it is still within its allowed duration time.

How to enable a stream

Use the Enable stream endpoint:

curl -X PUT 'https://api.fastpix.io/v1/live/streams/streamId/live-enable' \
   --user {ACCESS_TOKEN_ID}:{SECRET_KEY} \
   -H 'accept: application/json'

Replace streamId with your stream's unique identifier.

Response:

{
  "success": true
}

After enabling, the stream status changes to idle, and it's ready to accept connections from your broadcasting software.


End a broadcast session

When a broadcast finishes, you can manually complete the stream to trigger final processing and analytics.

Important: You can complete a stream only when it is actively broadcasting.

When to complete a stream

Complete a stream when:

  • The broadcast reaches its scheduled end time
  • You want to manually end a broadcast

How to complete a stream

Use the Complete stream endpoint:

curl -X PUT 'https://api.fastpix.io/v1/live/streams/streamId/finish' \
   --user {ACCESS_TOKEN_ID}:{SECRET_KEY} \
   -H 'accept: application/json'

Replace streamId with your stream's unique identifier.

Response:

{
  "success": true
}

The response simply confirms that the update was successful.

What happens after completion

When you complete a stream, FastPix:

  1. Closes an active connection and stops the broadcast
  2. Finalizes any recordings
  3. Starts processing tasks live to VOD.

Delete a stream

When you no longer need a stream, you can permanently delete it to keep your account organized.

Before you delete

Warning: Deleting a stream is permanent and can't be undone. Make sure you:

  • No longer need the stream configuration
  • Deleting the disabled streams

How to delete a stream

Use the Delete stream endpoint:

curl -X DELETE 'https://api.fastpix.io/v1/live/streams/streamId' \
   --user {ACCESS_TOKEN_ID}:{SECRET_KEY} \
   -H 'accept: application/json'

Replace streamId with your stream's unique identifier.

Response:

{
  "success": true
}

After successful deletion, the stream ID is no longer valid, and you can't retrieve any information about it.