Create an asynchronous segmentation job (image or video)
POST
/v1/jobs
const url = 'https://api.segmentationapi.com/v1/jobs';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"type":"image","prompts":["example"],"generatePreview":true,"threshold":1,"maskThreshold":1,"tasks":["a1b2c3d4-e5f6-7890-abcd-ef1234567890.png","b2c3d4e5-f6a7-8901-bcde-f12345678901.jpg"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.segmentationapi.com/v1/jobs \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "type": "image", "prompts": [ "example" ], "generatePreview": true, "threshold": 1, "maskThreshold": 1, "tasks": [ "a1b2c3d4-e5f6-7890-abcd-ef1234567890.png", "b2c3d4e5-f6a7-8901-bcde-f12345678901.jpg" ] }'Queue an image or video segmentation job from previously uploaded task IDs and text prompts. The job runs asynchronously. Poll retrieveJob until status is success, then fetch masks with retrieveJobResult or createJobDownload. Auth is required; there is no anonymous API.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Responses
Section titled “Responses”Job accepted
Media typeapplication/json
object
Example
{ "jobId": "job-abc-987", "type": "image", "totalItems": 2}Invalid request
Media typeapplication/json
object
Examplegenerated
{ "error": "example", "message": "example", "remainingTokens": 1, "requestedTokens": 1, "expiresAt": "2026-04-15T12:00:00Z", "activeJobId": "example", "upgradeUrl": "https://example.com", "retryAfterSeconds": 1}Authentication is missing, invalid, or expired
Media typeapplication/json
object
Examplegenerated
{ "error": "example", "message": "example", "remainingTokens": 1, "requestedTokens": 1, "expiresAt": "2026-04-15T12:00:00Z", "activeJobId": "example", "upgradeUrl": "https://example.com", "retryAfterSeconds": 1}Trial access is expired, exhausted, or insufficient
Media typeapplication/json
object
Examplegenerated
{ "error": "example", "message": "example", "remainingTokens": 1, "requestedTokens": 1, "expiresAt": "2026-04-15T12:00:00Z", "activeJobId": "example", "upgradeUrl": "https://example.com", "retryAfterSeconds": 1}The provided taskId does not belong to the authenticated account
Media typeapplication/json
object
Examplegenerated
{ "error": "example", "message": "example", "remainingTokens": 1, "requestedTokens": 1, "expiresAt": "2026-04-15T12:00:00Z", "activeJobId": "example", "upgradeUrl": "https://example.com", "retryAfterSeconds": 1}Request conflicts with the current resource state
Media typeapplication/json
object
Examplegenerated
{ "error": "example", "message": "example", "remainingTokens": 1, "requestedTokens": 1, "expiresAt": "2026-04-15T12:00:00Z", "activeJobId": "example", "upgradeUrl": "https://example.com", "retryAfterSeconds": 1}Internal server error
Media typeapplication/json
object
Examplegenerated
{ "error": "example", "message": "example", "remainingTokens": 1, "requestedTokens": 1, "expiresAt": "2026-04-15T12:00:00Z", "activeJobId": "example", "upgradeUrl": "https://example.com", "retryAfterSeconds": 1}Failed to enqueue job for background processing
Media typeapplication/json
object
Examplegenerated
{ "error": "example", "message": "example", "remainingTokens": 1, "requestedTokens": 1, "expiresAt": "2026-04-15T12:00:00Z", "activeJobId": "example", "upgradeUrl": "https://example.com", "retryAfterSeconds": 1}Free trial queue capacity is temporarily unavailable
Media typeapplication/json
object
Examplegenerated
{ "error": "example", "message": "example", "remainingTokens": 1, "requestedTokens": 1, "expiresAt": "2026-04-15T12:00:00Z", "activeJobId": "example", "upgradeUrl": "https://example.com", "retryAfterSeconds": 1}