PlatformsInstagram

Instagram

Instagram professional (Business and Creator) accounts through your Meta app, discovered and connected through the Facebook Page each account is linked to.

The permissions each operation needs are in App Review: Instagram.

  • feed and reel are publish variants of instagram.media.posts; stories are their own surface because Instagram serves them from their own edge.
  • A DM reply goes into the conversation, not to a message: send with the message's containerId, the counterpart's IGSID.
  • Instagram's comment webhook reports new comments only — no edits, deletions, or hides — so instagram.media.comments emits created alone.
  • DM reactions arrive as events, one per person per message: updated each time a person sets one, the first included, since Meta does not say which is first, and deleted when they remove it. A read lists one message's reactions, the account's own included.
CollectionOperationsEventsBackfill
instagram.media.postslist, get, publish, update, deletecreatedyes
instagram.media.commentslist, get, publish, perform_action, deletecreatedno
instagram.media.mentionsget, publishcreatedno
instagram.stories.postslist, get, publish, deletecreatedyes
instagram.dm.messageslist, get, resolve_attachment, publishcreatedyes
instagram.dm.reactionslist, get, publish, deleteupdated, deletedno
instagram.dm.conversationslist, get, perform_actionnoneno

instagram.media.posts

The account's feed posts and reels.

list

List Instagram profile media items.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
cursorstringnoOpaque cursor for fetching the next result page.
limitintegernoMaximum number of items to return.
includePlatformRawbooleannoWhether to include transient platform-native payloads.
JSON Schema
{
  "type": "object",
  "required": [
    "profileId"
  ],
  "properties": {
    "profileId": {
      "type": "string",
      "description": "Koil Profile associated with the operation.",
      "minLength": 1
    },
    "cursor": {
      "type": "string",
      "description": "Opaque cursor for fetching the next result page.",
      "minLength": 1
    },
    "limit": {
      "type": "integer",
      "description": "Maximum number of items to return.",
      "minimum": 1,
      "maximum": 100
    },
    "includePlatformRaw": {
      "type": "boolean",
      "description": "Whether to include transient platform-native payloads."
    }
  },
  "additionalProperties": false
}

get

Get one Instagram media item by platform id.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
externalIdstringyes
includePlatformRawbooleannoWhether to include transient platform-native payloads.
JSON Schema
{
  "type": "object",
  "required": [
    "profileId",
    "externalId"
  ],
  "properties": {
    "profileId": {
      "type": "string",
      "description": "Koil Profile associated with the operation.",
      "minLength": 1
    },
    "externalId": {
      "type": "string",
      "minLength": 1
    },
    "includePlatformRaw": {
      "type": "boolean",
      "description": "Whether to include transient platform-native payloads."
    }
  },
  "additionalProperties": false
}

publish

Publish an Instagram feed photo, a carousel of photos and videos, or a reel.

Submit through POST /v1/publish-requests with collection: "instagram.media.posts". These fields go in the item's args; profileId and variant are item fields.

variant: "feed"

