POST
Locate and segment specific objects within an image. You supply a list of objects to look for, and the endpoint returns a Run-Length Encoded (RLE) segmentation mask for each object it finds. This endpoint performs object segmentation only - it does not classify whether the image is AI-generated. To detect AI-generated content, use AI Image Detection.
Authentication Required. You need to login with a user and API key in order to access this method. Add this HTTP header to your request:Authorization: Bearer <Your-Login-Token>

Request

Path Parameters

scanId
string
required
A unique scan id provided by you. We recommend you use the same id in your database to represent the scan in the Copyleaks database. This will help you to debug incidents. Using the same ID for the same file will help you to avoid network problems that may lead to multiple scans for the same file. Learn more about the criteria for creating a Scan ID.>= 3 characters <= 36 characters

Content Type

Submit images using multipart/form-data. Headers:

Body Parameters

image
file
required
Binary image file.Requirements:
  • Size: Minimum 512x512px, maximum 6000x4500px (27 megapixels)
  • File size: Less than 32MB
  • Formats: PNG, JPG, JPEG, BMP, WebP, HEIC/HEIF
filename
string
required
The name of the image file including its extension.Requirements:
  • Allowed file extensions: .png, .jpg, .jpeg, .bmp, .webp, .heic, .heif
  • <= 255 characters
objectDetection
array
required
The list of objects to locate and segment within the image. Sent as a single JSON-encoded form field, for example objectDetection=[{"object":"face"},{"object":"hand"}].Each entry wraps the object name in an object ({ "object": "face" }) so future per-entry fields can be added without a breaking change.
  • Required. At least one entry.
  • Maximum 3 entries.
  • Each entry’s object value must be a non-empty string of at most 32 characters.
sandbox
boolean
default:"false"
Use sandbox mode to test your integration with the Copyleaks API without consuming any credits.

Responses

200 OK - The image was successfully analyzed. See the Object Detection Response for the full field reference.