Webhooks are a way for a web application to be alerted of activity on a Rewatch channel. By providing a URL to receive JSON payloads representing channel events, it’s possible to take action in response to that activity.
Read the webhooks overview for a general discussion of using webhooks with your Rewatch channel.
Note: Creating and configuring webhooks may only be done by channel administrators. Webhook events will contain information about channel resources such as collections and videos regardless of their visibility on the channel.
Webhook event types
There are a set of high-level event types that correspond to resource types in a Rewatch channel, and for each of those there are a set of actions that may be taken on those resources. The combination of those yields the set of events that trigger webhook deliveries.
The current event types and their actions are:
video
collection
In the near future there will be events added for member
and group
actions.
The combination of event type and action is represented in the Rewatch-Hook-Delivery-Event
header and the JSON payload event
field in webhook delivery HTTP requests.
For example, deleting a collection from your channel will result in those fields being set to collection.deleted
.
Example event payloads
video.addedToChannel
This event will fire whenever a video leaves the draft state on a channel, regardless of its visibility.
Version: HTTP/1.1
Host: rewatch-example.ngrok.io
User-Agent: Rewatch Webhooks
Accept: application/json;
charset=utf-8
Rewatch-Hook-Delivery-Nonce: dc808dc8cca765568b8b85b4df75b656e8c5de01
Rewatch-Hook-Delivery-Signatures: 38bdef36aaba6c3ec20c0da3f17284,41f15ca050e3787069ea0b1199a602
Rewatch-Hook-Delivery-Timestamp: 2021-08-10T06:09:39Z
Rewatch-Hook-Delivery-Event: video.addedToChannel
Rewatch-Hook-Id: V2ViaG9vay0x
{
"hookId": "V2ViaG9vay0x",
"nonce": "dc808dc8cca765568b8b85b4df75b656e8c5de01",
"at": "2021-08-10T06:09:39.071Z",
"event": "video.addedToChannel",
"actor": {
"id": "VXNlci02MTcz",
"firstName": "Example",
"lastName": "User",
"email": "user@example.com",
"createdAt": "2021-07-15T04:17:22.550Z"
},
"channel": {
"url": "https://example.rewatch.com",
"name": "Rewatch Example",
"subdomain": "example",
"description": null,
"createdAt": "2021-07-15T04:17:22.545Z"
},
"video": {
"id": "VmlkZW8tMTM4NjA=",
"url": "https://example.rewatch.com/video/13860/all-hands-presentation",
"title": "All-hands presentation",
"summary": "The latest updates from the leadership team.",
"visibility": "PRIVATE",
"presentedAt": "2021-08-10T00:00:00.000Z",
"duration": 25.7,
"collections": [
{
"id": "Q29sbGVjdGlvbi0xMzI2",
"url": "https://example.rewatch.com/collection/1326/new-collection-for-hook",
"name": "All-hands",
"description": "The bi-weekly all-hands sessions.",
"createdAt": "2021-08-02T21:08:57.146Z",
"secret": true,
"children": [],
"admins": [],
"members": []
}
],
"taggedUsers": [],
"createdAt": "2021-08-10T06:08:39.996Z"
}
}
video.updated
This event will fire when a video’s details, such as its title or description, are changed, collections are added or removed, users are tagged or untagged, or the video is trimmed.
Version: HTTP/1.1
Host: rewatch-example.ngrok.io
User-Agent: Rewatch Webhooks
Accept: application/json;
charset=utf-8
Rewatch-Hook-Delivery-Nonce: cf8540f64eb1de7f9606ecb3ad96b230b9ef8b15
Rewatch-Hook-Delivery-Signatures: 38bdef36aaba6c3ec20c0da3f17284,41f15ca050e3787069ea0b1199a602
Rewatch-Hook-Delivery-Timestamp: 2021-08-09T20:05:28Z
Rewatch-Hook-Delivery-Event: video.updated
Rewatch-Hook-Id: V2ViaG9vay0x
{
"hookId": "V2ViaG9vay0x",
"nonce": "cf8540f64eb1de7f9606ecb3ad96b230b9ef8b15",
"at": "2021-08-09T20:05:28.895Z",
"event": "video.updated",
"actor": {
"id": "VXNlci02MTcz",
"firstName": "Example",
"lastName": "User",
"email": "user@example.com",
"createdAt": "2021-07-15T04:17:22.550Z"
},
"channel": {
"url": "https://example.rewatch.com",
"name": "Rewatch Example",
"subdomain": "example",
"description": null,
"createdAt": "2021-07-15T04:17:22.545Z"
},
"video": {
"id": "VmlkZW8tMTE4MjA=",
"url": "https://example.rewatch.com/video/11820/snack",
"title": "My Zoom Call",
"summary": "",
"visibility": "ON_CHANNEL",
"presentedAt": "2021-07-15T00:00:00.000Z",
"duration": 60.466,
"collections": [
{
"id": "Q29sbGVjdGlvbi0xMjE1",
"url": "https://example.rewatch.com/collection/1215/test-collection",
"name": "Test Collection",
"description": "For testing!",
"createdAt": "2021-07-15T04:42:23.897Z",
"secret": false,
"children": [],
"admins": [],
"members": []
},
{
"id": "Q29sbGVjdGlvbi0xMjIy",
"url": "https://example.rewatch.com/collection/1222/test-collection-2",
"name": "Test Collection 2",
"description": "Another one.",
"createdAt": "2021-07-16T03:48:07.010Z",
"secret": false,
"children": [],
"admins": [],
"members": []
}
],
"taggedUsers": [],
"createdAt": "2021-07-15T04:43:10.154Z"
},
"updates": {
"title": {
"from": "My Zoom Call",
"to": "API Design Session"
}
}
}
video.deleted
This event fires whenever a non-draft video is removed from a channel.
Version: HTTP/1.1
Host: rewatch-example.ngrok.io
User-Agent: Rewatch Webhooks
Accept: application/json;
charset=utf-8
Rewatch-Hook-Delivery-Nonce: 9a0566584b7972e90d77e8b346a94344e6c2fd95
Rewatch-Hook-Delivery-Signatures: 38bdef36aaba6c3ec20c0da3f17284,41f15ca050e3787069ea0b1199a602
Rewatch-Hook-Delivery-Timestamp: 2021-08-10T06:16:42Z
Rewatch-Hook-Event: video.deleted
Rewatch-Hook: V2ViaG9vay0x
{
"hookId": "V2ViaG9vay0x",
"nonce": "9a0566584b7972e90d77e8b346a94344e6c2fd95",
"at": "2021-08-10T06:16:42.194Z",
"event": "video.deleted",
"actor": {
"id": "VXNlci02MTcz",
"firstName": "Example",
"lastName": "User",
"email": "user@example.com",
"createdAt": "2021-07-15T04:17:22.550Z"
},
"channel": {
"url": "https://example.rewatch.com",
"name": "Rewatch Example",
"subdomain": "example",
"description": null,
"createdAt": "2021-07-15T04:17:22.545Z"
},
"video": {
"id": "VmlkZW8tMTM4NjA=",
"url": "https://example.rewatch.com/video/13860/all-hands-presentation",
"title": "All-hands presentation",
"summary": "",
"visibility": "PRIVATE",
"presentedAt": "2021-08-10T00:00:00.000Z",
"duration": 25.7,
"collections": [],
"taggedUsers": [],
"createdAt": "2021-08-10T06:08:39.996Z"
}
}
collection.created
This event will fire when a collection is created.
Version: HTTP/1.1
Host: rewatch-example.ngrok.io
User-Agent: Rewatch Webhooks
Accept: application/json;
charset=utf-8
Rewatch-Hook-Delivery-Nonce: 8110fe3af6872b93073b7d5af4d38b3a731f0004
Rewatch-Hook-Delivery-Signatures: 38bdef36aaba6c3ec20c0da3f17284,41f15ca050e3787069ea0b1199a602
Rewatch-Hook-Delivery-Timestamp: 2021-08-10T06:27:59Z
Rewatch-Hook-Delivery-Event: collection.created
Rewatch-Hook-Id: V2ViaG9vay0x
{
"hookId": "V2ViaG9vay0x",
"nonce": "8110fe3af6872b93073b7d5af4d38b3a731f0004",
"at": "2021-08-10T06:27:59.354Z",
"event": "collection.created",
"actor": {
"id": "VXNlci02MTcz",
"firstName": "Example",
"lastName": "User",
"email": "user@example.com",
"createdAt": "2021-07-15T04:17:22.550Z"
},
"channel": {
"url": "https://example.rewatch.com",
"name": "Rewatch Example",
"subdomain": "example",
"description": null,
"createdAt": "2021-07-15T04:17:22.545Z"
},
"collection": {
"id": "Q29sbGVjdGlvbi0xMzc2",
"url": "https://example.rewatch.com/collection/1376/all-hands",
"name": "All-hands",
"description": "Collecting the bi-weekly all hands sessions.",
"createdAt": "2021-08-10T06:27:59.321Z",
"secret": false,
"children": [],
"admins": [],
"members": [],
"parent": null
}
}
collection.updated
This event will fire when a collection’s details, such as its name, description, parent, or secret status, are changed or members are added or removed.
Version: HTTP/1.1
Host: rewatch-example.ngrok.io
User-Agent: Rewatch Webhooks
Accept: application/json;
charset=utf-8
Rewatch-Hook-Delivery-Nonce: d25336894c531863962bd0263c94fd9026c09406
Rewatch-Hook-Delivery-Signatures: 38bdef36aaba6c3ec20c0da3f17284,41f15ca050e3787069ea0b1199a602
Rewatch-Hook-Delivery-Timestamp: 2021-08-10T06:31:55Z
Rewatch-Hook-Delivery-Event: collection.updated
Rewatch-Hook-Id: V2ViaG9vay0x
{
"hookId": "V2ViaG9vay0x",
"nonce": "d25336894c531863962bd0263c94fd9026c09406",
"at": "2021-08-10T06:31:55.427Z",
"event": "collection.updated",
"actor": {
"id": "VXNlci02MTcz",
"firstName": "Example",
"lastName": "User",
"email": "user@example.com",
"createdAt": "2021-07-15T04:17:22.550Z"
},
"channel": {
"url": "https://example.rewatch.com",
"name": "Rewatch Example",
"subdomain": "example",
"description": null,
"createdAt": "2021-07-15T04:17:22.545Z"
},
"collection": {
"id": "Q29sbGVjdGlvbi0xMzc3",
"url": "https://example.rewatch.com/collection/1377/q-and-a-sessions",
"name": "Q and A Sessions",
"description": "Q and As following the bi-weekly all-hands.",
"createdAt": "2021-08-10T06:30:46.095Z",
"secret": false,
"children": [],
"admins": [],
"members": [],
"parent": {
"id": "Q29sbGVjdGlvbi0xMzc2",
"url": "https://example.rewatch.com/collection/1376/all-hands",
"name": "All-hands",
"description": "Collecting the bi-weekly all hands sessions.",
"createdAt": "2021-08-10T06:27:59.321Z",
"secret": false,
"children": [
{
"id": "Q29sbGVjdGlvbi0xMzc3",
"url": "https://example.rewatch.com/collection/1377/q-and-a-sessions",
"name": "Q and A Sessions",
"description": "Q and As following the bi-weekly all-hands.",
"createdAt": "2021-08-10T06:30:46.095Z",
"secret": false,
"children": [],
"admins": [],
"members": []
}
],
"admins": [],
"members": []
}
},
"updates": {
"parent": {
"from": null,
"to": {
"id": "Q29sbGVjdGlvbi0xMzc2",
"url": "https://example.rewatch.com/collection/1376/all-hands",
"name": "All-hands",
"description": "Collecting the bi-weekly all hands sessions.",
"createdAt": "2021-08-10T06:27:59.321Z",
"secret": false,
"children": [
{
"id": "Q29sbGVjdGlvbi0xMzc3",
"url": "https://example.rewatch.com/collection/1377/q-and-a-sessions",
"name": "Q and A Sessions",
"description": "Q and As following the bi-weekly all-hands.",
"createdAt": "2021-08-10T06:30:46.095Z",
"secret": false,
"children": [],
"admins": [],
"members": []
}
],
"admins": [],
"members": []
}
}
}
}
collection.deleted
This event will fire when a collection is deleted.
Version: HTTP/1.1
Host: rewatch-example.ngrok.io
User-Agent: Rewatch Webhooks
Accept: application/json;
charset=utf-8
Rewatch-Hook-Delivery-Nonce: d4b28e32d885ff7c851da71116c7ab51003d2257
Rewatch-Hook-Delivery-Signatures: 30c468e042a6bdeed1301764c58767d145ba5b785dac7f3cc520741d0522faf4
Rewatch-Hook-Delivery-Timestamp: 2021-08-10T06:37:46Z
Rewatch-Hook-Delivery-Event: collection.deleted
Rewatch-Hook-Id: V2ViaG9vay0x
{
"hookId": "V2ViaG9vay0x",
"nonce": "d4b28e32d885ff7c851da71116c7ab51003d2257",
"at": "2021-08-10T06:37:46.181Z",
"event": "collection.deleted",
"actor": {
"id": "VXNlci02MTcz",
"firstName": "Example",
"lastName": "User",
"email": "user@example.com",
"createdAt": "2021-07-15T04:17:22.550Z"
},
"channel": {
"url": "https://example.rewatch.com",
"name": "Rewatch Example",
"subdomain": "example",
"description": null,
"createdAt": "2021-07-15T04:17:22.545Z"
},
"collection": {
"id": "Q29sbGVjdGlvbi0xMzc3",
"url": "https://example.rewatch.com/collection/1377/q-and-a-sessions",
"name": "Q and A Sessions",
"description": "Q and As following the bi-weekly all-hands.",
"createdAt": "2021-08-10T06:30:46.095Z",
"secret": false,
"children": [],
"admins": [],
"members": []
}
}