FieldTypeRequiredDescription
textstringnoCaption/body text for content.
mediaobject | object[]yesOne image, or a carousel of two to ten images and videos. A single video publishes as a reel (variant "reel"), which also appears in the feed.
aiGeneratedbooleannoLabel the post as AI-generated, with the platform's own AI label.
paidPartnershipbooleannoLabel the post as a paid partnership with a brand.
JSON Schema
{
  "type": "object",
  "required": [
    "media"
  ],
  "properties": {
    "text": {
      "type": "string",
      "description": "Caption/body text for content."
    },
    "media": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "object",
            "required": [
              "mediaId"
            ],
            "properties": {
              "mediaId": {
                "type": "string",
                "minLength": 1
              },
              "contentType": {
                "type": "string",
                "minLength": 1
              },
              "altText": {
                "type": "string",
                "minLength": 1
              }
            },
            "additionalProperties": false
          },
          {
            "type": "object",
            "required": [
              "sourceUrl"
            ],
            "properties": {
              "sourceUrl": {
                "type": "string",
                "minLength": 1
              },
              "contentType": {
                "type": "string",
                "minLength": 1
              },
              "altText": {
                "type": "string",
                "minLength": 1
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "minItems": 1,
      "maxItems": 10,
      "description": "One image, or a carousel of two to ten images and videos. A single video publishes as a reel (variant \"reel\"), which also appears in the feed."
    },
    "aiGenerated": {
      "type": "boolean",
      "description": "Label the post as AI-generated, with the platform's own AI label."
    },
    "paidPartnership": {
      "type": "boolean",
      "description": "Label the post as a paid partnership with a brand."
    }
  },
  "additionalProperties": false
}

variant: "reel"

FieldTypeRequiredDescription
textstringnoCaption/body text for content.
mediaobject | object[]yes
aiGeneratedbooleannoLabel the post as AI-generated, with the platform's own AI label.
paidPartnershipbooleannoLabel the post as a paid partnership with a brand.
JSON Schema
{
  "type": "object",
  "required": [
    "media"
  ],
  "properties": {
    "text": {
      "type": "string",
      "description": "Caption/body text for content."
    },
    "media": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "object",
            "required": [
              "mediaId"
            ],
            "properties": {
              "mediaId": {
                "type": "string",
                "minLength": 1
              },
              "contentType": {
                "type": "string",
                "minLength": 1,
                "pattern": "^video/"
              },
              "altText": {
                "type": "string",
                "minLength": 1
              }
            },
            "additionalProperties": false
          },
          {
            "type": "object",
            "required": [
              "sourceUrl"
            ],
            "properties": {
              "sourceUrl": {
                "type": "string",
                "minLength": 1
              },
              "contentType": {
                "type": "string",
                "minLength": 1,
                "pattern": "^video/"
              },
              "altText": {
                "type": "string",
                "minLength": 1
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "minItems": 1,
      "maxItems": 1
    },
    "aiGenerated": {
      "type": "boolean",
      "description": "Label the post as AI-generated, with the platform's own AI label."
    },
    "paidPartnership": {
      "type": "boolean",
      "description": "Label the post as a paid partnership with a brand."
    }
  },
  "additionalProperties": false
}

Media requirements

An asset that meets everything under Copied as is is published exactly as uploaded. Otherwise Koil converts only what misses, a billed media add-on that needs a paid plan. Anything under Refused fails the publish request, since no conversion fixes it.

VariantMediaCopied as isOtherwise convertedRefused
feedImageJPEG; at most 1440 px widere-encoded to JPEG; downscaled to fitaspect ratio outside 4:5 to 1.91:1; over 8 MB once staged
feedVideo (carousel item)MP4/MOV, H.264 or HEVC; at most 1920 px wide; at most 60 fpsre-encoded to H.264 in MP4; downscaled to fit; frame rate loweredaspect ratio outside 4:5 to 16:9; shorter than 3 s; longer than 60 s; under 23 fps; over 100 MB once staged
reelVideoMP4/MOV, H.264 or HEVC; at most 1920 px wide; at most 60 fpsre-encoded to H.264 in MP4; downscaled to fit; frame rate loweredaspect ratio outside 0.01:1 to 10:1; shorter than 3 s; longer than 15 min; under 23 fps; over 300 MB once staged

update

Turn comments on or off on a feed post or reel, the only change Graph allows: a caption cannot be edited.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
externalIdstringyes
commentsEnabledbooleanyesfalse turns comments off on the post; true turns them back on.
includePlatformRawbooleannoWhether to include transient platform-native payloads.
JSON Schema
{
  "type": "object",
  "required": [
    "profileId",
    "externalId",
    "commentsEnabled"
  ],
  "properties": {
    "profileId": {
      "type": "string",
      "description": "Koil Profile associated with the operation.",
      "minLength": 1
    },
    "externalId": {
      "type": "string",
      "minLength": 1
    },
    "commentsEnabled": {
      "type": "boolean",
      "description": "false turns comments off on the post; true turns them back on."
    },
    "includePlatformRaw": {
      "type": "boolean",
      "description": "Whether to include transient platform-native payloads."
    }
  },
  "additionalProperties": false
}

delete

Delete a feed post or reel; a carousel is deleted whole.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
externalIdstringyes
JSON Schema
{
  "type": "object",
  "required": [
    "profileId",
    "externalId"
  ],
  "properties": {
    "profileId": {
      "type": "string",
      "description": "Koil Profile associated with the operation.",
      "minLength": 1
    },
    "externalId": {
      "type": "string",
      "minLength": 1
    }
  },
  "additionalProperties": false
}

Not offered

  • resolve_attachment: not applicable
  • perform_action: platform not supported

Events

Backfill: supported (bounded coverage); see Backfill history.

Item schema

What list and get return and what events carry as data.

FieldTypeRequiredDescription
referencesobject[]no
textstringnoCaption/body text for content.
mediaobject[]no
engagementobjectnoPlatform-reported engagement counts.
permalinkstring (uri)noThe thing's URL on the platform, for display and linking only, never as a key. It may point at something private or expired.
publishedAtstring (date-time)noWhen the platform published it.
externalIdstringyesPlatform-owned content identifier.
variant"feed" | "reel" | "other"yesreel for a reel or any video, feed for other feed media. other is a media_product_type Koil does not model.
platformRawunknownnoOptional platform-native payload included only for transient delivery/debug use.
kind"instagram.media.posts"yesThe collection that delivered this item.

instagram.media.comments

Comments on the account's media, and replies to them.

list

List the top-level comments on one media item, or the replies to one of them.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
containerIdstringyesThe place the item was published into and lives in: the post or video a comment is on, or the conversation a message is in. Every item in the same place has the same containerId, replies to replies included. A post in the account has none.
targetIdstringnoA top-level comment on that media item: lists its replies instead.
cursorstringnoOpaque cursor for fetching the next result page.
limitintegernoMaximum number of items to return.
includePlatformRawbooleannoWhether to include transient platform-native payloads.
JSON Schema
{
  "type": "object",
  "required": [
    "profileId",
    "containerId"
  ],
  "properties": {
    "profileId": {
      "type": "string",
      "description": "Koil Profile associated with the operation.",
      "minLength": 1
    },
    "containerId": {
      "type": "string",
      "minLength": 1,
      "description": "The place the item was published into and lives in: the post or video a comment is on, or the conversation a message is in. Every item in the same place has the same `containerId`, replies to replies included. A post in the account has none."
    },
    "targetId": {
      "type": "string",
      "minLength": 1,
      "description": "A top-level comment on that media item: lists its replies instead."
    },
    "cursor": {
      "type": "string",
      "description": "Opaque cursor for fetching the next result page.",
      "minLength": 1
    },
    "limit": {
      "type": "integer",
      "description": "Maximum number of items to return.",
      "minimum": 1,
      "maximum": 100
    },
    "includePlatformRaw": {
      "type": "boolean",
      "description": "Whether to include transient platform-native payloads."
    }
  },
  "additionalProperties": false
}

get

Get one Instagram media comment by platform id.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
externalIdstringyes
includePlatformRawbooleannoWhether to include transient platform-native payloads.
JSON Schema
{
  "type": "object",
  "required": [
    "profileId",
    "externalId"
  ],
  "properties": {
    "profileId": {
      "type": "string",
      "description": "Koil Profile associated with the operation.",
      "minLength": 1
    },
    "externalId": {
      "type": "string",
      "minLength": 1
    },
    "includePlatformRaw": {
      "type": "boolean",
      "description": "Whether to include transient platform-native payloads."
    }
  },
  "additionalProperties": false
}

publish

Publish an Instagram comment: a reply to a comment or a top-level comment on a media item.

Submit through POST /v1/publish-requests with collection: "instagram.media.comments". These fields go in the item's args; profileId and variant are item fields.

FieldTypeRequiredDescription
targetobjectyesOne thing on the platform outside this item: content, an account, or anything else the platform gives an id or a URL.
textstringyesCaption/body text for content.
JSON Schema
{
  "type": "object",
  "required": [
    "target",
    "text"
  ],
  "properties": {
    "target": {
      "type": "object",
      "required": [
        "kind",
        "externalId"
      ],
      "properties": {
        "kind": {
          "enum": [
            "instagram.media.comments",
            "instagram.media.posts"
          ]
        },
        "externalId": {
          "type": "string",
          "description": "Platform-owned content identifier.",
          "minLength": 1
        }
      },
      "additionalProperties": false,
      "description": "One thing on the platform outside this item: content, an account, or anything else the platform gives an id or a URL."
    },
    "text": {
      "type": "string",
      "description": "Caption/body text for content."
    }
  },
  "additionalProperties": false
}

perform_action

Hide or unhide an Instagram media comment. Answers with the state applied.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
externalIdstringyes
action"hide" | "unhide"yesWhat to do with the item: hide (hide it from public view), unhide (show a hidden item again).
JSON Schema
{
  "type": "object",
  "required": [
    "profileId",
    "externalId",
    "action"
  ],
  "properties": {
    "profileId": {
      "type": "string",
      "description": "Koil Profile associated with the operation.",
      "minLength": 1
    },
    "externalId": {
      "type": "string",
      "minLength": 1
    },
    "action": {
      "enum": [
        "hide",
        "unhide"
      ],
      "description": "What to do with the item: `hide` (hide it from public view), `unhide` (show a hidden item again).",
      "x-koil-narrows": "ContentAction"
    }
  },
  "additionalProperties": false
}

delete

Delete a comment on the account's media, whoever wrote it.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
externalIdstringyes
JSON Schema
{
  "type": "object",
  "required": [
    "profileId",
    "externalId"
  ],
  "properties": {
    "profileId": {
      "type": "string",
      "description": "Koil Profile associated with the operation.",
      "minLength": 1
    },
    "externalId": {
      "type": "string",
      "minLength": 1
    }
  },
  "additionalProperties": false
}

Not offered

  • resolve_attachment: not applicable
  • update: platform not supported

Events

Backfill: not offered — platform no endpoint.

Item schema

What list and get return and what events carry as data.

FieldTypeRequiredDescription
containerIdstringyesThe place the item was published into and lives in: the post or video a comment is on, or the conversation a message is in. Every item in the same place has the same containerId, replies to replies included. A post in the account has none.
targetobjectyesThe one thing on the platform this item directly responds to: a comment's post, or the comment it replies to; a message's quoted or replied-to message, story or comment; what a reaction reacts to. Absent when the platform reports nothing it responds to.
referencesobject[]no
textstringyesCaption/body text for content.
authorobjectnoPlatform actor reference for observed content.
ownerAuthoredbooleannoWhether the Profile's own account wrote it. Absent when Koil cannot tell, which does not mean someone else did.
attachmentsunknown | unknown | unknown[]no
hiddenbooleannoWhether the account hid the comment from the public. Absent when the platform did not say.
engagementobjectnoPlatform-reported engagement counts.
permalinkstring (uri)noThe thing's URL on the platform, for display and linking only, never as a key. It may point at something private or expired.
publishedAtstring (date-time)noWhen the platform published it.
updatedAtstring (date-time)noWhen the platform last updated it.
externalIdstringyesPlatform-owned content identifier.
platformRawunknownnoOptional platform-native payload included only for transient delivery/debug use.
kind"instagram.media.comments"yesThe collection that delivered this item.

instagram.media.mentions

Mentions of the account in other users' posts and comments. Delivered as events: Meta offers no endpoint that lists them, but reads and replies to one by the id its event carries.

get

Get one mention of the Instagram account by the id and variant its event carries, with the mentioning caption or comment text. Meta does not name its author's account.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
externalIdstringyesThe mention's id: the comment id for a comment mention, the media id for a caption mention.
variant"post" | "comment"yesThe mention's variant, as its event names it.
includePlatformRawbooleannoWhether to include transient platform-native payloads.
JSON Schema
{
  "type": "object",
  "required": [
    "profileId",
    "externalId",
    "variant"
  ],
  "properties": {
    "profileId": {
      "type": "string",
      "description": "Koil Profile associated with the operation.",
      "minLength": 1
    },
    "externalId": {
      "type": "string",
      "minLength": 1,
      "description": "The mention's id: the comment id for a comment mention, the media id for a caption mention."
    },
    "variant": {
      "enum": [
        "post",
        "comment"
      ],
      "description": "The mention's `variant`, as its event names it."
    },
    "includePlatformRaw": {
      "type": "boolean",
      "description": "Whether to include transient platform-native payloads."
    }
  },
  "additionalProperties": false
}

publish

Reply to a mention of the Instagram account with a comment as the account: on the mentioning media item, or under the mentioning comment. Answers with the new comment's id.

Submit through POST /v1/publish-requests with collection: "instagram.media.mentions". These fields go in the item's args; profileId and variant are item fields.

FieldTypeRequiredDescription
targetobjectyesThe mention to reply to.
containerIdstringnoFor a comment mention, the media it is on, as the mention's containerId names it; omitted for a caption mention.
textstringyesCaption/body text for content.
JSON Schema
{
  "type": "object",
  "required": [
    "target",
    "text"
  ],
  "properties": {
    "target": {
      "type": "object",
      "required": [
        "kind",
        "externalId"
      ],
      "properties": {
        "kind": {
          "enum": [
            "instagram.media.mentions"
          ]
        },
        "externalId": {
          "type": "string",
          "description": "Platform-owned content identifier.",
          "minLength": 1
        }
      },
      "additionalProperties": false,
      "description": "The mention to reply to."
    },
    "containerId": {
      "type": "string",
      "minLength": 1,
      "description": "For a comment mention, the media it is on, as the mention's `containerId` names it; omitted for a caption mention."
    },
    "text": {
      "type": "string",
      "description": "Caption/body text for content."
    }
  },
  "additionalProperties": false
}

Not offered

  • list: platform no endpoint
  • resolve_attachment: not applicable
  • update: platform not supported
  • perform_action: platform not supported
  • delete: platform not supported

Events

Backfill: not offered — platform no endpoint.

Item schema

What list and get return and what events carry as data.

FieldTypeRequiredDescription
variant"post" | "comment"yesWhether the mentioning item is a post (identified by the post itself) or a comment (with the post it is on as containerId).
containerIdstringnoThe place the item was published into and lives in: the post or video a comment is on, or the conversation a message is in. Every item in the same place has the same containerId, replies to replies included. A post in the account has none.
textstringnoCaption/body text for content.
authorobjectnoPlatform actor reference for observed content.
permalinkstring (uri)noThe thing's URL on the platform, for display and linking only, never as a key. It may point at something private or expired.
publishedAtstring (date-time)noWhen the platform published it.
externalIdstringyesPlatform-owned content identifier.
platformRawunknownnoOptional platform-native payload included only for transient delivery/debug use.
kind"instagram.media.mentions"yesThe collection that delivered this item.

instagram.stories.posts

The account's live stories.

list

List the Instagram profile's live stories.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
cursorstringnoOpaque cursor for fetching the next result page.
limitintegernoMaximum number of items to return.
includePlatformRawbooleannoWhether to include transient platform-native payloads.
JSON Schema
{
  "type": "object",
  "required": [
    "profileId"
  ],
  "properties": {
    "profileId": {
      "type": "string",
      "description": "Koil Profile associated with the operation.",
      "minLength": 1
    },
    "cursor": {
      "type": "string",
      "description": "Opaque cursor for fetching the next result page.",
      "minLength": 1
    },
    "limit": {
      "type": "integer",
      "description": "Maximum number of items to return.",
      "minimum": 1,
      "maximum": 100
    },
    "includePlatformRaw": {
      "type": "boolean",
      "description": "Whether to include transient platform-native payloads."
    }
  },
  "additionalProperties": false
}

get

Get one Instagram story by platform id.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
externalIdstringyes
includePlatformRawbooleannoWhether to include transient platform-native payloads.
JSON Schema
{
  "type": "object",
  "required": [
    "profileId",
    "externalId"
  ],
  "properties": {
    "profileId": {
      "type": "string",
      "description": "Koil Profile associated with the operation.",
      "minLength": 1
    },
    "externalId": {
      "type": "string",
      "minLength": 1
    },
    "includePlatformRaw": {
      "type": "boolean",
      "description": "Whether to include transient platform-native payloads."
    }
  },
  "additionalProperties": false
}

publish

Publish an Instagram story from one image or video.

Submit through POST /v1/publish-requests with collection: "instagram.stories.posts". These fields go in the item's args; profileId and variant are item fields.

FieldTypeRequiredDescription
mediaobject | object[]yes
JSON Schema
{
  "type": "object",
  "required": [
    "media"
  ],
  "properties": {
    "media": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "object",
            "required": [
              "mediaId"
            ],
            "properties": {
              "mediaId": {
                "type": "string",
                "minLength": 1
              },
              "contentType": {
                "type": "string",
                "minLength": 1
              },
              "altText": {
                "type": "string",
                "minLength": 1
              }
            },
            "additionalProperties": false
          },
          {
            "type": "object",
            "required": [
              "sourceUrl"
            ],
            "properties": {
              "sourceUrl": {
                "type": "string",
                "minLength": 1
              },
              "contentType": {
                "type": "string",
                "minLength": 1
              },
              "altText": {
                "type": "string",
                "minLength": 1
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "minItems": 1,
      "maxItems": 1
    }
  },
  "additionalProperties": false
}

Media requirements

An asset that meets everything under Copied as is is published exactly as uploaded. Otherwise Koil converts only what misses, a billed media add-on that needs a paid plan. Anything under Refused fails the publish request, since no conversion fixes it.

MediaCopied as isOtherwise convertedRefused
ImageJPEG; at most 1440 px widere-encoded to JPEG; downscaled to fitover 8 MB once staged
VideoMP4/MOV, H.264 or HEVC; at most 1920 px wide; at most 60 fpsre-encoded to H.264 in MP4; downscaled to fit; frame rate loweredaspect ratio outside 1:10 to 10:1; longer than 60 s

delete

Delete one of the account's stories.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
externalIdstringyes
JSON Schema
{
  "type": "object",
  "required": [
    "profileId",
    "externalId"
  ],
  "properties": {
    "profileId": {
      "type": "string",
      "description": "Koil Profile associated with the operation.",
      "minLength": 1
    },
    "externalId": {
      "type": "string",
      "minLength": 1
    }
  },
  "additionalProperties": false
}

Not offered

  • resolve_attachment: not applicable
  • update: platform not supported
  • perform_action: platform not supported

Events

Backfill: supported (bounded coverage); see Backfill history.

Item schema

What list and get return and what events carry as data.

FieldTypeRequiredDescription
referencesobject[]no
textstringnoCaption/body text for content.
mediaobject[]no
engagementobjectnoPlatform-reported engagement counts.
permalinkstring (uri)noThe thing's URL on the platform, for display and linking only, never as a key. It may point at something private or expired.
publishedAtstring (date-time)noWhen the platform published it.
externalIdstringyesPlatform-owned content identifier.
platformRawunknownnoOptional platform-native payload included only for transient delivery/debug use.
kind"instagram.stories.posts"yesThe collection that delivered this item.

instagram.dm.messages

Messages in one Instagram DM conversation.

list

List the messages of the account's Instagram DM conversation with one person.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
containerIdstringyesThe conversation: the counterpart's IGSID or PSID, as a message's containerId names it.
cursorstringnoOpaque cursor for fetching the next result page.
limitintegernoMaximum number of items to return.
includePlatformRawbooleannoWhether to include transient platform-native payloads.
JSON Schema
{
  "type": "object",
  "required": [
    "profileId",
    "containerId"
  ],
  "properties": {
    "profileId": {
      "type": "string",
      "description": "Koil Profile associated with the operation.",
      "minLength": 1
    },
    "containerId": {
      "type": "string",
      "minLength": 1,
      "description": "The conversation: the counterpart's IGSID or PSID, as a message's `containerId` names it."
    },
    "cursor": {
      "type": "string",
      "description": "Opaque cursor for fetching the next result page.",
      "minLength": 1
    },
    "limit": {
      "type": "integer",
      "description": "Maximum number of items to return.",
      "minimum": 1,
      "maximum": 100
    },
    "includePlatformRaw": {
      "type": "boolean",
      "description": "Whether to include transient platform-native payloads."
    }
  },
  "additionalProperties": false
}

get

Get one Instagram DM by id, with fresh URLs for its files. Meta serves only a conversation's 20 most recent messages.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
externalIdstringyes
includePlatformRawbooleannoWhether to include transient platform-native payloads.
JSON Schema
{
  "type": "object",
  "required": [
    "profileId",
    "externalId"
  ],
  "properties": {
    "profileId": {
      "type": "string",
      "description": "Koil Profile associated with the operation.",
      "minLength": 1
    },
    "externalId": {
      "type": "string",
      "minLength": 1
    },
    "includePlatformRaw": {
      "type": "boolean",
      "description": "Whether to include transient platform-native payloads."
    }
  },
  "additionalProperties": false
}

resolve_attachment

Answer a fresh URL for a file an Instagram DM carries, by the id a read reported.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
externalIdstringyesThe item that carries the file.
attachmentExternalIdstringyesThe attachment's externalId, as the read reported it.
JSON Schema
{
  "type": "object",
  "required": [
    "profileId",
    "externalId",
    "attachmentExternalId"
  ],
  "properties": {
    "profileId": {
      "type": "string",
      "description": "Koil Profile associated with the operation.",
      "minLength": 1
    },
    "externalId": {
      "type": "string",
      "minLength": 1,
      "description": "The item that carries the file."
    },
    "attachmentExternalId": {
      "type": "string",
      "minLength": 1,
      "description": "The attachment's `externalId`, as the read reported it."
    }
  },
  "additionalProperties": false
}

publish

Send an Instagram DM to a recipient: text, optionally with quick replies; text with up to three reply or link buttons; or one image, video, audio file, or PDF.

Submit through POST /v1/publish-requests with collection: "instagram.dm.messages". These fields go in the item's args; profileId and variant are item fields.

FieldTypeRequiredDescription
containerIdstringyesThe conversation to send into, as a message's containerId names it: the counterpart's IGSID or PSID.
textstringnoThe message text; up to 640 characters with buttons.
attachmentsobject | object[]noOne image, video, audio file, or document, sent without text. Staged, then fetched by Meta from a URL Koil signs.
quickRepliesobject[]noUp to 13 replies offered under the text, which disappear once the person answers. Not with buttons.
buttonsobject | object[]noOne to three buttons under text of up to 640 characters. Not with quickReplies.
JSON Schema
{
  "type": "object",
  "required": [
    "containerId"
  ],
  "properties": {
    "containerId": {
      "type": "string",
      "minLength": 1,
      "description": "The conversation to send into, as a message's `containerId` names it: the counterpart's IGSID or PSID."
    },
    "text": {
      "type": "string",
      "description": "The message text; up to 640 characters with `buttons`."
    },
    "attachments": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "object",
            "required": [
              "mediaId"
            ],
            "properties": {
              "mediaId": {
                "type": "string",
                "minLength": 1
              },
              "contentType": {
                "type": "string",
                "minLength": 1
              },
              "altText": {
                "type": "string",
                "minLength": 1
              },
              "filename": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255,
                "description": "The name the recipient sees on a document, where the destination shows one. Defaults to the uploaded file's name."
              }
            },
            "additionalProperties": false
          },
          {
            "type": "object",
            "required": [
              "sourceUrl"
            ],
            "properties": {
              "sourceUrl": {
                "type": "string",
                "minLength": 1
              },
              "contentType": {
                "type": "string",
                "minLength": 1
              },
              "altText": {
                "type": "string",
                "minLength": 1
              },
              "filename": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255,
                "description": "The name the recipient sees on a document, where the destination shows one. Defaults to the uploaded file's name."
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "minItems": 1,
      "maxItems": 1,
      "description": "One image, video, audio file, or document, sent without `text`. Staged, then fetched by Meta from a URL Koil signs."
    },
    "quickReplies": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "title",
          "payload"
        ],
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20,
            "description": "The label the person sees, up to 20 characters: Meta refuses a longer one on Messenger and truncates it on Instagram."
          },
          "payload": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000,
            "description": "Your own value, up to 1,000 characters, returned as the reply message's `choice.payload` when the person taps the option."
          }
        },
        "additionalProperties": false,
        "description": "A suggested reply shown under the message until the person answers. A tap arrives as the person's message, its `text` the title and its `choice.payload` the payload."
      },
      "minItems": 1,
      "maxItems": 13,
      "description": "Up to 13 replies offered under the `text`, which disappear once the person answers. Not with `buttons`."
    },
    "buttons": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "object",
            "required": [
              "type",
              "title",
              "payload"
            ],
            "properties": {
              "type": {
                "type": "string",
                "const": "reply"
              },
              "title": {
                "type": "string",
                "minLength": 1,
                "maxLength": 20,
                "description": "The label the person sees, up to 20 characters: Meta refuses a longer one on Messenger and truncates it on Instagram."
              },
              "payload": {
                "type": "string",
                "minLength": 1,
                "maxLength": 1000,
                "description": "Your own value, up to 1,000 characters, returned as the reply message's `choice.payload` when the person taps the option."
              }
            },
            "additionalProperties": false,
            "description": "A button whose tap arrives as the person's message, its `text` the title and its `choice.payload` the payload."
          },
          {
            "type": "object",
            "required": [
              "type",
              "title",
              "url"
            ],
            "properties": {
              "type": {
                "type": "string",
                "const": "url"
              },
              "title": {
                "type": "string",
                "minLength": 1,
                "maxLength": 20,
                "description": "The label the person sees, up to 20 characters: Meta refuses a longer one on Messenger and truncates it on Instagram."
              },
              "url": {
                "type": "string",
                "format": "uri",
                "minLength": 1,
                "pattern": "^https?://",
                "description": "The page the button opens."
              }
            },
            "additionalProperties": false,
            "description": "A button that opens a web page. Tapping it sends nothing back."
          }
        ]
      },
      "minItems": 1,
      "maxItems": 3,
      "description": "One to three buttons under `text` of up to 640 characters. Not with `quickReplies`."
    }
  },
  "additionalProperties": false,
  "anyOf": [
    {
      "required": [
        "text"
      ]
    },
    {
      "required": [
        "attachments"
      ]
    }
  ],
  "dependentRequired": {
    "quickReplies": [
      "text"
    ],
    "buttons": [
      "text"
    ]
  },
  "dependentSchemas": {
    "attachments": {
      "properties": {
        "text": false,
        "quickReplies": false,
        "buttons": false
      }
    },
    "buttons": {
      "properties": {
        "quickReplies": false,
        "text": {
          "minLength": 1,
          "maxLength": 640
        }
      }
    }
  }
}

