Hubfly spaceDocs
Console

Managed Streams API · Dashboard

Restream destinations

Push a channel or an input to YouTube, Twitch, Facebook, Kick, X, LinkedIn or any RTMP(S) or SRT target.

Base URL: https://api.hubfly.space. Use a Dashboard bearer token authorized for the project. Replace :projectId in each path with the Dashboard project ID. JSON routes use Content-Type: application/json.

Stream servers live in a project of type managed; other projects return 409 MANAGED_PROJECT_REQUIRED. Replace :instanceId with the stream server ID from the instance list. Each endpoint lists the permission it needs; a token scoped to the stream permissions must hold that exact permission.

How to use these endpoints

  1. Choose a platform preset (it fills the ingest URL) or custom with your own url, and the source: a channel or an input.
  2. The destination's streamKey is write-only; reads return a streamKeyHint.
  3. With autoStart, the destination starts whenever its source goes live. Otherwise start and stop it with live control (destination.start / destination.stop).
  4. Bytes pushed to destinations are billed as bandwidth; restream copies cost no processing.

Restream a channel to YouTube

curl
curl -X POST "https://api.hubfly.space/api/v1/projects/$PROJECT_ID/managed/instances/$INSTANCE_ID/stream/destinations/create" \
  -H "Authorization: Bearer $HUBFLY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"YouTube","platform":"youtube","source":{"type":"channel","ref":"'"$CHANNEL_ID"'"},"streamKey":"'"$YOUTUBE_STREAM_KEY"'","autoStart":true}'

The response uses the standard Dashboard envelope: ok, data, and meta on success. On failure, use the returned error code and message to decide whether to correct the request or retry. The exact schema and response codes for each operation are below.

Endpoint reference

Dashboard endpoints (5)

These JSON routes are served by the Hubfly space Dashboard API and use Dashboard project authorization.

Open interactive API explorer
POSTCreate a restream destinationDetails +/api/v1/projects/:projectId/managed/instances/:instanceId/stream/destinations/create

Add a target that receives a channel or an input over RTMP, RTMPS or SRT. The youtube, twitch, facebook, kick and x presets fill the protocol and ingest URL; linkedin and custom need a url. Defaults: rendition: "source" and autoStart: true, which starts the restream whenever the source goes live and stops it when the source ends.

  • Requires stream:admin.
  • streamKey is write-only: it is stored encrypted and shown afterwards only as streamKeyHint.
  • rendition is source or one of the channel's ladder renditions; an input-fed destination can only use source. URLs use rtmp, rtmps or srt and may not point at private addresses.
  • A server holds up to 50 destinations. Invalid values return 422 STREAM_INVALID with details; a duplicate name returns 409 STREAM_NAME_TAKEN.
Request parameters
NameLocationRequiredTypeDescription
projectIdpathYesstring—
instanceIdpathYesstring—

JSON request body

