Skip to main content

documents.upload_job_status

Returns status for an upload started by Upload Documents or Upload Vectors. Poll until status is "completed".
client.documents.upload_job_status(namespace_name: str, job_id: str) -> dict[str, Any]
client.vectors.upload_job_status(namespace_name: str, job_id: str) -> dict[str, Any]
Both call the same endpoint. Use whichever matches the resource you uploaded with. API: GET /namespaces/{namespace_name}/upload-jobs/{job_id} — see Upload job status

Parameters

namespace_name
string
required
Namespace the upload job belongs to. Must match the namespace used when the job was started.
job_id
string
required
Job id returned from an upload call.

Example

import time
from moorcheh import MoorchehClient, MoorchehApiError

with MoorchehClient("http://localhost:8080") as client:
    resp = client.documents.upload(
        "my-documents",
        documents=[{"id": "doc-1", "text": "Hello"}],
    )

    while True:
        job = client.documents.upload_job_status("my-documents", resp["job_id"])
        print(job["status"], job["successful"], job["failed"])
        if job["status"] == "completed":
            break
        time.sleep(0.5)

    if job["failed"]:
        print(job.get("last_error"))

Returns

job_id
string
Id of the upload job.
namespace_name
string
Namespace items are being uploaded to.
status
string
Job state: "running" or "completed".
total
number
Total number of documents or vectors in the upload batch.
processed
number
Number of items processed so far (embedded or validated).
successful
number
Number of items successfully persisted.
failed
number
Number of items that failed during processing. Check last_error for the most recent failure reason.
last_error
string | null
Most recent per-item error message during processing; null if none.
started_at
string
ISO 8601 UTC timestamp when the job started.
updated_at
string
ISO 8601 UTC timestamp of the last job update.
finished_at
string | null
ISO 8601 UTC timestamp when the job finished; null while status is "running".
message
string
Error description when the job cannot be found.
Example return value (completed)
{
  "job_id": "job-a0e3d54b9d0d4616949474697308a39c",
  "namespace_name": "my-documents",
  "status": "completed",
  "total": 1,
  "processed": 1,
  "successful": 1,
  "failed": 0,
  "last_error": None,
  "started_at": "2026-05-21T12:00:00.000Z",
  "updated_at": "2026-05-21T12:00:02.000Z",
  "finished_at": "2026-05-21T12:00:02.000Z",
}

Error Handling

Non-2xx responses raise MoorchehApiError.
from moorcheh import MoorchehClient, MoorchehApiError

try:
    with MoorchehClient() as client:
        job = client.documents.upload_job_status("my-documents", job_id)
except MoorchehApiError as e:
    print(e.status_code, e.body)  # 404 if job not found
StatusCause
404Upload job not found, or job id does not belong to this namespace