# Generate Mask by Key Points

Generates a segmentation mask video based on coordinate key points.

Response behavior:
- Returns HTTP 202 with request_id and status_url
- The final result (via Status Service) will contain a mask_url.

Constraints:
- Max Duration: 5 seconds (Truncated if auto_trim=true).
- Max Resolution: 750p.

Endpoint: POST /mask_by_key_points

## Header parameters:

  - `api_token` (string, required)

## Request fields (application/json):

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

  - `frame_index` (integer)
    The frame number to apply key points to.

  - `key_points` (array, required)
    An array of coordinate objects defining the mask hints.

  - `key_points.x` (integer)

  - `key_points.y` (integer)

  - `key_points.type` (string)
    Enum: "positive", "negative"

  - `auto_trim` (boolean)
    If true, trims the video to the 5s limit.

  - `output_container_and_codec` (string)
    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)