Media requirements

An asset that meets everything under Copied as is is published exactly as uploaded. Otherwise Koil converts only what misses, a billed media add-on that needs a paid plan. Anything under Refused fails the publish request, since no conversion fixes it.

MediaCopied as isOtherwise convertedRefused
ImageJPEG or PNGre-encoded to JPEGover 8 MB once staged
VideoMP4/MOV, H.264re-encoded to H.264 in MP4over 25 MB once staged
AudioAAC or M4A—any other format; over 25 MB
DocumentPDF—any other format; over 25 MB

Not offered

  • update: platform not supported
  • perform_action: not applicable — Read receipts and typing indicators act on the conversation, not on one message.
  • delete: platform not supported

Events

Backfill: supported (partial coverage); see Backfill history.

Item schema

What list and get return and what events carry as data.

FieldTypeRequiredDescription
containerIdstringyesThe conversation: the same on every message in it, on reads and events alike, so an inbox groups by it. It is TikTok's conversation id, a WhatsApp group's id, and in a 1:1 chat on Instagram, Facebook or WhatsApp the counterpart's own id, since Meta's messaging webhooks carry no conversation id.
targetunknown | unknownnoThe one thing on the platform this item directly responds to: a comment's post, or the comment it replies to; a message's quoted or replied-to message, story or comment; what a reaction reacts to. Absent when the platform reports nothing it responds to.
referencesobject[]no
textstringnoCaption/body text for content.
authorobjectnoPlatform actor reference for observed content.
ownerAuthoredbooleannoWhether the Profile's own account wrote it. Absent when Koil cannot tell, which does not mean someone else did.
attachmentsunknown | unknown | unknown[]no
choiceobjectnoThe option the person picked instead of typing: a quick reply, a button or a list row a message offered, or one of the account's ice breakers. Its label is the message's text, and the message that offered it is target where the platform names it. Present where the platform reports the tap, which on Instagram and Messenger is the message's event only: a read of the same message returns its text without choice. Absent too when the platform withholds the payload (Meta sends a postback's payload only to the app that sent the button), so such a tap reads as typed text.
publishedAtstring (date-time)noWhen the platform published it.
externalIdstringyesPlatform-owned content identifier.
platformRawunknownnoOptional platform-native payload included only for transient delivery/debug use.
kind"instagram.dm.messages"yesThe collection that delivered this item.

