> ## 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

> GET /v3/biometric-templates/count/ — Diditでアプリケーションが保持する、画像を含まない顔の生体認証テンプレートの件数を、一覧エンドポイントと同じフィルターで取得します。

[生体認証テンプレートの一覧取得](https://docs.didit.me/ja/management-api/biometric-templates/list.md)と同じフィルターに一致するテンプレートの件数を返します。完全削除されたテンプレートは件数に含まれません。

```bash theme={null}
curl -X GET "https://verification.didit.me/v3/biometric-templates/count/?status=active" \
  -H "x-api-key: YOUR_API_KEY"
```

```json theme={null}
{ "count": 128 }
```

ダッシュボードに合計件数を表示する場合や、`delete_all: true`を指定してフィルター付きの[一括完全削除](https://docs.didit.me/ja/management-api/biometric-templates/batch-purge.md)を実行する前に、対象となるテンプレートを確認する場合に使用します。


## OpenAPI

````yaml ja/openapi-25.json GET /v3/biometric-templates/count/
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/count/:
    get:
      tags:
        - Biometric Templates
      summary: 保持されている生体認証テンプレートの件数を取得
      description: >-
        オプトインしたアプリケーションは、セッションが削除されたとき（`DELETE
        /v3/session/{sessionId}/delete/`を参照）、画像を含まない顔の生体認証テンプレートを1件、別途管理された状態でユーザーに紐づけて保持します。テンプレートは有限の`expires_at`を持つ生体データであり、画像、セッションデータ、本人情報のフィールドを含むことはありません。また、ユーザーの削除、プライバシーに基づく消去、有効期限切れ、または明示的なパージによって完全に削除されます。これらのエンドポイントはアプリケーションのAPIキー（`x-api-key`）のみを受け付けます。Business
        Consoleのユーザートークンは`403`で拒否されます。


        一覧エンドポイントと同じフィルターに一致するテンプレートの件数を返します。`delete_all:
        true`を指定したフィルター付きの一括パージで何が対象になるかを確認するために使用します。
      operationId: count_biometric_templates
      parameters:
        - in: query
          name: vendor_data
          required: false
          description: 所有するユーザーの現在の`vendor_data`に対する大文字・小文字を区別しない部分一致。
          schema:
            type: string
        - in: query
          name: vendor_user_uuid
          required: false
          description: 所有者であるユーザーとの完全一致です。
          schema:
            type: string
            format: uuid
        - in: query
          name: status
          required: false
          description: ライフサイクルステータス。完全削除されたテンプレートは一覧に表示されません。
          schema:
            type: string
            enum:
              - pending
              - active
              - expired
              - held_out_of_use
              - purge_pending
              - purge_failed
        - in: query
          name: source_type
          required: false
          description: テンプレートの作成方法。
          schema:
            type: string
            enum:
              - session_delete
              - automatic_retention
              - backfill
        - in: query
          name: retained_from
          required: false
          description: この日時以降に保持されたテンプレート。
          schema:
            type: string
            format: date-time
        - in: query
          name: retained_to
          required: false
          description: この日時以前に保持されたテンプレート。`retained_from`より前の日時は指定できません(`400`)。
          schema:
            type: string
            format: date-time
      responses:
        '200':
          description: 件数。
          content:
            application/json:
              schema:
                type: object
                properties:
                  count:
                    type: integer
                    minimum: 0
              examples:
                Count:
                  value:
                    count: 128
        '400':
          description: >-
            フィルターの値が無効であるか、`retained_to`が`retained_from`より前です。フィールドごとの検証エラーが返されます。
          content:
            application/json:
              examples:
                Bad range:
                  value:
                    retained_to:
                      - Must be on or after retained_from.
        '403':
          description: >-
            コンソールユーザートークンが使用されたか、APIキーが許可されていません。これらのエンドポイントはアプリケーションのAPIキーのみを受け付けます。
          content:
            application/json:
              examples:
                Forbidden:
                  value:
                    detail: You do not have permission to perform this action.
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: curl
          source: >-
            curl -X GET
            'https://verification.didit.me/v3/biometric-templates/count/?status=active'
            \
              -H 'x-api-key: YOUR_API_KEY'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            result = client.biometric_templates.count()
            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.count();
            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.BiometricTemplates.Count(ctx, didit.BiometricTemplatesCountParams{})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)"
        - lang: java
          label: Java
          source: |-
            import me.didit.Didit;

            // Reads DIDIT_API_KEY.
            Didit client = new Didit();

            var result = client.biometricTemplates().count();
            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->count();
            print_r($result->toArray());
        - lang: ruby
          label: Ruby
          source: |-
            require "didit"

            # Reads DIDIT_API_KEY.
            didit = Didit::Client.new

            result = didit.biometric_templates.count
            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.CountAsync();
            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        お客様のアプリケーションのAPIキーです。Business ConsoleのDevelopers -> API
        keysで取得できます。プライマリキーはフルアクセス権を持ちます。名前付きキーにはスコープを設定できます。リソースごとのアクセス権（なし、読み取り、書き込み）、一部のワークフローまたは承認済みセッションへの限定、IPアドレスのリストへの限定、有効期限の設定です。401は、キーが誤っている、失効している、または期限切れであることを意味します。403は、キーが送信されていない、キーにこのリソースやアクションへのアクセス権がない、またはIPリスト外のアドレスからリクエストが送信されたことを意味します。セッションのルートでの404は、セッションがキーのワークフローまたはステータスの対象外であることを意味します。メディアへのアクセス権がないキーでは、画像、動画、PDFのURLがnullで返されます。セッションの書き込み権限がないキーでは、セッションのリンクとトークンがnullで返されます。詳細は次を参照してください:
        https://docs.didit.me/console/api-keys

````

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