Developers

Instagram Scheduling API

An Instagram posting API for your own tools. Schedule Instagram posts from your own dashboard, a script or an automation: upload a photo or a video, put it on the schedule of a connected account, then move it, change its caption or cancel it. OwlStat publishes it at its time through Instagram's official API, the same way it publishes posts made on the Schedule page.

Base URL
https://api.owlstat.io/api/schedule
Authentication
Your API key in the apikey header
Limits
30 writes a minute, 60 uploads a day and 10 a minute per account
Availability
Beta: Schedule is switched on per account

Routes

Before you start

  • Schedule must be on for your OwlStat account. Until it is, every route answers 404.
  • The Instagram account must be connected for publishing on the Schedule page (Allow publishing). Business and creator accounts only, as Instagram requires.
  • Your API key is in Settings. It acts as you: keep it on your server, never in a browser or an app. A key made before August 2026 can be worked out from your email, so it can only read the schedule: use Make a new key there first.

Authentication

Send the key in the apikey header on every request. JSON in, JSON out, except the file upload.

curl https://api.owlstat.io/api/schedule/accounts \
  -H "apikey: YOUR_API_KEY"

Approval

By default a post you add through the API waits for approval: it shows up on the Schedule page with status pending, and goes out only after you press Approve there. A post nobody approves before its time does not go out: it turns failed, and a new time plus Approve put it back. To let posts from the API go out by themselves, turn on Publish posts from the API without my approval on the Schedule page. It can only be turned on there, never through the API.

While that setting is off, an approved post that the API gives a new caption or another account goes back to pending: what goes out is always what you approved. Moving it to another time keeps it approved. Reminders (posts with no account, see below) never wait. The OwlStat MCP server always waits, whatever this setting says.

The whole flow

# 1. Which accounts can publish
curl https://api.owlstat.io/api/schedule/accounts -H "apikey: $KEY"

# 2. Upload the file: the body is the file itself
curl https://api.owlstat.io/api/schedule/media -H "apikey: $KEY" \
  -H "Content-Type: image/jpeg" --data-binary @photo.jpg
# → { "token": "eyJ1aWQ…", "kind": "image",
#     "width": 1080, "height": 1350, "duration": null }

# 3. Put it on the schedule
curl https://api.owlstat.io/api/schedule/posts -H "apikey: $KEY" \
  -H "Content-Type: application/json" -d '{
  "type": "image",
  "media": ["eyJ1aWQ…"],
  "caption": "New collection, out Friday #fashion",
  "publishAt": "2026-11-20T18:00:00+01:00",
  "socialAccountId": "3f1c…"
}'

Accounts

GET/accounts

The Instagram accounts connected to your OwlStat account. Use id as socialAccountId; only accounts with canPublish: true can publish.

{ "accounts": [
    { "id": "3f1c…", "username": "yourbrand", "avatar": "https://…", "canPublish": true }
] }

Files

POST/media

The request body is the raw file, with its Content-Type (image/jpeg, image/png, image/webp,video/mp4, video/quicktime). Not JSON, not a multipart form. Photos up to 8 MB (converted to JPEG), videos up to 100 MB. 60 uploads a day and 10 a minute per account.

It answers with a token for POST /posts, valid for 24 hours, plus what was measured: kind(image or video), width, height and, for videos, duration in seconds. Files are kept for 200 days.

Posts

POST/posts

typeimage, carousel, reel or story
mediaTokens from POST /media, in posting order: one for image, reel and story; 2 to 10 for a carousel
captionUp to 2,200 characters, 30 hashtags, 20 mentions (Instagram's limits). Ignored for stories
publishAtISO 8601 with a time zone, e.g. 2026-11-20T18:00:00+01:00. From now to six months ahead
socialAccountIdThe account it goes on. null makes it a reminder: at its time you get an email with the files and the caption, to post by hand

Instagram's rules are checked when you add the post, not when it goes out: feed photos between 4:5 portrait and 1.91:1 landscape, reels from 3 seconds to 15 minutes, story videos from 3 to 60 seconds. It answers with the post:

{ "post": {
    "id": "a8e2…", "type": "image", "caption": "New collection…",
    "publishAt": "2026-11-20T17:00:00.000Z",
    "mode": "publish", "status": "pending", "socialAccountId": "3f1c…",
    "permalink": null, "error": null,
    "media": [ { "url": "https://…", "kind": "image", "w": 1080, "h": 1350 } ],
    "updatedAt": "2026-11-16T12:00:00.000Z"
} }

status is pending (waiting for approval), scheduled, publishing, published (with its permalink on Instagram), reminded or failed (with the reason in error). Times come back in UTC.

GET/posts?from=…&to=…

Posts with publishAt in the range, oldest first, up to 500. Without a range: the last two months and the next six.

PATCH/posts/:id

Any of caption, publishAt, socialAccountId. Only before the post goes out; a failed post can be tried again only from the Schedule page. To change the files, cancel it and add it again.

DELETE/posts/:id

Takes the post off the schedule. A post already published stays on Instagram: this only removes it from the list.

Errors

Every error is JSON with error (a code) and message (a sentence you can show to a person).

400Something in the request is wrong. message says what, in a sentence you can show to a person.
401The API key is missing or wrong.
403Allowed only from the Schedule page (approving a post, retrying a failed one, the approval setting), or old_key: the key was made before August 2026, make a new one in Settings.
404Schedule is not on for this account, or the post does not exist.
409The post is being published right now, or has already gone out.
413 / 415The file is too big, or not a photo or video Instagram takes.
429Too many requests, or 200 posts already waiting. Wait and try again.

Writes are limited to 30 a minute. A post is published within a minute of its time; if Instagram fails for a moment it is tried again, and you get an email if it cannot go out.

With an AI assistant

To schedule from Claude, ChatGPT or Cursor instead of code, use the OwlStat MCP server. Its posts always wait for your approval.