instagram.dm.reactions

Reactions to messages in one Instagram DM conversation, one per person per message. Events do not report the account's own; a read of the message does.

list

List the reactions to one Instagram DM, the account's own included. Meta reads only a conversation's 20 most recent messages.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
targetIdstringyesThe message whose reactions to list, as its externalId names it.
includePlatformRawbooleannoWhether to include transient platform-native payloads.
JSON Schema
{
  "type": "object",
  "required": [
    "profileId",
    "targetId"
  ],
  "properties": {
    "profileId": {
      "type": "string",
      "description": "Koil Profile associated with the operation.",
      "minLength": 1
    },
    "targetId": {
      "type": "string",
      "minLength": 1,
      "description": "The message whose reactions to list, as its `externalId` names it."
    },
    "includePlatformRaw": {
      "type": "boolean",
      "description": "Whether to include transient platform-native payloads."
    }
  },
  "additionalProperties": false
}

get

Get one person's reaction to an Instagram DM, by {reactor id}:{message id}. Meta reads only a conversation's 20 most recent messages.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
externalIdstringyes
includePlatformRawbooleannoWhether to include transient platform-native payloads.
JSON Schema
{
  "type": "object",
  "required": [
    "profileId",
    "externalId"
  ],
  "properties": {
    "profileId": {
      "type": "string",
      "description": "Koil Profile associated with the operation.",
      "minLength": 1
    },
    "externalId": {
      "type": "string",
      "minLength": 1
    },
    "includePlatformRaw": {
      "type": "boolean",
      "description": "Whether to include transient platform-native payloads."
    }
  },
  "additionalProperties": false
}

