Instagram Publisher

API key required
Data & APIs

Publish Instagram images, Reels, and carousels, check Instagram publishing status, fetch recent Instagram direct messages, and send Instagram direct messages through a preconfigured MyBrandMetrics API connection. Supports local files, remote media URLs, captions, carousel items, Reel feed sharing, thumbnail offset, publish status checks, and messaging workflows after Instagram Insights is connected in MyBrandMetrics.

Install

openclaw skills install clawbus-instagram-publish

Instagram Publisher

Publish Instagram images, Reels, and carousels, check publish status, and work with Instagram direct messages through bundled MyBrandMetrics scripts.

Use this skill when the user wants to publish to Instagram, post to IG, upload a Reel, create a carousel, publish a hosted media URL, publish a local media file, check an Instagram publish job, fetch recent Instagram DMs, or send an Instagram direct message.

Website: https://www.clawbus.com/
MyBrandMetrics API: https://mybrandmetrics.com/

Why This Instagram Publisher

This skillBuilding your own Instagram publishing and messaging integration
Sign in to MyBrandMetrics with Google and connect Instagram Insights.Set up and maintain your own Meta developer integration.
Use a MyBrandMetrics API key, connection ID, and account ID for publishing.Manage app credentials, account selection, publishing tokens, and token handling yourself.
Publish images and Reels from local files or remote URLs with one script.Implement media upload, hosted media handling, and publish requests for each media type.
Build mixed carousels by passing local files or URLs as --items.Upload every carousel child, collect child IDs, wait for processing, and publish the final carousel yourself.
Set captions, Reel feed sharing, thumbnail offset, wait behavior, and status checks from CLI flags.Build separate request handling for metadata, media-type differences, retries, and publish-status polling.
Fetch recent Instagram DMs and send replies with bundled messaging scripts.Implement Instagram messaging endpoints and handle Meta messaging-window errors yourself.

Use this when you want Instagram publishing and messaging workflows without building a full Instagram backend yourself.

Core Capabilities

CapabilityDetails
Image publishingPublish a single Instagram image from a remote URL or local file.
Reels publishingPublish an Instagram Reel from a remote video URL or local video file.
Carousel publishingPublish multi-item carousels from images and videos, including mixed local files and remote URLs.
Post metadataSet captions, Reel feed sharing, thumbnail offset, and wait behavior.
Publish status checksCheck an existing Instagram publish job with a returned publish ID.
Direct message fetchFetch recent Instagram direct messages with a configurable --limit.
Direct message sendSend a message to a conversation_id returned by the message fetch script.
Natural-language workflowsUse chat instructions after the skill is installed and credentials are configured.

Setup Flow

  1. Open https://mybrandmetrics.com/ and sign in with Google.
  2. In MyBrandMetrics, open Data sources.
  3. Connect Instagram Insights as a data source.
  4. Wait until the MyBrandMetrics connection is ready.
  5. Get the MyBrandMetrics API key, Instagram connection ID, and Instagram account ID from MyBrandMetrics.
  6. Install the instagram-publish skill.
  7. Provide credentials through command-line arguments, environment variables, or a workspace config.json.
  8. Start an image, Reel, carousel, publish-status, or direct-message workflow with natural-language instructions or direct scripts.

Messaging scripts only require the API key and connection ID. Publishing scripts also require the account ID.

Credential Options

The scripts load credentials in this order:

  1. Command-line arguments such as --api-key, --connection-id, and --account-id.
  2. Environment variables: INSTAGRAM_API_KEY, INSTAGRAM_AUTHORIZATION_TOKEN, INSTAGRAM_CONNECTION_ID, INSTAGRAM_ACCOUNT_ID, and optionally INSTAGRAM_PUBLISH_CONFIG.
  3. A workspace config.json file with an instagram object.

Example config.json:

{
  "instagram": {
    "authorization_token": "YOUR_API_KEY",
    "connection_id": "YOUR_CONNECTION_ID",
    "account_id": "YOUR_ACCOUNT_ID"
  }
}

Do not commit real API keys, connection IDs, or account IDs.

Workflow

Use natural-language prompts in chat after the skill is installed. Include:

  • the task: publish, check status, fetch messages, or send a message;
  • the media URL, local file path, or carousel item list;
  • the post type when it is not obvious: IMAGE, REELS, or CAROUSEL;
  • the caption;
  • whether a Reel should be shared to feed;
  • the publish ID for status checks;
  • the message conversation_id and message text for DM replies.

Before publishing, confirm the Instagram account, media source, post type, and caption. For carousels, review every item before posting. For direct messages, confirm the target conversation_id and exact message text.

Instagram direct messaging is subject to Meta platform policy and messaging-window limits. If the API returns a policy error, show the real response instead of retrying indefinitely.

Use The Scripts Directly

Use scripts/publish_instagram.py for publishing and status checks.

Single image from URL:

python3 scripts/publish_instagram.py \
  --type IMAGE \
  --url "https://example.com/image.jpg" \
  --caption "Hello World!"

Reel from local file:

python3 scripts/publish_instagram.py \
  --type REELS \
  --path "/path/to/video.mp4" \
  --caption "Check this out!" \
  --thumb-offset 1000

Mixed carousel:

python3 scripts/publish_instagram.py \
  --type CAROUSEL \
  --items "/path/to/img1.jpg" "https://example.com/video2.mp4" \
  --caption "My Carousel"

Check publish status:

python3 scripts/publish_instagram.py \
  --check-id "PUBLISH_ID"

Fetch recent direct messages:

python3 scripts/receive_messages.py \
  --limit 25

Send a direct message:

python3 scripts/send_message.py \
  --conversation-id "CONVERSATION_ID" \
  --message "Thanks for reaching out!"

Parameters

ParameterScriptRequiredPurpose
--api-keyall scriptsNo, if configured elsewhereMyBrandMetrics API key.
--connection-idall scriptsNo, if configured elsewhereInstagram connection ID from MyBrandMetrics.
--account-idpublish scriptNo, if configured elsewhereMyBrandMetrics Instagram account ID for publishing.
--configall scriptsNoPath to a custom config.json.
--typepublish scriptNoIMAGE, REELS, or CAROUSEL; default is IMAGE.
--captionpublish scriptNoInstagram caption text.
--urlpublish scriptFor URL-based single mediaRemote media URL for a single image or Reel.
--pathpublish scriptFor local single mediaLocal media path for a single image or Reel.
--itemspublish scriptFor carouselSpace-separated carousel item URLs or paths.
--thumb-offsetpublish scriptNoReel or video carousel thumbnail offset in milliseconds.
--no-feedpublish scriptNoDisable sharing Reels to feed.
--no-waitpublish scriptNoDo not wait for publishing or media processing completion.
--check-idpublish scriptFor status checksCheck status of an existing publish ID.
--limitreceive messages scriptNoNumber of recent messages to fetch; default is 25.
--conversation-idsend message scriptYesConversation ID returned by receive_messages.py.
--messagesend message scriptYesDirect message text to send.

Reference Files

FilePurpose
references/configuration.mdSupported credential sources, config shape, and secret-handling rules.
references/publishing-examples.mdConcrete commands for publishing, status checks, and direct messages.

The scripts print the real JSON response from the MyBrandMetrics API. Treat that response as the source of truth; do not fabricate publish IDs, media container IDs, message IDs, or success states.