Embedding job statuses
const url = 'https://example.com/wp-json/wp2tutor/embedding/v1/statuses';const options = { method: 'POST', headers: {'X-WP-Nonce': '<X-WP-Nonce>', 'Content-Type': 'application/json'}, body: '{"ids":[42,43]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/wp-json/wp2tutor/embedding/v1/statuses \ --header 'Content-Type: application/json' \ --header 'X-WP-Nonce: <X-WP-Nonce>' \ --data '{ "ids": [ 42, 43 ] }'SQLite chunk status map by id. PHP statuses: body { ids: int[] }, then chunk_source->get_statuses_for_chunks. No source (RAG off / no PDO) → 200 { statuses: [] }.
Values are ChunkStatus: 0 PENDING, 1 ACTIVE, 2 INDEXING, −1 ERROR. JSON object keys are string ids ({"42":1}). Empty ids or empty SELECT → [].
Always HTTP 200 once permission passes. Requires manage_options.
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”object
Same id_chunk values as sync. PHP intval. Empty or no source → statuses [].
Example
{ "ids": [ 42, 43 ]}Responses
Section titled “Responses”Object { statuses }. Empty PHP array encodes as JSON []; otherwise object id_chunk → ChunkStatus.
Not authenticated. DualRest: rest_forbidden (status 401) when there is no cookie session. Cookie + X-WP-Nonce or Application Password.
object
WP_Error code. For POST /chat 401 — rest_forbidden. DualRest cookie — rest_forbidden / rest_not_logged_in / rest_cookie_invalid_nonce.
WP_Error message (for the chat secret — Missing or invalid secret.).
Usually { status: HTTP code }, as PHP stores in WP_Error data.
object
Example
{ "code": "rest_forbidden", "message": "Missing or invalid secret.", "data": { "status": 401 }}Missing manage_options or invalid REST nonce. WordPress REST: rest_forbidden / rest_cookie_invalid_nonce.
object
WP_Error code. For POST /chat 401 — rest_forbidden. DualRest cookie — rest_forbidden / rest_not_logged_in / rest_cookie_invalid_nonce.
WP_Error message (for the chat secret — Missing or invalid secret.).
Usually { status: HTTP code }, as PHP stores in WP_Error data.
object
Example
{ "code": "rest_forbidden", "message": "Missing or invalid secret.", "data": { "status": 401 }}