publish

React to a message in an Instagram DM conversation as the account, replacing any reaction it set on that message.

Submit through POST /v1/publish-requests with collection: "instagram.dm.reactions". These fields go in the item's args; profileId and variant are item fields.

FieldTypeRequiredDescription
containerIdstringyesThe conversation of the message: the counterpart's IGSID or PSID, as the message's containerId names it.
targetobjectyesThe message to react to.
emojistringyesThe emoji reacted with, as the platform sent it.
JSON Schema
{
  "type": "object",
  "required": [
    "containerId",
    "target",
    "emoji"
  ],
  "properties": {
    "containerId": {
      "type": "string",
      "minLength": 1,
      "description": "The conversation of the message: the counterpart's IGSID or PSID, as the message's `containerId` names it."
    },
    "target": {
      "type": "object",
      "required": [
        "kind",
        "externalId"
      ],
      "properties": {
        "kind": {
          "enum": [
            "instagram.dm.messages"
          ]
        },
        "externalId": {
          "type": "string",
          "description": "Platform-owned content identifier.",
          "minLength": 1
        }
      },
      "additionalProperties": false,
      "description": "The message to react to."
    },
    "emoji": {
      "type": "string",
      "minLength": 1,
      "description": "The emoji reacted with, as the platform sent it."
    }
  },
  "additionalProperties": false
}

