Skip to main content

API: Endpoint Coverage and Schema Validation

non-critical   Property: ChurchWiseAI   Category: API / Integration Tier: all Persona: developer Touchpoint: /api/*, all endpoints

Preconditions

  • All API routes deployed
  • OpenAPI/Swagger docs available (if documented)

Steps

#ActionExpected Result
1POST /api/chatbot/stream with valid payloadReturns 200. Response is SSE stream or JSON. All required fields present.
2POST /api/contact with valid form dataReturns 200. Contact created in database. Confirmation email sent.
3GET /api/admin/analytics?churchId=XReturns 200 with analytics JSON. Schema matches expected format.
4POST /api/admin/kb-proxy with document uploadReturns 200. Document indexed. Returned immediately or queued.
5POST /api/stripe/webhook with signed payloadReturns 200 (webhook processed). Event handled correctly.
6GET /api/admin/agents?churchId=XReturns 200 with agent config. Schema includes all agent properties.
7Test each endpoint with missing required fieldsReturns 400 Bad Request. Error message describes missing field.
8Test each endpoint with invalid auth tokenReturns 401 Unauthorized. No data leaks in error response.

Known Failure Modes

  • Endpoint returns 404 — route doesn't exist or wrong path
  • Response schema missing fields — client can't parse
  • Endpoint accepts invalid inputs — validation missing
  • Wrong status code for errors — client misinterprets

References

Notes

Tests all major API endpoints exist, return correct status codes, and match expected response schemas. Serves as API contract verification. If these tests fail, frontend and mobile clients can't work. Run after adding any new API endpoints.