Editor-facing routes to queue OCR and poll status for a post’s PDF attachment.
Base path: /wp-json/prc-pdf-extraction/v1/
Source: includes/class-rest-api.php
Auth summary
Both routes require edit_post on the target post_id (convert_permission_check).
Route index
| Method | Path | Purpose |
|---|---|---|
POST | /convert | Schedule async extraction |
GET | /status | Read none / pending / complete |
POST /convert
Reference
2 fields
Body parameters
Typed options, defaults, and constraints in one scannable reference.
-
post_idnumber required -
Parent report post ID.
-
attachment_idnumber required -
PDF attachment ID.
No fields match this filter.
Success: { job_id, status: "queued" } when scheduled. Idempotent when already pending — returns status: "pending" without a new job.
Errors include: 403 forbidden, 404 missing post/attachment, 400 non-PDF mime, 500 schedule failure.
GET /status
Reference
2 fields
Query parameters
Typed options, defaults, and constraints in one scannable reference.
-
post_idnumber required -
Parent report post ID.
-
attachment_idnumber required -
PDF attachment ID.
No fields match this filter.
Success: { status, extraction_id } where status is none, pending, or complete.
Request
GET
/wp-json/prc-pdf-extraction/v1/status?post_id=123&attachment_id=456
HeadersKey: value
Accept application/json
Response
200 OK
Response headers
Key: value
BodyJSON
{
"status": "complete",
"extraction_id": 789
}