Rend Developers

Guides

Webhooks

Video takes and exports run in the background. Instead of polling, give Rend an https address and it posts a signed JSON event when the work finishes or fails. To show a take’s progress as it runs, follow it live instead.

Videos

Set callback_url when you start a take. When the take completes or fails, Rend sends a POST to that address:

JSON
{
  "id": "evt_...",
  "type": "video.completed",
  "created": 1796500120,
  "data": {
    "id": "video_3f9a0c...", "object": "video", "model": "rend-video", "status": "completed", "progress": 100,
    "seconds": 4, "size": "640x1152", "file_id": "file_3f9a0c1d2b7e4a6f8c0d1e2f",
    "url": "https://...", "url_expires_at": 1796586400, "expires_at": null,
    "price": { "usd": 0.59, "microusd": 590000, "charged": true }, "error": null
  }
}

type is video.completed or video.failed, and data is the video object. A completed take carries its file_id, a url that works for 24 hours, and expires_at (when the file is deleted, or null while you keep it); after that, fetch the video or the file again for a fresh link. A failed take has error and costs nothing.

The create reply’s callback_secret (whsec_...) signs these calls. It is the same for every video on your account, so store it once. Delivery, retries and the signature check work as below.

Exports

Exports made by your agent over MCP can call up to three https addresses you register in Settings → Connections → Webhooks, or over the API with your agent’s token:

Text
GET    https://rend.ai/api/webhooks              your URLs and each one's last 5 deliveries
POST   https://rend.ai/api/webhooks {"url":…}    adds one and returns its signing secret, once
DELETE https://rend.ai/api/webhooks {"id":…}     removes one

Rend sends export.completed or export.failed:

JSON
{ "id": "evt_…", "type": "export.completed", "created": 1795000000,
  "data": { "export": { "id": "export-…", "projectId": "…", "editId": "…", "status": "completed",
    "metadata": { "orderId": "1042" }, "mediaId": "…", "url": "https://rend.ai/api/media/…",
    "width": 1920, "height": 1080, "durationSeconds": 31.2, "version": 4, "createdAt": 1794999800000, "finishedAt": 1795000000000 } } }

A failed export has error (one sentence) instead of the file fields. url downloads with your agent’s token; a release also has shareUrl. An export that Rend restarted by itself names the first one in continuedFrom.

export_edit and release take an optional metadata object: up to 16 text keys (40 characters each) with text values (500 characters each), such as your own order id. It never changes the video. Every read of that export returns it, and so does its webhook. When the same cut is already exported or exporting with the same settings, the start returns that export, with its own metadata, and sends no second webhook.

Delivery

  • Answer with any 2xx within 10 seconds.
  • Anything else is tried again after 1 minute, 5 minutes, 30 minutes and 2 hours, then given up.
  • Redirects are not followed.
  • The same event can arrive twice, so skip an id you have already handled.

Check the signature

Each request carries Rend-Event-Id, Rend-Timestamp (Unix seconds) and Rend-Signature: v1=<hex>, an HMAC-SHA256 of timestamp.body with your signing secret. Check it against the raw body, and refuse old timestamps:

JavaScript
import crypto from "node:crypto";

function verify(rawBody, headers, secret) {
  const timestamp = headers["rend-timestamp"];
  const expected = crypto.createHmac("sha256", secret).update(`${timestamp}.${rawBody}`).digest("hex");
  const given = String(headers["rend-signature"]).replace(/^v1=/, "");
  const fresh = Math.abs(Date.now() / 1000 - Number(timestamp)) < 300;
  return fresh && given.length === expected.length && crypto.timingSafeEqual(Buffer.from(given), Buffer.from(expected));
}
Python
import hashlib, hmac, time

def verify(raw_body: bytes, headers, secret: str) -> bool:
    timestamp = headers["rend-timestamp"]
    expected = hmac.new(secret.encode(), f"{timestamp}.".encode() + raw_body, hashlib.sha256).hexdigest()
    given = headers["rend-signature"].removeprefix("v1=")
    return abs(time.time() - int(timestamp)) < 300 and hmac.compare_digest(given, expected)