Overview
Areas represent organizational units within a church (e.g., Worship, Youth, Children’s Ministry). Each area belongs to a specific church and can contain multiple teams.Authentication
All endpoints require authentication and thechurch.read or church.update permission depending on the operation.
List Areas
GET /api/areas
Retrieve all areas for a church
church.read
Query Parameters
Filter areas by church ID. If omitted, uses the authenticated user’s church (non-super admins)
Alternative parameter name for church_id
Request
Response
Indicates if the request was successful
Array of area objects
Create Area
POST /api/areas
Create a new area within a church
church.update
Request Body
The name of the area
The ID of the church this area belongs to
Alternative parameter name for church_id
Optional description of the area’s purpose
Request
Alternative with Query Parameter
Response
Error Responses
Missing Required Fields (400)Update Area
PUT /api/areas/{id}
Update an existing area
church.update
Request Parameters
The ID of the area to update
The updated name of the area
Updated description (optional)
Request
Response
Error Responses
Invalid ID (400)Delete Area
DELETE /api/areas/{id}
Delete an area
church.update
Request Parameters
The ID of the area to delete
Request
Response
Error Responses
Invalid ID (400)Permission Context
Church ID Resolution
The API automatically resolves the church context based on:- Query parameter:
church_idorchurchId - Request body: For POST/PUT requests
- User context: For non-super admins, uses their assigned church
- Super admin: Can access all churches or specify a church_id
Permission Checks
- Read operations: Require
church.readpermission for the specified church - Write operations: Require
church.updatepermission for the specified church - Super admins: Can perform operations across all churches
Activity Logging
Area creation automatically logs an activity entry:Error Codes
| Code | Description |
|---|---|
| 400 | Bad Request - Invalid or missing parameters |
| 401 | Unauthorized - Invalid or missing token |
| 403 | Forbidden - Insufficient permissions for the church |
| 404 | Not Found - Area doesn’t exist |
| 500 | Internal Server Error |
Related APIs
Churches
Manage church organizations
Teams
Manage teams within areas