FieldType / allowed valuesRequired
sourceobjectNo
protocolrtmp | rtmps | srtNo
urlstringNo
renditionstringNo
autoStartbooleanNo
namestringYes
enabledbooleanNo
platformcustom | youtube | twitch | facebook | kick | x | linkedinYes
streamKeystringYes
srtPassphrasestringNo
Complete request schema
{
  "type": "object",
  "properties": {
    "source": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "input",
            "channel"
          ]
        },
        "ref": {
          "type": "string"
        }
      },
      "required": [
        "type",
        "ref"
      ],
      "additionalProperties": false
    },
    "protocol": {
      "type": "string",
      "enum": [
        "rtmp",
        "rtmps",
        "srt"
      ]
    },
    "url": {
      "type": "string"
    },
    "rendition": {
      "type": "string"
    },
    "autoStart": {
      "type": "boolean"
    },
    "name": {
      "type": "string"
    },
    "enabled": {
      "type": "boolean"
    },
    "platform": {
      "type": "string",
      "enum": [
        "custom",
        "youtube",
        "twitch",
        "facebook",
        "kick",
        "x",
        "linkedin"
      ]
    },
    "streamKey": {
      "type": "string"
    },
    "srtPassphrase": {
      "type": "string",
      "nullable": true
    }
  },
  "required": [
    "name",
    "platform",
    "streamKey"
  ],
  "additionalProperties": false
}
Responses
  • 200 — Successful response
    Response schema
    {
      "type": "object",
      "properties": {
        "ok": {
          "const": true,
          "type": "boolean"
        },
        "data": {
          "type": "object",
          "properties": {
            "destination": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "platform": {
                  "type": "string",
                  "enum": [
                    "custom",
                    "youtube",
                    "twitch",
                    "facebook",
                    "kick",
                    "x",
                    "linkedin"
                  ]
                },
                "enabled": {
                  "type": "boolean"
                },
                "source": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "input",
                        "channel"
                      ]
                    },
                    "ref": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "type",
                    "ref"
                  ],
                  "additionalProperties": false
                },
                "protocol": {
                  "type": "string",
                  "enum": [
                    "rtmp",
                    "rtmps",
                    "srt"
                  ]
                },
                "url": {
                  "type": "string"
                },
                "rendition": {
                  "type": "string"
                },
                "autoStart": {
                  "type": "boolean"
                },
                "createdAt": {
                  "type": "string"
                },
                "updatedAt": {
                  "type": "string"
                },
                "revision": {
                  "type": "number"
                },
                "streamKeyHint": {
                  "type": "string",
                  "nullable": true
                },
                "hasSrtPassphrase": {
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "name",
                "platform",
                "enabled",
                "source",
                "protocol",
                "url",
                "rendition",
                "autoStart",
                "createdAt",
                "updatedAt",
                "revision",
                "streamKeyHint",
                "hasSrtPassphrase"
              ],
              "additionalProperties": false
            },
            "sync": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "string",
                  "enum": [
                    "pending",
                    "applied"
                  ]
                },
                "generation": {
                  "type": "number"
                },
                "error": {
                  "type": "string",
                  "nullable": true
                },
                "warnings": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "path": {
                        "type": "string"
                      },
                      "code": {
                        "type": "string"
                      },
                      "message": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "path",
                      "code",
                      "message"
                    ],
                    "additionalProperties": false
                  }
                }
              },
              "required": [
                "status",
                "generation",
                "error",
                "warnings"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "destination",
            "sync"
          ],
          "additionalProperties": false
        },
        "meta": {
          "type": "object",
          "properties": {
            "requestId": {
              "type": "string"
            },
            "timestamp": {
              "type": "string"
            }
          },
          "required": [
            "requestId",
            "timestamp"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "ok",
        "data",
        "meta"
      ],
      "additionalProperties": false
    }
    Example response
    {
      "ok": true,
      "data": {
        "destination": {
          "id": "string",
          "name": "string",
          "platform": "custom",
          "enabled": true,
          "source": {
            "type": "input",
            "ref": "string"
          },
          "protocol": "rtmp",
          "url": "string",
          "rendition": "string",
          "autoStart": true,
          "createdAt": "string",
          "updatedAt": "string",
          "revision": 0,
          "streamKeyHint": "string",
          "hasSrtPassphrase": true
        },
        "sync": {
          "status": "pending",
          "generation": 0,
          "error": "string",
          "warnings": [
            {
              "path": "string",
              "code": "string",
              "message": "string"
            }
          ]
        }
      },
      "meta": {
        "requestId": "string",
        "timestamp": "string"
      }
    }
GETList restream destinationsDetails +/api/v1/projects/:projectId/managed/instances/:instanceId/stream/destinations

List the server's restream destinations with their platform, source (a channel or an input), protocol, URL, rendition, autoStart, streamKeyHint and hasSrtPassphrase. Stream keys are never returned.

  • Requires stream:read.
