# Post to Instagram

`GET | POST /v1/publish` — Post a Reel, a picture or a carousel to an Instagram account linked to the workspace.

- Base URL: https://eroq.ai/v1
- Auth: `Authorization: Bearer eroq_sk_…` (create keys at https://eroq.ai/dashboard/keys)
- Credits: free

**Link the account once, in the studio** (Plugins & connectors › Instagram, a Business or Creator account). A workspace can link several: `GET /v1/connections` lists them, and a post names one by `id` or by `@handle`. TikTok and YouTube links show there too, but their posts are made from the studio only (`403 studio_only`): their rules want a person's click on every post.

**The files.** A Library creation (`creation:<id>`) or a file of the workspace (`POST /v1/uploads`, then `upload:<id>`): pictures in JPEG, PNG or WebP (sent to Instagram as JPEG), clips in MP4 or MOV (H.264/AAC). A Reel is one clip of 3 s to 15 min, an image post one picture (4:5 to 1.91:1), a carousel 2 to 10 pictures and clips (a clip 3 to 60 s).

**What is checked before anything leaves.** Your role may post and the plan includes posting; `attest` says the post follows Instagram's rules and you hold the rights to everything in it; a render made on an uncensored engine never goes; the caption meets the content policy; every file is looked at (each picture, three frames of each clip) and must suit a general audience. A refusal is a `4xx` before anything is sent; `503 check_unavailable` means the check could not run — retry.

**After the call.** A picture is usually live when the call returns (`201`, `status: "published"`, `url`); a clip takes Instagram a minute or two (`202`, `status: "processing"`): read `GET /v1/publications/{id}` every 30 s or so until `published` or `failed` (`error` says why, in plain words). Free; 40 posts a day per workspace, all platforms together.

## Operations

| Method | Path | What it does |
| --- | --- | --- |
| `GET` | `/v1/connections` | The accounts linked to the workspace — `api_publish` says which ones this API can post to. |
| `POST` | `/v1/publish` | Post to an Instagram account (202, or 201 when it is already live). Free. |
| `GET` | `/v1/publications/{id}` | Where a post stands — reading it moves it along: `queued`, `uploading`, `processing`, `published` (with `url`) or `failed` (with `error`). |
| `GET` | `/v1/publications` | The workspace's latest posts, studio and API, newest first (`?limit=` up to 100, default 20). |

## GET /v1/connections

The accounts linked to the workspace — `api_publish` says which ones this API can post to.

### Example request

```bash
curl https://eroq.ai/v1/connections \
  -H "Authorization: Bearer $EROQ_API_KEY"
```

```javascript
const res = await fetch('https://eroq.ai/v1/connections', {
  headers: { Authorization: `Bearer ${process.env.EROQ_API_KEY}` },
})
console.log(await res.json())
```

```python
import os, requests

res = requests.get("https://eroq.ai/v1/connections", headers={"Authorization": f"Bearer {os.environ['EROQ_API_KEY']}"})
print(res.json())
```

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"os"
)

func main() {
	req, _ := http.NewRequest("GET", "https://eroq.ai/v1/connections", nil)
	req.Header.Set("Authorization", "Bearer "+os.Getenv("EROQ_API_KEY"))

	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	out, _ := io.ReadAll(res.Body)
	fmt.Println(string(out))
}
```

### Response


```json
{
  "object": "list",
  "data": [{
    "id": "43e1743a-8302-43b7-b05c-91d20f44febb", "object": "connection", "provider": "instagram",
    "handle": "eroq.ai", "name": "eroq", "status": "active", "api_publish": true,
    "connected_at": "2026-10-26T00:53:31Z"
  }]
}
```

## POST /v1/publish

Post to an Instagram account (202, or 201 when it is already live). Free.

### Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `connection` | string | yes | An account `id` or `@handle`. |
| `kind` | string | yes | `reel`, `image` or `carousel`. |
| `media` | array | yes | `creation:<id>` or `upload:<id>`, in order. |
| `caption` | string | no | The caption. |
| `attest` | object | yes | `{ "guidelines": true, "rights": true }`. |
| `share_to_feed` | boolean | no | Reels: also in the grid (default `true`). |
| `dry_run` | boolean | no | Every check, the files handed to Instagram, nothing published. |

### Example request

```bash
curl https://eroq.ai/v1/publish \
  -H "Authorization: Bearer $EROQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "connection": "@eroq.ai",
  "kind": "reel",
  "media": [
    "upload:3f9a1c2b7d8e4f60"
  ],
  "caption": "Made in one take. #aivideo",
  "attest": {
    "guidelines": true,
    "rights": true
  }
}'
```

```javascript
const res = await fetch('https://eroq.ai/v1/publish', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.EROQ_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "connection": "@eroq.ai",
    "kind": "reel",
    "media": [
      "upload:3f9a1c2b7d8e4f60"
    ],
    "caption": "Made in one take. #aivideo",
    "attest": {
      "guidelines": true,
      "rights": true
    }
  }),
})
console.log(await res.json())
```

```python
import os, requests

