Skip to content

Embedding job statuses

POST
/wp-json/wp2tutor/embedding/v1/statuses
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.

Media typeapplication/json
object
ids

Same id_chunk values as sync. PHP intval. Empty or no source → statuses [].

Array<integer>
Example
{
"ids": [
42,
43
]
}

Object { statuses }. Empty PHP array encodes as JSON []; otherwise object id_chunk → ChunkStatus.

Media typeapplication/json
object
statuses
One of:
array
0
Example
{
"statuses": {
"42": 1,
"43": 0
}
}

Not authenticated. DualRest: rest_forbidden (status 401) when there is no cookie session. Cookie + X-WP-Nonce or Application Password.

Media typeapplication/json
object
code

WP_Error code. For POST /chat 401 — rest_forbidden. DualRest cookie — rest_forbidden / rest_not_logged_in / rest_cookie_invalid_nonce.

string
message

WP_Error message (for the chat secret — Missing or invalid secret.).

string
data

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.

Media typeapplication/json
object
code

WP_Error code. For POST /chat 401 — rest_forbidden. DualRest cookie — rest_forbidden / rest_not_logged_in / rest_cookie_invalid_nonce.

string
message

WP_Error message (for the chat secret — Missing or invalid secret.).

string
data

Usually { status: HTTP code }, as PHP stores in WP_Error data.

object
Example
{
"code": "rest_forbidden",
"message": "Missing or invalid secret.",
"data": {
"status": 401
}
}