Event subscriptions allow you to receive messages when events occur across your Cloudflare account. Cloudflare products (e.g., KV, Workers AI, Workers) can publish structured events to a queue, which you can then consume with Workers or HTTP pull consumers to build custom workflows, integrations, or logic.
For more information on Event Subscriptions, refer to the management guide.
Stream also sends webhooks for videos and Live Webhooks for live inputs. Use event subscriptions instead of webhooks when you need control over which events go where:
- Choose exactly which events you receive. Subscribe to any combination of 14 event types. Video webhooks send every ready and error event to a single URL.
- Send events to multiple destinations. Create multiple subscriptions to route different events to different queues, for example,
video_state.readyto a publishing pipeline andcaption.readyto an indexing pipeline. - Receive more event types. Event subscriptions include caption, download, and video update events that webhooks do not send.
- Process events your way. Consume events with a Worker or an HTTP pull consumer, with the retries and batching that Queues provides.
Use webhooks if you only need video ready and error notifications at one HTTP endpoint, need to filter live input events by input ID, or need live input error codes.
To send Stream events to a queue, create a subscription with the stream source:
npx wrangler queues subscription create <QUEUE_NAME> --source stream --events video_state.ready,live_input.connectedyarn wrangler queues subscription create <QUEUE_NAME> --source stream --events video_state.ready,live_input.connectedpnpm wrangler queues subscription create <QUEUE_NAME> --source stream --events video_state.ready,live_input.connectedTo route other events to a different queue, run the command again with that queue and event list.
You can also create a subscription in the dashboard. For instructions, refer to Manage event subscriptions.
For complete examples, refer to Send Stream error alerts and Summarize videos with Workers AI.
Stream publishes events for all videos and live inputs in your account. Stream subscriptions are account-level and do not take source-specific options.
Triggered when a broadcast connects to a live input. The payload matches the live input object returned by the Stream API, with status set to the live input's connection status when the event was sent.
Example:
{
"type": "cf.stream.live_input.connected",
"source": {
"type": "stream"
},
"payload": {
"id": "1a553f11a88915d093d45eda660d2f8c",
"created": "2026-12-01T02:48:57Z",
"modified": "2026-12-01T02:48:57Z",
"meta": {
"name": "My live input"
},
"status": "connected",
"rtmps": {
"url": "rtmps://live.cloudflare.com:443/live/",
"streamKey": "<RTMPS_STREAM_KEY>"
},
"enabled": true,
"deleteRecordingAfterDays": null,
"defaultCreator": null,
"rtmpsPlayback": {
"url": "rtmps://live.cloudflare.com:443/live/",
"streamKey": "<RTMPS_PLAYBACK_KEY>"
},
"srt": {
"url": "srt://live.cloudflare.com:778",
"streamId": "<SRT_STREAM_ID>",
"passphrase": "<SRT_PASSPHRASE>"
},
"srtPlayback": {
"url": "srt://live.cloudflare.com:778",
"streamId": "<SRT_PLAYBACK_STREAM_ID>",
"passphrase": "<SRT_PLAYBACK_PASSPHRASE>"
},
"webRTC": {
"url": "https://customer-f33zs165nr7gyfy4.cloudflarestream.com/<WEBRTC_KEY>/webRTC/publish"
},
"webRTCPlayback": {
"url": "https://customer-f33zs165nr7gyfy4.cloudflarestream.com/1a553f11a88915d093d45eda660d2f8c/webRTC/play"
},
"recording": {
"mode": "automatic",
"requireSignedURLs": false,
"allowedOrigins": null,
"hideLiveViewerCount": false
}
},
"metadata": {
"accountId": "f9f79265f388666de8122cfb508d7776",
"eventSubscriptionId": "1830c4bb612e43c3af7f4cada31fbf3f",
"eventSchemaVersion": 1,
"eventTimestamp": "2026-12-01T02:48:57.132Z"
}
}Triggered when a broadcast disconnects from a live input. The payload has the same shape as live_input.connected.
Example:
{
"type": "cf.stream.live_input.disconnected",
"source": {
"type": "stream"
},
"payload": {
"id": "1a553f11a88915d093d45eda660d2f8c",
"created": "2026-12-01T02:48:57Z",
"modified": "2026-12-01T02:48:57Z",
"meta": {
"name": "My live input"
},
"status": "client_disconnect",
"rtmps": {
"url": "rtmps://live.cloudflare.com:443/live/",
"streamKey": "<RTMPS_STREAM_KEY>"
},
"enabled": true,
"deleteRecordingAfterDays": null,
"defaultCreator": null
},
"metadata": {
"accountId": "f9f79265f388666de8122cfb508d7776",
"eventSubscriptionId": "1830c4bb612e43c3af7f4cada31fbf3f",
"eventSchemaVersion": 1,
"eventTimestamp": "2026-12-01T03:12:04.517Z"
}
}Triggered when a live input encounters an error, such as an unsupported codec or exhausted storage quota. The payload has the same shape as live_input.connected and does not include the error code. To receive error codes, use Live Webhooks.
Example:
{
"type": "cf.stream.live_input.errored",
"source": {
"type": "stream"
},
"payload": {
"id": "1a553f11a88915d093d45eda660d2f8c",
"created": "2026-12-01T02:48:57Z",
"modified": "2026-12-01T02:48:57Z",
"meta": {
"name": "My live input"
},
"status": "connected",
"rtmps": {
"url": "rtmps://live.cloudflare.com:443/live/",
"streamKey": "<RTMPS_STREAM_KEY>"
},
"enabled": true,
"deleteRecordingAfterDays": null,
"defaultCreator": null
},
"metadata": {
"accountId": "f9f79265f388666de8122cfb508d7776",
"eventSubscriptionId": "1830c4bb612e43c3af7f4cada31fbf3f",
"eventSchemaVersion": 1,
"eventTimestamp": "2026-12-01T03:12:04.517Z"
}
}Triggered when a video finishes processing and is ready to stream. The payload matches the video object returned by the Stream API.
Example:
{
"type": "cf.stream.video_state.ready",
"source": {
"type": "stream"
},
"payload": {
"id": "6b9e68b07dfee8cc2d116e4c51d6a957",
"allowedOrigins": [],
"created": "2026-12-01T02:40:12Z",
"creator": null,
"duration": 26.17,
"input": {
"width": 1920,
"height": 1080
},
"maxSizeBytes": null,
"maxDurationSeconds": null,
"meta": {
"name": "My video"
},
"modified": "2026-12-01T02:48:57Z",
"hlsPlaybackUrl": "https://customer-f33zs165nr7gyfy4.cloudflarestream.com/6b9e68b07dfee8cc2d116e4c51d6a957/manifest/video.m3u8",
"dashPlaybackUrl": "https://customer-f33zs165nr7gyfy4.cloudflarestream.com/6b9e68b07dfee8cc2d116e4c51d6a957/manifest/video.mpd",
"preview": "https://customer-f33zs165nr7gyfy4.cloudflarestream.com/6b9e68b07dfee8cc2d116e4c51d6a957/watch",
"readyToStream": true,
"readyToStreamAt": "2026-12-01T02:48:57Z",
"requireSignedURLs": false,
"scheduledDeletion": null,
"size": 4190963,
"status": {
"state": "ready",
"pctComplete": "100.000000",
"errorReasonCode": "",
"errorReasonText": ""
},
"thumbnail": "https://customer-f33zs165nr7gyfy4.cloudflarestream.com/6b9e68b07dfee8cc2d116e4c51d6a957/thumbnails/thumbnail.jpg",
"thumbnailTimestampPct": 0,
"uploaded": "2026-12-01T02:40:15Z",
"uploadExpiry": null,
"clippedFromId": null,
"publicDetails": null,
"watermark": null
},
"metadata": {
"accountId": "f9f79265f388666de8122cfb508d7776",
"eventSubscriptionId": "1830c4bb612e43c3af7f4cada31fbf3f",
"eventSchemaVersion": 1,
"eventTimestamp": "2026-12-01T02:48:57.132Z"
}
}Triggered when a video's properties are updated, for example, through the Stream API. The payload has the same shape as video_state.ready and reflects the video after the update.
Example:
{
"type": "cf.stream.video_state.updated",
"source": {
"type": "stream"
},
"payload": {
"id": "6b9e68b07dfee8cc2d116e4c51d6a957",
"allowedOrigins": ["example.com"],
"created": "2026-12-01T02:40:12Z",
"creator": null,
"duration": 26.17,
"input": {
"width": 1920,
"height": 1080
},
"maxSizeBytes": null,
"maxDurationSeconds": null,
"meta": {
"name": "My renamed video"
},
"modified": "2026-12-01T04:05:33Z",
"hlsPlaybackUrl": "https://customer-f33zs165nr7gyfy4.cloudflarestream.com/6b9e68b07dfee8cc2d116e4c51d6a957/manifest/video.m3u8",
"dashPlaybackUrl": "https://customer-f33zs165nr7gyfy4.cloudflarestream.com/6b9e68b07dfee8cc2d116e4c51d6a957/manifest/video.mpd",
"preview": "https://customer-f33zs165nr7gyfy4.cloudflarestream.com/6b9e68b07dfee8cc2d116e4c51d6a957/watch",
"readyToStream": true,
"readyToStreamAt": "2026-12-01T02:48:57Z",
"requireSignedURLs": true,
"scheduledDeletion": null,
"size": 4190963,
"status": {
"state": "ready",
"pctComplete": "100.000000",
"errorReasonCode": "",
"errorReasonText": ""
},
"thumbnail": "https://customer-f33zs165nr7gyfy4.cloudflarestream.com/6b9e68b07dfee8cc2d116e4c51d6a957/thumbnails/thumbnail.jpg",
"thumbnailTimestampPct": 0,
"uploaded": "2026-12-01T02:40:15Z",
"uploadExpiry": null,
"clippedFromId": null,
"publicDetails": null,
"watermark": null
},
"metadata": {
"accountId": "f9f79265f388666de8122cfb508d7776",
"eventSubscriptionId": "1830c4bb612e43c3af7f4cada31fbf3f",
"eventSchemaVersion": 1,
"eventTimestamp": "2026-12-01T04:05:33.410Z"
}
}Triggered when a video enters the error state. status.errorReasonCode and status.errorReasonText describe the failure. For a list of codes, refer to Error codes.
Example:
{
"type": "cf.stream.video_state.errored",
"source": {
"type": "stream"
},
"payload": {
"id": "6b9e68b07dfee8cc2d116e4c51d6a957",
"allowedOrigins": [],
"created": "2026-12-01T02:40:12Z",
"creator": null,
"duration": -1,
"input": {
"width": -1,
"height": -1
},
"maxSizeBytes": null,
"maxDurationSeconds": null,
"meta": {
"name": "My video"
},
"modified": "2026-12-01T02:41:03Z",
"hlsPlaybackUrl": "https://customer-f33zs165nr7gyfy4.cloudflarestream.com/6b9e68b07dfee8cc2d116e4c51d6a957/manifest/video.m3u8",
"dashPlaybackUrl": "https://customer-f33zs165nr7gyfy4.cloudflarestream.com/6b9e68b07dfee8cc2d116e4c51d6a957/manifest/video.mpd",
"preview": "https://customer-f33zs165nr7gyfy4.cloudflarestream.com/6b9e68b07dfee8cc2d116e4c51d6a957/watch",
"readyToStream": false,
"readyToStreamAt": null,
"requireSignedURLs": false,
"scheduledDeletion": null,
"size": 4190963,
"status": {
"state": "error",
"errorReasonCode": "ERR_NON_VIDEO",
"errorReasonText": "The file was not recognized as a valid video file."
},
"thumbnail": "https://customer-f33zs165nr7gyfy4.cloudflarestream.com/6b9e68b07dfee8cc2d116e4c51d6a957/thumbnails/thumbnail.jpg",
"thumbnailTimestampPct": 0,
"uploaded": "2026-12-01T02:40:15Z",
"uploadExpiry": null,
"clippedFromId": null,
"publicDetails": null,
"watermark": null
},
"metadata": {
"accountId": "f9f79265f388666de8122cfb508d7776",
"eventSubscriptionId": "1830c4bb612e43c3af7f4cada31fbf3f",
"eventSchemaVersion": 1,
"eventTimestamp": "2026-12-01T02:41:03.208Z"
}
}Triggered when a caption file is uploaded or caption generation starts. For generated captions, status is inprogress. For uploaded captions, status is ready.
Example:
{
"type": "cf.stream.caption.created",
"source": {
"type": "stream"
},
"payload": {
"videoId": "6b9e68b07dfee8cc2d116e4c51d6a957",
"language": "en",
"label": "English (auto-generated)",
"generated": true,
"status": "inprogress"
},
"metadata": {
"accountId": "f9f79265f388666de8122cfb508d7776",
"eventSubscriptionId": "1830c4bb612e43c3af7f4cada31fbf3f",
"eventSchemaVersion": 1,
"eventTimestamp": "2026-12-01T02:50:10.004Z"
}
}Triggered when a caption's status changes, such as when generation finishes or fails, or when an uploaded caption replaces an existing one. status is ready, inprogress, or error.
Example:
{
"type": "cf.stream.caption.updated",
"source": {
"type": "stream"
},
"payload": {
"videoId": "6b9e68b07dfee8cc2d116e4c51d6a957",
"language": "en",
"label": "English (auto-generated)",
"generated": true,
"status": "ready"
},
"metadata": {
"accountId": "f9f79265f388666de8122cfb508d7776",
"eventSubscriptionId": "1830c4bb612e43c3af7f4cada31fbf3f",
"eventSchemaVersion": 1,
"eventTimestamp": "2026-12-01T02:52:41.775Z"
}
}Triggered when a caption is ready to use.
Example:
{
"type": "cf.stream.caption.ready",
"source": {
"type": "stream"
},
"payload": {
"videoId": "6b9e68b07dfee8cc2d116e4c51d6a957",
"language": "en",
"label": "English (auto-generated)",
"generated": true,
"status": "ready"
},
"metadata": {
"accountId": "f9f79265f388666de8122cfb508d7776",
"eventSubscriptionId": "1830c4bb612e43c3af7f4cada31fbf3f",
"eventSchemaVersion": 1,
"eventTimestamp": "2026-12-01T02:52:41.775Z"
}
}Triggered when a caption is deleted.
Example:
{
"type": "cf.stream.caption.deleted",
"source": {
"type": "stream"
},
"payload": {
"videoId": "6b9e68b07dfee8cc2d116e4c51d6a957",
"language": "en"
},
"metadata": {
"accountId": "f9f79265f388666de8122cfb508d7776",
"eventSubscriptionId": "1830c4bb612e43c3af7f4cada31fbf3f",
"eventSchemaVersion": 1,
"eventTimestamp": "2026-12-01T05:01:19.320Z"
}
}Triggered when a downloadable file is requested for a video.
Example:
{
"type": "cf.stream.download.created",
"source": {
"type": "stream"
},
"payload": {
"videoId": "6b9e68b07dfee8cc2d116e4c51d6a957",
"percentComplete": 0,
"status": "inprogress",
"url": "https://customer-f33zs165nr7gyfy4.cloudflarestream.com/6b9e68b07dfee8cc2d116e4c51d6a957/downloads/default.mp4"
},
"metadata": {
"accountId": "f9f79265f388666de8122cfb508d7776",
"eventSubscriptionId": "1830c4bb612e43c3af7f4cada31fbf3f",
"eventSchemaVersion": 1,
"eventTimestamp": "2026-12-01T03:00:00.000Z"
}
}Triggered when a download's status changes. status is ready, inprogress, or error.
Example:
{
"type": "cf.stream.download.updated",
"source": {
"type": "stream"
},
"payload": {
"videoId": "6b9e68b07dfee8cc2d116e4c51d6a957",
"percentComplete": 100,
"status": "ready",
"url": "https://customer-f33zs165nr7gyfy4.cloudflarestream.com/6b9e68b07dfee8cc2d116e4c51d6a957/downloads/default.mp4"
},
"metadata": {
"accountId": "f9f79265f388666de8122cfb508d7776",
"eventSubscriptionId": "1830c4bb612e43c3af7f4cada31fbf3f",
"eventSchemaVersion": 1,
"eventTimestamp": "2026-12-01T03:00:42.118Z"
}
}Triggered when a download is ready to retrieve from url.
Example:
{
"type": "cf.stream.download.ready",
"source": {
"type": "stream"
},
"payload": {
"videoId": "6b9e68b07dfee8cc2d116e4c51d6a957",
"percentComplete": 100,
"status": "ready",
"url": "https://customer-f33zs165nr7gyfy4.cloudflarestream.com/6b9e68b07dfee8cc2d116e4c51d6a957/downloads/default.mp4"
},
"metadata": {
"accountId": "f9f79265f388666de8122cfb508d7776",
"eventSubscriptionId": "1830c4bb612e43c3af7f4cada31fbf3f",
"eventSchemaVersion": 1,
"eventTimestamp": "2026-12-01T03:00:42.118Z"
}
}Triggered when a download is deleted.
Example:
{
"type": "cf.stream.download.deleted",
"source": {
"type": "stream"
},
"payload": {
"videoId": "6b9e68b07dfee8cc2d116e4c51d6a957",
"url": "https://customer-f33zs165nr7gyfy4.cloudflarestream.com/6b9e68b07dfee8cc2d116e4c51d6a957/downloads/default.mp4"
},
"metadata": {
"accountId": "f9f79265f388666de8122cfb508d7776",
"eventSubscriptionId": "1830c4bb612e43c3af7f4cada31fbf3f",
"eventSchemaVersion": 1,
"eventTimestamp": "2026-12-01T05:10:00.000Z"
}
}