Webhooks
Download SpecList all webhooks
Retrieve a list of all webhooks configured for the current workspace.
apiKey
events
string
The webhook event that you wish to filter on.
- Example
- "video.encoding.quality.completed"
currentPage
int
Choose the number of search results to return per page. Minimum value: 1
- Default
- 1
- Example
- 2
pageSize
int
Results per page. Allowed values 1-100, default is 25.
- Default
- 25
- Example
- 30
Request
// First install the go client with "go get github.com/apivideo/api.video-go-client"
// Documentation: https://github.com/apivideo/api.video-go-client/blob/main/docs/WebhooksApi.md#list
package main
import (
"context"
"fmt"
"os"
apivideosdk "github.com/apivideo/api.video-go-client"
)
func main()
// First install the "@api.video/nodejs-client" npm package
// Documentation: https://github.com/apivideo/api.video-nodejs-client/blob/main/doc/api/WebhooksApi.md#list
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });
const events = 'video.encoding.quality.completed'; // The webhook event that you wish to filter on.
const currentPage = 2; // Choose the number of search results to return per page. Minimum value: 1
const pageSize = 30; // Results per page. Allowed values 1-100, default is 25.
const webhooks = await client.webhooks.list({ events, currentPage, pageSize });
# First install the api client with "pip install api.video"
# Documentation: https://github.com/apivideo/api.video-python-client/blob/main/docs/WebhooksApi.md#list
# Enter a context with an instance of the API client
# Create an instance of the API class
=
= # str | The webhook event that you wish to filter on. (optional)
= 2 # int | Choose the number of search results to return per page. Minimum value: 1 (optional) if omitted the server will use the default value of 1
= 30 # int | Results per page. Allowed values 1-100, default is 25. (optional) if omitted the server will use the default value of 25
# example passing only required values which don't have defaults set
# and optional values
# List all webhooks
=
// First add the "video.api:java-api-client" maven dependency to your project
// Documentation: https://github.com/apivideo/api.video-java-client/blob/main/docs/WebhooksApi.md#list
;
;
;
;
;
// First add the "ApiVideo" NuGet package to your project
// Documentation: https://github.com/apivideo/api.video-csharp-client/blob/main/docs/WebhooksApi.md#list
using System.Diagnostics;
using ApiVideo.Client;
namespace Example
{
public class listExample
{
public static void Main()
{
var basePath = ApiVideoClient.Client.Environment.SANDBOX;
var apiKey = "YOUR_API_KEY";
var apiInstance = new ApiVideoClient(apiKey,basePath);
var events = video.encoding.quality.completed; // string | The webhook event that you wish to filter on. (optional)
var currentPage = 2; // int? | Choose the number of search results to return per page. Minimum value: 1 (optional) (default to 1)
var pageSize = 30; // int? | Results per page. Allowed values 1-100, default is 25. (optional) (default to 25)
var apiWebhooksInstance = apiInstance.Webhooks();
try
{
// List all webhooks
WebhooksListResponse result = apiWebhooksInstance.list(events, currentPage, pageSize);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling WebhooksApi.list: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
// First install the api client: https://github.com/apivideo/api.video-ios-client#getting-started
// Documentation: https://github.com/apivideo/api.video-ios-client/blob/main/docs/WebhooksAPI.md#list
Response
Success
data
array[object (Webhook)]
required
Webhook
object (Webhook)
createdAt
string
date-time
When an webhook was created, presented in ISO-8601 format.
- Example
- "2019-06-24T11:45:01.109Z"
events
array[string]
A list of events that will trigger the webhook.
- Example
- "[\"video.encoding.quality.completed\"]"
string
url
string
URL of the webhook
- Example
- "http://clientnotificationserver.com/notif?myquery=query"
webhookId
string
Unique identifier of the webhook
- Example
- "webhook_XXXXXXXXXXXXXXX"
pagination
object (pagination)
required
- Example
- { "currentPage": 3, "currentPageItems": 20, "itemsTotal": 123, "links": { "first": { "rel": "first", "uri": "/videos/search?currentPage=1&pageSize=20" }, "last": { "rel": "last", "uri": "/videos/search?currentPage=6&pageSize=20" }, "next": { "rel": "next", "uri": "/videos/search?currentPage=4&pageSize=20" }, "previous": { "rel": "previous", "uri": "/videos/search?currentPage=2&pageSize=20" } }, "pageSize": 20, "pagesTotal": 7 }
currentPage
int
The current page index.
currentPageItems
int
The number of items on the current page.
itemsTotal
int
Total number of items that exist.
links
array[object (PaginationLink)]
required
PaginationLink
object (PaginationLink)
rel
string
uri
string
uri
pageSize
int
Maximum number of item per page.
pagesTotal
int
Number of items listed in the current page.
Create Webhook
Webhooks can push notifications to your server, rather than polling api.video for changes. We currently offer four events:
video.encoding.quality.completed
Occurs when a new video is uploaded into your account, it will be encoded into several different HLS and mp4 qualities. When each version is encoded, your webhook will get a notification. It will look like{ "type": "video.encoding.quality.completed", "emittedAt": "2021-01-29T16:46:25.217+01:00", "videoId": "viXXXXXXXX", "encoding": "hls", "quality": "720p"}
. This request says that the 720p HLS encoding was completed.live-stream.broadcast.started
When a live stream begins broadcasting, the broadcasting parameter changes from false to true, and this webhook fires.live-stream.broadcast.ended
This event fires when a live stream has finished broadcasting.video.source.recorded
This event occurs when a live stream is recorded and submitted for encoding.
apiKey
events
array[string]
required
A list of the webhooks that you are subscribing to. There are Currently four webhook options:
video.encoding.quality.completed
Occurs when a new video is uploaded into your account, it will be encoded into several different HLS and mp4 qualities. When each version is encoded, your webhook will get a notification. It will look like{ \"type\": \"video.encoding.quality.completed\", \"emittedAt\": \"2021-01-29T16:46:25.217+01:00\", \"videoId\": \"viXXXXXXXX\", \"encoding\": \"hls\", \"quality\": \"720p\"}
. This request says that the 720p HLS encoding was completed.live-stream.broadcast.started
When a live stream begins broadcasting, the broadcasting parameter changes from false to true, and this webhook fires.live-stream.broadcast.ended
This event fires when a live stream has finished broadcasting.video.source.recorded
Occurs when a live stream is recorded and submitted for encoding.
- Example
- [ "video.encoding.quality.completed" ]
string
url
string
required
The the url to which HTTP notifications are sent. It could be any http or https URL.
- Example
- "https://example.com/webhooks"
Request
// First install the go client with "go get github.com/apivideo/api.video-go-client"
// Documentation: https://github.com/apivideo/api.video-go-client/blob/main/docs/WebhooksApi.md#create
package main
import (
"context"
"fmt"
"os"
apivideosdk "github.com/apivideo/api.video-go-client"
)
func main()
// First install the "@api.video/nodejs-client" npm package
// Documentation: https://github.com/apivideo/api.video-nodejs-client/blob/main/doc/api/WebhooksApi.md#create
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });
const webhooksCreationPayload = {
events: ["video.encoding.quality.completed"], // A list of the webhooks that you are subscribing to. There are Currently four webhook options: * ```video.encoding.quality.completed``` Occurs when a new video is uploaded into your account, it will be encoded into several different HLS and mp4 qualities. When each version is encoded, your webhook will get a notification. It will look like ```{ "type": "video.encoding.quality.completed", "emittedAt": "2021-01-29T16:46:25.217+01:00", "videoId": "viXXXXXXXX", "encoding": "hls", "quality": "720p"} ```. This request says that the 720p HLS encoding was completed. * ```live-stream.broadcast.started``` When a lives tream begins broadcasting, the broadcasting parameter changes from false to true, and this webhook fires. * ```live-stream.broadcast.ended``` This event fires when the live stream has finished broadcasting, and the broadcasting parameter flips from false to true. * ```video.source.recorded``` Occurs when a live stream is recorded and submitted for encoding.
url: "https://example.com/webhooks", // The url to which HTTP notifications are sent. It could be any http or https URL.
};
const webhook = await client.webhooks.create(webhooksCreationPayload);
# First install the api client with "pip install api.video"
# Documentation: https://github.com/apivideo/api.video-python-client/blob/main/docs/WebhooksApi.md#create
# Enter a context with an instance of the API client
# Create an instance of the API class
=
= # WebhooksCreationPayload |
# example passing only required values which don't have defaults set
# Create Webhook
=
// First add the "video.api:java-api-client" maven dependency to your project
// Documentation: https://github.com/apivideo/api.video-java-client/blob/main/docs/WebhooksApi.md#create
;
;
;
;
;
// First add the "ApiVideo" NuGet package to your project
// Documentation: https://github.com/apivideo/api.video-csharp-client/blob/main/docs/WebhooksApi.md#create
using System.Diagnostics;
using ApiVideo.Client;
namespace Example
{
public class createExample
{
public static void Main()
{
var basePath = ApiVideoClient.Client.Environment.SANDBOX;
var apiKey = "YOUR_API_KEY";
var apiInstance = new ApiVideoClient(apiKey,basePath);
var webhooksCreationPayload = new WebhooksCreationPayload(); // WebhooksCreationPayload |
var apiWebhooksInstance = apiInstance.Webhooks();
try
{
// Create Webhook
Webhook result = apiWebhooksInstance.create(webhooksCreationPayload);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling WebhooksApi.create: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
// First install the api client: https://github.com/apivideo/api.video-ios-client#getting-started
// Documentation: https://github.com/apivideo/api.video-ios-client/blob/main/docs/WebhooksAPI.md#create
ApiVideoClient.apiKey =
let webhooksCreationPayload = webhooks-creation-payload(events: [ ], url: )
WebhooksAPI.create(webhooksCreationPayload: webhooksCreationPayload) { (response, error) in
}
Response
Created
Bad Request
createdAt
string
date-time
When an webhook was created, presented in ISO-8601 format.
- Example
- "2019-06-24T11:45:01.109Z"
events
array[string]
A list of events that will trigger the webhook.
- Example
- "[\"video.encoding.quality.completed\"]"
string
url
string
URL of the webhook
- Example
- "http://clientnotificationserver.com/notif?myquery=query"
webhookId
string
Unique identifier of the webhook
- Example
- "webhook_XXXXXXXXXXXXXXX"
name
string
The name of the parameter that caused the error.
problems
array[object (BadRequest)]
Returns any additional problems in the request in an array of objects.
BadRequest
object (BadRequest)
name
string
The name of the parameter that caused the error.
status
int
The HTTP status code.
title
string
A description of the error that occurred.
type
string
A link to the error documentation.
status
int
The HTTP status code.
title
string
A description of the error that occurred.
type
string
A link to the error documentation.
apiKey
webhookId
string
required
The unique webhook you wish to retreive details on.
Request
// First install the go client with "go get github.com/apivideo/api.video-go-client"
// Documentation: https://github.com/apivideo/api.video-go-client/blob/main/docs/WebhooksApi.md#get
package main
import (
"context"
"fmt"
"os"
apivideosdk "github.com/apivideo/api.video-go-client"
)
func main()
// First install the "@api.video/nodejs-client" npm package
// Documentation: https://github.com/apivideo/api.video-nodejs-client/blob/main/doc/api/WebhooksApi.md#get
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });
const webhookId = 'webhookId_example'; // The unique webhook you wish to retreive details on.
const webhook = await client.webhooks.get(webhookId);
# First install the api client with "pip install api.video"
# Documentation: https://github.com/apivideo/api.video-python-client/blob/main/docs/WebhooksApi.md#get
# Enter a context with an instance of the API client
# Create an instance of the API class
=
= # str | The unique webhook you wish to retreive details on.
# example passing only required values which don't have defaults set
# Show Webhook details
=
// First add the "video.api:java-api-client" maven dependency to your project
// Documentation: https://github.com/apivideo/api.video-java-client/blob/main/docs/WebhooksApi.md#get
;
;
;
;
;
// First add the "ApiVideo" NuGet package to your project
// Documentation: https://github.com/apivideo/api.video-csharp-client/blob/main/docs/WebhooksApi.md#get
using System.Diagnostics;
using ApiVideo.Client;
namespace Example
{
public class getExample
{
public static void Main()
{
var basePath = ApiVideoClient.Client.Environment.SANDBOX;
var apiKey = "YOUR_API_KEY";
var apiInstance = new ApiVideoClient(apiKey,basePath);
var webhookId = webhookId_example; // string | The unique webhook you wish to retreive details on.
var apiWebhooksInstance = apiInstance.Webhooks();
try
{
// Show Webhook details
Webhook result = apiWebhooksInstance.get(webhookId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling WebhooksApi.get: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
// First install the api client: https://github.com/apivideo/api.video-ios-client#getting-started
// Documentation: https://github.com/apivideo/api.video-ios-client/blob/main/docs/WebhooksAPI.md#get
Response
Success
createdAt
string
date-time
When an webhook was created, presented in ISO-8601 format.
- Example
- "2019-06-24T11:45:01.109Z"
events
array[string]
A list of events that will trigger the webhook.
- Example
- "[\"video.encoding.quality.completed\"]"
string
url
string
URL of the webhook
- Example
- "http://clientnotificationserver.com/notif?myquery=query"
webhookId
string
Unique identifier of the webhook
- Example
- "webhook_XXXXXXXXXXXXXXX"
apiKey
webhookId
string
required
The webhook you wish to delete.
Request
// First install the go client with "go get github.com/apivideo/api.video-go-client"
// Documentation: https://github.com/apivideo/api.video-go-client/blob/main/docs/WebhooksApi.md#delete
package main
import (
"context"
"fmt"
"os"
apivideosdk "github.com/apivideo/api.video-go-client"
)
func main()
// First install the "@api.video/nodejs-client" npm package
// Documentation: https://github.com/apivideo/api.video-nodejs-client/blob/main/doc/api/WebhooksApi.md#delete
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });
const webhookId = 'webhookId_example'; // The webhook you wish to delete.
await client.webhooks.delete(webhookId);
# First install the api client with "pip install api.video"
# Documentation: https://github.com/apivideo/api.video-python-client/blob/main/docs/WebhooksApi.md#delete
# Enter a context with an instance of the API client
# Create an instance of the API class
=
= # str | The webhook you wish to delete.
# example passing only required values which don't have defaults set
# Delete a Webhook
// First add the "video.api:java-api-client" maven dependency to your project
// Documentation: https://github.com/apivideo/api.video-java-client/blob/main/docs/WebhooksApi.md#delete
;
;
;
;
;
// First add the "ApiVideo" NuGet package to your project
// Documentation: https://github.com/apivideo/api.video-csharp-client/blob/main/docs/WebhooksApi.md#delete
using System.Diagnostics;
using ApiVideo.Client;
namespace Example
{
public class deleteExample
{
public static void Main()
{
var basePath = ApiVideoClient.Client.Environment.SANDBOX;
var apiKey = "YOUR_API_KEY";
var apiInstance = new ApiVideoClient(apiKey,basePath);
var webhookId = webhookId_example; // string | The webhook you wish to delete.
var apiWebhooksInstance = apiInstance.Webhooks();
try
{
// Delete a Webhook
apiWebhooksInstance.delete(webhookId);
}
catch (ApiException e)
{
Debug.Print("Exception when calling WebhooksApi.delete: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
// First install the api client: https://github.com/apivideo/api.video-ios-client#getting-started
// Documentation: https://github.com/apivideo/api.video-ios-client/blob/main/docs/WebhooksAPI.md#delete
Response
No Content
Empty response
Not Found
No schema
name
string
status
int
title
string
type
string
Was this page helpful?