Skip to content

REST API ​

Intercessor exposes a REST API under:

text
/wp-json/intercessor/v1/

Endpoints ​

MethodEndpointAccess
GET/requestsPublic; non-moderators receive approved public requests
GET/requests/{id}Public; non-moderators receive it only when it is approved and public, otherwise 404
POST/requestsSubmission permission checks apply
POST/requests/{id}/statusedit_prayers
GET/requestersedit_prayers
GET/requests/{id}/historyPublic for approved public requests; moderator-only fields are withheld
GET/requests/{id}/notesedit_prayers
POST/requests/{id}/notesedit_prayers
DELETE/requests/{id}/notes/{nid}edit_prayers

Listing requests ​

GET /requests accepts:

  • per_page — default 10, minimum 1, maximum 100.
  • page — default 1.
  • status — default approved.

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.

Intercessor — Prayer Request Management for WordPress