Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.moorcheh.ai/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Returns status for an upload started by upload_namespace_documents or upload_namespace_vectors. Poll until status is "completed". Check successful and failed for per-item results.

Method

client.upload_job_status(namespace_name: str, job_id: str) -> dict
Alias: upload_namespace_documents_job_status(namespace_name, job_id) — same behavior.

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 MoorchehApiClient, MoorchehApiError

client = MoorchehApiClient("http://localhost:8080")

resp = client.upload_namespace_documents("my-documents", {
    "documents": [{"id": "doc-1", "text": "Hello"}],
})

while True:
    job = client.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",
}

Errors

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

try:
    job = client.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