REST workflow examples
REST source, visual, and publication sequences with operation IDs, polling intervals, and completion checks.
Publishing, source extraction, and visual generation use the Submit → Poll → Result pattern. Read the completion rules for the exact operation. For task instructions using MCP, start with Agent workflows.
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). A scheduled post also returnsscheduledTime, the resolved UTC publish time.Check the
GETendpoint at least 10 seconds apart for posts and sources, and at least 15 seconds apart for visuals.Continue polling while status is processing (see status values below).
Stop on a terminal result. Report success only for the operation's success state, not for a failure or draft.
Set a waiting limit. Preserve the operation ID if processing remains unfinished. Do not submit a duplicate write because a poll failed or time elapsed.
Terminal Status Values by Operation:
Sources:
completed(success) orfailedVideos:
done(success),creation-from-template-failed,insufficient-credits, or any response withitem.error. Adraftis not a rendered result.Posts:
published(success),failed, orscheduledfor a future publication. Stop immediate polling after a scheduled result.All 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. To getpageIdfor Facebook/LinkedIn orplaylistIdsfor YouTube, also fetchGET /v2/users/me/accounts/{accountId}/subaccounts.For social platforms, set
content.platformandtarget.targetTypeto the same value (e.g., both"twitter"). The REST webhook target usesotherwithwebhook.Content Calendar:
GET /v2/schedulesto list scheduled posts.PATCH /v2/schedules/:idto update content or time.DELETE /v2/schedules/:idto cancel.GET /v2/schedule/slotsfor recurring time slots.Full reference: API reference for agents.
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:
Choose the template for the requested output. An image carousel, a narrated video, and a clip compilation use different templates and input structures. Inspect the selected template's inputs before generating.
Visual Generation Flow
Example Payload (with AI Prompt)
Example Payload (with Manual Inputs)
Replace the example image URLs with the user's accessible media URLs before submitting. These URLs illustrate the request structure, not content to publish.
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)
n8n / Make.com users: Check the operations in your installed integration. If it exposes Get Post, pass the original
postSubmissionId. Otherwise, use an HTTP request toGET /v2/posts/{postSubmissionId}with your Blotato credential. Do not assume all integration versions expose the same operations.
[!IMPORTANT] Prerequisites:
accountId: Get this fromGET /v2/users/me/accounts. Always fetch the user's accounts before publishing. See Accounts reference.
pageId: Required for Facebook Pages and LinkedIn company Pages. Omit it for a LinkedIn personal-profile post. Get it fromGET /v2/users/me/accounts/{accountId}/subaccounts. See How to Get the Right IDs.
mediaUrls: Use existing accessible media URLs, ormediaUrlandimageUrlsfrom an authorized visual-generation request. No upload step required for these URLs. Do not generate new media for a request to publish an existing file. Text-only posts omit media when the selected platform supports them.
content.platformandtarget.targetType: For social platforms, set both to the same value (e.g., both"twitter").
Step 0: Fetch Available Accounts (Always Do This First)
Response:
For a Facebook Page or LinkedIn company Page, fetch subaccounts and select the requested pageId. Omit pageId for a LinkedIn personal profile. For YouTube, fetch subaccounts only when playlist placement is requested:
See Accounts reference for full details.
Publish Flow
Example Payload
Get accountId from GET /v2/users/me/accounts. For social platforms, set content.platform and target.targetType to the same value.
To schedule instead of publishing immediately, add useNextFreeSlot or scheduledTime as a top-level field (sibling of post, not inside it). See Publish Post for details.
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
4. Managing the Content Calendar
Goal: View, update, reschedule, or delete scheduled posts. Manage the recurring time slots that define your posting cadence.
How Slots and Schedules Work Together:
Slots define recurring time windows (e.g., "Monday 9 AM for Twitter"). Create them with
POST /v2/schedule/slots.When you publish with
useNextFreeSlot: true, Blotato finds the next open slot matching the target platform and queues the post at that time.A slot is "occupied" when a scheduled post is already queued at that time. The next
useNextFreeSlotcall skips occupied slots.Schedules are the queued posts. Slots are the time windows. Manage them separately.
Endpoints:
Schedules:
GET /v2/schedules,GET /v2/schedules/:id,PATCH /v2/schedules/:id,DELETE /v2/schedules/:id(docs)Slots:
GET /v2/schedule/slots,POST /v2/schedule/slots,PATCH /v2/schedule/slots/:id,DELETE /v2/schedules/slots/:id,POST /v2/schedule/slots/next-available(docs)
Schedule Response Shape
The draft field in a schedule is the same shape as the post object in Publish Post:
Note: The response uses
scheduledAtfor the publish time. The update endpoint acceptsscheduledTimeas the input field name.
Rescheduling to the Next Free Slot
The PATCH /v2/schedules/:id endpoint accepts scheduledTime but not useNextFreeSlot. To move a post to the next available slot:
Pseudocode for Calendar Management
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
Retry failed reads after a delay. For a create request with an uncertain result, check existing work before resubmitting. For
429, wait and reduce request frequency. See Errors and retries.
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),target.mediaType-- required"reel"for videos (regular feed videos no longer supported), optional"story"for Stories, omit for text/image postsLinkedIn:
target.pageId(optional)Pinterest:
target.boardId(required)YouTube:
target.playlistIds(optional - array of playlist IDs from subaccounts)TikTok:
target.privacyLevel,target.disabledComments, etc. (required)Instagram:
target.mediaType(optional - default is "reel")Twitter, Threads, Bluesky: Minimal required fields
Last updated