> ## Documentation Index
> Fetch the complete documentation index at: https://apidoc.cometapi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Xóa vùng chọn video Kling

> Sử dụng API Kling Delete Video Selection để xóa các phần tử đã chọn khỏi một lượt chỉnh sửa video đa phần tử thông qua CometAPI, hỗ trợ quy trình làm việc video multimodal.

Sử dụng endpoint tiện ích này để xóa trạng thái vùng chọn khỏi một phiên chỉnh sửa multimodal trước khi bạn xây dựng lại hoặc hủy bỏ vùng chỉnh sửa hiện tại.

## Khi nào nên dùng

* Bạn muốn xóa bản ghi vùng chọn hiện tại thay vì tiếp tục với nó
* Bạn đang dọn dẹp một lượt chỉnh sửa trước khi đánh dấu vùng mục tiêu mới

## Vai trò trong quy trình

* Yêu cầu `session_id` từ [Khởi tạo video để chỉnh sửa](./initialize-video-for-editing)
* Yêu cầu `frame_index` và `points` theo tỷ lệ phần trăm 0-1 cho các điểm vùng chọn mà bạn muốn xóa
* Thường được theo sau bởi [Thêm vùng chọn video](./add-video-selection) hoặc kết thúc phiên mà không tạo nội dung

<Tip>
  Để xem tài liệu tham chiếu tham số đầy đủ, hãy xem [tài liệu Kling API](https://kling.ai/document-api/apiReference/model/multiElements).
</Tip>


## OpenAPI

````yaml api/openapi/video/kling/multimodal-video-editing/post-delete-video-selection.openapi.json POST /kling/v1/videos/multi-elements/delete-selection
openapi: 3.1.0
info:
  title: Delete Video Selection API
  version: 1.0.0
servers:
  - url: https://api.cometapi.com
security:
  - bearerAuth: []
paths:
  /kling/v1/videos/multi-elements/delete-selection:
    post:
      summary: Delete Video Selection
      operationId: delete_video_selection
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - session_id
                - frame_index
                - points
              properties:
                session_id:
                  type: string
                  description: >-
                    Selection session id returned by init-selection. Follow-up
                    calls must use the same account and exact session id.
                frame_index:
                  type: integer
                  description: Frame index where the selected point set applies.
                points:
                  type: array
                  description: Points to delete from the current selection.
                  items:
                    type: object
                    required:
                      - x
                      - 'y'
                    properties:
                      x:
                        type: number
                        description: Horizontal coordinate as a 0-1 frame percentage.
                      'y':
                        type: number
                        description: Vertical coordinate as a 0-1 frame percentage.
              default:
                session_id: <session_id>
                frame_index: 1
                points:
                  - x: 0.5
                    'y': 0.5
            examples:
              Default:
                summary: Delete selected points
                value:
                  session_id: <session_id>
                  frame_index: 1
                  points:
                    - x: 0.5
                      'y': 0.5
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - message
                properties:
                  code:
                    type: integer
                    description: Response code. `0` means the request succeeded.
                  message:
                    type: string
                    description: Response message.
                  data:
                    type: object
                    description: Route-specific response payload when present.
                    additionalProperties: true
                additionalProperties: true
      x-codeSamples:
        - lang: Shell
          label: Default
          source: >
            curl
            https://api.cometapi.com/kling/v1/videos/multi-elements/delete-selection
            \
              -H "Authorization: Bearer $COMETAPI_KEY" \
              -H "Content-Type: application/json" \
              -d '{
                  "session_id": "<session_id>",
                  "frame_index": 1,
                  "points": [
                    {
                      "x": 0.5,
                      "y": 0.5
                    }
                  ]
                }'
        - lang: Python
          label: Default
          source: |
            import os
            import requests

            response = requests.post(
                "https://api.cometapi.com/kling/v1/videos/multi-elements/delete-selection",
                headers={"Authorization": "Bearer " + os.environ["COMETAPI_KEY"]},
                json={
                  "session_id": "<session_id>",
                  "frame_index": 1,
                  "points": [
                    {
                      "x": 0.5,
                      "y": 0.5
                    }
                  ]
                },
            )

            result = response.json()
            print(result.get("code"), result.get("data"))
        - lang: JavaScript
          label: Default
          source: >
            const response = await
            fetch("https://api.cometapi.com/kling/v1/videos/multi-elements/delete-selection",
            {
              method: "POST",
              headers: {
                Authorization: `Bearer ${process.env.COMETAPI_KEY}`,
                "Content-Type": "application/json",
              },
              body: JSON.stringify({
                "session_id": "<session_id>",
                "frame_index": 1,
                "points": [
                  {
                    "x": 0.5,
                    "y": 0.5
                  }
                ]
              }),
            });


            const result = await response.json();

            console.log(result.code, result.data);
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Bearer token authentication. Use your CometAPI key.

````