Publish an image on social media
Upload a photo to the media library and publish it on Instagram, without a design. Use this for pictures that go out as they are: a product shot, a photo from an event. To publish a design instead, see Publish an export on social media.
You need:
- A service account with the permissions to upload media and to publish,
and its key in
HEYCREO_API_KEY. The values from Before you start. - A connected Instagram account, under Settings → Social accounts.
1. Upload the image
curl "https://app.heycreo.io/api/organizations/$ORGANIZATION_ID/assets/upload" \
-H "Authorization: Bearer $HEYCREO_API_KEY" \
-F "file=@tap-takeover.jpg" \
-F "ensureCollection=Instagram" \
| jq '{id, name, status}'
Keep the asset's id:
export ASSET_ID="…"
heycreo processes the file after the upload. Post it once its status is
completed:
curl "https://app.heycreo.io/api/organizations/$ORGANIZATION_ID/assets/$ASSET_ID" \
-H "Authorization: Bearer $HEYCREO_API_KEY" | jq '{status, width, height}'
Tags, a folder and your own fields can be set in the same upload: see Upload
assets with metadata. The webhook
asset.created reports when a file is ready, instead of asking.
2. Find the account
curl "https://app.heycreo.io/api/organizations/$ORGANIZATION_ID/social/accounts" \
-H "Authorization: Bearer $HEYCREO_API_KEY" \
| jq '.accounts[] | {id, platform, username, isActive}'
3. Create the publication
A publication from the media library has contentSource: "assets" and names its
images in mediaItems, not an export:
{
"name": "Tap takeover, photo",
"contentSource": "assets",
"status": "scheduled",
"scheduling": { "publishAt": "2026-12-10T17:00:00Z" },
"destinations": [
{
"platform": "instagram",
"accountId": "ACCOUNT_ID",
"caption": "Querkopf am Hahn: 12 December from 7 pm, Bar Quertreiber.",
"options": { "mediaType": "post" },
"mediaItems": [
{
"assetId": "ASSET_ID",
"mediaType": "image",
"position": 0,
"cropData": { "rect": { "x": 0.275, "y": 0, "w": 0.45, "h": 1 } }
}
]
}
],
"idempotencyKey": "tap-takeover-photo-instagram"
}
curl "https://app.heycreo.io/api/organizations/$ORGANIZATION_ID/publications" \
-H "Authorization: Bearer $HEYCREO_API_KEY" \
--json @publication.json \
| jq '{id, status}'
| Field | |
|---|---|
options.mediaType | What it becomes on Instagram: post (a feed post; also when left out), story or reel (a video). Not to be confused with mediaItems[].mediaType, the file type: image or video. |
options.instagramIsAiGenerated | true adds Instagram's "AI info" label. |
mediaItems[].assetId | The image from step 1. heycreo prepares it for the platform after the request. |
mediaItems[].position | The order. Several items make a carousel: 0, 1, 2, … |
mediaItems[].cropData | Optional. The part of the image to post, in fractions of its width and height (0–1). Instagram takes feed images between 4:5 (portrait) and 1.91:1 (landscape). The example cuts a 4:5 portrait from the middle of a 16:9 photo. Not for videos. |
scheduling | publishAt (UTC), publishAtLocal with timezone, or publishNow: true. |
If the workspace requires approval for publishing (Settings → Approvals →
Publishing approval), the post answers with pending_approval and waits for
the reviewers, as in Publish an export on social
media.
4. Follow the outcome
curl "https://app.heycreo.io/api/organizations/$ORGANIZATION_ID/publications/$PUBLICATION_ID" \
-H "Authorization: Bearer $HEYCREO_API_KEY" \
| jq '{status, destinations: [.destinations[] | {platform, publishStatus, platformPostUrl}]}'
scheduled until publishAt, then published with the link to the post in
platformPostUrl. The webhooks publication.published and
publication.failed report it without asking. All states are listed in Publish
an export on social media.
See also
- Upload assets with metadata
- Webhooks: the
asset.*andpublication.*events