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.

  1. Call the CREATE endpoint. Record the ID from the 201 response (id for sources, item.id for videos, postSubmissionId for posts).

  2. Loop every 2-5 seconds calling the GET endpoint with that ID.

  3. Continue polling while status is processing (see status values below).

  4. Succeed when status reaches a terminal state.

Terminal Status Values by Operation:

  • Sources: completed (success) or failed

  • Videos: done (success) or creation-from-template-failed

  • Posts: published (success) or failed

All Video Status Values (in order): queueing -> generating-script -> script-ready -> generating-media -> media-ready -> exporting -> done

Always fetch accounts first: GET /v2/users/me/accounts to get accountId for publishing. For Facebook/LinkedIn, also fetch GET /v2/users/me/accounts/{accountId}/subaccounts to get pageId.

Set content.platform and target.targetType to 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-v3

  • Poll: GET /v2/source-resolutions-v3/:id

Source Types:

  • youtube, tiktok, article, pdf, audio, twitter - Extract content from a URL (each type requires a url field)

  • text - Transform raw text content with optional AI instructions

  • perplexity-query - AI-powered web research on any topic (requires a text field)

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-templates

  • Poll: GET /v2/videos/creations/:id

  • Templates: 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/posts

  • Poll: GET /v2/posts/:postSubmissionId

  • Account Lookup: GET /v2/users/me/accounts (docs)

  • Subaccounts (for pageId): GET /v2/users/me/accounts/:accountId/subaccounts (docs)

[!IMPORTANT] Prerequisites:

  1. accountId: Get this from GET /v2/users/me/accounts. Always fetch the user's accounts before publishing. See Accounts reference.

  2. pageId (Facebook/LinkedIn): Get this from GET /v2/users/me/accounts/{accountId}/subaccounts. See How to Get the Right IDs.

  3. mediaUrls: Pass URLs directly from the Visual Workflow (outputs mediaUrl and imageUrls). No upload step required.

  4. content.platform and target.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.


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:

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