Bring your own app
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.
Koil is BYO-only for OAuth apps: every live-mode connection is authorized through an app your Organization owns and registers with Koil as an App. Koil operates no shared or default apps.
Why BYO-only
- No shared-app blast radius. A shared app is a single point of failure — one tenant's policy strike can get the whole app suspended and take every customer offline. With your own app, platform enforcement is isolated to your tenant, and nobody else's behavior can interrupt your users.
- Your branding on the consent screen. End users see and approve your app when they authorize access, not a third-party integration layer.
- You own the token relationship. Grants are issued to your app, so adopting Koil never requires your users to re-authorize — and neither does leaving: you can export any Connection's current grant. There is no lock-in through credential ownership. Migrate existing users walks through moving them over.
Koil manages everything downstream of the app: hosted Connect Sessions, credential storage and renewal, scope checks, Connection health, and Profile resolution for every operation.
What you need (example: Instagram)
Each platform has its own developer-console prerequisites. For Instagram via Facebook Login you need:
- A Meta app in your Meta developer account, with business verification completed for your business portfolio.
- The permissions for the surfaces you use, approved through Meta App Review. Koil's Instagram operations together use
instagram_basic,instagram_content_publish,instagram_manage_comments,instagram_manage_contents,instagram_manage_messages,pages_manage_metadata,pages_read_engagement,pages_show_list; request only those your product needs. Keeppages_manage_metadatawhatever else you drop: it subscribes the linked Page to your app, without which Meta delivers none of the account's events. - Your app's credentials at hand: the OAuth client ID and client secret. Note that the app secret also signs your app's webhook deliveries, which is how Koil verifies platform events for your tenant.
The App Review playbook maps each Koil operation to the credential and permissions it requires, per platform, so you can scope your review request to exactly what you use. Its tables are generated from the same declarations that admit your Connections at runtime, so what it says you need is what Koil checks.
The flow
-
Register Koil's redirect URI with your app. In the platform developer console, add
https://api.koil.co/oauth/callbackas the OAuth redirect URI (Meta calls it a Valid OAuth Redirect URI, Google an Authorized redirect URI). Every platform redirects your end users there after they approve access, and platforms reject an authorization whose redirect URI the app has not registered. -
Register an App with your app's OAuth client ID, client secret, and scopes. Koil returns a stable
app_*id and itswebhookVerifyToken, and every read of the App returns itsclientIdandscopesbut never the secret.scopes, when you send it, lists at least one scope and none twice. A platform that needs your app's own id besides its client ID says so onGET /v1/platforms(issuerAppId: which issuer, and where to find the id); pass it asissuerAppIdhere, since it cannot be added afterwards.curl -X POST "https://api.koil.co/v1/apps" \ -H "Authorization: Bearer $KOIL_API_KEY" \ -H "Koil-Version: 2026-12-08" \ -H "Content-Type: application/json" \ -d '{ "issuerId": "facebook", "displayName": "Acme Meta App", "clientId": "1234567890", "clientSecret": "app-secret", "scopes": [ "instagram_basic", "instagram_content_publish", "instagram_manage_comments", "instagram_manage_contents", "instagram_manage_messages", "pages_manage_engagement", "pages_manage_metadata", "pages_manage_posts", "pages_messaging", "pages_read_engagement", "pages_read_user_content", "pages_show_list", "publish_video" ]}' -
Run Connect Sessions against your app. Create Connect Sessions with your
appId; the returnedurlsends your end user through your app's consent screen. Completed sessions yield Connections, from which you create Profiles. -
Point your app's webhooks at Koil. For a Meta app, in the App Dashboard's webhook settings, give each webhook object the callback URL below for the Koil platform it serves, with your App's id as
{appId}, enter the App'swebhookVerifyToken(returned byPOSTandGET /v1/apps/…) as the verify token, and subscribe every field listed. Meta delivers only the fields you subscribe, so one left out loses its events without an error.Platform Callback URL Webhook object Fields to subscribe Instagram https://api.koil.co/webhooks/platforms/instagram?appId={appId}instagramcomments,mentions,story_insights,messages,messaging_postbacks,message_reactionsFacebook https://api.koil.co/webhooks/platforms/facebook?appId={appId}pagefeed,mention,messages,message_echoes,messaging_postbacks,message_reactionsWhatsApp https://api.koil.co/webhooks/platforms/whatsapp?appId={appId}whatsapp_business_accountmessages,group_lifecycle_update,group_participants_update,group_settings_update,group_status_updateKoil answers the console's verification handshake against that token, verifies every delivery with your app secret, normalizes it, and delivers it to your Event Destinations as
content.*events. A TikTok API for Business app needs no console step: Koil registers the callback URL with TikTok through the webhook API itself, for each event family an Event Destination of yours is actually subscribed to for a TikTok Profile under that app, removing it again when none is — and verifies each delivery'stiktok-signaturewith your app secret. If your app already points an event family somewhere else, such as a system you are migrating from, Koil leaves that callback alone and events of that family do not reach Koil; the App'swebhookConflictslists each such family and the URL holding it. Delete that callback with TikTok's/business/webhook/delete/and Koil registers its own within a few minutes. TikTok publishing additionally requires the media host to be a URL property your app has verified, which is not yet satisfiable — see the note on the TikTok page. A YouTube (Google Cloud) app has no webhook step at all: YouTube publishes no comment webhooks, so Koil polls, and the only console work is enabling the YouTube Data API, verifying the consent screen for theyoutube.force-sslscope, and passing the YouTube compliance audit if you need public uploads.
Rotate a compromised secret with POST /v1/apps/{appId}/rotate-secret, sending only the new clientSecret: it replaces the secret and keeps the App's client ID and scopes. Koil stores the secret as sent, so a wrong one shows up only as failed renewals and webhook deliveries. Every call Koil makes as your app, and every webhook verification, uses the new secret at once. Rotate here as soon as you reset the secret in the platform console: until you do, deliveries signed with the new secret fail verification and wait for the platform's retries. A different client is a new App, since its Connections' refresh tokens were issued to the old client and would stop renewing. Change the scopes with PATCH /v1/apps/{appId} and scopes: Connect Sessions request the new list from then on, while an existing Connection keeps the scopes its end user granted until they authorize again through a Connect Session for it. See the API endpoints for the full contract.
Google Business Profile needs no webhook step at all: Google publishes review notifications to a Cloud Pub/Sub topic rather than to an HTTP callback, so Koil polls, and there is no /webhooks/platforms/google_business_profile URL to enter anywhere.
A LinkedIn app registers its webhook by hand, and only once it has Community Management Standard Tier (Development Tier has push notifications switched off): in the Developer Portal's Webhooks tab, enter https://api.koil.co/webhooks/platforms/linkedin?appId={appId}. LinkedIn validates the URL with a challenge Koil answers with your app's client secret, and repeats the challenge every two hours for as long as the URL is registered. Notifications for a Page then need an event subscription for that Page and the admin who connected it, which Koil makes while one of your Event Destinations covers the Profile and removes once none does, provided that admin holds the Page's ADMINISTRATOR role. LinkedIn keys each subscription by your app's developer application id, the number in the app's Developer Portal URL (https://www.linkedin.com/developers/apps/{id}/…), which is not the OAuth client ID and which no API returns, so a LinkedIn App takes it as issuerAppId when you create it.
Taking your grants with you
Grants belong to your app, so they can leave Koil as easily as they came in. GET /v1/connections/{connectionId}/credential returns an oauth Connection's current grant (accessToken, refreshToken where the platform issued one, expiresAt, refreshTokenExpiresAt where Koil knows it, and scopes) in the shape POST /v1/connections takes as grant, so your own systems, or a later create, can keep acting for the end user without asking them to authorize again. A key Connection's key is the brand's and is never exported (not_supported). It is the grant as Koil holds it: Koil renews a renewable access token ahead of its expiry, so it is current unless renewal is failing; check expiresAt before you use it.
curl "https://api.koil.co/v1/connections/conn_123/credential" \ -H "Authorization: Bearer $KOIL_API_KEY" \ -H "Koil-Version: 2026-12-08"- The key needs the
credentials:exportpermission. No key has it unless you choose it when you create the key in the admin console. A refresh token keeps working after the key that exported it is revoked, so give the permission only to the key that runs your migration, and revoke that key when you are done. - Export last, then delete the Connection. Koil keeps renewing a Connection until you delete it, and a platform that rotates refresh tokens (TikTok) invalidates the one you exported the next time Koil renews it. Export when you are ready to switch over, then
DELETE /v1/connections/{connectionId}: Koil stops renewing, and the grant stays valid at the platform. - Only grants export. A credential Koil mints for a Profile, such as a Facebook Page access token, is not a Connection; mint it again from the exported user grant.
- An
invalidConnection is refused withconnection_invalid: its grant no longer authorizes, so there is nothing to take. - In sandbox mode, a Connection exports the magic grant it was created from.
Google Business Profile: apply before you build
Google Business Profile is the one platform whose gate comes before the first call rather than before going live, so plan for it earlier than the rest.
Every other platform lets you enable an API and start calling immediately, with review standing between you and public or large-scale use. Google caps a Cloud project at zero queries per minute until it approves an application for Business Profile API access — so an unapproved project cannot make a single request, and there is no sandbox and no read-only lane to develop against.
To apply you need a Google Business Profile that is verified and active for at least 60 days, a website representing that business, a complete and current profile, a Google Cloud project, and an Organization account. The application is the Business Profile API contact form ("Application for Basic API Access"), filed from an email listed as an owner or manager on the profile. Google publishes no turnaround time. Your project's quota is the signal: 0 QPM means the application is still pending, 300 QPM means it was granted.
Two things gate replying specifically, beyond the scope: the location must be verified, and in a Google Workspace tenant your admin must have enabled Google Search and/or Google Maps.
Koil's sandbox mode does not depend on any of this — build the whole integration against the sandbox_token_google_business_profile_healthy magic grant while the application is in flight.
Integrate today, go live when review completes
You do not need an app — or an approved permission set — to start integrating. Sandbox API keys exercise the same endpoints, schemas, events, and error contracts as live mode, with emulated platform behavior and a catalog of magic grants (such as sandbox_token_instagram_healthy or sandbox_token_instagram_missing_scopes) that you create Connections from in place of real ones, through a sandbox App with any client values. No OAuth flow, no consent screen, no app review.
That makes the onboarding path: build your full integration in sandbox mode now, run app review in parallel, then register your approved app with Koil as an App and switch to a live key to go live.