Skip to content

Jobs

Show:

A job represents an asynchronous unit of work, such as ingesting and embedding a document or running an API task. Use the /v1/jobs endpoints to inspect, control, and clean up jobs in your organization.

Note: All /v1/jobs endpoints require a workspace API key in the Authorization: Bearer <token> header. Read operations accept any valid key; write operations (cancel, reprocess, delete) require the jobs:write scope.

FieldTypeDescription
idstringUnique job identifier.
org_idstringOrganization that owns the job.
bucket_idstringBucket the job belongs to.
collection_idstring | nullCollection the job targets, if any.
document_idstring | nullLinked ingest document, if any.
workflow_idstring | nullLinked workflow, if any.
source_entry_idstring | nullLinked source entry, if any.
priorityintegerLower numbers run first (default 2).
statusstringOne of queued, extracting, chunking, embedding, indexing, ready, failed, cancelled.
s3_keystringStorage key for the source file or artifact.
file_namestringOriginal file name.
file_sizeintegerFile size in bytes.
file_typestring | nullFile type, for example pdf, txt, embed_bulk.
processing_typestring | nullsource_connector, bucket_page_reindex, or another task type.
estimated_costnumberEstimated cost at enqueue time.
actual_costnumber | nullActual cost after completion.
chunks_countinteger | nullNumber of chunks produced, if applicable.
failed_phasestring | nullPhase that failed, if status is failed.
error_categorystring | nullCategorized error reason.
error_messagestring | nullHuman-readable error message.
retryableboolean | nullWhether the failure is retryable.
retry_countintegerNumber of retry attempts.
reprocess_of_job_idstring | nullOriginal job ID if this job is a reprocessing retry.
worker_idstring | nullWorker currently processing the job.
scheduled_atstring | nullISO 8601 scheduled time, if deferred.
started_atstring | nullISO 8601 processing start time.
completed_atstring | nullISO 8601 completion time.
created_atstringISO 8601 creation time.
updated_atstringISO 8601 last update time.
metadata_snapshotobject | nullSnapshot of the originating document metadata for audit safety.

Retrieve a single job by ID.

ParameterTypeRequiredDescription
job_idstringYesJob identifier.
{
"id": "job_01J8X...",
"org_id": "org_abc123",
"bucket_id": "bucket_legal",
"collection_id": null,
"document_id": "doc_01J8X...",
"priority": 1,
"status": "ready",
"s3_key": "org_abc123/uploads/contract.pdf",
"file_name": "contract.pdf",
"file_size": 1048576,
"file_type": "pdf",
"estimated_cost": 0.05,
"actual_cost": 0.047,
"chunks_count": 42,
"failed_phase": null,
"error_category": null,
"error_message": null,
"retryable": null,
"retry_count": 0,
"reprocess_of_job_id": null,
"worker_id": null,
"scheduled_at": null,
"started_at": "2026-06-19T04:12:00Z",
"completed_at": "2026-06-19T04:12:08Z",
"created_at": "2026-06-19T04:11:55Z",
"updated_at": "2026-06-19T04:12:08Z",
"metadata_snapshot": {
"file_name": "contract.pdf",
"source_path": "org_abc123/uploads/contract.pdf",
"captured_at": "2026-06-19T04:11:55Z"
}
}
StatusCause
404Job not found or does not belong to the organization.

List jobs for the organization, newest first.

ParameterTypeRequiredDefaultDescription
bucket_idstringNoFilter to a single bucket.
statusstringNoFilter to a single status.
limitintegerNo50Maximum results. Must be between 1 and 200.
[
{
"id": "job_01J8X...",
"org_id": "org_abc123",
"bucket_id": "bucket_legal",
"status": "ready",
"file_name": "contract.pdf",
"file_size": 1048576,
"file_type": "pdf",
"priority": 1,
"created_at": "2026-06-19T04:11:55Z",
"updated_at": "2026-06-19T04:12:08Z"
},
{
"id": "job_01J8Y...",
"org_id": "org_abc123",
"bucket_id": "bucket_hr",
"status": "failed",
"file_name": "handbook.docx",
"file_size": 512000,
"file_type": "docx",
"priority": 2,
"error_message": "Provider embedding timeout",
"created_at": "2026-06-19T03:00:00Z",
"updated_at": "2026-06-19T03:05:00Z"
}
]

