Webhooks

Last modified: April 15, 2022Author: Jakub Pomykała

Webhooks allow you to notify external services when your image is ready to download. To use webhooks with RenderForm, you need to add a webhookUrl field to your image request.

Render an image and invoke endpoint

curl 
    --location 
    --request POST 'https://api.renderform.io/api/v1/render' \
    --header 'X-API-KEY: <API_KEY>' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "template": "<TEMPLATE_ID>",
        "webhookUrl": "https://my-service.com/webhook-receiver"
        "changes": [
            {
              "id": "text_1f",
              "text": "Hello There!",
            }
            ...
        ],
    }'

Response returned to client

RenderForm will respond immediately with requestId and a link where the rendered image will be saved on.

{
    "requestId": "febbd34c-cadf-43e6-926c-5942016aea4e"
    "href": "https://cdn.renderform.io/8af2cacf-a328-4a8f-a4a7-fc6419b5b805/results/febbd34c-cadf-43e6-926c-5942016aea4e.jpg"
}

Request sent to webhook endpoint

After a successful render, RenderForm will send a request to the given webhookUrl with requestId, href and request which has been sent to render the image.

{
    "requestId": "febbd34c-cadf-43e6-926c-5942016aea4e"
    "href": "https://cdn.renderform.io/8af2cacf-a328-4a8f-a4a7-fc6419b5b805/results/febbd34c-cadf-43e6-926c-5942016aea4e.jpg"
    "request": {
      //your request
    }
}