Skip to main content

Knowledge > Runbooks > Chatbot Ops > Disable or Suspend a Church's Chatbot

Disable or Suspend a Church's Chatbot

Temporarily disable or fully suspend a church's chatbot. This is used for non-payment (handled automatically by Stripe webhook), manual suspension, debugging, or at the church's request.

Prerequisites

  • Church UUID from organization_settings or churches table
  • Reason for disabling (non-payment, debugging, church request, policy violation)
  • Supabase MCP or direct DB access

Disable Types

TypeWhat to DoReversible?
Temporary (debug)Set enabled = falseYes — re-enable anytime
Non-paymentStripe webhook handles automaticallyYes — re-enabled on payment
Church requestSet enabled = false, note reasonYes
Policy violationSet enabled = false, flag accountRequires founder review

Steps

Disable the chatbot

UPDATE organization_settings
SET enabled = false,
updated_at = now()
WHERE church_id = '[uuid]';

Verify:

SELECT church_id, enabled, tier, updated_at
FROM organization_settings
WHERE church_id = '[uuid]';

Verify the widget returns a disabled state

curl -X POST https://churchwiseai.com/api/chatbot/stream \
-H "Content-Type: application/json" \
-d '{"message": "Hello", "churchId": "[uuid]", "conversationId": "test-123"}'

A disabled chatbot returns a 200 response with {"disabled": true} or an empty/graceful fallback message — not a 500 error.

For non-payment suspension (manual override of Stripe webhook)

The Stripe webhook at /api/stripe/webhook automatically sets organization_settings.enabled = false and downgrades premium_churches.plan on subscription cancellation or payment failure. To manually trigger the same state:

-- Disable the chatbot
UPDATE organization_settings
SET enabled = false, tier = 'free', updated_at = now()
WHERE church_id = '[uuid]';

-- Mark subscription as inactive
UPDATE premium_churches
SET status = 'cancelled', updated_at = now()
WHERE church_id = '[uuid]';

Confirm with the founder before manually modifying premium_churches.

Notify the church (if applicable)

For non-payment: the Stripe webhook email handles notification automatically. For manual suspension: email the church admin at their premium_churches.admin_email.

Re-enable the chatbot

UPDATE organization_settings
SET enabled = true,
tier = '[correct_tier]',
updated_at = now()
WHERE church_id = '[uuid]';

If re-enabling after non-payment, also restore the subscription status:

UPDATE premium_churches
SET status = 'active', updated_at = now()
WHERE church_id = '[uuid]';

Verification

After disabling:

  • API call to /api/chatbot/stream returns graceful disabled response (not 500).
  • Widget on church website shows disabled state or empty.

After re-enabling:

  • API call returns a valid chatbot response.
  • organization_settings.enabled = true.

See Also