REST API
Intercessor exposes a REST API under:
/wp-json/intercessor/v1/Endpoints
| Method | Endpoint | Access |
|---|---|---|
| GET | /requests | Public; non-moderators receive approved public requests |
| GET | /requests/{id} | Public; non-moderators receive it only when it is approved and public, otherwise 404 |
| POST | /requests | Submission permission checks apply |
| POST | /requests/{id}/status | edit_prayers |
| GET | /requesters | edit_prayers |
| GET | /requests/{id}/history | Public for approved public requests; moderator-only fields are withheld |
| GET | /requests/{id}/notes | edit_prayers |
| POST | /requests/{id}/notes | edit_prayers |
| DELETE | /requests/{id}/notes/{nid} | edit_prayers |
Listing requests
GET /requests accepts:
per_page— default10, minimum1, maximum100.page— default1.status— defaultapproved.
Non-moderators are forced to Approved status, and private requests are never exposed publicly.
Single-request visibility
GET /requests/{id} and GET /requests/{id}/history apply the same rule: a caller without the edit_prayers capability only ever receives a request that is both approved and public. Pending, rejected, archived, and private requests answer 404 (not 403), so the endpoint does not reveal whether a hidden request exists.
The public history response is built from a fixed allow-list of fields (id, prayer_request_id, old_status, new_status, date_created). The moderator's WordPress user ID (actor_user_id) and internal notes are returned only to callers with edit_prayers.
Creating requests
POST /requests delegates to the same submission pipeline used by the front-end form. This means rate limiting, duplicate prevention, profanity filtering, requester creation, storage, and configured notifications remain consistent across submission methods.
Moderation
Status changes use POST /requests/{id}/status and require the edit_prayers capability. When the status actually changes, the endpoint notifies the requester just as the admin screens do, so moderation over REST and in the admin behave identically. It returns 404 for an unknown request.
Notes
Request notes can be listed, created, and deleted by users with edit_prayers. New notes include content and an is_private flag, which defaults to true.
WARNING
Do not assume that a public GET endpoint exposes all stored fields. The REST implementation explicitly protects non-public and private requests from unauthorized callers.