# Eraser The enables the removal of elements or specific areas from a given image. You can define the area to be removed by providing a mask that outlines the region to be erased. There are two main ways recommended to generate these masks: 1. Masks can be created by allowing users to draw directly on the image with a brush, for example. To access the SDK that demonstrates how to implement a brush feature in your interface, please refer to the following link. 2. By using the route, which will generate all the possible masks for an image. - The modified image is returned at the original resolution, preserving full visual quality without any automatic resizing or downscaling. - All areas outside the provided mask remain completely unchanged, ensuring pixel-perfect preservation of unedited regions. Endpoint: POST /erase ## Header parameters: - `api_token` (string, required) ## Request fields (application/json): - `image` (string, required) The source image to be handled by the API. Supported input types: - - pointing to an image file that is publicly accessible and available at the time of processing. Accepted formats: , , , . - `mask` (string, required) The binary mask image that defines the region where object generation will occur. - The region to generate content must have a pixel value of . - All other areas must have a pixel value of . - The mask must have the as the input image. - – provide the mask data directly in the request. - – provide a publicly accessible URL to the mask image. Accepted formats: , , , . Ensure that any provided URL is publicly accessible at the time of the request. - `mask_type` (string) Specifies how the input mask was created. - – Use when the mask was generated by a user, for example, using a brush tool. - – Use when the mask was generated by an algorithm, such as or other automated segmentation methods. Enum: "manual", "automatic" - `sync` (boolean) Specifies the response mode. - When (default), the request is processed asynchronously: the API immediately returns a status URL to track progress. - When , the request is processed synchronously: the API hold the connection open until the proccess is complete and then returns the final image URL in the response. - `visual_input_content_moderation` (boolean) When enabled, applies content moderation to input visual. Expected behavior: - Processing stops if the image fails moderation. - Returns a 422 error with details about which parameter failed. - `visual_output_content_moderation` (boolean) When enabled, applies content moderation to result visual. Expected behavior: - If the modified image fails moderation, returns a 422 error. ## Response 200 fields (application/json): - `result` (object, required) - `result.image_url` (string, required) - `request_id` (string, required) ## Response 202 fields (application/json): - `request_id` (string, required) - `status_url` (string, required) ## Response 400 fields (application/json): - `error` (object, required) - `error.code` (integer, required) Example: 123 - `error.message` (string, required) - `error.details` (string, required) - `request_id` (string, required) ## Response 401 fields (application/json): - `error` (object, required) - `error.code` (integer, required) Example: 123 - `error.message` (string, required) - `error.details` (string, required) - `request_id` (string, required) ## Response 403 fields (application/json): - `error` (object, required) - `error.code` (integer, required) Example: 123 - `error.message` (string, required) - `error.details` (string, required) - `request_id` (string, required) ## Response 404 fields (application/json): - `error` (object, required) - `error.code` (integer, required) Example: 123 - `error.message` (string, required) - `error.details` (string, required) - `request_id` (string, required) ## Response 415 fields (application/json): - `error` (object, required) - `error.code` (integer, required) Example: 123 - `error.message` (string, required) - `error.details` (string, required) - `request_id` (string, required) ## Response 422 fields (application/json): - `error` (object, required) - `error.code` (integer, required) Example: 123 - `error.message` (string, required) - `error.details` (string, required) - `request_id` (string, required) ## Response 429 fields (application/json): - `error` (object, required) - `error.code` (integer, required) Example: 123 - `error.message` (string, required) - `error.details` (string, required) - `request_id` (string, required) ## Response 460 fields (application/json): - `error` (object, required) - `error.code` (integer, required) Example: 123 - `error.message` (string, required) - `error.details` (string, required) - `request_id` (string, required) ## Response 5XX fields (application/json): - `error` (object, required) - `error.code` (integer, required) Example: 123 - `error.message` (string, required) - `error.details` (string, required) - `request_id` (string, required)