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.
feedandreelare publish variants ofinstagram.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.commentsemitscreatedalone. - DM reactions arrive as events, one per person per message:
updatedeach time a person sets one, the first included, since Meta does not say which is first, anddeletedwhen they remove it. A read lists one message's reactions, the account's own included.
| Collection | Operations | Events | Backfill |
|---|---|---|---|
instagram.media.posts | list, get, publish, update, delete | created | yes |
instagram.media.comments | list, get, publish, perform_action, delete | created | no |
instagram.media.mentions | get, publish | created | no |
instagram.stories.posts | list, get, publish, delete | created | yes |
instagram.dm.messages | list, get, resolve_attachment, publish | created | yes |
instagram.dm.reactions | list, get, publish, delete | updated, deleted | no |
instagram.dm.conversations | list, get, perform_action | none | no |
instagram.media.posts
The account's feed posts and reels.
list
List Instagram profile media items.
| Field | Type | Required | Description |
|---|---|---|---|
profileId | string | yes | Koil Profile associated with the operation. |
cursor | string | no | Opaque cursor for fetching the next result page. |
limit | integer | no | Maximum number of items to return. |
includePlatformRaw | boolean | no | Whether 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.
| Field | Type | Required | Description |
|---|---|---|---|
profileId | string | yes | Koil Profile associated with the operation. |
externalId | string | yes | |
includePlatformRaw | boolean | no | Whether 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"
| Field | Type | Required | Description |
|---|---|---|---|
text | string | no | Caption/body text for content. |
media | object | object[] | yes | 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 | boolean | no | Label the post as AI-generated, with the platform's own AI label. |
paidPartnership | boolean | no | Label 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"
| Field | Type | Required | Description |
|---|---|---|---|
text | string | no | Caption/body text for content. |
media | object | object[] | yes | |
aiGenerated | boolean | no | Label the post as AI-generated, with the platform's own AI label. |
paidPartnership | boolean | no | Label 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.
| Variant | Media | Copied as is | Otherwise converted | Refused |
|---|---|---|---|---|
feed | Image | JPEG; at most 1440 px wide | re-encoded to JPEG; downscaled to fit | aspect ratio outside 4:5 to 1.91:1; over 8 MB once staged |
feed | Video (carousel item) | MP4/MOV, H.264 or HEVC; at most 1920 px wide; at most 60 fps | re-encoded to H.264 in MP4; downscaled to fit; frame rate lowered | aspect ratio outside 4:5 to 16:9; shorter than 3 s; longer than 60 s; under 23 fps; over 100 MB once staged |
reel | Video | MP4/MOV, H.264 or HEVC; at most 1920 px wide; at most 60 fps | re-encoded to H.264 in MP4; downscaled to fit; frame rate lowered | aspect 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.
| Field | Type | Required | Description |
|---|---|---|---|
profileId | string | yes | Koil Profile associated with the operation. |
externalId | string | yes | |
commentsEnabled | boolean | yes | false turns comments off on the post; true turns them back on. |
includePlatformRaw | boolean | no | Whether 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.
| Field | Type | Required | Description |
|---|---|---|---|
profileId | string | yes | Koil Profile associated with the operation. |
externalId | string | yes |
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 applicableperform_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.
| Field | Type | Required | Description |
|---|---|---|---|
references | object[] | no | |
text | string | no | Caption/body text for content. |
media | object[] | no | |
engagement | object | no | Platform-reported engagement counts. |
permalink | string (uri) | no | The thing's URL on the platform, for display and linking only, never as a key. It may point at something private or expired. |
publishedAt | string (date-time) | no | When the platform published it. |
externalId | string | yes | Platform-owned content identifier. |
variant | "feed" | "reel" | "other" | yes | reel for a reel or any video, feed for other feed media. other is a media_product_type Koil does not model. |
platformRaw | unknown | no | Optional platform-native payload included only for transient delivery/debug use. |
kind | "instagram.media.posts" | yes | The 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.
| Field | Type | Required | Description |
|---|---|---|---|
profileId | string | yes | Koil Profile associated with the operation. |
containerId | string | yes | 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 | string | no | A top-level comment on that media item: lists its replies instead. |
cursor | string | no | Opaque cursor for fetching the next result page. |
limit | integer | no | Maximum number of items to return. |
includePlatformRaw | boolean | no | Whether 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.
| Field | Type | Required | Description |
|---|---|---|---|
profileId | string | yes | Koil Profile associated with the operation. |
externalId | string | yes | |
includePlatformRaw | boolean | no | Whether 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.
| Field | Type | Required | Description |
|---|---|---|---|
target | object | yes | One thing on the platform outside this item: content, an account, or anything else the platform gives an id or a URL. |
text | string | yes | Caption/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.
| Field | Type | Required | Description |
|---|---|---|---|
profileId | string | yes | Koil Profile associated with the operation. |
externalId | string | yes | |
action | "hide" | "unhide" | yes | What 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.
| Field | Type | Required | Description |
|---|---|---|---|
profileId | string | yes | Koil Profile associated with the operation. |
externalId | string | yes |
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 applicableupdate: platform not supported
Events
Backfill: not offered — platform no endpoint.
Item schema
What list and get return and what events carry as data.
| Field | Type | Required | Description |
|---|---|---|---|
containerId | string | yes | 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. |
target | object | yes | The 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. |
references | object[] | no | |
text | string | yes | Caption/body text for content. |
author | object | no | Platform actor reference for observed content. |
ownerAuthored | boolean | no | Whether the Profile's own account wrote it. Absent when Koil cannot tell, which does not mean someone else did. |
attachments | unknown | unknown | unknown[] | no | |
hidden | boolean | no | Whether the account hid the comment from the public. Absent when the platform did not say. |
engagement | object | no | Platform-reported engagement counts. |
permalink | string (uri) | no | The thing's URL on the platform, for display and linking only, never as a key. It may point at something private or expired. |
publishedAt | string (date-time) | no | When the platform published it. |
updatedAt | string (date-time) | no | When the platform last updated it. |
externalId | string | yes | Platform-owned content identifier. |
platformRaw | unknown | no | Optional platform-native payload included only for transient delivery/debug use. |
kind | "instagram.media.comments" | yes | The 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.
| Field | Type | Required | Description |
|---|---|---|---|
profileId | string | yes | Koil Profile associated with the operation. |
externalId | string | yes | The mention's id: the comment id for a comment mention, the media id for a caption mention. |
variant | "post" | "comment" | yes | The mention's variant, as its event names it. |
includePlatformRaw | boolean | no | Whether 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.
| Field | Type | Required | Description |
|---|---|---|---|
target | object | yes | The mention to reply to. |
containerId | string | no | For a comment mention, the media it is on, as the mention's containerId names it; omitted for a caption mention. |
text | string | yes | Caption/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 endpointresolve_attachment: not applicableupdate: platform not supportedperform_action: platform not supporteddelete: platform not supported
Events
Backfill: not offered — platform no endpoint.
Item schema
What list and get return and what events carry as data.
| Field | Type | Required | Description |
|---|---|---|---|
variant | "post" | "comment" | yes | Whether the mentioning item is a post (identified by the post itself) or a comment (with the post it is on as containerId). |
containerId | string | no | 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. |
text | string | no | Caption/body text for content. |
author | object | no | Platform actor reference for observed content. |
permalink | string (uri) | no | The thing's URL on the platform, for display and linking only, never as a key. It may point at something private or expired. |
publishedAt | string (date-time) | no | When the platform published it. |
externalId | string | yes | Platform-owned content identifier. |
platformRaw | unknown | no | Optional platform-native payload included only for transient delivery/debug use. |
kind | "instagram.media.mentions" | yes | The collection that delivered this item. |
instagram.stories.posts
The account's live stories.
list
List the Instagram profile's live stories.
| Field | Type | Required | Description |
|---|---|---|---|
profileId | string | yes | Koil Profile associated with the operation. |
cursor | string | no | Opaque cursor for fetching the next result page. |
limit | integer | no | Maximum number of items to return. |
includePlatformRaw | boolean | no | Whether 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.
| Field | Type | Required | Description |
|---|---|---|---|
profileId | string | yes | Koil Profile associated with the operation. |
externalId | string | yes | |
includePlatformRaw | boolean | no | Whether 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.
| Field | Type | Required | Description |
|---|---|---|---|
media | object | 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.
| Media | Copied as is | Otherwise converted | Refused |
|---|---|---|---|
| Image | JPEG; at most 1440 px wide | re-encoded to JPEG; downscaled to fit | over 8 MB once staged |
| Video | MP4/MOV, H.264 or HEVC; at most 1920 px wide; at most 60 fps | re-encoded to H.264 in MP4; downscaled to fit; frame rate lowered | aspect ratio outside 1:10 to 10:1; longer than 60 s |
delete
Delete one of the account's stories.
| Field | Type | Required | Description |
|---|---|---|---|
profileId | string | yes | Koil Profile associated with the operation. |
externalId | string | yes |
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 applicableupdate: platform not supportedperform_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.
| Field | Type | Required | Description |
|---|---|---|---|
references | object[] | no | |
text | string | no | Caption/body text for content. |
media | object[] | no | |
engagement | object | no | Platform-reported engagement counts. |
permalink | string (uri) | no | The thing's URL on the platform, for display and linking only, never as a key. It may point at something private or expired. |
publishedAt | string (date-time) | no | When the platform published it. |
externalId | string | yes | Platform-owned content identifier. |
platformRaw | unknown | no | Optional platform-native payload included only for transient delivery/debug use. |
kind | "instagram.stories.posts" | yes | The 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.
| Field | Type | Required | Description |
|---|---|---|---|
profileId | string | yes | Koil Profile associated with the operation. |
containerId | string | yes | The conversation: the counterpart's IGSID or PSID, as a message's containerId names it. |
cursor | string | no | Opaque cursor for fetching the next result page. |
limit | integer | no | Maximum number of items to return. |
includePlatformRaw | boolean | no | Whether 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.
| Field | Type | Required | Description |
|---|---|---|---|
profileId | string | yes | Koil Profile associated with the operation. |
externalId | string | yes | |
includePlatformRaw | boolean | no | Whether 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.
| Field | Type | Required | Description |
|---|---|---|---|
profileId | string | yes | Koil Profile associated with the operation. |
externalId | string | yes | The item that carries the file. |
attachmentExternalId | string | yes | The 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.
| Field | Type | Required | Description |
|---|---|---|---|
containerId | string | yes | The conversation to send into, as a message's containerId names it: the counterpart's IGSID or PSID. |
text | string | no | The message text; up to 640 characters with buttons. |
attachments | object | object[] | no | One image, video, audio file, or document, sent without text. Staged, then fetched by Meta from a URL Koil signs. |
quickReplies | object[] | no | Up to 13 replies offered under the text, which disappear once the person answers. Not with buttons. |
buttons | object | object[] | no | One 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.
| Media | Copied as is | Otherwise converted | Refused |
|---|---|---|---|
| Image | JPEG or PNG | re-encoded to JPEG | over 8 MB once staged |
| Video | MP4/MOV, H.264 | re-encoded to H.264 in MP4 | over 25 MB once staged |
| Audio | AAC or M4A | — | any other format; over 25 MB |
| Document | — | any other format; over 25 MB |
Not offered
update: platform not supportedperform_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.
| Field | Type | Required | Description |
|---|---|---|---|
containerId | string | yes | The 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. |
target | unknown | unknown | no | The 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. |
references | object[] | no | |
text | string | no | Caption/body text for content. |
author | object | no | Platform actor reference for observed content. |
ownerAuthored | boolean | no | Whether the Profile's own account wrote it. Absent when Koil cannot tell, which does not mean someone else did. |
attachments | unknown | unknown | unknown[] | no | |
choice | object | no | The 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. |
publishedAt | string (date-time) | no | When the platform published it. |
externalId | string | yes | Platform-owned content identifier. |
platformRaw | unknown | no | Optional platform-native payload included only for transient delivery/debug use. |
kind | "instagram.dm.messages" | yes | The 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.
| Field | Type | Required | Description |
|---|---|---|---|
profileId | string | yes | Koil Profile associated with the operation. |
targetId | string | yes | The message whose reactions to list, as its externalId names it. |
includePlatformRaw | boolean | no | Whether 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.
| Field | Type | Required | Description |
|---|---|---|---|
profileId | string | yes | Koil Profile associated with the operation. |
externalId | string | yes | |
includePlatformRaw | boolean | no | Whether 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.
| Field | Type | Required | Description |
|---|---|---|---|
containerId | string | yes | The conversation of the message: the counterpart's IGSID or PSID, as the message's containerId names it. |
target | object | yes | The message to react to. |
emoji | string | yes | The 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.
| Field | Type | Required | Description |
|---|---|---|---|
profileId | string | yes | Koil Profile associated with the operation. |
containerId | string | yes | The conversation of the message: the counterpart's IGSID or PSID, as the message's containerId names it. |
externalId | string | yes | The 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 applicableupdate: 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.
| Field | Type | Required | Description |
|---|---|---|---|
target | object | yes | The message reacted to. |
containerId | string | yes | The conversation of the message reacted to: the counterpart's IGSID or PSID, as its messages' containerId names it. |
emoji | string | no | The emoji reacted with, as the platform sent it. |
author | object | yes | The account that reacted: the counterpart, or the account itself. |
ownerAuthored | boolean | no | Whether the Profile's own account wrote it. Absent when Koil cannot tell, which does not mean someone else did. |
publishedAt | string (date-time) | no | When the platform published it. |
externalId | string | yes | Platform-owned content identifier. |
platformRaw | unknown | no | Optional platform-native payload included only for transient delivery/debug use. |
kind | "instagram.dm.reactions" | yes | The 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.
| Field | Type | Required | Description |
|---|---|---|---|
profileId | string | yes | Koil Profile associated with the operation. |
cursor | string | no | Opaque cursor for fetching the next result page. |
limit | integer | no | Maximum number of items to return. |
includePlatformRaw | boolean | no | Whether 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.
| Field | Type | Required | Description |
|---|---|---|---|
profileId | string | yes | Koil Profile associated with the operation. |
externalId | string | yes | |
includePlatformRaw | boolean | no | Whether 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.
| Field | Type | Required | Description |
|---|---|---|---|
profileId | string | yes | Koil Profile associated with the operation. |
externalId | string | yes | The conversation, as its externalId names it: the counterpart's IGSID or PSID. |
action | "seen" | "typing_on" | "typing_off" | yes | 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). |
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 applicablepublish: not applicable — A conversation starts with its first message.update: platform not supporteddelete: 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.
| Field | Type | Required | Description |
|---|---|---|---|
counterpart | object | no | The person the account is talking to in a 1:1 conversation. A group chat has none. |
messageRequest | boolean | no | Whether 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. |
updatedAt | string (date-time) | no | When the conversation last changed, as the platform reports it. |
externalId | string | yes | The counterpart's IGSID or PSID: the containerId its messages carry. |
graphConversationId | string | no | Graph's own id for the conversation, for calls to Graph that take it. Koil's inputs take externalId. |
platformRaw | unknown | no | Optional platform-native payload included only for transient delivery/debug use. |
kind | "instagram.dm.conversations" | yes | The 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.
GET /v1/profiles/{profileId}/settings/instagram.dm_welcome: Get an Instagram account's ice breakers.PATCH /v1/profiles/{profileId}/settings/instagram.dm_welcome: Set or clear an Instagram account's ice breakers.nullclears them. Meta allows the linked Page 10 Messenger Profile calls in 10 minutes, and an update spends up to three.
| Field | Type | Required | Description |
|---|---|---|---|
iceBreakers | object[] | no | Up to four questions per locale, offered to a person who has not written yet; one entry must be the default locale. |