Complete setup instructions for configuring OpenPhone API integration.
- Cloudflare account (ID:
0bc21e3a5a9de1a4cc843be9c3e98121) - Node.js 18+ installed
- Wrangler CLI installed:
npm install -g wrangler - OpenPhone account with API access
- Access to shared Neon database (
chittyos-core)
- Log in to OpenPhone Dashboard
- Navigate to Settings → API & Integrations
- Click Generate API Key
- Important: Copy the key immediately - it's only shown once!
- Save securely (password manager recommended)
- In OpenPhone dashboard, go to Settings → Webhooks
- Click Add Webhook
- Configure:
- URL:
https://reception.chitty.cc/webhooks/openphone - Events: Select all:
- ✅
call.initiated - ✅
call.completed - ✅
message.created - ✅
voicemail.created
- ✅
- URL:
- Click Create Webhook
- Copy the Webhook Signing Secret (shown once)
# Clone/navigate to project
cd chittyreception
# Install dependencies
npm install
# Create local environment file
cp .env.example .env
# Edit .env with your values
nano .envConfigure .env:
# OpenPhone (required)
OPENPHONE_API_KEY=sk_live_xxxxxxxxxxxxx
OPENPHONE_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxx
# ChittyOS Services (get from other services)
CHITTY_ID_SERVICE_TOKEN=token_from_chittyid
CHITTY_AUTH_SERVICE_TOKEN=token_from_chittyauth
CHITTY_CONNECT_SERVICE_TOKEN=token_from_chittyconnect
# Database (shared)
NEON_DATABASE_URL=postgresql://user:pass@host/chittyos-core
# Security (generate new)
JWT_SECRET=$(openssl rand -hex 32)
ENCRYPTION_KEY=$(openssl rand -hex 32)
# Environment
ENVIRONMENT=development# Production namespace
wrangler kv:namespace create RECEPTION_KV
# Preview/dev namespace
wrangler kv:namespace create RECEPTION_KV --previewOutput will be:
{ binding = "RECEPTION_KV", id = "abc123..." }
{ binding = "RECEPTION_KV", preview_id = "def456..." }
Edit wrangler.toml and replace placeholder IDs:
[[kv_namespaces]]
binding = "RECEPTION_KV"
id = "abc123..." # Use ID from above
preview_id = "def456..." # Use preview_id from above# Set all required secrets
wrangler secret put OPENPHONE_API_KEY
# Paste your OpenPhone API key when prompted
wrangler secret put OPENPHONE_WEBHOOK_SECRET
# Paste your webhook secret
wrangler secret put NEON_DATABASE_URL
# Paste your Neon database URL
wrangler secret put JWT_SECRET
# Generate: openssl rand -hex 32
wrangler secret put ENCRYPTION_KEY
# Generate: openssl rand -hex 32
wrangler secret put CHITTY_ID_SERVICE_TOKEN
# Get from chittyid service
wrangler secret put CHITTY_AUTH_SERVICE_TOKEN
# Get from chittyauth service
wrangler secret put CHITTY_CONNECT_SERVICE_TOKEN
# Get from chittyconnect servicewrangler secret listShould show:
OPENPHONE_API_KEY
OPENPHONE_WEBHOOK_SECRET
NEON_DATABASE_URL
JWT_SECRET
ENCRYPTION_KEY
CHITTY_ID_SERVICE_TOKEN
CHITTY_AUTH_SERVICE_TOKEN
CHITTY_CONNECT_SERVICE_TOKEN
ChittyReception uses the shared chittyos-core database. Create tables:
# Connect to database
psql $NEON_DATABASE_URL
# Run schema (if not exists)
\i init-database.sqlRequired tables:
identities(from chittyid)api_tokens(from chittyauth)audit_logs(shared)
# Start dev server
npm run devService runs on http://localhost:8787
# Health check
curl http://localhost:8787/api/v1/health
# Send test SMS (requires valid phone numbers)
curl -X POST http://localhost:8787/api/v1/send-message \
-H "Content-Type: application/json" \
-d '{
"from": "+15551234567",
"to": ["+15559876543"],
"content": "Test message from ChittyReception"
}'# In separate terminal, expose local server
ngrok http 8787
# Update OpenPhone webhook URL to ngrok URL
# Example: https://abc123.ngrok.io/webhooks/openphone
# Send test message to your OpenPhone number
# Check logs for webhook events# Deploy staging environment
npm run deploy:staging
# View logs
npm run tailUpdate OpenPhone webhook URL:
https://chittyreception-staging.workers.dev/webhooks/openphone
Test staging deployment:
curl https://chittyreception-staging.workers.dev/api/v1/health# Ensure all secrets are set
wrangler secret list
# Deploy production
npm run deploy:production
# Configure custom domain (Cloudflare dashboard)
# reception.chitty.cc → chittyreception-productionUpdate OpenPhone webhook URL:
https://reception.chitty.cc/webhooks/openphone
curl -X POST https://registry.chitty.cc/api/v1/register \
-H "Authorization: Bearer $CHITTY_REGISTRY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"service": "chittyreception",
"version": "1.0.0",
"endpoint": "https://reception.chitty.cc",
"health_check": "https://reception.chitty.cc/api/v1/health",
"capabilities": ["phone", "sms", "voicemail", "ai-routing"]
}'- OpenPhone API key set and tested
- Webhook secret configured
- KV namespaces created and bound
- All secrets set in Cloudflare
- Database tables exist
- Local dev server runs
- Staging deployment successful
- Production deployment successful
- Webhooks receiving events
- Custom domain configured
- Service registered in ChittyRegistry
-
Send SMS via API:
curl -X POST https://reception.chitty.cc/api/v1/send-message \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "from": "+15551234567", "to": ["+15559876543"], "content": "Test message" }'
-
Receive SMS: Send message to your OpenPhone number, check logs
-
Make Call:
curl -X POST https://reception.chitty.cc/api/v1/make-call \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "from": "+15551234567", "to": "+15559876543" }'
# Run test suite
npm test
# Run with coverage
npm run test -- --coverage- Verify key in OpenPhone dashboard
- Check secret is set:
wrangler secret list - Regenerate key if necessary
- Update secret:
wrangler secret put OPENPHONE_API_KEY
- Check webhook URL in OpenPhone dashboard
- Verify URL is publicly accessible
- Check webhook signature verification
- View logs:
npm run tail - Test webhook endpoint directly
- Verify namespace exists:
wrangler kv:namespace list - Check binding in wrangler.toml
- Verify preview_id for local dev
- Check namespace permissions
- Test connection:
psql $NEON_DATABASE_URL -c "SELECT 1" - Verify secret:
wrangler secret get NEON_DATABASE_URL - Check IP allowlist in Neon dashboard
- Verify database name is
chittyos-core
Add to Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"chittyreception": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-fetch",
"https://reception.chitty.cc/mcp"
]
}
}
}Restart Claude Desktop to load MCP tools.
- Test OpenPhone integration - Send/receive test messages
- Implement AI orchestration - Add intelligent routing
- Connect to ChittyConnect - Link with case management
- Set up monitoring - Configure alerts and dashboards
- Plan Twilio migration - Evaluate cost savings
- Documentation: https://docs.chitty.cc/reception
- OpenPhone API: https://docs.openphone.com
- ChittyOS Issues: https://github.com/chittyos/issues