> ## 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のGET /v3/session/{id}/files-export/{export_id}/で、セッションファイルのエクスポートの進捗を確認し、ZIPの準備が完了したら署名付きダウンロードリンクを取得できます。

[ファイルのエクスポート](https://docs.didit.me/ja/sessions-api/export-files.md)で開始したエクスポートを取得します。

* `PENDING`と`PROCESSING`:ZIPを準備中です。数秒後にもう一度エクスポートを取得してください。
* `READY`:`download_url`はZIPへの署名付きリンクで、短時間だけ有効です。`expires_at`までは、エクスポートを再度取得すると新しいリンクを取得できます。
* `FAILED`:ZIPを準備できませんでした。新しいエクスポートを開始してください。
* `EXPIRED`:ZIPは削除されました。新しいエクスポートを開始してください。

ダウンロードリンクを返す取得は、すべてセッションの監査ログに記録されます。削除されたセッションのエクスポートは`404`を返します。


## OpenAPI

````yaml ja/openapi-25.json GET /v3/session/{sessionId}/files-export/{exportId}/
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/session/{sessionId}/files-export/{exportId}/:
    get:
      tags:
        - Sessions
      summary: セッションファイルのエクスポートを取得
      description: >-
        `POST
        /v3/session/{sessionId}/files-export/`で開始したエクスポートの進捗です。`status`が`READY`になると、`download_url`はZIPの署名付きURLとなり、短時間のみ有効です。`expires_at`までは、エクスポートを再度読み取ることで新しいURLを取得できます。ダウンロードリンクを発行する読み取りは、すべてセッションの監査ログに記録されます。削除されたセッションのエクスポートは`404`を返します。
      operationId: get_v3_session_files_export
      parameters:
        - name: sessionId
          in: path
          required: true
          description: >-
            検証セッションのUUID(`POST
            /v3/session/`が返す`session_id`)。ユーザー認証(KYC)と法人確認(KYB)の両方のセッションIDを受け付けます。削除されたセッションは`404`を返します。
          schema:
            type: string
            format: uuid
            example: 11111111-2222-3333-4444-555555555555
        - name: exportId
          in: path
          required: true
          description: '`POST /v3/session/{sessionId}/files-export/`が返した`export_id`です。'
          schema:
            type: string
            format: uuid
            example: aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee
      responses:
        '200':
          description: エクスポートです。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionFilesExport'
              example:
                export_id: aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee
                session_id: 11111111-2222-3333-4444-555555555555
                status: READY
                file_count: 9
                size_bytes: 18734120
                download_url: >-
                  https://storage.example.com/session/11111111-2222-3333-4444-555555555555/files-export/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee/session-42-files.zip?X-Amz-Signature=...
                expires_at: '2026-10-30T12:00:41Z'
                error: null
                created_at: '2026-10-29T12:00:03Z'
                completed_at: '2026-10-29T12:00:41Z'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: curl
          source: >-
            curl -X GET
            'https://verification.didit.me/v3/session/11111111-2222-3333-4444-555555555555/files-export/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee/'
            \
              -H 'x-api-key: YOUR_API_KEY'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            result = client.sessions.get_files_export(
                "11111111-2222-3333-4444-555555555555",
                "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
            )
            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.sessions.getFilesExport(
              "11111111-2222-3333-4444-555555555555",
              "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
            );
            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.Sessions.GetFilesExport(ctx, \"11111111-2222-3333-4444-555555555555\", \"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\")\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.sessions().getFilesExport("11111111-2222-3333-4444-555555555555",
            "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee");

            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->sessions->getFilesExport('11111111-2222-3333-4444-555555555555',
            'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee');

            print_r($result->toArray());
        - lang: ruby
          label: Ruby
          source: |-
            require "didit"

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

            result = didit.sessions.get_files_export(
              "11111111-2222-3333-4444-555555555555",
              "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"
            )
            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.Sessions.GetFilesExportAsync("11111111-2222-3333-4444-555555555555",
            "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee");

            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  schemas:
    SessionFilesExport:
      type: object
      description: セッションのすべてのファイルを元の品質のまま収めた1つのZIPファイル。
      required:
        - export_id
        - session_id
        - status
        - file_count
        - size_bytes
        - download_url
        - expires_at
        - error
        - created_at
        - completed_at
      properties:
        export_id:
          type: string
          format: uuid
          description: >-
            エクスポートのID。`GET
            /v3/session/{sessionId}/files-export/{exportId}/`に渡します。
        session_id:
          type: string
          format: uuid
          description: ファイルの取得元のセッション。
        status:
          type: string
          enum:
            - PENDING
            - PROCESSING
            - READY
            - FAILED
            - EXPIRED
          description: >-
            ZIPの準備中は`PENDING`および`PROCESSING`、ダウンロード可能になると`READY`、準備できなかった場合は`FAILED`（新しいエクスポートをリクエストしてください）、ZIPが削除されると`EXPIRED`です。
        file_count:
          type: integer
          nullable: true
          description: ZIP内のファイル。`status`が`READY`の間のみ設定されます。
        size_bytes:
          type: integer
          format: int64
          nullable: true
          description: ZIPのサイズ(バイト単位)。`status`が`READY`の間のみ設定されます。
        download_url:
          type: string
          format: uri
          nullable: true
          description: >-
            ZIPの署名付きURLで、有効期間は短時間です。`status`が`READY`の間のみ設定されます。新しいURLを取得するには、エクスポートを再度読み取ってください。
        expires_at:
          type: string
          format: date-time
          nullable: true
          description: ZIPが削除される日時で、準備完了から24時間後です。`status`が`READY`の間のみ設定されます。
        error:
          type: string
          nullable: true
          description: '`status`が`FAILED`の場合に、エクスポートが失敗した理由。'
        created_at:
          type: string
          format: date-time
          description: エクスポートがリクエストされた日時。
        completed_at:
          type: string
          format: date-time
          nullable: true
          description: ZIPの準備が完了した日時、またはエクスポートが失敗した日時。
  responses:
    Unauthorized:
      description: 未認証
      content:
        application/json:
          examples:
            Invalid API Key:
              summary: 無効なAPIキー
              value:
                detail: Invalid API Key.
    Forbidden:
      description: アクセス禁止
      content:
        application/json:
          examples:
            No Permission:
              summary: 権限がありません
              value:
                detail: You do not have permission to perform this action.
            Not Enough Credits:
              summary: クレジット不足
              value:
                error: >-
                  You don't have enough credits to perform this request. Please
                  top up at https://business.didit.me
    NotFound:
      description: 見つかりません
      content:
        application/json:
          examples:
            Not Found:
              summary: 見つかりません
              value:
                detail: Resource not found.
  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.