Webhooks

Stripe Lifecycle Webhook

Fan out a Stripe lifecycle event to Slack + Loops.so.

Called by kolens-web/app/api/stripe/webhook/route.ts AFTER the Stripe signature has been verified on Vercel. Auth is the shared X-Admin-Secret (same pattern as /api/workspaces/.../billing/ credit-grant). Returns 200 with {received, processed, slack_sent, loops_sent} so the BFF can log what fired without needing to wait on either downstream provider.

Event types handled:

  • checkout.session.completed → Slack: :tada: New paying customer: <email> (<plan>, <amount>) Loops: subscription_purchased
  • customer.subscription.deleted → Slack: :disappointed: Churned customer: <email> Loops: subscription_canceled
  • invoice.payment_failed → Slack: :warning: Payment failed: <email> Loops: payment_failed

Any other event type returns 200 with processed=False — unknown types are not an error. All integrations gracefully no-op when their env keys are unset; the response reflects what actually fired.

post/webhooks/stripe

Request

  • Base URL: https://api.kolens.ai (the document declares no server; this is the origin it was published from)
  • URL: https://api.kolens.ai/webhooks/stripe
  • Auth: none declared

Headers

X-Admin-Secretstring nullable

Request body

stripe_event_idstring required
typestring required
emailstring nullable
planstring nullable
amount_centsinteger nullable
currencystring nullable
workspace_slugstring nullable

Response

Successful Response

object required

Changes

No recorded changes to this operation across all 1 revision of this API.