Skip to main content

Jobs API

Monitor job progress and cancel running jobs.

List Jobs

source_id
string
Filter jobs by source ID
skip
integer
Pagination offset (default: 0)
limit
integer
Pagination limit (default: 50, max: 100)
# All jobs
curl https://api.trygroundai.com/jobs \
  -H "Authorization: Bearer gnd_your_api_key"

# Jobs for a specific source
curl "https://api.trygroundai.com/jobs?source_id={source_id}"
{
  "jobs": [
    {
      "id": "job-uuid",
      "source_id": "source-uuid",
      "status": "completed",
      "stage": "finalize",
      "progress_percent": 100,
      "progress_message": "Done",
      "files_processed": 45,
      "chunks_created": 42,
      "chunks_updated": 3,
      "chunks_deleted": 0,
      "created_at": "2026-01-17T10:00:00Z",
      "started_at": "2026-01-17T10:00:05Z",
      "completed_at": "2026-01-17T10:05:00Z"
    }
  ],
  "total": 1
}

Get Job

curl https://api.trygroundai.com/jobs/{job_id} \
  -H "Authorization: Bearer gnd_your_api_key"
{
  "id": "job-uuid",
  "source_id": "source-uuid",
  "status": "running",
  "stage": "embed",
  "progress_percent": 60,
  "progress_message": "Generating embeddings...",
  "stage_details": {
    "chunks_embedded": 150,
    "total_chunks": 250
  },
  "files_processed": 250,
  "chunks_created": 0,
  "chunks_updated": 0,
  "chunks_deleted": 0,
  "error_message": null,
  "error_details": null,
  "retry_count": 0,
  "created_at": "2026-01-17T10:00:00Z",
  "started_at": "2026-01-17T10:00:05Z",
  "completed_at": null
}

Job Status Values

StatusDescription
pendingJob created, waiting to be processed
runningJob currently executing
completedJob finished successfully
failedJob failed with error
cancelledJob was cancelled

Job Stages

StageProgressDescription
queued0%Waiting in queue
fetch10%Downloading content
parse25%Extracting text
chunk40%Splitting into chunks
embed60%Generating embeddings
index80%Storing in database
finalize95%Updating metadata

Cancel Job

curl -X POST https://api.trygroundai.com/jobs/{job_id}/cancel \
  -H "Authorization: Bearer gnd_your_api_key"
{
  "id": "job-uuid",
  "status": "cancelled",
  "...": "..."
}
Only pending and running jobs can be cancelled. Cancelling a completed or failed job returns an error.

Failed Jobs

When a job fails:
{
  "id": "job-uuid",
  "status": "failed",
  "stage": "fetch",
  "error_message": "Failed to fetch URL: 404 Not Found",
  "error_details": {
    "url": "https://example.com/openapi.json",
    "status_code": 404
  },
  "retry_count": 3
}
Jobs automatically retry up to max_retries times (default: 3).