Request parameters
NameLocationRequiredTypeDescription
projectIdpathYesstring—
instanceIdpathYesstring—
Responses
  • 200 — Successful response
    Response schema
    {
      "type": "object",
      "properties": {
        "ok": {
          "const": true,
          "type": "boolean"
        },
        "data": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "platform": {
                "type": "string",
                "enum": [
                  "custom",
                  "youtube",
                  "twitch",
                  "facebook",
                  "kick",
                  "x",
                  "linkedin"
                ]
              },
              "enabled": {
                "type": "boolean"
              },
              "source": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "input",
                      "channel"
                    ]
                  },
                  "ref": {
                    "type": "string"
                  }
                },
                "required": [
                  "type",
                  "ref"
                ],
                "additionalProperties": false
              },
              "protocol": {
                "type": "string",
                "enum": [
                  "rtmp",
                  "rtmps",
                  "srt"
                ]
              },
              "url": {
                "type": "string"
              },
              "rendition": {
                "type": "string"
              },
              "autoStart": {
                "type": "boolean"
              },
              "createdAt": {
                "type": "string"
              },
              "updatedAt": {
                "type": "string"
              },
              "revision": {
                "type": "number"
              },
              "streamKeyHint": {
                "type": "string",
                "nullable": true
              },
              "hasSrtPassphrase": {
                "type": "boolean"
              }
            },
            "required": [
              "id",
              "name",
              "platform",
              "enabled",
              "source",
              "protocol",
              "url",
              "rendition",
              "autoStart",
              "createdAt",
              "updatedAt",
              "revision",
              "streamKeyHint",
              "hasSrtPassphrase"
            ],
            "additionalProperties": false
          }
        },
        "meta": {
          "type": "object",
          "properties": {
            "requestId": {
              "type": "string"
            },
            "timestamp": {
              "type": "string"
            }
          },
          "required": [
            "requestId",
            "timestamp"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "ok",
        "data",
        "meta"
      ],
      "additionalProperties": false
    }
    Example response
    {
      "ok": true,
      "data": [
        {
          "id": "string",
          "name": "string",
          "platform": "custom",
          "enabled": true,
          "source": {
            "type": "input",
            "ref": "string"
          },
          "protocol": "rtmp",
          "url": "string",
          "rendition": "string",
          "autoStart": true,
          "createdAt": "string",
          "updatedAt": "string",
          "revision": 0,
          "streamKeyHint": "string",
          "hasSrtPassphrase": true
        }
      ],
      "meta": {
        "requestId": "string",
        "timestamp": "string"
      }
    }
DELETEDelete a restream destinationDetails +/api/v1/projects/:projectId/managed/instances/:instanceId/stream/destinations/:destinationId/delete

Delete a destination and its stored stream key.

  • Requires stream:admin.
  • Refused with 409 STREAM_IN_USE while a schedule still uses the destination; the error lists the referrers.
Request parameters
NameLocationRequiredTypeDescription
projectIdpathYesstring—
instanceIdpathYesstring—
destinationIdpathYesstring—
Responses
  • 200 — Successful response
    Response schema
    {
      "type": "object",
      "properties": {
        "ok": {
          "const": true,
          "type": "boolean"
        },
        "data": {
          "type": "object",
          "properties": {
            "deleted": {
              "const": true,
              "type": "boolean"
            },
            "sync": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "string",
                  "enum": [
                    "pending",
                    "applied"
                  ]
                },
                "generation": {
                  "type": "number"
                },
                "error": {
                  "type": "string",
                  "nullable": true
                },
                "warnings": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "path": {
                        "type": "string"
                      },
                      "code": {
                        "type": "string"
                      },
                      "message": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "path",
                      "code",
                      "message"
                    ],
                    "additionalProperties": false
                  }
                }
              },
              "required": [
                "status",
                "generation",
                "error",
                "warnings"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "deleted",
            "sync"
          ],
          "additionalProperties": false
        },
        "meta": {
          "type": "object",
          "properties": {
            "requestId": {
              "type": "string"
            },
            "timestamp": {
              "type": "string"
            }
          },
          "required": [
            "requestId",
            "timestamp"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "ok",
        "data",
        "meta"
      ],
      "additionalProperties": false
    }
    Example response
    {
      "ok": true,
      "data": {
        "deleted": true,
        "sync": {
          "status": "pending",
          "generation": 0,
          "error": "string",
          "warnings": [
            {
              "path": "string",
              "code": "string",
              "message": "string"
            }
          ]
        }
      },
      "meta": {
        "requestId": "string",
        "timestamp": "string"
      }
    }
