Jobs

Create asynchronous segmentation jobs for images or videos, then poll for results. Each job processes 1-100 uploaded task IDs with the text prompts you specify.

Create a Job

POST/v1/jobs

Submit a type ("image" or "video"), a tasks array of task IDs from the upload flow, and a prompts array with at least one non-empty text phrase.

Request Body

FieldTypeRequiredDescription
typestringYes"image" or "video"
tasksstring[]Yes1–100 task IDs from presign uploads
promptsstring[]YesText prompts for segmentation targets
thresholdnumberNoDetection confidence threshold (0–1, image only)
maskThresholdnumberNoMask binarization threshold (0–1, image only)
generatePreviewbooleanNoGenerate overlay preview image/video

Image job

curl -X POST \
  https://api.segmentationapi.com/v1/jobs \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_SEGMENTATION_API_KEY" \
  -d '{
    "type": "image",
    "tasks": ["0000_a1b2c3d4"],
    "prompts": ["painting"],
    "threshold": 0.5,
    "maskThreshold": 0.5,
    "generatePreview": true
  }'

Video job

curl -X POST \
  https://api.segmentationapi.com/v1/jobs \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_SEGMENTATION_API_KEY" \
  -d '{
    "type": "video",
    "tasks": ["0001_e5f6g7h8"],
    "prompts": ["person"],
    "generatePreview": true
  }'

Response

202 Accepted

{
  "jobId": "job-abc-987",
  "type": "image",
  "status": "queued",
  "totalItems": 1
}

List Jobs

GET/v1/jobs

Retrieve a paginated list of jobs for your account. Pass limit (max 100) and nextToken for cursor-based pagination.

Request

curl -X GET \
  "https://api.segmentationapi.com/v1/jobs?limit=20" \
  -H "x-api-key: YOUR_SEGMENTATION_API_KEY"

200 OK

{
  "items": [
    {
      "jobId": "job-abc-987",
      "type": "image",
      "status": "completed",
      "totalItems": 1,
      "createdAt": "2026-03-07T12:00:00Z",
      "updatedAt": "2026-03-07T12:01:00Z"
    }
  ],
  "nextToken": "eyJvZmZzZXQiOjIwfQ=="
}
Query ParamTypeDefaultDescription
limitnumber20Results per page (max 100)
nextTokenstringCursor from previous response

Get a Job

GET/v1/jobs/{jobId}

Fetch full details for a single job including per-task status. Each task moves through queuedprocessing success | failed.

Request

curl -X GET \
  https://api.segmentationapi.com/v1/jobs/job-abc-987 \
  -H "x-api-key: YOUR_SEGMENTATION_API_KEY"

200 OK

{
  "userId": "user-123",
  "jobId": "job-abc-987",
  "type": "image",
  "tasks": [
    {
      "taskId": "0000_a1b2c3d4",
      "status": "success"
    }
  ]
}

Job Status Lifecycle

StatusDescription
queuedJob is accepted and waiting for a processing slot
processingSegmentation is actively processing
successAll tasks completed — masks are available
failedProcessing failed — check task-level errors for details