> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dohoo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Instagram Posting API: Photos and Videos | Dohoo

> Use the Dohoo Instagram posting API to publish photos and videos programmatically with one authenticated request.

The Instagram Publish endpoint lets you post photos and videos to a connected Instagram account without leaving your application. Pass a valid connection ID, a file reference, and an optional caption to schedule or immediately publish content to any Instagram profile you've linked in the Dohoo dashboard.

## Endpoint

```
POST https://dohoo.ai/api/v2/instagram/publish
```

## Request headers

| Header         | Required | Description                |
| -------------- | -------- | -------------------------- |
| `X-API-Key`    | ✅        | Your Dohoo API key         |
| `Content-Type` | ✅        | Must be `application/json` |

## Request body

| Field          | Type   | Required | Description                                         |
| -------------- | ------ | -------- | --------------------------------------------------- |
| `connectionId` | string | ✅        | The ID of the Instagram connection to publish from  |
| `fileId`       | string | ✅        | The ID of the uploaded file (photo or video)        |
| `caption`      | string | ❌        | Caption text for the post. Maximum 2,200 characters |

## Example request

```bash theme={null}
curl -X POST https://dohoo.ai/api/v2/instagram/publish \
  -H "X-API-Key: dh_live_xxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "connectionId": "conn_instagram_001",
    "fileId": "abc123",
    "caption": "Your caption here #hashtag"
  }'
```

## Example response

```json theme={null}
{
  "success": true,
  "platform": "instagram",
  "postId": "17841400123456789",
  "connectionId": "conn_instagram_001",
  "status": "published",
  "publishedAt": "2025-01-15T10:32:00Z",
  "url": "https://www.instagram.com/p/ABC123xyz/"
}
```

<Note>
  You can retrieve your `connectionId` by calling `GET /api/connections/unified`. This endpoint returns all active social connections linked to your Dohoo account.
</Note>

<Tip>
  Keep captions under 2,200 characters — Instagram silently truncates anything beyond that limit. Front-load your key message and hashtags near the beginning of the caption for maximum visibility.
</Tip>

<Warning>
  Instagram does not support publishing to personal profiles via the API — only to **Instagram Business** or **Creator** accounts. Ensure the connected account is set to the correct account type in the Instagram app before publishing.
</Warning>
