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. Image and video jobs accept different tuning parameters — see the dedicated tables below.

Common Fields

FieldTypeRequiredDescription
typestringYes"image" or "video"
tasksstring[]YesTask IDs from presign uploads. Up to 100 for image jobs; exactly one for video jobs.
promptsstring[]YesAt least one non-empty text prompt for segmentation targets
generatePreviewbooleanNoDefault false. When true, renders a preview artifact — a composited PNG overlay for images, or a baked MP4 for video.

Image Parameters

FieldTypeDefaultDescription
thresholdnumber0.5Detection confidence threshold (0–1). Higher keeps fewer, more confident detections.
maskThresholdnumber0.5Mask binarization threshold (0–1).

Video Parameters

FieldTypeDefaultDescription
scoreThresholdnumber0.0Per-object detection score threshold (0–1).
fpsnumberSample the video at this frame rate (> 0). Mutually exclusive with numFrames.
numFramesintegerSample exactly this many evenly-spaced frames (> 0). Mutually exclusive with fps.
maxFramesintegerUpper bound on the number of frames processed (> 0).

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"],
    "scoreThreshold": 0.5,
    "fps": 6,
    "generatePreview": true
  }'

Response

202 Accepted

{
  "jobId": "job-abc-987",
  "type": "image",
  "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": "success",
      "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. This response carries no mask data — poll it until the job succeeds, then retrieve masks via the Results flow.

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",
  "error": "",
  "tasks": [
    {
      "taskId": "0000_a1b2c3d4",
      "status": "success"
    }
  ]
}

Job Status Lifecycle

StatusDescription
queuedJob is accepted and waiting for a processing slot
processingSegmentation is actively processing
successFinished — request the results archive to download masks
failedProcessing failed — check task-level errors for details