This project now includes centralized runtime settings and startup validation in
config/runtime.py.
APP_ENV: runtime environment label (default:development)STRICT_STARTUP: iftrue, startup fails when required runtime dependencies are missingAPP_TIMEZONE: app timezone for metrics timestamps (default:America/Chicago)APP_VERSION: API version string reported by health/root endpointsLOG_JSON: structured JSON logs on/off (default:true)LOG_LEVEL: logger level (default:INFO)
Paperclip supports per-company CRM routing with optional per-agent override.
BUSINESS_CRM_MAP(JSON map): default business to CRM provider mappingAGENT_CRM_MAP(JSON map): optional agent to CRM provider overrides
Default mapping:
aiphoneguy->ghlcallingdigital->attioautointelligence->hubspot
Provider credentials:
- GHL:
GHL_API_KEY,GHL_LOCATION_ID - HubSpot:
HUBSPOT_API_KEY(orHUBSPOT_ACCESS_TOKEN) - Attio:
ATTIO_API_KEY
Useful endpoint:
GET /api/crm/configreturns active mapping and provider readiness.
Paperclip can publish queued AI Phone Guy content to a GoHighLevel site workflow through a secure webhook adapter.
Required env vars:
GHL_SITE_PUBLISH_WEBHOOK_URL: inbound GHL workflow/webhook URL that creates or updates a site post
Optional env vars:
GHL_SITE_PUBLISH_WEBHOOK_AUTH: custom Authorization header value sent to the publish webhook
Operational endpoint:
POST /content/publish/ghl?limit=5
Behavior:
- Pulls queued content for
aiphoneguy - Builds a branded SVG hero graphic payload for each item
- Sends title/body/slug/graphic payload to your GHL webhook
- Marks successful items as published in
content_queue
Startup now logs a single configuration summary and warning/fatal checks for:
- API auth configuration (
API_KEYS) - Postgres persistence (
DATABASE_URL) - LLM credentials for configured provider
- GHL CRM credentials
GET /health: liveness + runtime metadataGET /health/ready: readiness probe (returns503when not ready)
/health/ready is designed for deploy gates and can be wired into production monitoring.
- External integrations now use retry-aware service calls in
services/http_client.py - Standardized service error envelope lives in
services/errors.py - GHL integration in
tools/ghl.pynow runs through this service layer - Request correlation ID is emitted in logs and returned as
X-Request-ID
Run focused foundation tests:
python3 -m unittest tests/test_phase2_foundation.py