InstagramInstagramSocial

Stage an Instagram post — create its media container

instagram.instagram.media.container.create

Stage an Instagram post by creating the media container it will be published from

Price
freeAt provider cost
Success rate
—No success-rate data yetNo success-rate data yet
Latency p50
——
Last verified
—Not verified yet
POSThttps://toolswitch.dev/v1/tools/instagram.instagram.media.container.createPreview
Try onlineComing soonProvider docs ↗
  • Uses platform quota
  • Synchronous response
  • Reads public data

Parameters

step 1 of the publish flow. Needs instagram_content_publish (treg's `post` capability — a `read` connection 403s here) and returns {id: <container id>}. A VIDEO container is not ready when this returns: poll instagram.media.container.status until status_code is FINISHED before publishing, or the publish call fails. Stories have no carousel — publish each story as its own container

ParameterTypeRequiredDescriptionExample
Path parameters
ig_user_idstringRequirednumeric Instagram professional account id — the same one instagram.user.profile takes17841400000000000
Query parameters
captionstringOptionalup to 2,200 characters and 30 hashtags. On a carousel the caption belongs on the PARENT container — set it on a child and the post publishes captionlessThree things we learned this week.
childrenstringOptionalCAROUSEL parent only: comma-separated child container ids, 2 to 10 of them, in display order17890000000000001,17890000000000002
image_urlstringOptionalpublic JPEG URL. Use this OR video_url, never bothhttps://example.com/photo.jpg
video_urlstringOptionalpublic MP4 URLhttps://example.com/clip.mp4
media_typestringOptionalomit for a plain feed image; REELS for a video in the feed, STORIES for a 24-hour story, CAROUSEL for the parent container that groups childrenREELS
location_idstringOptionala Facebook Page id that has a location
thumb_offsetintegerOptionalvideo only — milliseconds into the clip to take the cover frame from0
collaboratorsstringOptionalJSON array of @handles invited as collaborators; not allowed on stories
is_carousel_itembooleanOptionaltrue on each child container of a carousel; children carry no caption and are never published on their owntrue
  • Path parameters
  • ig_user_idstringRequired

    numeric Instagram professional account id — the same one instagram.user.profile takes

    Example: 17841400000000000

  • Query parameters
  • captionstringOptional

    up to 2,200 characters and 30 hashtags. On a carousel the caption belongs on the PARENT container — set it on a child and the post publishes captionless

    Example: Three things we learned this week.

  • childrenstringOptional

    CAROUSEL parent only: comma-separated child container ids, 2 to 10 of them, in display order

    Example: 17890000000000001,17890000000000002

  • image_urlstringOptional

    public JPEG URL. Use this OR video_url, never both

    Example: https://example.com/photo.jpg

  • video_urlstringOptional

    public MP4 URL

    Example: https://example.com/clip.mp4

  • media_typestringOptional

    omit for a plain feed image; REELS for a video in the feed, STORIES for a 24-hour story, CAROUSEL for the parent container that groups children

    Example: REELS

  • location_idstringOptional

    a Facebook Page id that has a location

  • thumb_offsetintegerOptional

    video only — milliseconds into the clip to take the cover frame from

    Example: 0

  • collaboratorsstringOptional

    JSON array of @handles invited as collaborators; not allowed on stories

  • is_carousel_itembooleanOptional

    true on each child container of a carousel; children carry no caption and are never published on their own

    Example: true

Code samples

Replace $TOOLSWITCH_KEY with the key you created in the console.

Preview
curl -X POST 'https://toolswitch.dev/v1/tools/instagram.instagram.media.container.create' \
  -H "X-Toolswitch-Key: $TOOLSWITCH_KEY"

This gateway API is in preview; its URL and authentication may change. The example parameters are sample data. Calls are billed at free, including the service fee.