Skip to content
Browse all functions

Guide

Long-running functions & webhooks

Make, Zapier and Power Automate stop waiting for an answer after a fixed time. Video conversion, transcription or OCR of many pages can take longer. Give the call a webhook URL: 1001fx answers at once, runs the function in the background and sends the result to your webhook when it is done.

How it works

  1. Call any function as usual and add two headers: x-fx-webhook (the URL that receives the result) and x-fx-webhook-ref (your reference ID).
  2. 1001fx checks the call as usual. Errors such as a missing parameter (400), a wrong key (401) or too few credits (402) come back at once, without a job.
  3. Otherwise the answer is 202 with a jobId. The function runs in the background.
  4. When it is done, 1001fx sends a POST with the result to your webhook URL – also when the function failed.

Without x-fx-webhook nothing changes: the call is answered directly, exactly as before.

Costs

The function costs the same credits as a direct call, only when it succeeds. Each call with a webhook costs 1 extra credit, also when the function fails – you still get the webhook with the error. Retries of the delivery are free.

Request

The reference ID is required as soon as a webhook URL is set (up to 255 characters). It comes back unchanged in the webhook, so you can match the result to your data, for example a row ID.

curl
curl -X POST 'https://api.1001fx.com/audiovideo/convertvideo' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -H 'x-fx-webhook: https://hook.eu1.make.com/abc123' \
  -H 'x-fx-webhook-ref: row-42' \
  -H 'Content-Type: application/json' \
  -d '{"url":"https://example.com/video.mov","format":"mp4"}'
Answer
HTTP/1.1 202 Accepted

{
  "jobId": "01JC8Z4M3Q7Y1V2X9K5T6R8N0P",
  "status": "queued",
  "ref": "row-42",
  "statusUrl": "https://api.1001fx.com/jobs/01JC8Z4M3Q7Y1V2X9K5T6R8N0P"
}

The webhook

1001fx sends a POST with Content-Type: application/json. result holds what the function answers directly (without the outer result key). Functions that return a file deliver a download URL instead; the file is kept for 48 hours.

Function succeeded
{
  "jobId": "01JC8Z4M3Q7Y1V2X9K5T6R8N0P",
  "ref": "row-42",
  "group": "audiovideo",
  "fx": "convertvideo",
  "status": "succeeded",
  "statusCode": 200,
  "result": {
    "url": "https://files.1001fx.com/tempassets/…/01JC….mp4",
    "filename": "video",
    "extension": "mp4",
    "contentType": "video/mp4",
    "size": 18234567
  },
  "credits": { "function": 20, "webhook": 1, "balance": 4711 },
  "createdAt": "2026-11-02T10:00:00.000Z",
  "finishedAt": "2026-11-02T10:03:12.000Z",
  "durationMs": 192000
}
Function failed
{
  "jobId": "01JC8Z4M3Q7Y1V2X9K5T6R8N0P",
  "ref": "row-42",
  "group": "audiovideo",
  "fx": "convertvideo",
  "status": "failed",
  "statusCode": 400,
  "message": "Could not download the file",
  "credits": { "function": 0, "webhook": 1, "balance": 4730 },
  …
}

Headers of every webhook:

  • x-fx-job-id – the job ID
  • x-fx-webhook-ref – your reference ID
  • x-fx-delivery-attempt – 1 for the first attempt, then 2, 3 …
  • x-fx-signature – only if you created a signing secret (see below)

Delivery and retries

  • Your webhook must answer with a 2xx status within 10 seconds. The answer body is ignored and redirects are not followed.
  • On a network error, 5xx, 408 or 429 1001fx tries again after 1 minute, 5 minutes, 30 minutes, 2 hours and 6 hours. Other 4xx answers end the delivery at once.
  • The same job can arrive twice (for example when your answer got lost). Use jobId to ignore duplicates.
  • The webhook URL must be a public https address.
  • A job runs for up to 30 minutes. After that it ends with "status": "failed", "statusCode": 504 and Job timeout.

Verify the signature

Create a webhook signing secret in the app under API key. From then on every webhook carriesx-fx-signature: t=<unix time>,v1=<signature>. The signature is the hex HMAC-SHA256 of t + "." + body with your secret. Without a secret there is no signature.

Node.js
import { createHmac, timingSafeEqual } from 'node:crypto'

// rawBody: the request body exactly as received (string), header: x-fx-signature
function isFrom1001fx(rawBody, header, secret) {
  const parts = Object.fromEntries(header.split(',').map((p) => p.split('=')))
  const t = Number(parts.t)
  if (!t || Math.abs(Date.now() / 1000 - t) > 300) return false // older than 5 minutes
  const expected = createHmac('sha256', secret).update(`${t}.${rawBody}`).digest('hex')
  return parts.v1?.length === expected.length && timingSafeEqual(Buffer.from(parts.v1), Buffer.from(expected))
}

Check the status

For platforms without webhooks, or if a webhook got lost: GET /jobs/<jobId> with the same API key. While the job runs you get "status": "queued" or"running", afterwards the same body as the webhook plus the delivery state. The call is free. Jobs of other keys answer 404.

curl
curl 'https://api.1001fx.com/jobs/01JC8Z4M3Q7Y1V2X9K5T6R8N0P' -H 'X-API-KEY: YOURSECRETAPIKEY'

Make: two scenarios

In Make the result arrives in a second scenario that starts with a webhook.

Scenario B – receives the result (create it first):

  1. Add Webhooks → Custom webhook as trigger and copy its address.
  2. Add the modules that process the result, for example Google Sheets → Update a row with ref as row number and result.url as value.
  3. Turn the scenario on. Run scenario A once and click Redetermine data structure at the webhook, so Make knows the fields.

Scenario A – starts the function:

  1. Open the 1001fx module and click Show advanced settings.
  2. Paste the webhook address into Webhook URL (run as background job).
  3. Map an ID into Webhook reference ID, for example the row number from Google Sheets.
  4. The module now finishes at once with Job ID and Job status URL; the result arrives in scenario B.

Try it in the app

Every function has its own page in the app: the Webhook section there sends the same headers.