Integration guide

Schedule posts from n8n

Use n8n's HTTP Request and Webhook nodes with the ClipEmber API: import a video, schedule a post, verify signed webhooks and retry safely.

Uses the REST API and webhooks·n8n expressions and a Code node (JavaScript)·updated

01Before you start

No ClipEmber node yet — the HTTP Request node does it.

There is no ClipEmber node in n8n today. Everything below uses n8n's built-in HTTP Request, Webhook and Code nodes against the public REST API, so it keeps working if a node appears later.

An API key
Create it in the app (API keys). New keys come with Pro and Agency, and during the 7-day Pro trial; a key you already have keeps working on any plan. The secret is shown once, so put it straight into your tool’s credential store. It goes in the X-API-Key header of every call.
Connected accounts
Connect TikTok, YouTube, Instagram and the rest in the app, through each network’s own sign-in. A key or an agent can’t sign in to a network for you. Each account has an id you pass as connectionId.
A credential in n8n
Create a Header Auth credential: name X-API-Key, value your key. In each HTTP Request node choose Authentication → Generic Credential Type → Header Auth and pick it, so the key never sits in the workflow itself.
Your account ids
One HTTP Request node, GET, to find each connectionId:
GET https://clipember.com/api/v1/connections

02Import a video

Hand ClipEmber a link; it fetches the file.

For a video that already sits at a public https address (your storage, a CMS). YouTube and TikTok page links are not video files.

HTTP Request node
Method POST, URL https://clipember.com/api/v1/media/import, your Header Auth credential. Send Headers: Idempotency-Key = import-{{ $json.recordId }}. Send Body → JSON:
{ "url": {{ JSON.stringify($json.videoUrl) }} }
The answer is 201 with data.id (the mediaId) and status: "uploading"; the download runs in the background.
No need to wait
A post can use the mediaId straight away and waits for the file. To check it yourself, GET /api/v1/media/:id shows the status and, if it failed, why.
Files you hold
For a file inside the workflow, use the three-step upload instead (POST /api/v1/media, PUT the bytes, then POST /api/v1/media/:id/complete) — see Your own videos.

03Schedule a post

One node, one video, several accounts.

HTTP Request node
Method POST, URL https://clipember.com/api/v1/posts, Header Auth credential, header Idempotency-Key = post-{{ $json.recordId }}, Send Body → JSON. JSON.stringify keeps quotes and line breaks in captions from breaking the JSON:
{
  "source": { "mediaId": {{ JSON.stringify($json.mediaId) }} },
  "mode": "schedule",
  "scheduledFor": {{ JSON.stringify($json.publishAt) }},
  "targets": [
    { "platform": "youtube_shorts", "connectionId": "<connectionId>",
      "caption": {{ JSON.stringify($json.caption) }} },
    { "platform": "instagram_reels", "connectionId": "<connectionId>",
      "caption": {{ JSON.stringify($json.caption) }} }
  ],
  "externalId": {{ JSON.stringify(String($json.recordId)) }}
}
publishAt must be ISO 8601 with an offset, e.g. 2026-12-12T18:00:00+01:00. The answer is 201 with a groupId and one post per account.
source
{ "mediaId": "…" } for a video of your own (from the import step), or { "clipId": "…" } for a clip made in ClipEmber.
mode
schedule (with scheduledFor, ISO 8601 with an offset), now or draft.
targets
One per account: platform, connectionId, caption and optional per-network settings. A TikTok post waits for a person to choose who can see it unless you send that choice — see Posts.
externalId
Optional, your own id (1–128 characters), e.g. the row or record id that started the workflow. It comes back on every post and in every post webhook, and GET /api/v1/posts?externalId=… finds the posts. It isn’t unique — that’s what Idempotency-Key is for.
Idempotency-Key
A header (1–255 printable ASCII characters) on POST /api/v1/posts and POST /api/v1/media/import. Build it from something stable — the record id, not the time — so a retried run sends the same key. For 24 hours the same key and body return the first answer again with Idempotent-Replayed: true; a different body gets 409 idempotency_key_reused.

04Errors and retries

Retry what can succeed, stop on the rest.

