PlatformsFacebook

Facebook

Facebook Pages through your Meta app with Facebook Login; every operation acts with the Page's own access token, which Koil obtains when the profile is connected.

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

  • Without pages_manage_metadata a Page still connects, but it is never subscribed to webhooks, so no events arrive for it.
  • Comments and posts emit their whole lifecycle: an edit is updated, a deletion deleted, and a hide or unhide moderated with the resulting hidden state.
  • Reactions arrive only as events, since Meta withholds other accounts' reactions from its reads; the Page itself can only like, and remove its own like.
  • DM reactions arrive only 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.
CollectionOperationsEventsBackfill
facebook.media.postslist, get, publish, update, perform_actioncreated, updated, deletedyes
facebook.media.commentslist, get, publish, update, perform_action, deletecreated, updated, deleted, moderatedno
facebook.media.mentionslist, perform_actioncreatedyes
facebook.media.reactionspublish, deleteupdated, deletedno
facebook.stories.postslist, publishcreatedyes
facebook.dm.messageslist, get, resolve_attachment, publishcreatedyes
facebook.dm.reactionspublish, deleteupdated, deletedno
facebook.dm.conversationslist, get, perform_actionnoneno

facebook.media.posts

The Page's posts.

list

List published Facebook Page posts.

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 Facebook Page post 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 a Facebook Page post: text, a link, photos, a video, or a reel.

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

variant: "feed"

FieldTypeRequiredDescription
textstringnoCaption/body text for content.
linkstring (uri)noA URL to attach as a link post; not combinable with media.
mediaobject | object[]no
JSON Schema
{
  "type": "object",
  "required": [],
  "properties": {
    "text": {
      "type": "string",
      "description": "Caption/body text for content."
    },
    "link": {
      "type": "string",
      "minLength": 1,
      "format": "uri",
      "description": "A URL to attach as a link post; not combinable with media."
    },
    "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
    }
  },
  "additionalProperties": false,
  "anyOf": [
    {
      "required": [
        "text"
      ]
    },
    {
      "required": [
        "link"
      ]
    },
    {
      "required": [
        "media"
      ]
    }
  ],
  "dependentSchemas": {
    "media": {
      "properties": {
        "link": false
      }
    }
  }
}

variant: "reel"

FieldTypeRequiredDescription
textstringnoCaption/body text for content.
mediaobject | object[]yes
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
    }
  },
  "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, PNG or GIF; within 2048×2048re-encoded to JPEG; downscaled to fitover 10 MB once staged
feedVideo (on its own)MP4/MOV or MKV/WebM, H.264, HEVC, VP9 or AV1re-encoded to H.264 in MP4shorter than 1 s; longer than 20 min; over 1 GB once staged
reelVideoMP4/MOV, H.264, HEVC, VP9 or AV1; at most 60 fpsre-encoded to H.264 in MP4; frame rate loweredsmaller than 540×960; aspect ratio outside 9:16 to 16:9; shorter than 3 s; longer than 90 s; under 24 fps

update

Edit the text of a Facebook Page post published through this Meta app. Meta lets an app edit only the posts it published, so a post made on Facebook or through another app is refused as a validation error.

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

perform_action

Hide a Facebook Page post from the Page's timeline, or unhide it. A hidden post stays reachable by link and through shares. 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
}

Not offered

  • resolve_attachment: not applicable
  • delete: platform not supported — Meta restricts deleting Page posts through the API to select developers.
  • perform_action like: not applicable — The Page likes a post by publishing to facebook.media.reactions and removes the like by deleting that reaction.
  • perform_action unlike: not applicable — The Page likes a post by publishing to facebook.media.reactions and removes the like by deleting that reaction.

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"yes
platformRawunknownnoOptional platform-native payload included only for transient delivery/debug use.
kind"facebook.media.posts"yesThe collection that delivered this item.

facebook.media.comments

Comments on the Page's posts, replies included.

list

List comments on one Facebook Page post, replies included.

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.
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."
    },
    "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 Facebook Page 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 a Facebook Page comment, as a reply to a comment or a top-level comment on a post: text, one photo, or both.

