Skip to main content

Mosque Management

:::info Status Implemented. Source: fastapi-backend/api/v1/endpoints/mosques.py. :::

The mosque entity itself and who administers it — distinct from Membership, which covers the member↔mosque relationship.

Mosque CRUD

EndpointPurpose
GET /mosquesList/search mosques (by registration code, city, active flag, free-text q); paginated with limit/offset, or unpaginated for mobile/legacy clients when limit is omitted
GET /mosques/{id}Mosque detail — public, no auth required
POST /mosquesCreate a mosque; fails on a duplicate registration_code
PATCH /mosques/{id}Update a mosque — requires mosque-admin standing for that mosque (see Authorization); only a superadmin may change registration_code
GET /mosques/{id}/audioLook up the active recording for a trigger type (azaan, jummah, waaz, taraweeh, announcement, test)
GET /mosques/{id}/activityMerged recent-activity feed for the admin Overview page — broadcasts, device events, announcements, new members
POST /mosques/{mosque_id}/triggerSame as POST /triggers/mosque/{mosque_id} — create a broadcast trigger for this mosque

Mosque admins

A mosque admin row is a separate relationship from memberships — see Authorization — mosque-admin flags for is_owner/can_trigger/can_manage.

EndpointPurpose
GET /mosques/{mosque_id}/adminsList a mosque's admins
POST /mosques/{mosque_id}/adminsAdd an existing user as an admin of this mosque
DELETE /mosques/{mosque_id}/admins/{user_id}Remove an admin

Auto-approve members

mosques.auto_approve_members decides whether self-service joins (POST /mosques/{id}/join, join-by-code) land as approved immediately or pending — see Membership module.

Full request/response schemas: API Reference.