# Koil Docs > Koil is social infrastructure for SaaS products that serve brands: one API to receive the comments, DMs, mentions, and reviews across your customers' accounts as a single event stream, and to reply, moderate, and publish, all on your own apps. ## Docs - [Overview](https://docs.koil.co/index.md): Koil is social infrastructure for SaaS products that serve brands: one API to receive the comments, DMs, mentions, and reviews across your customers' accounts as a single event stream, and to reply, moderate, and publish, all on your own apps. - [Quickstart](https://docs.koil.co/quickstart.md): Connect a sandbox profile, publish a comment, and receive its events — in sandbox mode, with no app. - [Sandbox](https://docs.koil.co/sandbox.md): Build and verify a full Koil integration with sandbox keys and magic connections, before any app is approved. - [Bring your own app](https://docs.koil.co/byo-apps.md): Koil runs every live connection through your own OAuth app — what you need, how to set it up, and how sandbox mode lets you integrate before app review completes. - [App Review playbook](https://docs.koil.co/app-review.md): What to request on your own app, per Koil operation, and what each platform's review takes. - [Build with a coding agent](https://docs.koil.co/coding-agents.md): Point Claude Code, Cursor, Codex, or another coding agent at Koil's machine-readable docs and OpenAPI document, and let it integrate end to end in sandbox mode. - [API overview](https://docs.koil.co/api.md): How the Koil API is shaped — resources, ids, content addressing — and where each part is documented. - [Events reference](https://docs.koil.co/events.md): Every event topic Koil delivers to Event Destinations, with the JSON Schema of each delivery envelope. ## Guides - [Guides](https://docs.koil.co/guides.md): Step-by-step guides for connecting platform accounts, publishing content, receiving events, and replying to platform content. - [Connect platform accounts](https://docs.koil.co/guides/connect-platform-accounts.md): Understand the Koil connection flow before publishing content or subscribing to events. - [Migrate existing users](https://docs.koil.co/guides/migrate-existing-users.md): Move users you already serve through your own app onto Koil, a cohort at a time, without anyone re-authorizing. - [Publish content](https://docs.koil.co/guides/publishing.md): Create posts and other platform content with Koil Publish Requests. - [Subscribe to events](https://docs.koil.co/guides/subscribe-to-events.md): Receive platform content and Koil lifecycle events at your own endpoint, queue, or stream. - [Verify webhook deliveries](https://docs.koil.co/guides/verify-webhooks.md): Check that a webhook delivery came from Koil before trusting it, and handle retries without duplicates. - [Reply to content](https://docs.koil.co/guides/reply-to-content.md): Send a platform reply from a Koil content event. - [Backfill history](https://docs.koil.co/guides/backfill.md): Re-deliver a collection's history for a Profile as ordinary content events. ## Concepts - [Authentication](https://docs.koil.co/concepts/authentication.md): API keys, modes, Organizations, and how each request finds the platform credential it runs with. - [Content](https://docs.koil.co/concepts/content.md): How platform content is named and related — collections, kind, containers, targets, references, and pointers — and how it is created and changed. - [Versioning](https://docs.koil.co/concepts/versioning.md): How dated API versions pin request, response, and event shapes, what Koil changes within a version, and how long old versions stay supported. - [Idempotency](https://docs.koil.co/concepts/idempotency.md): Retry writes safely with Idempotency-Key. - [Errors](https://docs.koil.co/concepts/errors.md): The error envelope, every public error code, and how to handle each. - [Rate limits](https://docs.koil.co/concepts/rate-limits.md): Koil's per-Organization and per-Profile request budgets, and how they differ from platform limits. - [Pagination](https://docs.koil.co/concepts/pagination.md): How list endpoints page, for Koil resources and platform content alike. - [Data and storage](https://docs.koil.co/concepts/data-and-storage.md): What Koil stores, what it only passes through, and for how long. ## API endpoints - [List Instagram profile media items](https://docs.koil.co/openapi/content-instagram/v1-profiles-profileid-content-instagram-media-posts-get.md) - [Get one Instagram media item by platform id](https://docs.koil.co/openapi/content-instagram/v1-profiles-profileid-content-instagram-media-posts-externalid-get.md) - [Turn comments on or off on a feed post or reel, the only change Graph allows](https://docs.koil.co/openapi/content-instagram/v1-profiles-profileid-content-instagram-media-posts-externalid-patch.md): a caption cannot be edited. - [Delete a feed post or reel; a carousel is deleted whole](https://docs.koil.co/openapi/content-instagram/v1-profiles-profileid-content-instagram-media-posts-externalid-delete.md) - [List the top-level comments on one media item, or the replies to one of them](https://docs.koil.co/openapi/content-instagram/v1-profiles-profileid-content-instagram-media-comments-get.md) - [Get one Instagram media comment by platform id](https://docs.koil.co/openapi/content-instagram/v1-profiles-profileid-content-instagram-media-comments-externalid-get.md) - [Delete a comment on the account's media, whoever wrote it](https://docs.koil.co/openapi/content-instagram/v1-profiles-profileid-content-instagram-media-comments-externalid-delete.md) - [Hide or unhide an Instagram media comment](https://docs.koil.co/openapi/content-instagram/v1-profiles-profileid-content-instagram-media-comments-externalid-actions-post.md): Answers with the state applied. - [Get one mention of the Instagram account by the id and variant its event carries, with the mentioning caption or comment text](https://docs.koil.co/openapi/content-instagram/v1-profiles-profileid-content-instagram-media-mentions-externalid-get.md): Meta does not name its author's account. - [List the Instagram profile's live stories](https://docs.koil.co/openapi/content-instagram/v1-profiles-profileid-content-instagram-stories-posts-get.md) - [Get one Instagram story by platform id](https://docs.koil.co/openapi/content-instagram/v1-profiles-profileid-content-instagram-stories-posts-externalid-get.md) - [Delete one of the account's stories](https://docs.koil.co/openapi/content-instagram/v1-profiles-profileid-content-instagram-stories-posts-externalid-delete.md) - [List the messages of the account's Instagram DM conversation with one person](https://docs.koil.co/openapi/content-instagram/v1-profiles-profileid-content-instagram-dm-messages-get.md) - [Get one Instagram DM by id, with fresh URLs for its files](https://docs.koil.co/openapi/content-instagram/v1-profiles-profileid-content-instagram-dm-messages-externalid-get.md): Meta serves only a conversation's 20 most recent messages. - [Answer a fresh URL for a file an Instagram DM carries, by the id a read reported](https://docs.koil.co/openapi/content-instagram/v1-profiles-profileid-content-instagram-dm-messages-externalid-attachments-attachmentexternalid-get.md) - [List the reactions to one Instagram DM, the account's own included](https://docs.koil.co/openapi/content-instagram/v1-profiles-profileid-content-instagram-dm-reactions-get.md): Meta reads only a conversation's 20 most recent messages. - [Get one person's reaction to an Instagram DM, by `{reactor id}:{message id}`](https://docs.koil.co/openapi/content-instagram/v1-profiles-profileid-content-instagram-dm-reactions-externalid-get.md): Meta reads only a conversation's 20 most recent messages. - [Remove the account's reaction to an Instagram DM](https://docs.koil.co/openapi/content-instagram/v1-profiles-profileid-content-instagram-dm-reactions-externalid-delete.md) - [List the account's Instagram DM conversations](https://docs.koil.co/openapi/content-instagram/v1-profiles-profileid-content-instagram-dm-conversations-get.md): Meta does not tell the inbox folders apart on Instagram, so message requests are listed with the rest and not marked; one inactive for 30 days is not listed. - [Get the account's Instagram DM conversation with one person, by their IGSID](https://docs.koil.co/openapi/content-instagram/v1-profiles-profileid-content-instagram-dm-conversations-externalid-get.md) - [Mark the person's messages in the account's Instagram DM conversation as seen, or show or stop showing that the account is typing](https://docs.koil.co/openapi/content-instagram/v1-profiles-profileid-content-instagram-dm-conversations-externalid-actions-post.md): A typing indicator turns itself off after 20 seconds or at the account's next message. - [Get an Instagram account's ice breakers](https://docs.koil.co/openapi/profile-settings-instagram/v1-profiles-profileid-settings-instagram-dm_welcome-get.md) - [Set or clear an Instagram account's ice breakers](https://docs.koil.co/openapi/profile-settings-instagram/v1-profiles-profileid-settings-instagram-dm_welcome-patch.md): `null` clears them. Meta allows the linked Page 10 Messenger Profile calls in 10 minutes, and an update spends up to three. - [List published Facebook Page posts](https://docs.koil.co/openapi/content-facebook/v1-profiles-profileid-content-facebook-media-posts-get.md) - [Get one Facebook Page post by platform id](https://docs.koil.co/openapi/content-facebook/v1-profiles-profileid-content-facebook-media-posts-externalid-get.md) - [Edit the text of a Facebook Page post published through this Meta app](https://docs.koil.co/openapi/content-facebook/v1-profiles-profileid-content-facebook-media-posts-externalid-patch.md): 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. - [Hide a Facebook Page post from the Page's timeline, or unhide it](https://docs.koil.co/openapi/content-facebook/v1-profiles-profileid-content-facebook-media-posts-externalid-actions-post.md): A hidden post stays reachable by link and through shares. Answers with the state applied. - [List comments on one Facebook Page post, replies included](https://docs.koil.co/openapi/content-facebook/v1-profiles-profileid-content-facebook-media-comments-get.md) - [Get one Facebook Page comment by platform id](https://docs.koil.co/openapi/content-facebook/v1-profiles-profileid-content-facebook-media-comments-externalid-get.md) - [Edit the text of a comment the Page wrote](https://docs.koil.co/openapi/content-facebook/v1-profiles-profileid-content-facebook-media-comments-externalid-patch.md) - [Delete a comment on a Facebook Page post](https://docs.koil.co/openapi/content-facebook/v1-profiles-profileid-content-facebook-media-comments-externalid-delete.md) - [Hide or unhide a comment on a Facebook Page post](https://docs.koil.co/openapi/content-facebook/v1-profiles-profileid-content-facebook-media-comments-externalid-actions-post.md): Answers with the state applied. - [List public posts that tag the Facebook Page](https://docs.koil.co/openapi/content-facebook/v1-profiles-profileid-content-facebook-media-mentions-get.md): Covers post mentions only: Meta lists no mentions in comments, which arrive only as events. - [Like the mentioning post or comment as the Facebook Page, or remove the Page's like](https://docs.koil.co/openapi/content-facebook/v1-profiles-profileid-content-facebook-media-mentions-externalid-actions-post.md): Answers with the state applied. - [Remove the Page's own like](https://docs.koil.co/openapi/content-facebook/v1-profiles-profileid-content-facebook-media-reactions-externalid-delete.md) - [List the Page's stories](https://docs.koil.co/openapi/content-facebook/v1-profiles-profileid-content-facebook-stories-posts-get.md) - [List the messages of the Page's Messenger conversation with one person](https://docs.koil.co/openapi/content-facebook/v1-profiles-profileid-content-facebook-dm-messages-get.md) - [Get one Messenger message by id, with fresh URLs for its files](https://docs.koil.co/openapi/content-facebook/v1-profiles-profileid-content-facebook-dm-messages-externalid-get.md): Meta serves only a conversation's 20 most recent messages. - [Answer a fresh URL for a file a Messenger message carries, by the id a read reported](https://docs.koil.co/openapi/content-facebook/v1-profiles-profileid-content-facebook-dm-messages-externalid-attachments-attachmentexternalid-get.md) - [Remove the Page's reaction to a Messenger message](https://docs.koil.co/openapi/content-facebook/v1-profiles-profileid-content-facebook-dm-reactions-externalid-delete.md) - [List the Page's Messenger conversations](https://docs.koil.co/openapi/content-facebook/v1-profiles-profileid-content-facebook-dm-conversations-get.md): its inbox, or its message requests. A message request inactive for 30 days is not listed. - [Get the Page's Messenger conversation with one person, by their PSID](https://docs.koil.co/openapi/content-facebook/v1-profiles-profileid-content-facebook-dm-conversations-externalid-get.md) - [Mark the person's messages in the Page's Messenger conversation as seen, or show or stop showing that the Page is typing](https://docs.koil.co/openapi/content-facebook/v1-profiles-profileid-content-facebook-dm-conversations-externalid-actions-post.md): A typing indicator turns itself off after 20 seconds or at the Page's next message. - [Get a Facebook Page's Messenger greeting and ice breakers](https://docs.koil.co/openapi/profile-settings-facebook/v1-profiles-profileid-settings-facebook-dm_welcome-get.md) - [Set or clear a Facebook Page's Messenger greeting and ice breakers](https://docs.koil.co/openapi/profile-settings-facebook/v1-profiles-profileid-settings-facebook-dm_welcome-patch.md): A field left out keeps its value, and `null` clears it. Meta allows a Page 10 Messenger Profile calls in 10 minutes, and an update spends up to three. - [Mark a message the person sent, and those before it, as read, showing them a read receipt; `typing_on` also shows that the business is typing, until it replies or for 25 seconds](https://docs.koil.co/openapi/content-whatsapp/v1-profiles-profileid-content-whatsapp-dm-messages-externalid-actions-post.md) - [Get a URL for a file a WhatsApp message carries](https://docs.koil.co/openapi/content-whatsapp/v1-profiles-profileid-content-whatsapp-dm-messages-externalid-attachments-attachmentexternalid-get.md): WhatsApp serves the file only to the business, so the URL is a Koil link that streams it from WhatsApp; it expires after five minutes. - [Remove the business number's own reaction](https://docs.koil.co/openapi/content-whatsapp/v1-profiles-profileid-content-whatsapp-dm-reactions-externalid-delete.md) - [Mark a message a participant sent as read, showing them a read receipt](https://docs.koil.co/openapi/content-whatsapp/v1-profiles-profileid-content-whatsapp-groups-messages-externalid-actions-post.md): Unlike in a 1:1 chat, WhatsApp marks only that message, not those before it. - [Get a URL for a file a WhatsApp group message carries](https://docs.koil.co/openapi/content-whatsapp/v1-profiles-profileid-content-whatsapp-groups-messages-externalid-attachments-attachmentexternalid-get.md): WhatsApp serves the file only to the business, so the URL is a Koil link that streams it from WhatsApp; it expires after five minutes. - [List the groups the business number is in now, with each group's subject and creation time](https://docs.koil.co/openapi/content-whatsapp/v1-profiles-profileid-content-whatsapp-groups-conversations-get.md): A group the number has left or deleted is not listed; `get` reads the rest of a group. - [Get one WhatsApp group by its id](https://docs.koil.co/openapi/content-whatsapp/v1-profiles-profileid-content-whatsapp-groups-conversations-externalid-get.md): its subject, description, settings and participants, each keyed by BSUID. - [Change a WhatsApp group's subject or description, answering with the group as read right after](https://docs.koil.co/openapi/content-whatsapp/v1-profiles-profileid-content-whatsapp-groups-conversations-externalid-patch.md): Meta reports each change's outcome later, as an `updated` event carrying the fields it applied, so the answer may not show a change Meta has yet to apply. - [Delete a WhatsApp group, removing every participant, the business included](https://docs.koil.co/openapi/content-whatsapp/v1-profiles-profileid-content-whatsapp-groups-conversations-externalid-delete.md) - [List the TikTok account's public posts, newest first](https://docs.koil.co/openapi/content-tiktok/v1-profiles-profileid-content-tiktok-videos-posts-get.md) - [Get one TikTok post by platform id](https://docs.koil.co/openapi/content-tiktok/v1-profiles-profileid-content-tiktok-videos-posts-externalid-get.md) - [List comments on one TikTok post, or the replies to one of its comments](https://docs.koil.co/openapi/content-tiktok/v1-profiles-profileid-content-tiktok-videos-comments-get.md) - [Get one TikTok comment by platform id](https://docs.koil.co/openapi/content-tiktok/v1-profiles-profileid-content-tiktok-videos-comments-externalid-get.md) - [Delete a TikTok comment the account made](https://docs.koil.co/openapi/content-tiktok/v1-profiles-profileid-content-tiktok-videos-comments-externalid-delete.md) - [Hide, unhide, like, or unlike a TikTok comment](https://docs.koil.co/openapi/content-tiktok/v1-profiles-profileid-content-tiktok-videos-comments-externalid-actions-post.md): Answers with the action applied. TikTok says an unhide does not always take effect; the `moderated` event reports the outcome. - [List the top mentions of the TikTok account in other users' captions or comments](https://docs.koil.co/openapi/content-tiktok/v1-profiles-profileid-content-tiktok-videos-mentions-get.md) - [Get one mention in full, hydrating a mention event](https://docs.koil.co/openapi/content-tiktok/v1-profiles-profileid-content-tiktok-videos-mentions-externalid-get.md): TikTok's webhook payload carries no engagement counts or thumbnail, and no comment text or author handle for a comment mention. Details stay readable for 48 hours after the webhook. - [List the TikTok Business Account's direct-message conversations from the last 90 days](https://docs.koil.co/openapi/content-tiktok/v1-profiles-profileid-content-tiktok-dm-conversations-get.md) - [Mark the person's messages in the account's TikTok conversation as seen, or show that the account is typing](https://docs.koil.co/openapi/content-tiktok/v1-profiles-profileid-content-tiktok-dm-conversations-externalid-actions-post.md): TikTok clears a typing indicator after five seconds and has no action that clears it sooner. - [List the 20 most recent messages of one TikTok direct-message conversation](https://docs.koil.co/openapi/content-tiktok/v1-profiles-profileid-content-tiktok-dm-messages-get.md) - [Get a URL for an image or video a TikTok direct message carries](https://docs.koil.co/openapi/content-tiktok/v1-profiles-profileid-content-tiktok-dm-messages-externalid-attachments-attachmentexternalid-get.md): TikTok mints one per call, valid for 24 hours. - [List the channel's videos and Shorts, newest first](https://docs.koil.co/openapi/content-youtube/v1-profiles-profileid-content-youtube-videos-posts-get.md) - [Get one YouTube video by platform id](https://docs.koil.co/openapi/content-youtube/v1-profiles-profileid-content-youtube-videos-posts-externalid-get.md) - [Edit a video's title, description, tags, category, or privacy](https://docs.koil.co/openapi/content-youtube/v1-profiles-profileid-content-youtube-videos-posts-externalid-patch.md) - [Delete one of the channel's videos](https://docs.koil.co/openapi/content-youtube/v1-profiles-profileid-content-youtube-videos-posts-externalid-delete.md) - [Like a video as the channel, or remove the channel's like](https://docs.koil.co/openapi/content-youtube/v1-profiles-profileid-content-youtube-videos-posts-externalid-actions-post.md): Answers with the action applied. - [List comments across the channel's videos (newest thread first, replies inline), one video's comments, or the replies to one comment](https://docs.koil.co/openapi/content-youtube/v1-profiles-profileid-content-youtube-videos-comments-get.md) - [Get one YouTube comment by platform id](https://docs.koil.co/openapi/content-youtube/v1-profiles-profileid-content-youtube-videos-comments-externalid-get.md) - [Edit the text of a comment the channel made](https://docs.koil.co/openapi/content-youtube/v1-profiles-profileid-content-youtube-videos-comments-externalid-patch.md) - [Delete a comment on one of the channel's videos](https://docs.koil.co/openapi/content-youtube/v1-profiles-profileid-content-youtube-videos-comments-externalid-delete.md) - [Publish, hold for review, or reject a comment on one of the channel's videos, optionally banning its author](https://docs.koil.co/openapi/content-youtube/v1-profiles-profileid-content-youtube-videos-comments-externalid-actions-post.md): Answers with the status applied rather than the comment: YouTube's read by id never reports `moderationStatus`, and no read returns a rejected comment. - [List the location's reviews, most recently changed first](https://docs.koil.co/openapi/content-google-business-profile/v1-profiles-profileid-content-google_business_profile-locations-reviews-get.md) - [Get one review of the location by platform id](https://docs.koil.co/openapi/content-google-business-profile/v1-profiles-profileid-content-google_business_profile-locations-reviews-externalid-get.md) - [Get the owner's reply to one review](https://docs.koil.co/openapi/content-google-business-profile/v1-profiles-profileid-content-google_business_profile-locations-review_replies-externalid-get.md) - [Edit the owner's reply to a review](https://docs.koil.co/openapi/content-google-business-profile/v1-profiles-profileid-content-google_business_profile-locations-review_replies-externalid-patch.md): Google moderates the new text before it appears. - [Remove the owner's reply to a review](https://docs.koil.co/openapi/content-google-business-profile/v1-profiles-profileid-content-google_business_profile-locations-review_replies-externalid-delete.md) - [List the Page's posts, newest created first](https://docs.koil.co/openapi/content-linkedin/v1-profiles-profileid-content-linkedin-feed-posts-get.md) - [Get one of the Page's posts by its share or ugcPost URN](https://docs.koil.co/openapi/content-linkedin/v1-profiles-profileid-content-linkedin-feed-posts-externalid-get.md) - [Edit the text of one of the Page's posts](https://docs.koil.co/openapi/content-linkedin/v1-profiles-profileid-content-linkedin-feed-posts-externalid-patch.md) - [Delete one of the Page's posts](https://docs.koil.co/openapi/content-linkedin/v1-profiles-profileid-content-linkedin-feed-posts-externalid-delete.md) - [Get a download URL for an image or video on one of the Page's posts, named by the `content.mediaUrn` or `content.imageUrns` entry a read reported](https://docs.koil.co/openapi/content-linkedin/v1-profiles-profileid-content-linkedin-feed-posts-externalid-attachments-attachmentexternalid-get.md): The URL is signed and expires. - [List the comments on one of the Page's posts, or the replies to one of its comments](https://docs.koil.co/openapi/content-linkedin/v1-profiles-profileid-content-linkedin-feed-comments-get.md) - [Get one comment by its URN](https://docs.koil.co/openapi/content-linkedin/v1-profiles-profileid-content-linkedin-feed-comments-externalid-get.md) - [Edit the text of a comment the Page wrote](https://docs.koil.co/openapi/content-linkedin/v1-profiles-profileid-content-linkedin-feed-comments-externalid-patch.md) - [Delete a comment the Page wrote](https://docs.koil.co/openapi/content-linkedin/v1-profiles-profileid-content-linkedin-feed-comments-externalid-delete.md) - [List the reactions on one post or comment, newest first](https://docs.koil.co/openapi/content-linkedin/v1-profiles-profileid-content-linkedin-feed-reactions-get.md) - [Get one reaction by its URN](https://docs.koil.co/openapi/content-linkedin/v1-profiles-profileid-content-linkedin-feed-reactions-externalid-get.md) - [Remove the Page's own reaction](https://docs.koil.co/openapi/content-linkedin/v1-profiles-profileid-content-linkedin-feed-reactions-externalid-delete.md) - [List Apps for the current Organization](https://docs.koil.co/openapi/apps/v1-apps-get.md) - [Create a customer-owned OAuth App](https://docs.koil.co/openapi/apps/v1-apps-post.md) - [Get an App](https://docs.koil.co/openapi/apps/v1-apps-appid-get.md) - [Update an App](https://docs.koil.co/openapi/apps/v1-apps-appid-patch.md): `scopes` replaces the scopes a Connect Session requests from then on; an existing Connection keeps the scopes its grant holds until it is reauthorized. - [Delete an App](https://docs.koil.co/openapi/apps/v1-apps-appid-delete.md) - [Rotate an App's OAuth client secret](https://docs.koil.co/openapi/apps/v1-apps-appid-rotate-secret-post.md): Only the secret is replaced; the client id and scopes are kept. A different client is a new App: its Connections' refresh tokens were issued to the old client and would stop renewing. - [List the Organization's backfill requests, newest first](https://docs.koil.co/openapi/backfill-requests/v1-backfill-requests-get.md): `profileId` and `status` narrow the list. - [Submit one or more backfill requests](https://docs.koil.co/openapi/backfill-requests/v1-backfill-requests-post.md): Each re-delivers one collection's history on one Profile; historical items are delivered as ordinary `content.*` events; nothing is stored. Validation is atomic across the submission and every item then runs independently. Requires an `Idempotency-Key`; one run per collection per profile may be in flight at a time. - [Get one backfill request and its progress](https://docs.koil.co/openapi/backfill-requests/v1-backfill-requests-backfillrequestid-get.md) - [Get the current Organization's plan, entitlement caps, and Profile count](https://docs.koil.co/openapi/billing-account/v1-billing-account-get.md) - [Create a Koil Connect Session](https://docs.koil.co/openapi/connect-sessions/v1-connect-sessions-post.md): a link that lets one end user authorize one of your Apps, or re-authorize one of its Connections in place. Create it when the user clicks to connect and redirect them to its `url` at once; every way it ends sends them to your `returnUrl`. A Connection the session creates takes its `metadata`. One it re-authorizes, by `connectionId` or because the same end user authorized again, keeps its own, which `PATCH /v1/connections/{connectionId}` changes. - [Get a Koil Connect Session](https://docs.koil.co/openapi/connect-sessions/v1-connect-sessions-connectsessionid-get.md): Once `completed`, it reports the scopes the end user granted (`grantedScopes`) and those requested that they declined (`missingScopes`): the session completes either way. - [List Koil Connections for the current Organization](https://docs.koil.co/openapi/connections/v1-connections-get.md) - [Create a Koil Connection from a credential you already hold](https://docs.koil.co/openapi/connections/v1-connections-post.md): for `method: "oauth"`, a platform grant an end user gave your App, so adopting Koil costs no reauthorization; for `method: "key"`, a key the brand gave you, as `key`: the `config` and `secret` its issuer declares (`GET /v1/issuers`), with no App. Requires an `Idempotency-Key`. The credential is first checked with the platform, and refused with `connection_invalid` if the platform rejects it, with nothing stored. It always creates: a credential for an account that already has a Connection under the same issuer, App (none for a key) and `clientUserId` is refused with `conflict` (409), whose `meta.resourceId` names that Connection; replace its credential with `PUT /v1/connections/{connectionId}/credential`. The new Connection takes the request's `metadata`. A grant whose access token has expired is renewed first and its fresh token checked, and refused if the platform refuses to renew it or nothing can. A key's `secret` is sealed and never returned. For `method: "oauth"`, the answer names the App's scopes the grant lacks (`missingScopes`), as a completed Connect Session does. - [Export an `oauth` Connection's current platform grant](https://docs.koil.co/openapi/connections/v1-connections-connectionid-credential-get.md): Requires an API key with the `credentials:export` permission. Any other method is refused with `not_supported`: Koil exports only what a platform issued to an authorization it ran, never a key someone submitted. - [Replace a Connection's credential with a new one of its own method, for the same platform account](https://docs.koil.co/openapi/connections/v1-connections-connectionid-credential-put.md): a new key (`method: "key"`, with `key`: its `config` and `secret`), or a fresh grant (`method: "oauth"`). The credential is first checked with the platform, and refused with `connection_invalid` if the platform rejects it; one for another account is refused with `validation_error` (`subject_mismatch`). Nothing is stored unless both pass. The Connection keeps its id, Profiles and `metadata`, becomes `active` again as a reconnect would (an `invalid` one included), and announces `connection.updated`. - [Get a Koil Connection](https://docs.koil.co/openapi/connections/v1-connections-connectionid-get.md) - [Update a Koil Connection's metadata](https://docs.koil.co/openapi/connections/v1-connections-connectionid-patch.md) - [Delete a Koil Connection](https://docs.koil.co/openapi/connections/v1-connections-connectionid-delete.md) - [List platform profiles eligible for Profile creation](https://docs.koil.co/openapi/connections/v1-connections-connectionid-eligible-platform-profiles-get.md): A page can hold fewer than `limit` profiles, even none, while `hasMore` is true. - [List Koil Profiles for the current Organization, newest first](https://docs.koil.co/openapi/profiles/v1-profiles-get.md): `connectionId`, `platformId` and `clientUserId` narrow the list. - [Create a Koil Profile from an eligible platform profile](https://docs.koil.co/openapi/profiles/v1-profiles-post.md): Requires an `Idempotency-Key`. - [Get a Koil Profile](https://docs.koil.co/openapi/profiles/v1-profiles-profileid-get.md) - [Update a Koil Profile's metadata](https://docs.koil.co/openapi/profiles/v1-profiles-profileid-patch.md) - [Delete a Koil Profile](https://docs.koil.co/openapi/profiles/v1-profiles-profileid-delete.md) - [Get what a Profile's credential can do](https://docs.koil.co/openapi/profiles/v1-profiles-profileid-capabilities-get.md): each of its platform's collections with the operations, events and backfill the credential's scopes cover, and each of its account settings with the operations the credential covers. Where the platform restricts the profile further (a Facebook Page role, a WhatsApp number that cannot message yet), what it leaves out is declined as `platform_profile_restricted`; Koil asks the platform on each read, and shows the grant's answer when the platform cannot answer. - [List every collection Koil serves](https://docs.koil.co/openapi/collections/v1-collections-get.md): its operations, the events it emits, and whether it can be backfilled. `GET /v1/profiles/{profileId}/capabilities` narrows the same entries to one profile's credential. - [Get one collection Koil serves](https://docs.koil.co/openapi/collections/v1-collections-collection-get.md) - [List Event Destinations for the current Organization](https://docs.koil.co/openapi/event-destinations/v1-event-destinations-get.md) - [Create an Event Destination](https://docs.koil.co/openapi/event-destinations/v1-event-destinations-post.md): where events are delivered, which topics it receives, and optionally which Profiles. Its events are rendered in the request's `Koil-Version`, which it keeps. - [Get an Event Destination](https://docs.koil.co/openapi/event-destinations/v1-event-destinations-eventdestinationid-get.md) - [Update an Event Destination](https://docs.koil.co/openapi/event-destinations/v1-event-destinations-eventdestinationid-patch.md): Send only what changes: a field left out keeps its value, and `metadata` is merged into what is stored. `config` and `credentials` are each replaced whole, so send every setting the destination should keep; a webhook's `secret` left out is kept. A change to either also names the destination's `type`, which decides what they take. - [Delete an Event Destination](https://docs.koil.co/openapi/event-destinations/v1-event-destinations-eventdestinationid-delete.md) - [Rotate a webhook Event Destination's signing secret](https://docs.koil.co/openapi/event-destinations/v1-event-destinations-eventdestinationid-rotate-secret-post.md): Koil generates a new one, and until `previousSecretInvalidAt` (24 hours after the rotation unless you set it) deliveries carry a signature for the old one too. Read the new secret with `GET /v1/event-destinations/{eventDestinationId}/secret`. A destination of another type has no secret to rotate. - [Get a webhook Event Destination's signing secret, and during a rotation's overlap the secret it replaces](https://docs.koil.co/openapi/event-destinations/v1-event-destinations-eventdestinationid-secret-get.md): No other response returns it; a destination of another type has none. - [List an Event Destination's delivery attempts, newest first](https://docs.koil.co/openapi/event-destinations/v1-event-destinations-eventdestinationid-attempts-get.md): which event was sent, how the destination answered, and when. Attempts describe deliveries, not the events' bodies. - [Deliver one event to an Event Destination again, as a new attempt](https://docs.koil.co/openapi/event-destinations/v1-event-destinations-eventdestinationid-events-eventid-retry-post.md): The destination must be enabled and already have an attempt for the event; list its attempts to find one. - [Retry an Event Destination's deliveries in a time window, judged by when they were attempted](https://docs.koil.co/openapi/event-destinations/v1-event-destinations-eventdestinationid-retry-post.md): with `include: "failed"`, every event whose delivery failed in the window and has not succeeded since; with `include: "all"`, every event attempted in it. Each is delivered again once, as a new attempt. The retry runs in the background, paced to about 10 events a second, and each delivery appears in the destination's attempts with `manual: true`. The destination must be enabled. Requires an `Idempotency-Key`. - [List the issuers Koil connects through](https://docs.koil.co/openapi/issuers/v1-issuers-get.md): the methods each supports, and the JSON Schema of what each takes (a key's `config` and `secret`). Needs no key. - [Create a media object](https://docs.koil.co/openapi/media/v1-media-post.md): Give an HTTPS `sourceUrl` for Koil to fetch, or omit it to get a pre-signed upload URL in the response. Images may be up to 50 MB and 100 megapixels, videos up to 1 GB, audio up to 25 MB, and documents (PDF and Office) up to 100 MB. Reference the returned `mediaId` from publish requests within 24 hours of creating it. Requires an `Idempotency-Key`. - [Get a media object's processing status and derived variants](https://docs.koil.co/openapi/media/v1-media-mediaid-get.md) - [Delete a media object and its derived variants](https://docs.koil.co/openapi/media/v1-media-mediaid-delete.md): Publishes already running keep their own staged copy. - [List the platforms available through Koil and their operations](https://docs.koil.co/openapi/platforms/v1-platforms-get.md) - [Get a platform available through Koil and its operations](https://docs.koil.co/openapi/platforms/v1-platforms-platformid-get.md) - [List the Organization's publish requests, newest first](https://docs.koil.co/openapi/publish-requests/v1-publish-requests-get.md): `profileId` and `status` narrow the list. - [Submit one or more publish requests](https://docs.koil.co/openapi/publish-requests/v1-publish-requests-post.md): Each item creates platform content — a post, a comment, a reply, a message — through a Profile. Every item's `args` is validated against its collection's publish input first and the submission is rejected whole if any item fails; each item then runs independently with its own `pub_*` ledger entry. Requires an `Idempotency-Key`. Answers `202` with each item as it stands. Sent with `Prefer: wait=`, it waits up to that long (at most 10 seconds) for every item's outcome, and answers `200` if every item then has one. - [Get one publish request and its current status](https://docs.koil.co/openapi/publish-requests/v1-publish-requests-publishrequestid-get.md) - [Cancel a publish request that has not started](https://docs.koil.co/openapi/publish-requests/v1-publish-requests-publishrequestid-cancel-post.md): A request whose platform execution has begun answers `409 conflict` with its current status. ## Platforms - [Platforms](https://docs.koil.co/platforms.md): The platforms Koil serves, and how platform content is named across the API. - [Facebook](https://docs.koil.co/platforms/facebook.md): 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. - [Google Business Profile](https://docs.koil.co/platforms/google_business_profile.md): Reviews of your customers' business locations, and the owner's replies, through your Google Cloud project with the single `business.manage` scope. - [Instagram](https://docs.koil.co/platforms/instagram.md): professional (Business and Creator) accounts through your Meta app, discovered and connected through the Facebook Page each account is linked to. - [LinkedIn](https://docs.koil.co/platforms/linkedin.md): Pages (company and showcase pages) through your LinkedIn developer app with the Community Management API. - [TikTok](https://docs.koil.co/platforms/tiktok.md): business accounts through your TikTok API for Business app ("TikTok Accounts"). - [WhatsApp](https://docs.koil.co/platforms/whatsapp.md): Business Platform numbers through your Meta app, connected with Facebook Login for Business (Embedded Signup). - [YouTube](https://docs.koil.co/platforms/youtube.md): channels through your Google Cloud project, with the single `youtube.force-ssl` scope. ## API contract - [OpenAPI document](https://docs.koil.co/openapi.json): the OpenAPI 3.1 document every endpoint page is generated from; generate clients from it.