Domo AI API Integration Tutorial
Want to generate Domo AI videos automatically inside your own app? This guide shows how to integrate the Domo AI API step by step create text-to-video or image-to-video tasks, track progress with task IDs (polling or webhooks), and return finished video URLs in a clean, production ready workflow.
Domo AI API Integration Tutorial (Step-by-Step) - 2026 Developer Guide
This tutorial shows how to integrate the DomoAI Enterprise API into your app or backend to generate videos programmatically using:
-
Text → Video (
POST /v1/video/text2video) -
Image → Video (
POST /v1/video/image2video) -
Template → Video (
POST /v1/video/template2video) -
Task status polling (
GET /v1/tasks/{task_id}) -
Optional webhook callbacks (
callback_url)
The official docs describe the base URL as https://api.domoai.app and API-key auth via Authorization: Bearer <YOUR_API_KEY>.
1) How the Domo AI API works (the mental model)
DomoAI’s API is asynchronous:
-
You send a request (text2video / image2video / template2video).
-
The API returns a task_id immediately.
-
You either:
-
Poll the task endpoint until
statusbecomesSUCCESS, or -
Provide a callback_url so Domo AI can notify your server when status changes.
-
-
When complete, the task payload contains one or more output video URLs plus metadata like width/height and credit usage.
2) Prerequisites
What you need
-
A DomoAI Enterprise API account + API Key (created in the Dashboard → API Keys).
-
A backend environment (Node.js / Python / any language that can call HTTPS)
-
(Optional) A public HTTPS endpoint if you want webhook callbacks (
callback_url)
Auth method
Every request uses:
-
Authorization: Bearer <YOUR_API_KEY>
3) Base URL + endpoints
Docs list the base URL as:
-
https://api.domoai.app
Core endpoints:
-
POST /v1/video/text2video -
POST /v1/video/image2video -
POST /v1/video/template2video -
GET /v1/tasks/{task_id}
Note: Some examples in the docs show
api.domoai.comin curl snippets while the “Base URL” section saysapi.domoai.app. Use the base URL stated in the docs (api.domoai.app) unless your account documentation specifies otherwise.
4) Integration pattern options
Option A - Polling (simplest)
-
Best for: scripts, cron jobs, internal tools, small apps
-
Flow: Create task → poll
GET /v1/tasks/{task_id}until finished
Option B - Webhook callback (callback_url) (most scalable)
-
Best for: production systems, queues, high volume
-
Flow: Create task with
callback_url→ DomoAI calls your endpoint when status changes (SUCCESS / FAILED)
The callback schema includes status, category, output_videos, credits, etc.
5) Quick Start: Text to Video with cURL
The docs provide a simple text-to-video request like this:
Response returns a task id:
Then check status:
6) A production-ready workflow (recommended)
Here’s a reliable pattern used in real systems:
-
Receive request from your user (prompt or image).
-
Create task in Domo AI.
-
Store:
-
task_id -
user_id / project_id
-
input metadata (prompt, template, etc.)
-
timestamps
-
-
Either:
-
Start polling in a worker, or
-
Wait for webhook callback
-
-
When
SUCCESS:-
Store output URL(s)
-
Trigger next step (download, transcode, publish, notify user)
-
DomoAI task statuses include PENDING, QUEUING, PROCESSING, SUCCESS, FAILED, CANCELED.
7) Text-to-Video API details (deep dive)
Endpoint
POST /v1/video/text2video
Key request fields (from docs)
-
prompt(required, 1–2000 chars) -
seconds(required, 1–10) -
model(default provided; options includet2v-2.4-faster,t2v-2.4-advanced) -
Optional:
-
style(japanese_anime,realistic,pixel,cartoon_game,flat_color_anime,90s_style) -
aspect_ratio(16:9,9:16,1:1,4:3,3:4) -
callback_urlfor webhook delivery
-
Example request (9:16 YouTube Shorts / TikTok / Reels)
8) Image-to-Video API details (deep dive)
Endpoint
POST /v1/video/image2video
What’s different here?
You must send an image using an ImageInput object with base64 content (example is shown in docs).
Key fields:
-
modelrequired (animate-2.4-faster,animate-2.4-advanced) -
image.bytes_base64_encodedrequired -
secondsrequired (1–10) -
Optional
prompt(default empty string) -
Optional
aspect_ratio(if null, API may auto-detect based on image) -
Optional
callback_url
Converting an image file to base64
Most languages can do this quickly. The important part is: send raw bytes encoded as base64, not a data URL prefix.
Example shape:
9) Template-to-Video API details (deep dive)
Endpoint
POST /v1/video/template2video
Templates are great when you want “viral” formats in your app quickly (e.g., zoom, loop, hug/kiss styles).
Fields:
-
templaterequired — examples include:-
kissing_screen,looping_animation,hug,groove_dance,kiss,french_kiss,360_view,zoom_in,zoom_out,crane_up
-
-
imagesrequired (array; docs note it currently supports only one image) -
secondsrequired (1–10) -
Optional
prompt,aspect_ratio,callback_url
Example request:
10) Getting task results
Endpoint
GET /v1/tasks/{task_id}
The task response includes:
-
status(PENDING / QUEUING / PROCESSING / SUCCESS / FAILED / CANCELED) -
category(TEXT_TO_VIDEO, IMAGE_TO_VIDEO, VIDEO_TO_VIDEO, TEMPLATE_TO_VIDEO) -
output_videosarray withurl,width,height -
creditsconsumed -
created_at
When status is SUCCESS, you should be able to use the output_videos[*].url.
11) Webhooks (callback_url) - production best practice
If you include callback_url in a create request, DomoAI will POST updates to that URL when status changes.
Callback payload essentials
The callback protocol defines fields like:
-
task_id,status,category -
output_videos,credits -
inputs,created_at
What your webhook endpoint must do
A solid webhook handler should:
-
Verify the request (see “Security tips” below)
-
Parse JSON
-
Look up your internal record by
task_id -
If
SUCCESS→ store output URLs, mark job complete -
If
FAILED→ store error state, notify user
The docs specify callbacks are sent as POST JSON with
Content-Type: application/json.
12) Full Node.js integration example (create → poll)
Below is a clean integration example you can adapt for Express, Next.js API routes, Cloudflare Workers, etc.
Usage:
This matches the official flow: create task → use task_id to query status.
13) Python integration example (image → video)
The request matches the docs: model, image.bytes_base64_encoded, seconds, optional prompt.
14) Error handling (common issues)
Docs list common quick start errors:
401 Unauthorized
-
Cause: invalid/revoked key or wrong Authorization header format
-
Fix: ensure
Authorization: Bearer <YOUR_API_KEY>is correct
402 Payment Required
-
Cause: insufficient credits
-
Fix: check billing/credits in dashboard
422 Unprocessable Entity
-
Cause: request body didn’t match schema (bad seconds range, missing required field, wrong JSON shape)
-
Fix: validate payload (e.g.,
secondsrange 1–10 is enforced)
15) Security tips (important for production)
Even though the API uses Bearer tokens, your integration still needs safe defaults:
-
Never expose your API key in frontend code
-
Keep calls server-side only.
-
-
Use a secrets manager
-
Environment variables are OK for small apps; secrets managers are better for production.
-
-
Webhook safety
-
Put your callback endpoint behind HTTPS
-
Add a shared secret query param or custom header on your callback URL (and verify it)
-
Rate-limit your webhook endpoint
-
-
Store minimal input data
-
Store only what you need (task_id, user_id, output URLs, timestamps)
-
The docs emphasize secure access per org via API keys.
16) How to design a “Domo AI generation” feature in your app
Here are three proven product patterns:
Pattern 1 - “Generate Shorts” button (text-to-video)
-
User enters prompt + selects style + aspect ratio
-
Backend calls
text2video -
Frontend shows progress via polling
-
Final: show download link + “Publish” CTA
Pattern 2 - “Animate this photo” (image-to-video)
-
User uploads image
-
Backend stores image (S3/R2) OR base64 encodes temporarily
-
Backend calls
image2video -
Final: add an “Upscale” option (post-processing step in your pipeline)
Pattern 3 - Viral templates
-
User selects template (zoom/loop/360/hug/kiss)
-
Backend calls
template2video -
Great for social apps and quick meme workflows
Template names like zoom_in, looping_animation, and 360_view are listed in the API reference.
17) Performance and scaling tips
When you scale beyond a handful of videos per day:
-
Use a job queue (BullMQ, RabbitMQ, SQS, etc.)
-
Run workers that:
-
create tasks
-
store task IDs
-
poll (or wait for callback) and update job records
-
-
Use callbacks when possible to reduce polling load
-
Make your UI resilient:
-
show “Queued / Processing / Done”
-
allow users to close the tab and come back later
-
The API is built around task management and callbacks for exactly this reason.