Submit through POST /v1/publish-requests with collection: "facebook.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.
textstringnoCaption/body text for content.
attachmentsobject | object[]noOne image, posted as a photo comment with text beside it. Staged, then fetched by Meta from a URL Koil signs.
JSON Schema
{
  "type": "object",
  "required": [
    "target"
  ],
  "properties": {
    "target": {
      "type": "object",
      "required": [
        "kind",
        "externalId"
      ],
      "properties": {
        "kind": {
          "enum": [
            "facebook.media.comments",
            "facebook.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."
    },
    "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
              }
            },
            "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,
      "description": "One image, posted as a photo comment with `text` beside it. Staged, then fetched by Meta from a URL Koil signs."
    }
  },
  "additionalProperties": false,
  "anyOf": [
    {
      "required": [
        "text"
      ]
    },
    {
      "required": [
        "attachments"
      ]
    }
  ]
}

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, PNG or GIF; within 2048×2048re-encoded to JPEG; downscaled to fitover 10 MB once staged

update

Edit the text of a comment the Page wrote.

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

perform_action

Hide or unhide a comment on a Facebook Page post. 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 a Facebook Page post.

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 like: not applicable — The Page likes a comment by publishing to facebook.media.reactions and removes the like by deleting that reaction.
  • perform_action unlike: not applicable — The Page likes a comment by publishing to facebook.media.reactions and removes the like by deleting that reaction.

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
hiddenbooleanno
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"facebook.media.comments"yesThe collection that delivered this item.

facebook.media.mentions

Mentions of the Page in other posts and comments. Every mention arrives as an event; Meta lists posts that tag the Page, but not mentions in comments.

list

List public posts that tag the Facebook Page. Covers post mentions only: Meta lists no mentions in comments, which arrive only as events.

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
}

perform_action

Like the mentioning post or comment as the Facebook Page, or remove the Page's like. Answers with the state applied.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
externalIdstringyes
action"like" | "unlike"yesWhat to do with the item: like (like it as the profile), unlike (remove the profile's like).
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": [
        "like",
        "unlike"
      ],
      "description": "What to do with the item: `like` (like it as the profile), `unlike` (remove the profile's like).",
      "x-koil-narrows": "ContentAction"
    }
  },
  "additionalProperties": false
}

Not offered

  • get: platform no endpoint — A mention's id does not say whether it is a post or a comment, and Graph's comment node does not name the post it is on, so no read returns what the mention event carries.
  • resolve_attachment: not applicable
  • publish: not applicable — A mention is written by someone else, never by the Page.
  • update: platform not supported
  • 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
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"facebook.media.mentions"yesThe collection that delivered this item.

facebook.media.reactions

Reactions on the Page's posts and comments. Delivered as events only: Meta withholds other accounts' reactions from its read endpoints.

publish

Like a post or a comment as the Page, the only reaction Graph lets a Page write.

Submit through POST /v1/publish-requests with collection: "facebook.media.reactions". 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.
reactionType"like"yesOnly like: Graph lets a Page write no other reaction.
JSON Schema
{
  "type": "object",
  "required": [
    "target",
    "reactionType"
  ],
  "properties": {
    "target": {
      "type": "object",
      "required": [
        "kind",
        "externalId"
      ],
      "properties": {
        "kind": {
          "enum": [
            "facebook.media.posts",
            "facebook.media.comments"
          ]
        },
        "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."
    },
    "reactionType": {
      "enum": [
        "like"
      ],
      "description": "Only `like`: Graph lets a Page write no other reaction."
    }
  },
  "additionalProperties": false
}

delete

Remove the Page's own like.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
externalIdstringyesThe Page's own reaction, {pageId}:{targetId}.
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,
      "description": "The Page's own reaction, {pageId}:{targetId}."
    }
  },
  "additionalProperties": false
}

Not offered

  • list: platform no endpoint — Graph's reactions edge returns only the caller's own reactions; other users' and Pages' are withheld for privacy.
  • get: platform no endpoint — A Facebook reaction has no id of its own to read it by.
  • resolve_attachment: not applicable
  • update: not applicable — A Page can only like, so there is no other type to change to.
  • 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 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.
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.
emojistringnoThe emoji reacted with, as the platform sent it.
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.
publishedAtstring (date-time)noWhen the platform published it.
externalIdstringyesPlatform-owned content identifier.
reactionType"like" | "love" | "care" | "haha" | "wow" | "sad" | "angry" | "other"yeslike, love, care, haha, wow, sad or angry; other is a type Facebook added that Koil does not model.
platformRawunknownnoOptional platform-native payload included only for transient delivery/debug use.
kind"facebook.media.reactions"yesThe collection that delivered this item.

