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

# 생체 인식 템플릿 일괄 삭제 API

> Didit POST /v3/biometric-templates/delete/로 ID 목록 또는 필터에 맞는 보관된 얼굴 생체 인식 템플릿을 삭제합니다. 템플릿별로 멱등성이 보장됩니다.

여러 템플릿을 한 번의 호출로 영구 삭제합니다. 명시적인 ID 목록을 제공하거나 `delete_all: true`를 제공할 수 있으며, 선택적으로 [List Biometric Templates](https://docs.didit.me/ko/management-api/biometric-templates/list.md)와 동일한 필터로 범위를 좁힐 수 있습니다.

## 요청 본문

| 필드 | 타입 | 설명 |
| - | - | - |
| `template_uuids` | UUID\[] | 영구 삭제할 템플릿입니다. `delete_all`이 `true`가 아니면 필수입니다. 이미 영구 삭제된 ID는 `already_purged`로 보고됩니다. |
| `delete_all` | boolean | `true`이면 아래 필터와 일치하는 모든 템플릿을 영구 삭제합니다(필터가 없으면 애플리케이션의 모든 템플릿). `template_uuids`는 무시됩니다. |
| `vendor_data` | string | `delete_all`에서만 사용합니다. 해당 사용자의 `vendor_data`에 대해 대소문자를 구분하지 않는 부분 문자열 일치를 수행합니다. |
| `vendor_user_uuid` | UUID | `delete_all`에서만 사용합니다. 해당 사용자와 정확히 일치해야 합니다. |
| `status` | enum | `delete_all`에서만 사용합니다. `pending`, `active`, `expired`, `held_out_of_use`, `purge_pending`, `purge_failed` 중 하나입니다. |
| `source_type` | enum | `delete_all`에서만 사용합니다. `session_delete`, `automatic_retention`, `backfill` 중 하나입니다. |
| `retained_from`, `retained_to` | datetime | `delete_all`에서만 사용합니다. 보존 날짜 범위입니다. |

> [!WARNING]
>
> 필터 없이 `delete_all: true`를 사용하면 애플리케이션의 모든 생체 인식 템플릿이 영구 삭제되며 되돌릴 수 없습니다. 삭제 전에 같은 필터로 [Count Biometric Templates](https://docs.didit.me/ko/management-api/biometric-templates/count.md)를 실행하여 삭제 대상을 확인하십시오.

## 예제

> [tab] ID로
>
> ```bash theme={null}
> curl -X POST https://verification.didit.me/v3/biometric-templates/delete/ \
>   -H "x-api-key: YOUR_API_KEY" \
>   -H "Content-Type: application/json" \
>   -d '{"template_uuids": ["9d2f4b6e-1c3a-4e8f-b7d5-0a1c2e3f4a5b", "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d"]}'
> ```

> [tab] 사용자 한 명의 모든 템플릿
>
> ```bash theme={null}
> curl -X POST https://verification.didit.me/v3/biometric-templates/delete/ \
>   -H "x-api-key: YOUR_API_KEY" \
>   -H "Content-Type: application/json" \
>   -d '{"delete_all": true, "vendor_user_uuid": "2f7c1a9e-8b4d-4c6a-9e1f-3d5b7a9c1e2f"}'
> ```

> [tab] 애플리케이션의 모든 템플릿
>
> ```bash theme={null}
> curl -X POST https://verification.didit.me/v3/biometric-templates/delete/ \
>   -H "x-api-key: YOUR_API_KEY" \
>   -H "Content-Type: application/json" \
>   -d '{"delete_all": true}'
> ```

```json theme={null}
{
  "results": [
    { "uuid": "9d2f4b6e-1c3a-4e8f-b7d5-0a1c2e3f4a5b", "outcome": "purged" },
    { "uuid": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d", "outcome": "already_purged" }
  ]
}
```

템플릿은 하나씩 영구 삭제되며, 각 결과에는 `purged` 또는 `already_purged`가 보고됩니다. 생체 저장소를 사용할 수 없으면 실패한 첫 번째 템플릿에서 호출이 `503`을 반환합니다. 같은 요청에서 앞서 영구 삭제된 템플릿은 그대로 삭제 상태로 남고, 실패한 템플릿은 `purge_failed` 상태로 바뀌어 이미 매칭에서 제외됩니다. 요청을 다시 보내면 나머지 작업이 완료됩니다.

## 오류

| 상태 코드 | 발생 조건 | 본문 |
| - | - | - |
| `400` | `template_uuids`와 `delete_all: true`가 모두 없는 경우 | `{"template_uuids": ["This field is required unless delete_all is true."]}` |
| `400` | 잘못된 필터 값이 있거나 `retained_to`가 `retained_from`보다 이른 경우 | 필드별 검증 오류 |
| `403` | 콘솔 사용자 토큰을 사용했거나 API 키가 허용되지 않은 경우 | `{"detail": "You do not have permission to perform this action."}` |
| `503` | 생체 저장소를 사용할 수 없었습니다. 요청을 다시 보내십시오. | `{"detail": "The biometric-template operation could not finish because an external store is unavailable. The operation is retryable."}` |


## OpenAPI

````yaml ko/openapi-25.json POST /v3/biometric-templates/delete/
openapi: 3.0.0
info:
  version: 3.0.0
  title: Didit Verification API
  description: 신분증 인증 API입니다. x-api-key 헤더로 인증합니다.
servers:
  - url: https://verification.didit.me
security: []
tags: []
paths:
  /v3/biometric-templates/delete/:
    post:
      tags:
        - Biometric Templates
      summary: 보존된 생체 인식 템플릿 일괄 삭제
      description: >-
        옵트인한 애플리케이션은 세션이 삭제될 때 사용자에게 연결된 별도로 관리되는 이미지가 없는 얼굴 생체 인식 템플릿 하나를
        유지합니다(`DELETE /v3/session/{sessionId}/delete/` 참조). 템플릿은 유한한
        `expires_at`이 있는 생체 인식 데이터입니다. 이미지, 세션 데이터 또는 신원 필드를 절대 포함하지 않으며, 사용자
        삭제, 개인정보 삭제 처리, 만료 또는 명시적 영구 삭제 시 완전히 삭제됩니다. 이러한 endpoint는 애플리케이션 API
        키(`x-api-key`)만 허용하며, Business Console 사용자 token은 `403`으로 거부됩니다.


        한 번의 호출로 명시적 ID 목록을 사용하거나 목록 endpoint와 동일한 필터로 선택적으로 범위를 좁힌 `delete_all:
        true`를 사용하여 여러 템플릿을 영구 삭제합니다. 템플릿은 하나씩 영구 삭제되며 각 결과는 `purged` 또는
        `already_purged`로 보고됩니다. 생체 인식 저장소를 사용할 수 없는 경우 호출 시 실패한 첫 번째 템플릿에서
        `503`을 반환합니다. 요청에서 이전에 영구 삭제된 템플릿은 영구 삭제된 상태로 유지되고, 실패한 템플릿은
        `purge_failed`로 이동하며(이미 대조에서 제외됨), 요청을 반복하면 작업을 완료합니다.


        **필터 없이 `delete_all: true`를 사용하면 애플리케이션의 모든 생체 인식 템플릿이 영구 삭제되며 되돌릴 수
        없습니다.** 먼저 동일한 필터로 개수 조회 endpoint를 실행하세요.
      operationId: bulk_purge_biometric_templates
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                template_uuids:
                  type: array
                  items:
                    type: string
                    format: uuid
                  minItems: 1
                  description: >-
                    영구 삭제할 템플릿입니다. `delete_all`이 `true`가 아닌 경우 필수입니다. 이미 영구 삭제된
                    ID는 `already_purged`로 보고됩니다.
                delete_all:
                  type: boolean
                  default: false
                  description: >-
                    `true`인 경우 아래 필터와 일치하는 모든 템플릿을 영구 삭제합니다(필터가 제공되지 않으면 애플리케이션의
                    모든 템플릿). `template_uuids`는 무시됩니다. 되돌릴 수 없습니다.
                vendor_data:
                  type: string
                  description: >-
                    `delete_all`과 함께 사용할 때만 적용: 소유한 사용자의 `vendor_data`에 대한 대소문자
                    구분 없는 부분 문자열 일치.
                vendor_user_uuid:
                  type: string
                  format: uuid
                  description: '`delete_all`과 함께 사용할 때만 적용: 소유 User에 대한 정확한 일치.'
                status:
                  type: string
                  enum:
                    - pending
                    - active
                    - expired
                    - held_out_of_use
                    - purge_pending
                    - purge_failed
                  description: '`delete_all`과 함께 사용할 때만 유효합니다.'
                source_type:
                  type: string
                  enum:
                    - session_delete
                    - automatic_retention
                    - backfill
                  description: '`delete_all`과 함께 사용할 때만 유효합니다.'
                retained_from:
                  type: string
                  format: date-time
                  description: '`delete_all`과 함께 사용할 때만 유효합니다.'
                retained_to:
                  type: string
                  format: date-time
                  description: '`delete_all`과 함께 사용할 때만 유효합니다. `retained_from`보다 이전일 수 없습니다.'
            examples:
              By id:
                value:
                  template_uuids:
                    - 9d2f4b6e-1c3a-4e8f-b7d5-0a1c2e3f4a5b
                    - 1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d
              Every template of one User:
                value:
                  delete_all: true
                  vendor_user_uuid: 2f7c1a9e-8b4d-4c6a-9e1f-3d5b7a9c1e2f
              Every template in the application:
                value:
                  delete_all: true
      responses:
        '200':
          description: 템플릿별 삭제 결과입니다.
          content:
            application/json:
              schema:
                type: object
                properties:
                  results:
                    type: array
                    items:
                      type: object
                      properties:
                        uuid:
                          type: string
                          format: uuid
                        outcome:
                          type: string
                          enum:
                            - purged
                            - already_purged
              examples:
                Mixed:
                  value:
                    results:
                      - uuid: 9d2f4b6e-1c3a-4e8f-b7d5-0a1c2e3f4a5b
                        outcome: purged
                      - uuid: 1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d
                        outcome: already_purged
        '400':
          description: 검증 오류 — 아무것도 영구 삭제되지 않습니다.
          content:
            application/json:
              examples:
                Missing selector:
                  value:
                    template_uuids:
                      - This field is required unless delete_all is true.
                Bad range:
                  value:
                    retained_to:
                      - Must be on or after retained_from.
        '403':
          description: 콘솔 사용자 token이거나 허용되지 않은 API 키입니다. 이 endpoint들은 애플리케이션 API 키만 허용합니다.
          content:
            application/json:
              examples:
                Forbidden:
                  value:
                    detail: You do not have permission to perform this action.
        '503':
          description: >-
            생체 인식 템플릿을 보존하거나 삭제하는 동안 생체 인식 저장소를 사용할 수 없었습니다. 아무것도 삭제되지 않았으므로 동일한
            요청을 반복하십시오. 재시도는 멱등성을 가지며 단일 템플릿으로 수렴됩니다.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
              examples:
                Retryable:
                  value:
                    detail: >-
                      The biometric-template operation could not finish because
                      an external store is unavailable. The operation is
                      retryable.
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: curl
          source: >-
            curl -X POST
            https://verification.didit.me/v3/biometric-templates/delete/ \
              -H 'x-api-key: YOUR_API_KEY' \
              -H 'Content-Type: application/json' \
              -d '{"delete_all": true, "vendor_user_uuid": "2f7c1a9e-8b4d-4c6a-9e1f-3d5b7a9c1e2f"}'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            result = client.biometric_templates.batch_delete(
                template_uuids=["9d2f4b6e-1c3a-4e8f-b7d5-0a1c2e3f4a5b", "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d"],
            )
            print(result)
        - lang: javascript
          label: Node.js
          source: |-
            import Didit from "@didit-protocol/sdk-node";

            // Reads DIDIT_API_KEY.
            const didit = new Didit();

            const result = await didit.biometricTemplates.batchDelete({
              template_uuids: ["9d2f4b6e-1c3a-4e8f-b7d5-0a1c2e3f4a5b", "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d"],
            });
            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.BiometricTemplates.BatchDelete(ctx, didit.BiometricTemplatesBatchDeleteParams{\n\tTemplateUUIDs: didit.Some([]string{\"9d2f4b6e-1c3a-4e8f-b7d5-0a1c2e3f4a5b\", \"1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d\"}),\n})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)"
        - lang: java
          label: Java
          source: >-
            import java.util.List;

            import me.didit.Didit;

            import me.didit.types.BiometricTemplatesBatchDeleteParams;


            // Reads DIDIT_API_KEY.

            Didit client = new Didit();


            var result =
            client.biometricTemplates().batchDelete(BiometricTemplatesBatchDeleteParams.builder()
                    .templateUuids(List.of("9d2f4b6e-1c3a-4e8f-b7d5-0a1c2e3f4a5b", "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d"))
                    .build());
            System.out.println(result);
        - lang: php
          label: PHP
          source: |-
            <?php

            require 'vendor/autoload.php';

            use Didit\DiditClient;

            // Reads DIDIT_API_KEY.
            $didit = new DiditClient();

            $result = $didit->biometricTemplates->batchDelete([
                'template_uuids' => ['9d2f4b6e-1c3a-4e8f-b7d5-0a1c2e3f4a5b', '1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d'],
            ]);
            print_r($result->toArray());
        - lang: ruby
          label: Ruby
          source: >-
            require "didit"


            # Reads DIDIT_API_KEY.

            didit = Didit::Client.new


            result = didit.biometric_templates.batch_delete(template_uuids:
            ["9d2f4b6e-1c3a-4e8f-b7d5-0a1c2e3f4a5b",
            "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d"])

            puts result.to_h
        - lang: csharp
          label: .NET
          source: >-
            using System;

            using System.Text.Json;

            using Didit;


            // Reads DIDIT_API_KEY.

            using var client = new DiditClient();


            var result = await client.BiometricTemplates.BatchDeleteAsync(new
            BiometricTemplatesBatchDeleteParams

            {
                TemplateUuids = new string[] { "9d2f4b6e-1c3a-4e8f-b7d5-0a1c2e3f4a5b", "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d" },
            });

            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Business Console의 Developers -> API keys에서 발급받은 귀하 애플리케이션의 API 키입니다. 기본
        키는 전체 접근 권한을 갖습니다. 이름이 지정된 키는 리소스별 none, read, write 범위로 권한을 제한할 수 있으며
        특정 워크플로나 승인된 세션, IP 주소 목록, 만료일 등으로 제한할 수도 있습니다. 401은 키가 잘못되었거나 폐기되었거나
        만료되었음을 의미합니다. 403은 키가 전송되지 않았거나, 키에 해당 리소스나 작업에 대한 접근 권한이 없거나, 요청이 허용된
        IP 목록 외부 주소에서 발생했음을 의미합니다. 세션 경로에서의 404는 해당 세션이 키의 허용 워크플로 또는 상태 범위를
        벗어났음을 의미합니다. 미디어 접근 권한이 없는 키는 이미지, 비디오, PDF URL을 null로 수신하며, 세션 write
        권한이 없는 키는 세션 링크와 token을 null로 수신합니다.
        https://docs.didit.me/console/api-keys 를 참고하십시오.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.