Workflows
Most Blotato API operations are asynchronous. You must follow the Submit -> Poll -> Result pattern.
System Prompt for Agents
You can use the following snippet to instruct your AI agent on how to interact with Blotato:
Blotato API Protocol: All creation operations (posts, videos, sources) are async.
Call the
CREATEendpoint. Record the ID from the 201 response (idfor sources,item.idfor videos,postSubmissionIdfor posts).Loop every 2-5 seconds calling the
GETendpoint with that ID.Continue polling while status is processing (see status values below).
Succeed when status reaches a terminal state.
Terminal Status Values by Operation:
Sources:
completed(success) orfailedVideos:
done(success) orcreation-from-template-failedPosts:
published(success) orfailedAll Video Status Values (in order):
queueing->generating-script->script-ready->generating-media->media-ready->exporting->doneAlways fetch accounts first:
GET /v2/users/me/accountsto getaccountIdfor publishing. For Facebook/LinkedIn, also fetchGET /v2/users/me/accounts/{accountId}/subaccountsto getpageId.Set
content.platformandtarget.targetTypeto the same value (e.g., both"twitter").Full reference: https://help.blotato.com/api/llm
1. Create Source -> Get Source
Goal: Research a topic or extract content from a URL so Blotato can generate related visuals.
Endpoints:
Create:
POST /v2/source-resolutions-v3Poll:
GET /v2/source-resolutions-v3/:id
Source Types:
youtube,tiktok,article,pdf,audio,twitter- Extract content from a URL (each type requires aurlfield)text- Transform raw text content with optional AI instructionsperplexity-query- AI-powered web research on any topic (requires atextfield)
Example Payloads
From YouTube URL:
From AI Research Query (use this for agents to research topics):
From Text with Custom Instructions:
2. Create Visual -> Get Visual
Goal: Generate a video or image from a template.
Endpoints:
Create:
POST /v2/videos/from-templatesPoll:
GET /v2/videos/creations/:idTemplates:
GET /v2/videos/templates?fields=id,name,description,inputs
Discovering Templates
If you don't have a specific template ID, retrieve available templates:
Recommendation for Agents: If freely deciding which template to use, carousel templates are versatile and work well for most content repurposing scenarios. See all visual templates for IDs and specs.
Visual Generation Flow
Example Payload (with AI Prompt)
Example Payload (with Manual Inputs)
3. Create Post -> Get Post
Goal: Publish content to a social platform.
Endpoints:
Create:
POST /v2/postsPoll:
GET /v2/posts/:postSubmissionIdAccount Lookup:
GET /v2/users/me/accounts(docs)Subaccounts (for pageId):
GET /v2/users/me/accounts/:accountId/subaccounts(docs)
[!IMPORTANT] Prerequisites:
accountId: Get this fromGET /v2/users/me/accounts. Always fetch the user's accounts before publishing. See Accounts reference.
pageId(Facebook/LinkedIn): Get this fromGET /v2/users/me/accounts/{accountId}/subaccounts. See How to Get the Right IDs.
mediaUrls: Pass URLs directly from the Visual Workflow (outputsmediaUrlandimageUrls). No upload step required.
content.platformandtarget.targetType: Set both to the same platform value (e.g., both"twitter").
Step 0: Fetch Available Accounts (Always Do This First)
Response:
For Facebook/LinkedIn, also fetch subaccounts to get the pageId:
See Accounts reference for full details.
Publish Flow
Example Payload
Get accountId from GET /v2/users/me/accounts. Set content.platform and target.targetType to the same value.
Complete End-to-End Workflow (Recommended for AI Agents)
This is the standard content creation sequence: research topic → create visual → publish to social.
Pseudocode for Agents
Error Handling
All asynchronous operations can fail during processing. Handle failures gracefully:
Status Failure
When polling returns status: "failed", check the error message:
Source Failure (Get Source endpoint):
Video Failure (Get Visual Status endpoint):
Post Failure (Get Post Status endpoint):
Retry Strategy
Don't retry automatically on failure - most failures are permanent
Log the error message and report it to the user
Inform user that the operation failed and provide next steps
Only retry on temporary network errors (5xx status codes), not on 4xx errors
Platform-Specific Setup
Different platforms require different fields and have different requirements. See detailed guides:
Instagram Setup - Reels, Stories, Collaborators, Alt Text
LinkedIn Setup - Company Pages, Professional Network
Facebook Setup - Page ID, Media Types
Platform Requirements - All platforms at a glance
When publishing, always include the required fields for the target platform:
Facebook:
target.pageId(required)LinkedIn:
target.pageId(optional)Pinterest:
target.boardId(required)TikTok:
target.privacyLevel,target.disabledComments, etc. (required)Instagram:
target.mediaType(optional - default is "reel")Twitter, Threads, Bluesky: Minimal required fields
Last updated