{"openapi":"3.0.3","info":{"title":"Christite REST API","version":"1.1.0","description":"Public REST API for integrating with the Christite platform.\n\nAuthenticate with `Authorization: Bearer <api-key>`. Keys are scoped; each endpoint documents the scope it requires. Rate limits are per-credential (returned as HTTP 429 with `Retry-After`).\n\n### Webhooks\nDeliveries include headers `x-christite-event` and `x-christite-signature: t=<ts>,v1=<hex>` — verify using HMAC-SHA256 of `${ts}.${rawBody}` with your webhook secret. Failed deliveries retry with exponential backoff (30s, 5m, 30m, 2h, 6h) before being marked dead."},"servers":[{"url":"/"}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Bearer <api-key>"}},"schemas":{"Post":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string"},"title":{"type":"string"},"content":{"type":"string"},"slug":{"type":"string"},"amen_count":{"type":"integer"},"created_at":{"type":"string","format":"date-time"}}},"IntakeInput":{"type":"object","required":["channel","body_text"],"properties":{"channel":{"type":"string","enum":["web","whatsapp","sms","email","voice","api"]},"body_text":{"type":"string","maxLength":8000},"language":{"type":"string"},"media_url":{"type":"string","format":"uri"},"requester_hint":{"type":"string"},"source_msg_id":{"type":"string"},"org_id":{"type":"string","format":"uuid"},"raw_payload":{"type":"object","additionalProperties":true}}},"Error":{"type":"object","properties":{"error":{"type":"string"}}}}},"security":[{"ApiKeyAuth":[]}],"x-scopes":[{"code":"posts:read","desc":"Read approved posts (testimonies, prayers, articles)"},{"code":"ministries:read","desc":"Read ministry directory"},{"code":"sanctuary:read","desc":"Read Sanctuary Q&A archive"},{"code":"intake:write","desc":"Submit prayer requests / intake messages"}],"x-webhook-events":["intake.created","intake.triaged","post.created","post.approved","post.flagged","assignment.created","assignment.responded","test.ping"],"paths":{"/api/public/v1/posts":{"get":{"summary":"List posts","x-scope":"posts:read","parameters":[{"name":"type","in":"query","schema":{"type":"string","enum":["testimony","prayer_req","blog"]}},{"name":"limit","in":"query","schema":{"type":"integer","default":20,"maximum":100}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Post"}}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited"}}}},"/api/public/v1/ministries":{"get":{"summary":"List ministries","x-scope":"ministries:read","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","default":50,"maximum":200}}],"responses":{"200":{"description":"OK"},"401":{"description":"Unauthorized"},"429":{"description":"Rate limited"}}}},"/api/public/v1/sanctuary-qa":{"get":{"summary":"List Sanctuary Q&A","x-scope":"sanctuary:read","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","default":50,"maximum":200}}],"responses":{"200":{"description":"OK"},"401":{"description":"Unauthorized"}}}},"/api/public/v1/intake":{"post":{"summary":"Submit an intake message (prayer/testimony/contact)","x-scope":"intake:write","description":"Emits webhook event `intake.created` on success. Idempotent when `source_msg_id` + `channel` are provided.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntakeInput"}}}},"responses":{"200":{"description":"Deduplicated (existing row returned)"},"201":{"description":"Created"},"400":{"description":"Invalid payload"},"401":{"description":"Unauthorized"},"403":{"description":"Missing scope intake:write"},"429":{"description":"Rate limited"}}}}}}