Skip to main content
POST
Connect Integration
Connect an integration whose setup only needs an API key and/or a webhook signing secret: Polar, Paddle, Dodo Payments, Whop, Creem, Chargebee, Clerk, PostHog, or Affonso. Credentials are validated against the provider where possible, stored encrypted, and never returned by any endpoint. Payment providers queue their initial revenue backfill automatically; Affonso queues its affiliate backfill; PostHog can optionally import its event history. The response includes webhookUrl - configure it in the provider’s webhook settings with the same secret you passed here, or live events will not arrive. Calling this for an already-connected provider replaces its stored credentials. OAuth and app-install providers (Stripe, Shopify, Supabase, GitHub, WooCommerce, Meta) cannot be connected here: their flows need a browser, so they return a 400 pointing at the dashboard. Use Integration Catalog to discover each connectable provider’s exact fields via connectFields. Requires an API key with the integrations:manage scope.

Request

string
required
One of polar, paddle, dodo, whop, creem, chargebee, clerk, posthog, affonso.
string
required
Signing secret of the webhook you create at the provider, pointed at the returned webhookUrl. For Chargebee, pass the webhook’s basic-auth credentials as username:password.
string
Provider API key. Required for every provider except Clerk and PostHog.
string
Provider account ID. Required for Paddle (seller ID), Dodo (business ID), Whop (company ID, biz_...), Creem (store ID), and Chargebee (site name). Polar resolves it from the API key; Clerk, PostHog, and Affonso derive it.
object
PostHog only: { syncAllEvents?: boolean, eventAllowlist?: string[] }. Defaults to syncing every non-internal event.
object
PostHog only: { region: "us" | "eu", projectId: string, personalApiKey: string }. Imports the project’s event history after connecting; the personal API key needs query read access.

Response fields

object
The connected integration, in the same shape as List Integrations. Credentials are never included.
string
URL to configure in the provider’s webhook settings with the same secret.
boolean
Payment providers only: whether the initial revenue backfill was queued.
boolean
Affonso only: whether the affiliate backfill was queued.
object
PostHog only: {(requested, queued, error)} for the optional history import. The webhook connection succeeds even when queueing the import failed.

Responses