Create a presigned upload URL for an input file
POST
/v1/uploads/presign
const url = 'https://api.segmentationapi.com/v1/uploads/presign';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"contentType":"image/png"}'};
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/uploads/presign \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "contentType": "image/png" }'Request a short-lived S3 PUT URL and a task ID for an image or video file. PUT the bytes to uploadUrl with the same Content-Type, then pass the task ID to createJob.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
Responses
Section titled “Responses”Presigned upload URL and object key
Media typeapplication/json
object
Example
{ "taskId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890.png"}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}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}