Creates a live input, and returns credentials that you or your users can use to stream live video to Cloudflare Stream.
/accounts/{account_identifier}/stream/live_inputs
post
Stream Live Inputs
stream-live-inputs-create-a-live-input
null null [
{
"in": "path",
"name": "account_identifier",
"required": true,
"schema": {
"description": "Identifier",
"example": "023e105f4ecef8ad9ca31a8372d0c353",
"maxLength": 32,
"readOnly": true,
"type": "string"
}
}
] {
"content": {
"application/json": {
"schema": {
"properties": {
"defaultCreator": {
"description": "Sets the creator ID asssociated with this live input.",
"type": "string"
},
"deleteRecordingAfterDays": {
"description": "Indicates the number of days after which the live inputs recordings will be deleted. When a stream completes and the recording is ready, the value is used to calculate a scheduled deletion date for that recording. Omit the field to indicate no change, or include with a `null` value to remove an existing scheduled deletion.",
"example": 45,
"minimum": 30,
"type": "number"
},
"meta": {
"description": "A user modifiable key-value store used to reference other systems of record for managing live inputs.",
"example": {
"name": "test stream 1"
},
"type": "object"
},
"recording": {
"description": "Records the input to a Cloudflare Stream video. Behavior depends on the mode. In most cases, the video will initially be viewable as a live video and transition to on-demand after a condition is satisfied.",
"example": {
"mode": "off",
"requireSignedURLs": false,
"timeoutSeconds": 0
},
"properties": {
"allowedOrigins": {
"description": "Lists the origins allowed to display videos created with this input. Enter allowed origin domains in an array and use `*` for wildcard subdomains. An empty array allows videos to be viewed on any origin.",
"example": [
"example.com"
],
"items": {
"type": "string"
},
"type": "array"
},
"mode": {
"default": "off",
"description": "Specifies the recording behavior for the live input. Set this value to `off` to prevent a recording. Set the value to `automatic` to begin a recording and transition to on-demand after Stream Live stops receiving input.",
"enum": [
"off",
"automatic"
],
"example": "automatic",
"type": "string"
},
"requireSignedURLs": {
"default": false,
"description": "Indicates if a video using the live input has the `requireSignedURLs` property set. Also enforces access controls on any video recording of the livestream with the live input.",
"example": true,
"type": "boolean"
},
"timeoutSeconds": {
"default": 0,
"description": "Determines the amount of time a live input configured in `automatic` mode should wait before a recording transitions from live to on-demand. `0` is recommended for most use cases and indicates the platform default should be used.",
"type": "integer"
}
},
"type": "object"
}
}
}
}
},
"required": true
} {
"200": {
"content": {
"application/json": {
"schema": {
"allOf": [
{
"allOf": [
{
"properties": {
"errors": {
"example": [],
"items": {
"properties": {
"code": {
"minimum": 1000,
"type": "integer"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object",
"uniqueItems": true
},
"type": "array"
},
"messages": {
"example": [],
"items": {
"properties": {
"code": {
"minimum": 1000,
"type": "integer"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object",
"uniqueItems": true
},
"type": "array"
},
"result": {
"anyOf": [
{
"type": "object"
},
{
"items": {},
"type": "array"
},
{
"type": "string"
}
]
},
"success": {
"description": "Whether the API call was successful",
"enum": [
true
],
"example": true,
"type": "boolean"
}
},
"required": [
"success",
"errors",
"messages",
"result"
],
"type": "object"
},
{
"properties": {
"result": {
"anyOf": [
{
"type": "object"
},
{
"type": "string"
}
]
}
}
}
],
"type": "object"
},
{
"properties": {
"result": {
"description": "Details about a live input.",
"properties": {
"created": {
"description": "The date and time the live input was created.",
"example": "2014-01-02T02:20:00Z",
"format": "date-time",
"type": "string"
},
"deleteRecordingAfterDays": {
"description": "Indicates the number of days after which the live inputs recordings will be deleted. When a stream completes and the recording is ready, the value is used to calculate a scheduled deletion date for that recording. Omit the field to indicate no change, or include with a `null` value to remove an existing scheduled deletion.",
"example": 45,
"minimum": 30,
"type": "number"
},
"meta": {
"description": "A user modifiable key-value store used to reference other systems of record for managing live inputs.",
"example": {
"name": "test stream 1"
},
"type": "object"
},
"modified": {
"description": "The date and time the live input was last modified.",
"example": "2014-01-02T02:20:00Z",
"format": "date-time",
"type": "string"
},
"recording": {
"description": "Records the input to a Cloudflare Stream video. Behavior depends on the mode. In most cases, the video will initially be viewable as a live video and transition to on-demand after a condition is satisfied.",
"example": {
"mode": "off",
"requireSignedURLs": false,
"timeoutSeconds": 0
},
"properties": {
"allowedOrigins": {
"description": "Lists the origins allowed to display videos created with this input. Enter allowed origin domains in an array and use `*` for wildcard subdomains. An empty array allows videos to be viewed on any origin.",
"example": [
"example.com"
],
"items": {
"type": "string"
},
"type": "array"
},
"mode": {
"default": "off",
"description": "Specifies the recording behavior for the live input. Set this value to `off` to prevent a recording. Set the value to `automatic` to begin a recording and transition to on-demand after Stream Live stops receiving input.",
"enum": [
"off",
"automatic"
],
"example": "automatic",
"type": "string"
},
"requireSignedURLs": {
"default": false,
"description": "Indicates if a video using the live input has the `requireSignedURLs` property set. Also enforces access controls on any video recording of the livestream with the live input.",
"example": true,
"type": "boolean"
},
"timeoutSeconds": {
"default": 0,
"description": "Determines the amount of time a live input configured in `automatic` mode should wait before a recording transitions from live to on-demand. `0` is recommended for most use cases and indicates the platform default should be used.",
"type": "integer"
}
},
"type": "object"
},
"rtmps": {
"description": "Details for streaming to an live input using RTMPS.",
"properties": {
"streamKey": {
"description": "The secret key to use when streaming via RTMPS to a live input.",
"example": "2fb3cb9f17e68a2568d6ebed8d5505eak3ceaf8c9b1f395e1b76b79332497cada",
"type": "string"
},
"url": {
"description": "The RTMPS URL you provide to the broadcaster, which they stream live video to.",
"example": "rtmps://live.cloudflare.com:443/live/",
"type": "string"
}
},
"type": "object"
},
"rtmpsPlayback": {
"description": "Details for playback from an live input using RTMPS.",
"properties": {
"streamKey": {
"description": "The secret key to use for playback via RTMPS.",
"example": "2fb3cb9f17e68a2568d6ebed8d5505eak3ceaf8c9b1f395e1b76b79332497cada",
"type": "string"
},
"url": {
"description": "The URL used to play live video over RTMPS.",
"example": "rtmps://live.cloudflare.com:443/live/",
"type": "string"
}
},
"type": "object"
},
"srt": {
"description": "Details for streaming to a live input using SRT.",
"properties": {
"passphrase": {
"description": "The secret key to use when streaming via SRT to a live input.",
"example": "2fb3cb9f17e68a2568d6ebed8d5505eak3ceaf8c9b1f395e1b76b79332497cada",
"type": "string"
},
"streamId": {
"description": "The identifier of the live input to use when streaming via SRT.",
"example": "f256e6ea9341d51eea64c9454659e576",
"type": "string"
},
"url": {
"description": "The SRT URL you provide to the broadcaster, which they stream live video to.",
"example": "srt://live.cloudflare.com:778",
"type": "string"
}
},
"type": "object"
},
"srtPlayback": {
"description": "Details for playback from an live input using SRT.",
"properties": {
"passphrase": {
"description": "The secret key to use for playback via SRT.",
"example": "2fb3cb9f17e68a2568d6ebed8d5505eak3ceaf8c9b1f395e1b76b79332497cada",
"type": "string"
},
"streamId": {
"description": "The identifier of the live input to use for playback via SRT.",
"example": "f256e6ea9341d51eea64c9454659e576",
"type": "string"
},
"url": {
"description": "The URL used to play live video over SRT.",
"example": "rtmps://live.cloudflare.com:443/live/",
"type": "string"
}
},
"type": "object"
},
"status": {
"description": "The connection status of a live input.",
"enum": [
null,
"connected",
"reconnected",
"reconnecting",
"client_disconnect",
"ttl_exceeded",
"failed_to_connect",
"failed_to_reconnect",
"new_configuration_accepted"
],
"nullable": true,
"type": "string"
},
"uid": {
"description": "A unique identifier for a live input.",
"example": "66be4bf738797e01e1fca35a7bdecdcd",
"maxLength": 32,
"type": "string"
},
"webRTC": {
"description": "Details for streaming to a live input using WebRTC.",
"properties": {
"url": {
"description": "The WebRTC URL you provide to the broadcaster, which they stream live video to.",
"example": "https://customer-m033z5x00ks6nunl.cloudflarestream.com/b236bde30eb07b9d01318940e5fc3edake34a3efb3896e18f2dc277ce6cc993ad/webRTC/publish",
"type": "string"
}
},
"type": "object"
},
"webRTCPlayback": {
"description": "Details for playback from a live input using WebRTC.",
"properties": {
"url": {
"description": "The URL used to play live video over WebRTC.",
"example": "https://customer-m033z5x00ks6nunl.cloudflarestream.com/b236bde30eb07b9d01318940e5fc3edake34a3efb3896e18f2dc277ce6cc993ad/webRTC/play",
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}
}
}
]
}
}
},
"description": "Create a live input response"
},
"4XX": {
"content": {
"application/json": {
"schema": {
"properties": {
"errors": {
"allOf": [
{
"example": [],
"items": {
"properties": {
"code": {
"minimum": 1000,
"type": "integer"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object",
"uniqueItems": true
},
"type": "array"
}
],
"example": [
{
"code": 7003,
"message": "No route for the URI"
}
],
"minLength": 1
},
"messages": {
"allOf": [
{
"example": [],
"items": {
"properties": {
"code": {
"minimum": 1000,
"type": "integer"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object",
"uniqueItems": true
},
"type": "array"
}
],
"example": []
},
"result": {
"enum": [
null
],
"nullable": true,
"type": "object"
},
"success": {
"description": "Whether the API call was successful",
"enum": [
false
],
"example": false,
"type": "boolean"
}
},
"required": [
"success",
"errors",
"messages",
"result"
],
"type": "object"
}
}
},
"description": "Create a live input response failure"
}
} [
{
"api_email": [],
"api_key": []
}
]