res = requests.post(
    "https://eroq.ai/v1/publish",
    headers={"Authorization": f"Bearer {os.environ['EROQ_API_KEY']}"},
    json={
        "connection": "@eroq.ai",
        "kind": "reel",
        "media": [
            "upload:3f9a1c2b7d8e4f60"
        ],
        "caption": "Made in one take. #aivideo",
        "attest": {
            "guidelines": True,
            "rights": True
        }
    },
)
print(res.json())
```

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"os"
	"strings"
)

func main() {
	body := strings.NewReader(`{
  "connection": "@eroq.ai",
  "kind": "reel",
  "media": [
    "upload:3f9a1c2b7d8e4f60"
  ],
  "caption": "Made in one take. #aivideo",
  "attest": {
    "guidelines": true,
    "rights": true
  }
}`)

	req, _ := http.NewRequest("POST", "https://eroq.ai/v1/publish", body)
	req.Header.Set("Authorization", "Bearer "+os.Getenv("EROQ_API_KEY"))
	req.Header.Set("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	out, _ := io.ReadAll(res.Body)
	fmt.Println(string(out))
}
```

### Response


```json
{
  "id": "6b0e4f9a-2c1d-4e7b-9a3f-5d8c7b6a1e2f", "object": "publication", "provider": "instagram",
  "connection": "43e1743a-8302-43b7-b05c-91d20f44febb", "handle": "eroq.ai", "kind": "reel",
  "status": "processing", "url": null, "error": null,
  "created_at": "2026-12-04T17:02:11Z", "published_at": null
}
```

## GET /v1/publications/{id}

Where a post stands — reading it moves it along: `queued`, `uploading`, `processing`, `published` (with `url`) or `failed` (with `error`).

### Example request

```bash
curl https://eroq.ai/v1/publications/PUBLICATION_ID \
  -H "Authorization: Bearer $EROQ_API_KEY"
```

```javascript
const res = await fetch('https://eroq.ai/v1/publications/PUBLICATION_ID', {
  headers: { Authorization: `Bearer ${process.env.EROQ_API_KEY}` },
})
console.log(await res.json())
```

```python
import os, requests

res = requests.get("https://eroq.ai/v1/publications/PUBLICATION_ID", headers={"Authorization": f"Bearer {os.environ['EROQ_API_KEY']}"})
print(res.json())
```

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"os"
)

func main() {
	req, _ := http.NewRequest("GET", "https://eroq.ai/v1/publications/PUBLICATION_ID", nil)
	req.Header.Set("Authorization", "Bearer "+os.Getenv("EROQ_API_KEY"))

	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	out, _ := io.ReadAll(res.Body)
	fmt.Println(string(out))
}
```

### Response


```json
{
  "id": "6b0e4f9a-2c1d-4e7b-9a3f-5d8c7b6a1e2f", "object": "publication", "provider": "instagram",
  "connection": "43e1743a-8302-43b7-b05c-91d20f44febb", "handle": "eroq.ai", "kind": "reel",
  "status": "published", "url": "https://www.instagram.com/reel/DRk3…/", "error": null,
  "created_at": "2026-12-04T17:02:11Z", "published_at": "2026-12-04T17:03:40Z"
}
```

## GET /v1/publications

The workspace's latest posts, studio and API, newest first (`?limit=` up to 100, default 20).

### Query parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `limit` | integer | no | 1 to 100, default 20. |

### Example request

```bash
curl "https://eroq.ai/v1/publications?limit=20" \
  -H "Authorization: Bearer $EROQ_API_KEY"
```

```javascript
const res = await fetch('https://eroq.ai/v1/publications?limit=20', {
  headers: { Authorization: `Bearer ${process.env.EROQ_API_KEY}` },
})
console.log(await res.json())
```

```python
import os, requests

res = requests.get("https://eroq.ai/v1/publications?limit=20", headers={"Authorization": f"Bearer {os.environ['EROQ_API_KEY']}"})
print(res.json())
```

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"os"
)

func main() {
	req, _ := http.NewRequest("GET", "https://eroq.ai/v1/publications?limit=20", nil)
	req.Header.Set("Authorization", "Bearer "+os.Getenv("EROQ_API_KEY"))

	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	out, _ := io.ReadAll(res.Body)
	fmt.Println(string(out))
}
```

### Response


```json
{ "object": "list", "data": [{ "id": "6b0e…", "object": "publication", "provider": "instagram", "kind": "carousel", "status": "published", "url": "https://www.instagram.com/p/DRk4…/" }] }
```

---
Canonical: https://eroq.ai/docs/publish · Index for agents: https://eroq.ai/llms.txt · OpenAPI: https://eroq.ai/openapi.json