delete

Remove the account's reaction to an Instagram DM.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
containerIdstringyesThe conversation of the message: the counterpart's IGSID or PSID, as the message's containerId names it.
externalIdstringyesThe account's own reaction, as a publish answered it: {account id}:{message id}.
JSON Schema
{
  "type": "object",
  "required": [
    "profileId",
    "containerId",
    "externalId"
  ],
  "properties": {
    "profileId": {
      "type": "string",
      "description": "Koil Profile associated with the operation.",
      "minLength": 1
    },
    "containerId": {
      "type": "string",
      "minLength": 1,
      "description": "The conversation of the message: the counterpart's IGSID or PSID, as the message's `containerId` names it."
    },
    "externalId": {
      "type": "string",
      "minLength": 1,
      "description": "The account's own reaction, as a publish answered it: `{account id}:{message id}`."
    }
  },
  "additionalProperties": false
}

Not offered

  • resolve_attachment: not applicable
  • update: not applicable — Publishing a reaction again replaces the account's reaction to that message.
  • perform_action: not applicable

Events

Backfill: not offered — platform no endpoint.

Item schema

What list and get return and what events carry as data.

FieldTypeRequiredDescription
targetobjectyesThe message reacted to.
containerIdstringyesThe conversation of the message reacted to: the counterpart's IGSID or PSID, as its messages' containerId names it.
emojistringnoThe emoji reacted with, as the platform sent it.
authorobjectyesThe account that reacted: the counterpart, or the account itself.
ownerAuthoredbooleannoWhether the Profile's own account wrote it. Absent when Koil cannot tell, which does not mean someone else did.
publishedAtstring (date-time)noWhen the platform published it.
externalIdstringyesPlatform-owned content identifier.
platformRawunknownnoOptional platform-native payload included only for transient delivery/debug use.
kind"instagram.dm.reactions"yesThe collection that delivered this item.