List files associated with a job. A Schift job is currently single-document, so this returns at most one file. The response shape mirrors OpenAI vector_store.file objects.

ParameterTypeRequiredDescription
job_idstringYesJob identifier.
{
"object": "list",
"data": [
{
"id": "doc_01J8X...",
"object": "vector_store.file",
"vector_store_id": "bucket_legal",
"status": "uploaded",
"filename": "contract.pdf",
"created_at": "2026-06-19T04:11:55Z"
}
],
"has_more": false
}
StatusCause
404Job not found or does not belong to the organization.

Download the source file associated with a job. The response is returned as a binary stream with an attachment Content-Disposition header.

ParameterTypeRequiredDescription
job_idstringYesJob identifier.

Binary file content. The Content-Type is taken from the job’s file_type, defaulting to application/octet-stream.

StatusCause
404Job not found, job has no file, or file could not be retrieved from storage.

Cancel a queued or in-progress job.

Note: This endpoint requires the jobs:write scope.

ParameterTypeRequiredDescription
job_idstringYesJob identifier.
ParameterTypeRequiredDefaultDescription
forcebooleanNofalseForce-cancel even if the job is in progress.
  • If the job is already in a terminal state (ready, failed, cancelled), the response returns the current status with detail: "job already in terminal state".
  • If the job is in progress and force is false, the endpoint returns 400 and suggests using ?force=true.
  • If force=true, the job is marked cancelled regardless of its current in-progress status.
{
"status": "cancelled"
}
StatusCause
400In-progress job and force=false.
404Job not found or does not belong to the organization.
409Job is no longer queued (race condition).

Create a new job that reprocesses a failed or otherwise terminal job. The new job copies the original source, bucket, collection, and priority, and links back via reprocess_of_job_id.

Note: This endpoint requires the jobs:write scope.

ParameterTypeRequiredDescription
job_idstringYesJob identifier.
{
"id": "job_01J8Z...",
"org_id": "org_abc123",
"bucket_id": "bucket_legal",
"document_id": "doc_01J8X...",
"status": "queued",
"file_name": "contract.pdf",
"file_size": 1048576,
"priority": 1,
"reprocess_of_job_id": "job_01J8X...",
"created_at": "2026-06-19T05:00:00Z",
"updated_at": "2026-06-19T05:00:00Z"
}
StatusCause
400Job is not in a terminal state.
404Job not found or does not belong to the organization.

Delete a job. In-progress jobs cannot be deleted.

Note: This endpoint requires the jobs:write scope.

ParameterTypeRequiredDescription
job_idstringYesJob identifier.

204 No Content on success.

StatusCause
400Cannot delete an in-progress job.
404Job not found or does not belong to the organization.

Mark long-stuck in-progress jobs as failed. This endpoint is intended for cron or platform administrators to recover from dead workers.

Note: This endpoint does not use a regular workspace API key. It accepts one of:

  • A platform_admin JWT or API key in Authorization: Bearer <token>.
  • The X-Cron-Secret header matching the server’s CRON_SECRET environment variable.
ParameterTypeRequiredDefaultDescription
timeout_minutesintegerNo30How long a job must be stuck before it is reaped. Range 11440.
HeaderRequiredDescription
X-Cron-SecretConditionalCron secret for Cloud Scheduler / CLI callers.
AuthorizationConditionalBearer <platform_admin_token> for UI or manual use.
{
"timeout_minutes": 30,
"reaped_count": 2,
"jobs": [
{
"job_id": "job_01J8X...",
"org_id": "org_abc123",
"stuck_status": "embedding"
},
{
"job_id": "job_01J8Y...",
"org_id": "org_def456",
"stuck_status": "extracting"
}
]
}
StatusCause
401No valid authentication provided.
403X-Cron-Secret header present but invalid.