Personalized onboarding videos dramatically accelerate product activation in B2B SaaS. Addressing a newly registered customer by their first name, displaying their company logo, and highlighting the specific workflow module they selected during signup routinely lifts trial-to-paid conversion rates by 15% to 35%. However, scaling this experience manually is impossible: a customer success team cannot hand-record, edit, and export bespoke MP4 clips for hundreds or thousands of daily registrations.
The solution is an automated, zero-touch rendering pipeline. By coupling the Elai.io REST API with asynchronous webhook callbacks, engineering teams can convert dynamic user metadata directly into tailored, AI-narrated MP4 videos within minutes.
At 365Finds, our institutional evaluation is clear: Elai.io is the premier choice for automated onboarding pipelines when your video narrative requires presentation-style structure—combining presenter avatars with dynamic typography, background product UI captures, and multi-slide layouts. While competing platforms like HeyGen or Tavus excel at pure conversational talking-head closeups, Elai.io treats video as a programmable multi-layer canvas.
This guide details the complete technical implementation: configuring dynamic template placeholders, executing variable substitution via the /api/v1/videos/renderTemplate/{videoId} endpoint, securing webhook event ingestion, handling single-attempt delivery constraints, and connecting the rendered output to downstream CRM marketing workflows.
Architecture Overview: The Asynchronous Video Pipeline
Video rendering is computationally intensive. Video synthesis—including photorealistic neural avatar lip-sync, text-to-speech (TTS) audio generation, and multi-layer WebGL canvas composition—takes between 2 to 7 minutes per minute of output. Consequently, video generation must never be invoked synchronously in the user signup request cycle.
The recommended production architecture decouples the user registration flow from video processing using an asynchronous event-driven loop.
flowchart TD
A["New User Registration\n(Web / App Signup)"] --> B["Backend Ingestion Service\n(Extracts Name, Company, Domain)"]
B --> C["Elai.io REST API\nPOST /videos/renderTemplate/{videoId}"]
C -->|"HTTP 200 (Queued)\nReturns requestId"| D["Save Job State\n(Status: pending_render)"]
subgraph "Elai.io Cloud Infrastructure"
E["Rendering Engine\n- Avatar Lip Sync\n- Canvas Layer Composition\n- MP4 Encoding"]
end
C -.-> E
E -->|"POST Webhook Event\n(video_ready)"| F["API Gateway / Webhook Ingestion\n(HMAC Signature Verification)"]
F -->|"HTTP 200 (Ack < 10s)"| E
F --> G["Background Queue (BullMQ / SQS)"]
G --> H["Notification Service\n(HubSpot / Customer.io / SendGrid)"]
H --> I["Personalized Onboarding Email / In-App Message\n(Dynamic MP4 Video & GIF Thumbnail)"]
subgraph "Resilience Cron Worker"
J["Hourly Cron Job\nGET /videos/{videoId}"] -.->|"Reconcile Missed Deliveries"| D
end
Architectural Key Steps
- Trigger & Payload Construction: A new user signup event emits identity parameters (e.g., first name, workspace name, plan tier, uploaded logo URL).
- Asynchronous Dispatch: The backend sends a single-row batch to Elai.io's template rendering endpoint and records an internal job mapping the returned
requestIdandvideoIdto the user. - Cloud Synthesis: Elai.io synthesizes speech, fits dynamic text into canvas containers, fetches remote image assets, and encodes the MP4.
- Push Notification: Elai.io dispatches an authenticated HTTP POST payload to your webhook receiver upon completion (
video_ready) or error (video_error). - Downstream Delivery: Your webhook worker updates your database and signals your marketing automation platform (e.g., Customer.io, HubSpot, Klaviyo) to trigger a personalized welcome email featuring an animated GIF thumbnail and MP4 link.
- Reconciliation Sweeper: A scheduled task periodically polls Elai.io to recover any dropped deliveries caused by network timeouts.
Step 1: Template Engineering in Elai.io Studio
Before making API calls, you must design a master onboarding template inside the Elai.io web application. The template establishes the visual layout, avatar positioning, transition animations, and dynamic placeholders.
1. Dynamic Text and Speech Tags
To inject user-specific copy, wrap your variable keys in double curly braces: {{tag_name}}.
- Narration / Speech: In the slide's speech input box, configure dynamic scripts such as:
Hi {{first_name}}, welcome to {{company_name}}! I noticed you signed up for our {{plan_tier}} tier. Let's walk through your new analytics dashboard. - Canvas Headings and Subtitles: Insert standard text blocks onto the canvas and enter placeholders such as
{{first_name}}'s WorkspaceorTarget: {{growth_goal}}. - Naming Conventions: Elai.io enforces strict naming rules for variable tags. Only alphanumeric English characters, underscores, dashes, and spaces are supported (
a-z,A-Z,0-9,_,-,). Special symbols such as@,$,%, or non-Latin glyphs will cause API rejection.
2. Auto-Adjusting Typography (fitTextBox)
In real-world SaaS registrations, text lengths vary wildly—a customer's first name might be "Bo" (2 characters) or "Bartholomew" (11 characters), and company names range from short acronyms to long corporate entities.
To prevent elongated text from overflowing slide boundaries or clipping against the avatar, Elai.io provides an automated bounding-box calculation feature:
- In the template editor, draw your text box to the maximum allowed width and height for that visual element.
- When invoking the API, pass
"fitTextBox": true. Elai.io will automatically calculate line wrapping and scale font sizes down so the dynamic string fits the pre-allocated bounding box cleanly.
3. Dynamic Media Elements (Logos & Product UI Captures)
You can dynamically replace slide background graphics, company logos, and screenshots:
- Upload a placeholder image or company logo onto the slide canvas.
- Select the image element in Elai.io Studio.
- Look at the right-hand properties sidebar: once your account has an API token generated, an API Id (a unique numeric identifier, e.g.,
457597335176) appears for that element. - Record this ID. In your API request payload, passing this ID as a key with a publicly accessible image URL will overwrite the placeholder asset during rendering.
Step 2: Triggering Renders via the Personalization API
Elai.io handles template variable substitution and batch generation through its dedicated Personalization endpoint:
POST https://apis.elai.io/api/v1/videos/renderTemplate/{videoId}
Critical Plan & Credential Requirements
- Authentication: All API requests require a Bearer token in the
Authorizationheader (Authorization: Bearer <your-workspace-token>). Generate this token under Settings → API in the Elai.io dashboard. - Workspace Admin Scope: The API token authenticates as the workspace administrator.
- Plan Restriction: Organizations on the legacy Unlimited plan cannot access the REST API (requests receive a bare
401 Unauthorizedwithout a message body). The API is supported on Creator, Team, and Enterprise plans. - Creation Quotas: Video generation is constrained by an 8-hour rolling window quota: 1,000 videos per 8 hours on Creator/Team plans; 6,000 videos per 8 hours on Enterprise plans.
Single-User Onboarding Request Payload
To generate an onboarding video immediately after registration, construct a single-item array in templateData:
{
"templateData": [
{
"first_name": "Jordan",
"company_name": "Acme Dynamics",
"plan_tier": "Enterprise Growth",
"growth_goal": "Automate Onboarding",
"457597335176": "https://cdn.example.com/customer-logos/acme-dynamics.png"
}
],
"requestId": "onboarding_usr_98412a_seq1",
"tags": ["onboarding", "tier-enterprise", "locale-en"],
"fitTextBox": true,
"public": false,
"render": true,
"emailNotification": false
}
Field Specifications
templateData(array of objects, required): Maximum 200 objects per call. For real-time onboarding, send an array with exactly 1 object.requestId(string, optional but strongly recommended): Your internal correlation ID. It will be passed back in the webhook payload, enabling seamless correlation between the rendered video and your customer record.fitTextBox(boolean): Set totrueto ensure variable text adjusts font size dynamically without overflowing template containers.emailNotification(boolean): Defaults totrue. In automated production pipelines, always set this tofalse, otherwise Elai.io will send an email notification to the workspace administrator for every generated video.render(boolean): Set totrueto immediately trigger the rendering engine. Iffalse, the video document is cloned into the workspace but left unrendered.
Dispatch Implementation (Node.js / TypeScript)
import axios from 'axios';
interface OnboardingVideoRequest {
userId: string;
firstName: string;
companyName: string;
planTier: string;
logoUrl: string;
}
interface ElaiRenderResponse {
accepted: boolean;
requestId: string;
videoId?: string;
}
export async function triggerPersonalizedOnboardingVideo(
user: OnboardingVideoRequest,
templateId: string,
logoElementApiId: string
): Promise<ElaiRenderResponse> {
const elaiApiToken = process.env.ELAI_API_TOKEN;
if (!elaiApiToken) throw new Error('ELAI_API_TOKEN is missing');
const payload = {
templateData: [
{
first_name: user.firstName,
company_name: user.companyName,
plan_tier: user.planTier,
[logoElementApiId]: user.logoUrl,
},
],
requestId: `usr_${user.userId}_${Date.now()}`,
tags: ['onboarding', user.planTier.toLowerCase().replace(/\s+/g, '-')],
fitTextBox: true,
public: false,
render: true,
emailNotification: false,
};
try {
const response = await axios.post<ElaiRenderResponse>(
`https://apis.elai.io/api/v1/videos/renderTemplate/${templateId}`,
payload,
{
headers: {
'Authorization': `Bearer ${elaiApiToken}`,
'Content-Type': 'application/json',
},
timeout: 10000,
}
);
// When templateData has exactly 1 item, videoId is returned immediately
console.log(`Video render queued: Video ID ${response.data.videoId}, Request ID: ${response.data.requestId}`);
return response.data;
} catch (error: any) {
if (error.response) {
console.error(`Elai API Error: Status ${error.response.status}`, error.response.data);
if (error.response.status === 429) {
throw new Error(`Elai Rate Limit / Quota Exceeded: ${error.response.data.message}`);
}
}
throw error;
}
}
[!IMPORTANT] Understanding the HTTP 200 Response: An HTTP
200 OKfrom/videos/renderTemplate/{videoId}signifies that the job was accepted and queued, not that the video is finished. Slide validation and media asset fetching execute asynchronously. Do not poll immediately; wait for the webhook callback.
Step 3: Webhook Subscription and Cryptographic Verification
Because rendering is asynchronous, webhooks provide the only real-time push mechanism to notify your system when an MP4 is ready for distribution.
1. The Subscription Order Trap
When setting up webhooks programmatically, there is a critical dependency order:
- Subscribe first: Call
POST https://apis.elai.io/api/v1/webhook/with your endpoint URL andtechEmail. - Set secret token second: Call
POST https://apis.elai.io/api/v1/webhook/secretwith your shared secret string.
[!WARNING] If you call
POST /webhook/secretbefore a webhook is actively enabled on the workspace, Elai.io silently discards the secret while still returning HTTP 200. Deliveries will then arrive unsigned, causing your signature verification to fail. Always subscribe first, set the secret second, and verify the configuration withGET /apiConfig.
2. Single-Attempt Delivery Rules
Elai.io’s webhook dispatcher enforces strict operational behavior:
- Single Attempt: Elai.io dispatches one HTTP POST request per event and expects a
2xxresponse within 10 seconds. - Zero Native Retries: There is no automatic exponential backoff or dead-letter queue. If your receiver drops the connection, takes 11 seconds to process, or returns HTTP 500, that event notification is permanently lost.
- Auto-Disabling Threshold: If 10 consecutive webhook deliveries fail across your workspace, Elai.io automatically disables webhooks and alerts your
techEmail.
3. Cryptographic Signature Verification
When a secret is configured, Elai.io signs every outbound webhook delivery with two HTTP headers:
Elai-Timestamp: Unix epoch timestamp in milliseconds.Elai-Signature: Hex-encoded HMAC-SHA256 signature calculated over<Elai-Timestamp>.<raw_request_body>.
To prevent replay attacks and ensure payload authenticity, verify the raw bytes before parsing JSON:
// Express.js Webhook Receiver Implementation
const express = require('express');
const crypto = require('crypto');
const app = express();
const WEBHOOK_SECRET = process.env.ELAI_WEBHOOK_SECRET;
// Preserve raw body buffer for byte-accurate HMAC calculation
app.use(
express.json({
verify: (req, _res, buf) => {
req.rawBody = buf.toString('utf8');
},
})
);
function verifyElaiSignature(req) {
const timestamp = req.headers['elai-timestamp'];
const receivedSig = req.headers['elai-signature'];
if (!timestamp || !receivedSig || !WEBHOOK_SECRET) {
return false;
}
// Reject payloads older than 5 minutes to prevent replay attacks
const currentTime = Date.now();
if (Math.abs(currentTime - parseInt(timestamp, 10)) > 5 * 60 * 1000) {
return false;
}
const payloadToSign = `${timestamp}.${req.rawBody}`;
const computedSig = crypto
.createHmac('sha256', WEBHOOK_SECRET)
.update(payloadToSign)
.digest('hex');
if (receivedSig.length !== computedSig.length) {
return false;
}
return crypto.timingSafeEqual(Buffer.from(receivedSig), Buffer.from(computedSig));
}
app.post('/api/webhooks/elai', async (req, res) => {
// 1. Authenticate request
if (!verifyElaiSignature(req)) {
return res.status(401).send('Invalid signature');
}
// 2. Acknowledge within 10 seconds to satisfy Elai.io single-attempt requirement
res.status(200).send({ received: true });
// 3. Hand off payload to asynchronous queue worker
const { event, error, requestId, video } = req.body;
try {
if (event === 'video_ready' && video && video.status === 'ready') {
console.log(`Video ready: ${video._id}, Request ID: ${requestId}`);
// Push to job queue (e.g., BullMQ / SQS)
await queueOnboardingEmailJob({
requestId,
videoId: video._id,
videoUrl: video.url,
thumbnailUrl: video.thumbnail,
duration: video.duration,
});
} else if (event === 'video_error') {
console.error(`Render failed for request ${requestId}:`, error);
// Fallback: Notify CRM to send default static onboarding email
await triggerFallbackOnboardingFlow(requestId, error);
}
} catch (err) {
console.error('Error dispatching webhook background task:', err);
}
});
Step 4: The Webhook Payload and Downstream CRM Integration
When a video completes rendering, Elai.io delivers a video_ready event containing direct S3 storage URLs:
{
"event": "video_ready",
"error": null,
"requestId": "usr_98412a_seq1",
"batchRowId": "0",
"video": {
"_id": "64bc819f72b210001a4e58b1",
"name": "Hello Jordan!",
"status": "ready",
"public": false,
"deleted": false,
"tags": ["api", "onboarding", "tier-enterprise"],
"userId": "61b1529d2055d2805c0",
"accountId": "61b1529d2055d2805c",
"duration": 42.15,
"data": {},
"thumbnail": "https://elai-media.s3.eu-west-2.amazonaws.com/videos/64bc819f72b210001a4e58b1/thumbnail.jpg",
"url": "https://elai-media.s3.eu-west-2.amazonaws.com/videos/64bc819f72b210001a4e58b1/hello-jordan.mp4",
"createdAt": "2026-11-05T01:30:00.000Z",
"updatedAt": "2026-11-05T01:34:25.000Z"
}
}
Passing Assets to Customer.io / HubSpot
Most email clients do not support inline MP4 video playback. To achieve optimal click-through rates:
- Store
video.urlandvideo.thumbnailas custom attributes on the user profile in your CRM (customer.custom_onboarding_video_urlandcustomer.custom_onboarding_thumbnail_url). - Construct an email template displaying the thumbnail image overlaid with a video play button icon.
- Link the image directly to your product's onboarding portal or a custom branded landing page:
https://app.example.com/welcome?v=64bc819f72b210001a4e58b1.
Production Reliability & Error Recovery (Fail-Safe Sweeper)
Because network failures can interrupt single-attempt webhook deliveries, a production-grade system must implement two reliability patterns: an out-of-band reconciliation worker and fallback mechanisms for validation errors.
1. The Polling Sweeper
Run a cron job every 10 to 15 minutes that queries your database for onboarding video jobs in pending_render state older than 10 minutes. The worker reconciles missing statuses via the Video Retrieval endpoint:
GET https://apis.elai.io/api/v1/videos/{videoId}
If video.status === "ready", the sweeper dispatches the marketing event and updates the internal database record, neutralizing the risk of lost webhook events.
2. Common Rendering Errors and Workarounds
| Error Message | Root Cause | Engineering Resolution |
|---|---|---|
Slide N is too long. Please limit speech to Xs. | Dynamic text variable generated excessive speech exceeding slide maximums. | Clamp input text length at prompt generation; split long scripts across multiple slides. |
Slide N uses a premium avatar that is no longer available... | Master template references an avatar tier not included in current plan. | Re-bind template to workspace-approved standard avatar or upgrade workspace tier. |
You do not have enough minutes to render this video... | Workspace minute balance depleted. | Implement balance alerting via GET /users/me; purchase minute top-ups automatically. |
Too many videos in one batch request, maximum is 200 | Exceeded batch array limit. | Chunk bulk requests into batches of ≤ 200 rows. |
Bare 401 Unauthorized | Invalid token OR organization is on an unsupported plan (e.g., Unlimited). | Check workspace plan type under Settings; ensure token is generated by workspace admin. |
Strategic Evaluation: When to Choose Elai.io for Onboarding
| Evaluation Dimension | Elai.io REST API | HeyGen API | Tavus Conversational API |
|---|---|---|---|
| Primary Strength | Multi-slide presentations, dynamic typography, canvas image swapping | High photorealism avatars, wide voice library | 1-on-1 dynamic camera angle talking-head clones |
| Template Layout | Full multi-layer canvas (avatar, text, background graphics, shapes) | Pre-configured avatar scenes | Single talking head frame |
| Variable Injection | {{tags}} in text + TTS speech + API IDs for canvas media | Dynamic avatar script variables | Phoneme/video segment stitching |
| Webhook Model | Single attempt, HMAC signed (video_ready, video_error) | Webhook events with automatic retries | Webhook callbacks upon completion |
| Rendering Latency | 3–8 minutes (Asynchronous) | 3–7 minutes (Asynchronous) | 1–4 minutes (Asynchronous) |
| Ideal Use Case | Product onboarding tours, feature overviews, multi-metric dashboard updates | Marketing video generation, automated social clips | High-touch executive welcome notes |
365Finds Recommendation
- Deploy Elai.io when your onboarding video requires demonstrating software UI screens, displaying corporate logos on slides, and structuring multi-point feature orientations alongside an avatar presenter.
- Avoid synchronous gating: Do not force users to wait on the registration screen for video generation. Direct users straight into your product, and deliver the personalized video via email or an in-app slideover 5 minutes into their session.
- Target High-LTV Cohorts: If your SaaS operates on a freemium model with large registration volumes, gate personalized video generation behind qualifying signals (e.g., corporate email domain verification, specific team size selection) to optimize Elai.io minute consumption while maximizing conversion impact.