instagram.dm.conversations

The account's Instagram DM conversations, each keyed by the person it is with.

list

List the account's Instagram DM conversations. Meta does not tell the inbox folders apart on Instagram, so message requests are listed with the rest and not marked; one inactive for 30 days is not listed.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
cursorstringnoOpaque cursor for fetching the next result page.
limitintegernoMaximum number of items to return.
includePlatformRawbooleannoWhether to include transient platform-native payloads.
JSON Schema
{
  "type": "object",
  "required": [
    "profileId"
  ],
  "properties": {
    "profileId": {
      "type": "string",
      "description": "Koil Profile associated with the operation.",
      "minLength": 1
    },
    "cursor": {
      "type": "string",
      "description": "Opaque cursor for fetching the next result page.",
      "minLength": 1
    },
    "limit": {
      "type": "integer",
      "description": "Maximum number of items to return.",
      "minimum": 1,
      "maximum": 100
    },
    "includePlatformRaw": {
      "type": "boolean",
      "description": "Whether to include transient platform-native payloads."
    }
  },
  "additionalProperties": false
}

get

Get the account's Instagram DM conversation with one person, by their IGSID.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
externalIdstringyes
includePlatformRawbooleannoWhether to include transient platform-native payloads.
JSON Schema
{
  "type": "object",
  "required": [
    "profileId",
    "externalId"
  ],
  "properties": {
    "profileId": {
      "type": "string",
      "description": "Koil Profile associated with the operation.",
      "minLength": 1
    },
    "externalId": {
      "type": "string",
      "minLength": 1
    },
    "includePlatformRaw": {
      "type": "boolean",
      "description": "Whether to include transient platform-native payloads."
    }
  },
  "additionalProperties": false
}

