# Eraser

Try out this capability in Bria's sandbox


Description
Initiates an asynchronous object erasure job. Removes objects defined by the mask input and reconstructs the background.


Mask Input


This endpoint requires a mask definition object. You can provide a direct mask_url, or use one of our masking endpoints (mask_by_prompt, mask_by_key_points) to define the mask area.


Response behavior:

- Returns HTTP 202 with request_id and status_url

- Check job status by polling status_url or by calling the Status Service with the request_id until a terminal status is returned


Constraints & Limits:

- Max Duration: 5 seconds. Videos longer than 5s will be truncated if auto_trim is true, or rejected if false.

- Max Resolution: 750p. Inputs higher than 750p will be automatically downscaled.

- Frame Rate: Recommended 24 FPS (preserved in output).


Preservation Rules:

- Aspect Ratio (within 16:9 constraint)

- Frame Rate

- Audio (preserved by default)

Endpoint: POST /erase

## Header parameters:

  - `api_token` (string, required)

## Request fields (application/json):

  - `video` (string, required)
    Publicly accessible URL of the input video.

  - `mask` (string, required)
    Required. A URL with mask video defining the area to erase.

  - `preserve_audio` (boolean)
    Whether to keep the original audio track.

  - `auto_trim` (boolean)
    If true, videos longer than 5 seconds are trimmed to the first 5 seconds.

  - `output_container_and_codec` (string)
    Output container and codec preset.
    Enum: "mp4_h264", "mp4_h265", "webm_vp9", "mov_h265", "mov_proresks", "mkv_h264", "mkv_h265", "mkv_vp9", "gif"

## 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 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 405 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 500 fields (application/json):

  - `error` (object, required)

  - `error.code` (integer, required)
    Example: 123

  - `error.message` (string, required)

  - `error.details` (string, required)

  - `request_id` (string, required)


