<!-- Generated from the canonical 99 Digital API documentation. Do not edit this file. -->

Canonical page: https://docs.99digital.co.il/facebook-api/webhooks/instagram-post

# Instagram Post

**Webhook.** Sent to the webhook URL you configure.

Instagram Post allows you to receive a webhook when a new post of your Instagram account is announced (`event` "post").

It is sent for an Instagram connection (`facebook_type` 4), to the URL you
set with [Set Webhook](https://docs.99digital.co.il/facebook-api/webhooks/set-webhook) for that
connection. Delivery, retries and duplicates are explained on the
[Webhook Events](https://docs.99digital.co.il/facebook-api/webhooks/webhook-events) page.

**When it is sent.** Instagram (Meta) sends **no** notification when a new
post is published, so we create this event ourselves:

- A post you publish with
  [Create Post](https://docs.99digital.co.il/facebook-api/instagram-pages/create-post) is announced
  **right away**.
- A post created on Instagram itself (the Instagram app or the web) is
  announced when its **first comment** arrives: you get this `post` event
  first, and the [Instagram Comment](https://docs.99digital.co.il/facebook-api/webhooks/instagram-comment)
  event of that comment about 5 seconds later. The few seconds are not
  exact: order events by `timestamp`.
- A post created on Instagram itself that **never gets a comment is never
  announced**.
- A post is announced **once**. `action` is always "created": Instagram
  does not report edits or deletes of posts.
- Ads are not announced: a comment on an ad reaches you as an Instagram
  Comment event only.
- This is true for every post of the account that was never announced:
  also a post from before your connection was made, or one published with
  another tool. Its first comment that reaches us announces it, so the
  post can be months or years old.
- In rare cases, a post you published with Create Post is announced only
  when its first comment arrives, like a post created on Instagram. And
  when we can't read a post at the moment its first comment arrives, that
  comment is still sent to you, and the post is announced with a comment
  that arrives at least 10 minutes later.

**`timestamp` is when the post was created** — not when the event was
sent. A post that is announced by its first comment can be hours, days or
even months old, so order events by `timestamp`. (When Instagram does not
give the creation time, `timestamp` is the time of the comment that
announced the post.)

:::warning Download the media soon
For a post created on Instagram itself, `mediaUrl` and `thumbnailUrl` are
temporary links of Meta's servers. They stop working after a few days, so
download the file soon after the event if you need to keep it.
:::

**Settings:**

| Setting | Value |
| --- | --- |
| URL | Your URL — set it with [Set Webhook](https://docs.99digital.co.il/facebook-api/webhooks/set-webhook) |
| Method | JSON via POST |

**With every Instagram post event, you will get some of the following:**

```json
{
  "event": "post",
  "action": "created",
  "eventId": "fbw_19e4c7a0d3f62859b1e4c7a0d3f6a274",
  "platform": "instagram",
  "from": "463745743546390",
  "facebook_type": 4,
  "igUserId": "17841458392017465",
  "mediaId": "18054729384756120",
  "mediaType": "VIDEO",
  "mediaProductType": "REELS",
  "text": "Behind the scenes of our spring collection 🌷",
  "permalink": "https://www.instagram.com/reel/AbC123xYz45/",
  "mediaUrl": "https://scontent.cdninstagram.com/v/t50.2886-16/spring-reel.mp4",
  "thumbnailUrl": "https://scontent.cdninstagram.com/v/t51.2885-15/spring-reel-cover.jpg",
  "author": { "id": "17841458392017465", "username": "my_flowers_shop" },
  "fromSelf": true,
  "timestamp": 1795412000
}
```

### Response explained

| Parameter | Description / Example |
| --- | --- |
| `event` | "post" always, for post webhooks. |
| `action` | "created" always. |
| `eventId` | The unique ID of this event (`fbw_` and 32 characters). A post is announced once, always with the same `eventId`, so use it to ignore an event you already received. |
| `platform` | "instagram" always, for Instagram. |
| `from` | The ID of your connection — the `from` you use to call our API. |
| `facebook_type` | 4 always (Instagram). |
| `igUserId` | Your Instagram account ID. |
| `mediaId` | The post ID. Use it with [All Posts](https://docs.99digital.co.il/facebook-api/instagram-pages/all-posts), [All Comments](https://docs.99digital.co.il/facebook-api/instagram-pages/all-comments), [Create Comment](https://docs.99digital.co.il/facebook-api/instagram-pages/create-comment), [Toggle Comments](https://docs.99digital.co.il/facebook-api/instagram-pages/toggle-comments) and [Delete Post](https://docs.99digital.co.il/facebook-api/instagram-pages/delete-post). |
| `mediaType` | "IMAGE", "VIDEO" or "CAROUSEL_ALBUM", as Instagram reports it. A reel is "VIDEO". |
| `mediaProductType` | "FEED", "REELS" or "STORY", as Instagram reports it. A reel is "REELS". |
| `text` | The caption, or null when there is none (a story has none). |
| `permalink` | The link to the post on Instagram. null for a post you published with Create Post — read it with [All Posts](https://docs.99digital.co.il/facebook-api/instagram-pages/all-posts) and the `mediaId`. |
| `mediaUrl` | For a post created on Instagram itself: a temporary link to the image or video on Meta's servers (download it soon, see above), or null when Instagram does not give it. For a post you published with Create Post: the link you sent, or null for a carousel. |
| `thumbnailUrl` | For a post created on Instagram itself: a temporary link to the video's cover image (videos only), otherwise null. For a reel you published with Create Post: the `coverUrl` you sent, otherwise null. |
| `author` | Your own Instagram account: `id` (your `igUserId`) and `username` (can be null). |
| `fromSelf` | true always: posts are written by your own account. |
| `timestamp` | When the post was created (Unix time in seconds, UTC). For a post announced by its first comment, it can be long before the event reached you; when Instagram does not give the creation time, it is the time of that comment. |

## Webhook payload

Content type: `application/json`

| Field | Type | Description |
| --- | --- | --- |
| `event` | string | "post" always, for post webhooks. Always `post`. |
| `action` | string | "created" always — Instagram does not report edits or deletes of posts. Always `created`. |
| `eventId` | string | The unique ID of this event (`fbw_` and 32 characters). A post is announced once, always with the same `eventId`, so use it to ignore an event you already received. Example: `fbw_19e4c7a0d3f62859b1e4c7a0d3f6a274`. |
| `platform` | string | "instagram" always, for Instagram. Always `instagram`. |
| `from` | string | The ID of your connection — the `from` you use to call our API. Example: `463745743546390`. |
| `facebook_type` | integer | 4 always (Instagram). Always `4`. |
| `igUserId` | string | Your Instagram account ID. Example: `17841458392017465`. |
| `mediaId` | string | The post ID. Use it with All Posts, All Comments, Create Comment, Toggle Comments and Delete Post. Example: `18054729384756120`. |
| `mediaType` | string \| null | "IMAGE", "VIDEO" or "CAROUSEL_ALBUM", as Instagram reports it. A reel is "VIDEO". Example: `VIDEO`. |
| `mediaProductType` | string \| null | "FEED", "REELS" or "STORY", as Instagram reports it. A reel is "REELS". Example: `REELS`. |
| `text` | string \| null | The caption, or null when there is none (a story has none). Example: `Behind the scenes of our spring collection 🌷`. |
| `permalink` | string \| null | The link to the post on Instagram. null for a post you published with Create Post — read it with All Posts and the `mediaId`. Example: `https://www.instagram.com/reel/AbC123xYz45/`. |
| `mediaUrl` | string \| null | For a post created on Instagram itself: a temporary link to the image or video on Meta's servers (it stops working after a few days — download it soon), or null when Instagram does not give it. For a post you published with Create Post: the link you sent, or null for a carousel. Example: `https://scontent.cdninstagram.com/v/t50.2886-16/spring-reel.mp4`. |
| `thumbnailUrl` | string \| null | For a post created on Instagram itself: a temporary link to the video's cover image (videos only), otherwise null. For a reel you published with Create Post: the `coverUrl` you sent, otherwise null. Example: `https://scontent.cdninstagram.com/v/t51.2885-15/spring-reel-cover.jpg`. |
| `author` | object | Your own Instagram account. |
| `author.id` | string | Your Instagram account ID (`igUserId`). Example: `17841458392017465`. |
| `author.username` | string \| null | Your Instagram username, or null when it is not known. Example: `my_flowers_shop`. |
| `fromSelf` | boolean | true always — posts are written by your own account. Always `true`. |
| `timestamp` | integer | When the post was created (Unix time in seconds, UTC). For a post announced by its first comment, it can be long before the event reached you; when Instagram does not give the creation time, it is the time of that comment. Example: `1795412000`. |

### Example: Created in the Instagram app

A reel created in the Instagram app, announced when its first comment arrived. The links are temporary, and `timestamp` is when the reel was created.

```json
{
  "event": "post",
  "action": "created",
  "eventId": "fbw_19e4c7a0d3f62859b1e4c7a0d3f6a274",
  "platform": "instagram",
  "from": "463745743546390",
  "facebook_type": 4,
  "igUserId": "17841458392017465",
  "mediaId": "18054729384756120",
  "mediaType": "VIDEO",
  "mediaProductType": "REELS",
  "text": "Behind the scenes of our spring collection 🌷",
  "permalink": "https://www.instagram.com/reel/AbC123xYz45/",
  "mediaUrl": "https://scontent.cdninstagram.com/v/t50.2886-16/spring-reel.mp4",
  "thumbnailUrl": "https://scontent.cdninstagram.com/v/t51.2885-15/spring-reel-cover.jpg",
  "author": {
    "id": "17841458392017465",
    "username": "my_flowers_shop"
  },
  "fromSelf": true,
  "timestamp": 1795412000
}
```

### Example: Published with Create Post

An image you published with Create Post, announced right away. `mediaUrl` is the link you sent, and `permalink` is null.

```json
{
  "event": "post",
  "action": "created",
  "eventId": "fbw_7c0f3a6d9b2e45180c3f6a9d2b5e8c41",
  "platform": "instagram",
  "from": "463745743546390",
  "facebook_type": 4,
  "igUserId": "17841458392017465",
  "mediaId": "18054729384799871",
  "mediaType": "IMAGE",
  "mediaProductType": "FEED",
  "text": "Our new collection is here",
  "permalink": null,
  "mediaUrl": "https://example.com/image.jpg",
  "thumbnailUrl": null,
  "author": {
    "id": "17841458392017465",
    "username": "my_flowers_shop"
  },
  "fromSelf": true,
  "timestamp": 1795622400
}
```

### Example: Carousel with Create Post

A carousel you published with Create Post — `mediaUrl` is null.

```json
{
  "event": "post",
  "action": "created",
  "eventId": "fbw_4e7b0d3a6c9f21857e0b3d6a9c2f5d18",
  "platform": "instagram",
  "from": "463745743546390",
  "facebook_type": 4,
  "igUserId": "17841458392017465",
  "mediaId": "18054729384811234",
  "mediaType": "CAROUSEL_ALBUM",
  "mediaProductType": "FEED",
  "text": "Swipe to see the whole collection",
  "permalink": null,
  "mediaUrl": null,
  "thumbnailUrl": null,
  "author": {
    "id": "17841458392017465",
    "username": "my_flowers_shop"
  },
  "fromSelf": true,
  "timestamp": 1795626000
}
```

## Responses

### 200 — Received. Answer with any 2xx status (200, 201, 204 …) — we wait up to 5 seconds to connect and up to 15 seconds for your answer. The body of your answer is ignored.

### default — Any other status, or no answer in time, counts as a failed delivery. We try again: immediately, then 5 minutes, 20 minutes, 1 hour, 4 hours and 24 hours after the previous failure. After that, the event is not sent again.