perform_action

Mark the person's messages in the account's Instagram DM conversation as seen, or show or stop showing that the account is typing. A typing indicator turns itself off after 20 seconds or at the account's next message.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
externalIdstringyesThe conversation, as its externalId names it: the counterpart's IGSID or PSID.
action"seen" | "typing_on" | "typing_off"yesWhat to do with the item: seen (show the person a read receipt for their messages), typing_on (show the person that the profile is typing), typing_off (stop showing that the profile is typing).
JSON Schema
{
  "type": "object",
  "required": [
    "profileId",
    "externalId",
    "action"
  ],
  "properties": {
    "profileId": {
      "type": "string",
      "description": "Koil Profile associated with the operation.",
      "minLength": 1
    },
    "externalId": {
      "type": "string",
      "minLength": 1,
      "description": "The conversation, as its `externalId` names it: the counterpart's IGSID or PSID."
    },
    "action": {
      "enum": [
        "seen",
        "typing_on",
        "typing_off"
      ],
      "description": "What to do with the item: `seen` (show the person a read receipt for their messages), `typing_on` (show the person that the profile is typing), `typing_off` (stop showing that the profile is typing).",
      "x-koil-narrows": "ContentAction"
    }
  },
  "additionalProperties": false
}

Not offered

  • resolve_attachment: not applicable
  • publish: not applicable — A conversation starts with its first message.
  • update: platform not supported
  • delete: platform not supported

Events

None: this collection is read-only.

Backfill: not offered — not applicable.

Item schema

What list and get return and what events carry as data.

FieldTypeRequiredDescription
counterpartobjectnoThe person the account is talking to in a 1:1 conversation. A group chat has none.
messageRequestbooleannoWhether the conversation is still a message request: the person wrote and the account has not replied yet. Absent when the read or event did not say.
updatedAtstring (date-time)noWhen the conversation last changed, as the platform reports it.
externalIdstringyesThe counterpart's IGSID or PSID: the containerId its messages carry.
graphConversationIdstringnoGraph's own id for the conversation, for calls to Graph that take it. Koil's inputs take externalId.
platformRawunknownnoOptional platform-native payload included only for transient delivery/debug use.
kind"instagram.dm.conversations"yesThe collection that delivered this item.

instagram.dm_welcome

What Instagram shows a person before they first message the account: its ice breakers. An account setting, not a collection: it has no items, events or backfill.

FieldTypeRequiredDescription
iceBreakersobject[]noUp to four questions per locale, offered to a person who has not written yet; one entry must be the default locale.

On this page