GETRead a restream destinationDetails +/api/v1/projects/:projectId/managed/instances/:instanceId/stream/destinations/:destinationId

Return one destination with its settings, revision, streamKeyHint and hasSrtPassphrase. The stream key itself is never returned.

  • Requires stream:read.
Request parameters
NameLocationRequiredTypeDescription
projectIdpathYesstring—
instanceIdpathYesstring—
destinationIdpathYesstring—
Responses
  • 200 — Successful response
    Response schema
    {
      "type": "object",
      "properties": {
        "ok": {
          "const": true,
          "type": "boolean"
        },
        "data": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "platform": {
              "type": "string",
              "enum": [
                "custom",
                "youtube",
                "twitch",
                "facebook",
                "kick",
                "x",
                "linkedin"
              ]
            },
            "enabled": {
              "type": "boolean"
            },
            "source": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "input",
                    "channel"
                  ]
                },
                "ref": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "ref"
              ],
              "additionalProperties": false
            },
            "protocol": {
              "type": "string",
              "enum": [
                "rtmp",
                "rtmps",
                "srt"
              ]
            },
            "url": {
              "type": "string"
            },
            "rendition": {
              "type": "string"
            },
            "autoStart": {
              "type": "boolean"
            },
            "createdAt": {
              "type": "string"
            },
            "updatedAt": {
              "type": "string"
            },
            "revision": {
              "type": "number"
            },
            "streamKeyHint": {
              "type": "string",
              "nullable": true
            },
            "hasSrtPassphrase": {
              "type": "boolean"
            }
          },
          "required": [
            "id",
            "name",
            "platform",
            "enabled",
            "source",
            "protocol",
            "url",
            "rendition",
            "autoStart",
            "createdAt",
            "updatedAt",
            "revision",
            "streamKeyHint",
            "hasSrtPassphrase"
          ],
          "additionalProperties": false
        },
        "meta": {
          "type": "object",
          "properties": {
            "requestId": {
              "type": "string"
            },
            "timestamp": {
              "type": "string"
            }
          },
          "required": [
            "requestId",
            "timestamp"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "ok",
        "data",
        "meta"
      ],
      "additionalProperties": false
    }
    Example response
    {
      "ok": true,
      "data": {
        "id": "string",
        "name": "string",
        "platform": "custom",
        "enabled": true,
        "source": {
          "type": "input",
          "ref": "string"
        },
        "protocol": "rtmp",
        "url": "string",
        "rendition": "string",
        "autoStart": true,
        "createdAt": "string",
        "updatedAt": "string",
        "revision": 0,
        "streamKeyHint": "string",
        "hasSrtPassphrase": true
      },
      "meta": {
        "requestId": "string",
        "timestamp": "string"
      }
    }
PUTUpdate a restream destinationDetails +/api/v1/projects/:projectId/managed/instances/:instanceId/stream/destinations/:destinationId/update

Change a destination's name, enabled state, source, protocol, URL, rendition or autoStart, or replace its streamKey or srtPassphrase. Omitted fields keep their value; the stored key stays unless you send a new one.

  • Requires stream:admin.
  • Send revision equal to the destination's current revision; if it changed meanwhile you get 409 STREAM_REVISION_CONFLICT.
  • Invalid values return 422 STREAM_INVALID with details. Start and stop a restream live with destination.start and destination.stop in the control call.
Request parameters
NameLocationRequiredTypeDescription
projectIdpathYesstring—
instanceIdpathYesstring—
destinationIdpathYesstring—

JSON request body

