You can also use exports and destinations to define a call to a webhook on your end and get notified when the rendering process is complete or the exports finished.

The webhook destination object has the following required properties:

And one optional property:

The default content-type is application/json.

Example:

{
    "resolution": "full-hd",
    "quality": "high",
    "scenes": [],
    "exports": [{
        "destinations": [{
            "type": "webhook",
            "endpoint": "https://domain.com/webhook"
        }]
    }]
}

The webhooks are always a POST requests, and depending of the content-type you will receive a JSON payload or form encoded variables.

The webhook payload includes the following video properties: width, height, duration, size in bytes, and url to the video hosted by JSON2Video.

Example of a JSON payload:

{
    "width": "1920",
    "height": "1080",
    "duration": "10",
    "size": "35870",
    "url": "https://assets.json2video.com/clients/bm1pc474z4/renders/2023-03-25-73376.mp4",
    "project": "4GpXmec1aEttCLTF"
}

Webhooks can also be defined as Connections in the dashboard and referenced by the id property.

Dashboard connections webhook

Using multiple destinations

As destinations are executed sequentially, if you add a webhook destination after the ftp destination, the webhook will be executed after and you will get a notification when the upload process is complete.

Example:

{
    "resolution": "full-hd",
    "quality": "high",
    "scenes": [],
    "exports": [{
        "destinations": [{
            "id": "test-ftp",
            "file": "__hh__-__nn__-__random__.mp4"
        }, {
            "type": "webhook",
            "endpoint": "https://domain.com/webhook"
        }]
    }]
}

The webhook at https://domain.com/webhook will be called once the FTP upload process is complete.