Webhooks

Webhooks allow your application to receive updates in real-time, rather than having to constantly poll the Editframe API for new data. This can be more efficient and cost-effective than constantly checking for updates, as it reduces the number of requests that your server has to handle.


Configuring webhooks

To begin receiving webhooks, you must enable the feature within your application. You can enable or disable webhooks directly from the main Editframe dashboard page. Once they have been enabled, you can provide your webhook URL under the Webhooks tab. A webhook will now be fired off by Editframe whenver something notable happens. Let's examine what webhook requests to your server look like.


Receiving webhooks

When your app receives a webhook request from Editframe, check the event attribute to see what event triggered the request. The first portion of the event is the object type while the second portion is the name of the trigger.

Example webhook payload

{
  "id": "X3Jq5j12GN",
  "event": "video.created",
  "timestamp": 1671228849,
  //...
}

In the example above, a video was triggered by the created event, and the object type is a video.


Webhook signing

To know for sure that a webhook was, in fact, sent by Editframe instead of a malicious actor, you can verify the request signature. Each webhook request contains a header named X-Editframe-Signature. The signature is an HMAC hash of the request payload hashed using your API token. Here is an example of how to verify the signature in your applcation:

Verifying a request

const signature = req.headers['X-Editframe-Signature']
const payload = req.rawBody
const secret = process.env.EDITFRAME_API_TOKEN
const hash = crypto.createHmac('sha256', secret).update(payload).digest('hex')

if (hash === signature) {
  // Request is verified
} else {
  // Request could not be verified
}

Available events

  • Name
    video.created
    Type
    Description

    A new video was created in our system. This video will begin processing soon.

  • Name
    video.processing
    Type
    Description

    A video is currently being processed by rendering servers.

  • Name
    video.processed
    Type
    Description

    A video has finished processing and can be consumed.

  • Name
    video.failed
    Type
    Description

    A video failed to be proccessed.

  • Name
    flow.processing
    Type
    Description

    A workflow is currently being processed by worker servers.

  • Name
    flow.processed
    Type
    Description

    A workflow has finished processing and its deliverables are available.

  • Name
    flow.failed
    Type
    Description

    A workflow failed to be processed in its entirety.

Example payload

{
  "id": "X3Jq5j12GN",
  "event": "video.processed",
  "timestamp": 1671238849,
  "webhook_version": 2,
  "metadata": {
    //...
  }
}