Before you start
You need these objects:- An API credential with access to the Workspace.
- A Workspace ID.
- A connected Instagram Destination ID.
- Media Assets for the Post, Reel, or Story.
Choose the Instagram content type
Instagram requires media for every Post. Setplacement in destination_options.instagram:
Use
post for a single image or carousel. Use reel for one video. Use story for one temporary profile Story.
The Instagram media guidelines page lists the current file, aspect ratio, and duration limits.
Create an Instagram draft
Create a draft with the Instagram channel. Set the Instagram placement indestination_options.
POST /workspaces/{workspace_id}/posts. Store the returned Post id and version.
Prepare Instagram media
Upload each file as an Asset before publication. Add the Asset IDs to the Post body in the order that you want Instagram to display them. OpenPMM applies these product limits:- Image files use JPEG format and have an 8 MB maximum.
- A carousel accepts one to 10 images.
- A Reel accepts one MP4 or MOV video.
- An Instagram video can be up to 500 MiB.
- A Reel video can be 3 seconds to 15 minutes long.
- An image Post uses a 4:5 to 1.91:1 aspect ratio.
Publish the reviewed Post
Publish the same Post with its current version and the Instagram Destination ID.POST /workspaces/{workspace_id}/posts/publish. Add a unique Idempotency-Key header. Use the same key when you retry the same request after a timeout.
For a scheduled Post, use when: "schedule" and provide the publication time described in Queue, schedule, and retry.
Check the result
UseGET /workspaces/{workspace_id}/posts/{post} after the request. The response includes the Post state and publication receipt.
If the Post enters preparing, it has not reached Instagram. Poll the Post until it becomes ready, scheduled, or needs-attention. Do not confirm the same Post again after it moves from preparing.
If Instagram returns a media validation error, correct the file or the destination_options.instagram.placement value. A Post and a Story accept an image. A Reel requires a video.