See the answer
In the HTTP Request node’s options, turn on Include Response Headers and Status and Never Error. The node then outputs statusCode, headers and body instead of failing the run, and an IF node can branch on {{ $json.body.error?.retryable }}.
Retry branch
A Wait node for {{ $json.headers['retry-after'] ?? 30 }} seconds, then back to the same request. The Idempotency-Key expression gives the same key, so a post that did go through isn’t created twice. Cap the loop (e.g. three tries).
Stop branch
retryable: false: send body.error.message to wherever your team looks (it’s written for a person) and stop. The code is in the catalog.
Error body
{ "error": { "code", "message", "retryable" } }. Retry only when retryable is true; otherwise the request or the account has to change first, and message says what.
429 rate_limited
Wait the Retry-After seconds, then retry with the same Idempotency-Key. Every response that went through the limiter carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset (Unix seconds), so a loop can slow down before it hits the limit.
Check without creating
POST /api/v1/posts?dryRun=1 runs every check and answers valid or the same error, without creating a post — useful while you build the workflow.

05Receive webhooks

React to a published or failed post without polling.

A Webhook node receives ClipEmber's signed POSTs; a Code node checks the signature before anything else runs.

1. Webhook node
HTTP Method POST, Respond Immediately (ClipEmber only needs a 2xx within 15 seconds). In its options turn on Raw Body, so the exact bytes are kept for the signature check. Copy the Production URL.
2. Add the address
In the app on the Webhooks page, or with the API. Store the whsec_… secret at once — it isn’t shown again.
curl -X POST https://clipember.com/api/v1/webhooks \
  -H "X-API-Key: cf_..." -H "Content-Type: application/json" \
  -d '{"url": "<your webhook URL>", "events": ["post.published", "post.failed"]}'
# 201 -> { "data": { "id": "…", "secret": "whsec_…", … } }   the secret is shown only here
3. Code node
Right after the Webhook node, mode Run Once for All Items. It stops the run unless the signature is valid and recent, and outputs the event. On self-hosted n8n, allow the built-in module with NODE_FUNCTION_ALLOW_BUILTIN=crypto; if your instance blocks $env, paste the secret from wherever your instance keeps secrets. If the raw body isn’t under the binary property data, use the name the Webhook node shows.
const crypto = require('crypto');
const SECRET = $env.CLIPEMBER_WEBHOOK_SECRET;   // whsec_…
const TOLERANCE_SEC = 300;

const item = $input.first();
const header = item.json.headers['clipember-signature'] || '';
const parts = Object.fromEntries(
  header.split(',').map((kv) => kv.trim().split('=')),
);
const t = Number(parts.t);
if (!Number.isInteger(t) || !parts.v1) throw new Error('No ClipEmber signature');
if (Math.abs(Date.now() / 1000 - t) > TOLERANCE_SEC) throw new Error('Old signature');

const raw = await this.helpers.getBinaryDataBuffer(0, 'data');
const expected = crypto.createHmac('sha256', SECRET)
  .update(`${t}.`).update(raw).digest('hex');
const a = Buffer.from(parts.v1);
const b = Buffer.from(expected);
if (a.length !== b.length || !crypto.timingSafeEqual(a, b)) {
  throw new Error('Bad ClipEmber signature');
}

const event = JSON.parse(raw.toString('utf8'));
// { id, createdAt, event: "post.published", data: { postId, externalId, … } }
return [{ json: event }];
4. Route by event
A Switch node on {{ $json.event }}. Post events carry your externalId, so you can update the record that started the post; post.failed adds errorHint and errorAction in plain words. Keep the id of handled events to skip repeats.
Try it
POST /api/v1/webhooks/:id/test with {"event": "post.published"} sends a signed sample with "test": true.
Plan
Adding a webhook address needs Pro and Agency (or the 7-day Pro trial). Addresses must be public https:// URLs.
Events
post.scheduled, post.published, post.failed, post.unconfirmed, post.first_comment_failed, post.deferred, post.canceled, post.updated, post.deleted_remote, post.remote_action_failed, account.connected, account.disconnected, account.reauth_required, clip.ready, request.failed. Leave events out to get all of them. Payloads: Webhooks.
Delivery
A signed POST with headers ClipEmber-Event, ClipEmber-Delivery (the same on every retry) and ClipEmber-Signature. Answer any 2xx within 15 seconds; otherwise we try again — 6 attempts over about 8.6 hours. Retries can arrive twice or out of order, so skip an id you’ve already handled.
Signature
t=<unix seconds>,v1=<hex>, where v1 is HMAC-SHA256 of <t>.<raw body> with the endpoint’s whsec_… secret. Compute it over the body exactly as received, and reject an old t (we use 5 minutes in the examples).

06Reference

Where the details live.

OpenAPI
The machine-readable description: /api/v1/openapi.json.
Error codes
Every code with its HTTP status, whether to retry and what to do.

Try it with a real account.

Every new account gets 7 days of Pro, API keys included. No card.