facebook.stories.posts

The Page's stories.

list

List the Page's 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
}

publish

Publish a Facebook Page story from one photo or video.

Submit through POST /v1/publish-requests with collection: "facebook.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, PNG or GIF; within 2048×2048re-encoded to JPEG; downscaled to fitover 10 MB once staged
VideoMP4/MOV, H.264, HEVC, VP9 or AV1; at most 60 fpsre-encoded to H.264 in MP4; frame rate loweredsmaller than 540×960; longer than 60 s

Not offered

  • get: platform no endpoint
  • resolve_attachment: not applicable
  • update: platform not supported
  • perform_action: platform not supported
  • delete: 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"photo" | "video" | "other"yesThe story's media_type. other is a type Meta added that Koil does not model yet.
status"published" | "archived" | "other"yesarchived once the story leaves the Page. other is a state Meta added that Koil does not model yet.
mediaExternalIdstringnoMeta's id for the story's photo or video.
platformRawunknownnoOptional platform-native payload included only for transient delivery/debug use.
kind"facebook.stories.posts"yesThe collection that delivered this item.

facebook.dm.messages

Messages in one Messenger conversation.

list

List the messages of the Page's Messenger 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 Messenger message 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 a Messenger message 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 a Messenger message from the Page to a recipient: text, optionally with quick replies; text with up to three reply, link, or call buttons; or one image, video, audio file, or document.

Submit through POST /v1/publish-requests with collection: "facebook.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 | 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."
          },
          {
            "type": "object",
            "required": [
              "type",
              "title",
              "phoneNumber"
            ],
            "properties": {
              "type": {
                "type": "string",
                "const": "phone"
              },
              "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."
              },
              "phoneNumber": {
                "type": "string",
                "pattern": "^\\+[1-9][0-9]{1,14}$",
                "description": "The number the button dials, in E.164 with its `+`, such as `+16505551234`."
              }
            },
            "additionalProperties": false,
            "description": "A button that calls a phone number. 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, PNG or GIFre-encoded to JPEGover 8 MB once staged
VideoMP4/MOV, H.264re-encoded to H.264 in MP4over 25 MB once staged
AudioMP3, AAC or M4A—any other format; over 25 MB
DocumentPDF, DOC, DOCX, XLS, XLSX, PPT or PPTX—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"facebook.dm.messages"yesThe collection that delivered this item.

facebook.dm.reactions

Reactions to messages in one Messenger conversation, one per person per message. Delivered as events only: Meta offers no endpoint that lists them, and does not report the Page's own.

publish

React to a message in a Messenger conversation as the Page, replacing any reaction it set on that message.

Submit through POST /v1/publish-requests with collection: "facebook.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": [
            "facebook.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 Page's reaction to a Messenger message.

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

  • list: platform no endpoint
  • get: platform no endpoint
  • 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.
reactionType"smile" | "angry" | "sad" | "wow" | "love" | "like" | "dislike" | "other"noMessenger's name for the reaction, beside its emoji; other is an emoji outside Messenger's named set.
platformRawunknownnoOptional platform-native payload included only for transient delivery/debug use.
kind"facebook.dm.reactions"yesThe collection that delivered this item.

facebook.dm.conversations

The Page's Messenger conversations, each keyed by the person it is with.

list

List the Page's Messenger conversations: its inbox, or its message requests. A message request inactive for 30 days is not listed.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
messageRequestbooleannotrue lists message requests, false the inbox. Omitted, Meta's default folder is listed and items do not say which they are.
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
    },
    "messageRequest": {
      "type": "boolean",
      "description": "true lists message requests, false the inbox. Omitted, Meta's default folder is listed and items do not say which they are."
    },
    "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 Page's Messenger conversation with one person, by their PSID.

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 Page's Messenger conversation as seen, or show or stop showing that the Page is typing. A typing indicator turns itself off after 20 seconds or at the Page'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"facebook.dm.conversations"yesThe collection that delivered this item.

facebook.dm_welcome

What Messenger shows a person before they first write to the Page: its greeting and ice breakers. An account setting, not a collection: it has no items, events or backfill.

FieldTypeRequiredDescription
greetingobject[]noThe text on the welcome screen of a person who has not written to the Page yet, per locale; one entry must be the default locale.
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