FieldType / allowed valuesRequired
sourceobjectNo
protocolrtmp | rtmps | srtNo
urlstringNo
renditionstringNo
autoStartbooleanNo
namestringNo
enabledbooleanNo
streamKeystringNo
srtPassphrasestringNo
revisionnumberYes
Complete request schema
{
  "type": "object",
  "properties": {
    "source": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "input",
            "channel"
          ]
        },
        "ref": {
          "type": "string"
        }
      },
      "required": [
        "type",
        "ref"
      ],
      "additionalProperties": false
    },
    "protocol": {
      "type": "string",
      "enum": [
        "rtmp",
        "rtmps",
        "srt"
      ]
    },
    "url": {
      "type": "string"
    },
    "rendition": {
      "type": "string"
    },
    "autoStart": {
      "type": "boolean"
    },
    "name": {
      "type": "string"
    },
    "enabled": {
      "type": "boolean"
    },
    "streamKey": {
      "type": "string"
    },
    "srtPassphrase": {
      "type": "string",
      "nullable": true
    },
    "revision": {
      "type": "number"
    }
  },
  "required": [
    "revision"
  ],
  "additionalProperties": false
}
Responses
  • 200 — Successful response
    Response schema
    {
      "type": "object",
      "properties": {
        "ok": {
          "const": true,
          "type": "boolean"
        },
        "data": {
          "type": "object",
          "properties": {
            "destination": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "platform": {
                  "type": "string",
                  "enum": [
                    "custom",
                    "youtube",
                    "twitch",
                    "facebook",
                    "kick",
                    "x",
                    "linkedin"
                  ]
                },
                "enabled": {
                  "type": "boolean"
                },
                "source": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "input",
                        "channel"
                      ]
                    },
                    "ref": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "type",
                    "ref"
                  ],
                  "additionalProperties": false
                },
                "protocol": {
                  "type": "string",
                  "enum": [
                    "rtmp",
                    "rtmps",
                    "srt"
                  ]
                },
                "url": {
                  "type": "string"
                },
                "rendition": {
                  "type": "string"
                },
                "autoStart": {
                  "type": "boolean"
                },
                "createdAt": {
                  "type": "string"
                },
                "updatedAt": {
                  "type": "string"
                },
                "revision": {
                  "type": "number"
                },
                "streamKeyHint": {
                  "type": "string",
                  "nullable": true
                },
                "hasSrtPassphrase": {
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "name",
                "platform",
                "enabled",
                "source",
                "protocol",
                "url",
                "rendition",
                "autoStart",
                "createdAt",
                "updatedAt",
                "revision",
                "streamKeyHint",
                "hasSrtPassphrase"
              ],
              "additionalProperties": false
            },
            "sync": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "string",
                  "enum": [
                    "pending",
                    "applied"
                  ]
                },
                "generation": {
                  "type": "number"
                },
                "error": {
                  "type": "string",
                  "nullable": true
                },
                "warnings": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "path": {
                        "type": "string"
                      },
                      "code": {
                        "type": "string"
                      },
                      "message": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "path",
                      "code",
                      "message"
                    ],
                    "additionalProperties": false
                  }
                }
              },
              "required": [
                "status",
                "generation",
                "error",
                "warnings"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "destination",
            "sync"
          ],
          "additionalProperties": false
        },
        "meta": {
          "type": "object",
          "properties": {
            "requestId": {
              "type": "string"
            },
            "timestamp": {
              "type": "string"
            }
          },
          "required": [
            "requestId",
            "timestamp"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "ok",
        "data",
        "meta"
      ],
      "additionalProperties": false
    }
    Example response
    {
      "ok": true,
      "data": {
        "destination": {
          "id": "string",
          "name": "string",
          "platform": "custom",
          "enabled": true,
          "source": {
            "type": "input",
            "ref": "string"
          },
          "protocol": "rtmp",
          "url": "string",
          "rendition": "string",
          "autoStart": true,
          "createdAt": "string",
          "updatedAt": "string",
          "revision": 0,
          "streamKeyHint": "string",
          "hasSrtPassphrase": true
        },
        "sync": {
          "status": "pending",
          "generation": 0,
          "error": "string",
          "warnings": [
            {
              "path": "string",
              "code": "string",
              "message": "string"
            }
          ]
        }
      },
      "meta": {
        "requestId": "string",
        "timestamp": "string"
      }
    }

Related guides

Something unclear or out of date? Emailsupport@hubfly.spaceBack to top