This page documents two related endpoints for listing churches based on different user contexts.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/SidneyEmeka/church_management_system/llms.txt
Use this file to discover all available pages before exploring further.
Get Pastor Churches
Retrieve all churches where the authenticated user is the pastor.Authentication
This endpoint requires:- Valid JWT token in the Authorization header
- User role must be
pastor
Endpoint
Path Parameters
The MongoDB ObjectId of the pastor. This should match the authenticated user’s profile ID.
Response
Indicates whether the operation was successful.
A descriptive message including the count of churches found.
Array of church objects where the user is the pastor.
The unique MongoDB ObjectId of the church.
The name of the church.
The physical address of the church.
Contact information object containing phone, email, and optional website.
Populated pastor profile object (excludes sensitive auth details).
Array of populated member profile objects (excludes sensitive auth details).
Example Request
Example Response
Success (200 OK)
No Churches Found (404 Not Found)
Unauthorized - Not a Pastor (403 Forbidden)
Get User Churches
Retrieve all churches where the authenticated user is a member.Authentication
This endpoint requires:- Valid JWT token in the Authorization header
- Any authenticated user role (pastor or member)
Endpoint
Path Parameters
The MongoDB ObjectId of the user profile. This should match the authenticated user’s profile ID.
Response
Indicates whether the operation was successful.
A descriptive message including the count of churches found.
Array of church objects where the user is a member.
The unique MongoDB ObjectId of the church.
The name of the church.
The physical address of the church.
Contact information object containing phone, email, and optional website.
Populated pastor profile object with basic information (excludes auth details and sensitive fields).
Example Request
Example Response
Success (200 OK)
No Churches Found (404 Not Found)
Server Error (500 Internal Server Error)
Notes
Pastor Churches Endpoint
- Only accessible by users with
pastorrole - Returns complete church information including all members
- Useful for pastors to manage their churches
- Member list is fully populated with profile details
User Churches Endpoint
- Accessible by any authenticated user (pastor or member)
- Returns churches where the user is a member (including as pastor)
- Member list is excluded from the response for privacy
- Only pastor information is populated
- Both endpoints return an empty result with 404 if no churches are found