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_metadataa 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 deletiondeleted, and a hide or unhidemoderatedwith the resultinghiddenstate. - 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:
updatedeach time a person sets one, the first included, since Meta does not say which is first, anddeletedwhen they remove it.
| Collection | Operations | Events | Backfill |
|---|---|---|---|
facebook.media.posts | list, get, publish, update, perform_action | created, updated, deleted | yes |
facebook.media.comments | list, get, publish, update, perform_action, delete | created, updated, deleted, moderated | no |
facebook.media.mentions | list, perform_action | created | yes |
facebook.media.reactions | publish, delete | updated, deleted | no |
facebook.stories.posts | list, publish | created | yes |
facebook.dm.messages | list, get, resolve_attachment, publish | created | yes |
facebook.dm.reactions | publish, delete | updated, deleted | no |
facebook.dm.conversations | list, get, perform_action | none | no |
facebook.media.posts
The Page's posts.
list
List published Facebook Page posts.
| 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 Facebook Page post 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 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"
| Field | Type | Required | Description |
|---|---|---|---|
text | string | no | Caption/body text for content. |
link | string (uri) | no | A URL to attach as a link post; not combinable with media. |
media | object | 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"
| Field | Type | Required | Description |
|---|---|---|---|
text | string | no | Caption/body text for content. |
media | object | 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.
| Variant | Media | Copied as is | Otherwise converted | Refused |
|---|---|---|---|---|
feed | Image | JPEG, PNG or GIF; within 2048×2048 | re-encoded to JPEG; downscaled to fit | over 10 MB once staged |
feed | Video (on its own) | MP4/MOV or MKV/WebM, H.264, HEVC, VP9 or AV1 | re-encoded to H.264 in MP4 | shorter than 1 s; longer than 20 min; over 1 GB once staged |
reel | Video | MP4/MOV, H.264, HEVC, VP9 or AV1; at most 60 fps | re-encoded to H.264 in MP4; frame rate lowered | smaller 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.
| Field | Type | Required | Description |
|---|---|---|---|
profileId | string | yes | Koil Profile associated with the operation. |
externalId | string | yes | |
text | string | yes | Caption/body text for content. |
includePlatformRaw | boolean | no | Whether 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.
| 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
}Not offered
resolve_attachment: not applicabledelete: platform not supported — Meta restricts deleting Page posts through the API to select developers.perform_actionlike: not applicable — The Page likes a post by publishing to facebook.media.reactions and removes the like by deleting that reaction.perform_actionunlike: not applicable — The Page likes a post by publishing to facebook.media.reactions and removes the like by deleting that reaction.
Events
content.facebook.media.posts.createdcontent.facebook.media.posts.updatedcontent.facebook.media.posts.deleted
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" | yes | |
platformRaw | unknown | no | Optional platform-native payload included only for transient delivery/debug use. |
kind | "facebook.media.posts" | yes | The 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.
| 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. |
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."
},
"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.
| 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 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.
| 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 | no | Caption/body text for content. |
attachments | object | object[] | no | One 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.
| Media | Copied as is | Otherwise converted | Refused |
|---|---|---|---|
| Image | JPEG, PNG or GIF; within 2048×2048 | re-encoded to JPEG; downscaled to fit | over 10 MB once staged |
update
Edit the text of a comment the Page wrote.
| Field | Type | Required | Description |
|---|---|---|---|
profileId | string | yes | Koil Profile associated with the operation. |
externalId | string | yes | |
text | string | yes | Caption/body text for content. |
includePlatformRaw | boolean | no | Whether 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.
| 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 a Facebook Page post.
| 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_actionlike: not applicable — The Page likes a comment by publishing to facebook.media.reactions and removes the like by deleting that reaction.perform_actionunlike: not applicable — The Page likes a comment by publishing to facebook.media.reactions and removes the like by deleting that reaction.
Events
content.facebook.media.comments.createdcontent.facebook.media.comments.updatedcontent.facebook.media.comments.deletedcontent.facebook.media.comments.moderated
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 | |
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 | "facebook.media.comments" | yes | The 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.
| 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
}perform_action
Like the mentioning post or comment as the Facebook Page, or remove the Page's like. Answers with the state applied.
| Field | Type | Required | Description |
|---|---|---|---|
profileId | string | yes | Koil Profile associated with the operation. |
externalId | string | yes | |
action | "like" | "unlike" | yes | What 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 applicablepublish: not applicable — A mention is written by someone else, never by the Page.update: platform not supporteddelete: 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 |
|---|---|---|---|
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 | "facebook.media.mentions" | yes | The 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.
| 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. |
reactionType | "like" | yes | Only 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.
| Field | Type | Required | Description |
|---|---|---|---|
profileId | string | yes | Koil Profile associated with the operation. |
externalId | string | yes | The 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 applicableupdate: 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.
| Field | Type | Required | Description |
|---|---|---|---|
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. |
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. |
emoji | string | no | The emoji reacted with, as the platform sent it. |
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. |
publishedAt | string (date-time) | no | When the platform published it. |
externalId | string | yes | Platform-owned content identifier. |
reactionType | "like" | "love" | "care" | "haha" | "wow" | "sad" | "angry" | "other" | yes | like, love, care, haha, wow, sad or angry; other is a type Facebook added that Koil does not model. |
platformRaw | unknown | no | Optional platform-native payload included only for transient delivery/debug use. |
kind | "facebook.media.reactions" | yes | The collection that delivered this item. |
facebook.stories.posts
The Page's stories.
list
List the Page's 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
}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.
| 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, PNG or GIF; within 2048×2048 | re-encoded to JPEG; downscaled to fit | over 10 MB once staged |
| Video | MP4/MOV, H.264, HEVC, VP9 or AV1; at most 60 fps | re-encoded to H.264 in MP4; frame rate lowered | smaller than 540×960; longer than 60 s |
Not offered
get: platform no endpointresolve_attachment: not applicableupdate: platform not supportedperform_action: platform not supporteddelete: 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 | "photo" | "video" | "other" | yes | The story's media_type. other is a type Meta added that Koil does not model yet. |
status | "published" | "archived" | "other" | yes | archived once the story leaves the Page. other is a state Meta added that Koil does not model yet. |
mediaExternalId | string | no | Meta's id for the story's photo or video. |
platformRaw | unknown | no | Optional platform-native payload included only for transient delivery/debug use. |
kind | "facebook.stories.posts" | yes | The 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.
| 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 Messenger message 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 a Messenger message 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 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.
| 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 | 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."
},
{
"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.
| Media | Copied as is | Otherwise converted | Refused |
|---|---|---|---|
| Image | JPEG, PNG or GIF | 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 | MP3, AAC or M4A | — | any other format; over 25 MB |
| Document | PDF, DOC, DOCX, XLS, XLSX, PPT or PPTX | — | 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 | "facebook.dm.messages" | yes | The 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.
| 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": [
"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.
| 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
list: platform no endpointget: platform no endpointresolve_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. |
reactionType | "smile" | "angry" | "sad" | "wow" | "love" | "like" | "dislike" | "other" | no | Messenger's name for the reaction, beside its emoji; other is an emoji outside Messenger's named set. |
platformRaw | unknown | no | Optional platform-native payload included only for transient delivery/debug use. |
kind | "facebook.dm.reactions" | yes | The 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.
| Field | Type | Required | Description |
|---|---|---|---|
profileId | string | yes | Koil Profile associated with the operation. |
messageRequest | boolean | no | true lists message requests, false the inbox. Omitted, Meta's default folder is listed and items do not say which they are. |
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
},
"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.
| 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 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.
| 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 | "facebook.dm.conversations" | yes | The 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.
GET /v1/profiles/{profileId}/settings/facebook.dm_welcome: Get a Facebook Page's Messenger greeting and ice breakers.PATCH /v1/profiles/{profileId}/settings/facebook.dm_welcome: Set or clear a Facebook Page's Messenger greeting and ice breakers. A field left out keeps its value, andnullclears it. Meta allows a Page 10 Messenger Profile calls in 10 minutes, and an update spends up to three.
| Field | Type | Required | Description |
|---|---|---|---|
greeting | object[] | no | The 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. |
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. |