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

# Export Session Files API: Download Every File as One ZIP

> POST /v3/session/{id}/files-export/ to prepare one ZIP with every image, video and document of a KYC or KYB session, in original quality.

Prepare one ZIP with every file of a User Verification (KYC) or Business Verification (KYB) session: document sides, selfies, liveness videos and uploaded documents, in original quality.

The ZIP is prepared in the background. The call answers `202` with the export; read it with [Get files export](https://docs.didit.me/sessions-api/get-files-export.md) until `status` is `READY`, then download `download_url`.

* While an export of the same session is still being prepared, the call returns that export instead of starting a new one.
* The ZIP is deleted 24 hours after it is ready, and at once when the session is deleted.
* A deleted session cannot be exported: the call returns `404`.
* Every export is written to the session's audit log.
* A scoped API key needs `media: read` and `decisions: read`.


## OpenAPI

````yaml POST /v3/session/{sessionId}/files-export/
openapi: 3.0.0
info:
  version: 3.0.0
  title: Didit Verification API
  description: Identity verification API. Authenticate with x-api-key header.
servers:
  - url: https://verification.didit.me
security: []
tags: []
paths:
  /v3/session/{sessionId}/files-export/:
    post:
      tags:
        - Sessions
      summary: Export every file of a session
      description: >-
        Start preparing one ZIP with every image, video and document of a User
        Verification (KYC) or Business Verification (KYB) session, in original
        quality: the files are stored in the ZIP as they were captured, never
        recompressed. Answers `202` with the export; read it with `GET
        /v3/session/{sessionId}/files-export/{exportId}/` until `status` is
        `READY`, then download `download_url`. While an export of the same
        session is still being prepared, that export is returned instead of a
        new one.


        The ZIP is deleted 24 hours after it is ready, and at once when the
        session is deleted. A deleted session cannot be exported. Every export
        and every download link handed out is written to the session's audit
        log. A scoped API key needs `media: read` and `decisions: read`; a
        console user needs the privilege to read sessions.
      operationId: post_v3_session_files_export
      parameters:
        - name: sessionId
          in: path
          required: true
          description: >-
            UUID of the verification session (the `session_id` returned by `POST
            /v3/session/`). Accepts both User Verification (KYC) and Business
            Verification (KYB) session IDs. A deleted session returns `404`.
          schema:
            type: string
            format: uuid
            example: 11111111-2222-3333-4444-555555555555
      responses:
        '202':
          description: The export, being prepared.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionFilesExport'
              example:
                export_id: aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee
                session_id: 11111111-2222-3333-4444-555555555555
                status: PENDING
                file_count: null
                size_bytes: null
                download_url: null
                expires_at: null
                error: null
                created_at: '2026-10-29T12:00:03Z'
                completed_at: null
        '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 POST
            'https://verification.didit.me/v3/session/11111111-2222-3333-4444-555555555555/files-export/'
            \
              -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.export_files(
                "11111111-2222-3333-4444-555555555555",
            )
            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.exportFiles("11111111-2222-3333-4444-555555555555");

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

            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->exportFiles('11111111-2222-3333-4444-555555555555');

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


            # Reads DIDIT_API_KEY.

            didit = Didit::Client.new


            result =
            didit.sessions.export_files("11111111-2222-3333-4444-555555555555")

            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.ExportFilesAsync("11111111-2222-3333-4444-555555555555");

            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  schemas:
    SessionFilesExport:
      type: object
      description: One ZIP with every file of a session, in original quality.
      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 of the export. Pass it to `GET
            /v3/session/{sessionId}/files-export/{exportId}/`.
        session_id:
          type: string
          format: uuid
          description: The session the files are from.
        status:
          type: string
          enum:
            - PENDING
            - PROCESSING
            - READY
            - FAILED
            - EXPIRED
          description: >-
            `PENDING` and `PROCESSING` while the ZIP is prepared, `READY` once
            it can be downloaded, `FAILED` when it could not be prepared
            (request a new export), `EXPIRED` once the ZIP was deleted.
        file_count:
          type: integer
          nullable: true
          description: Files in the ZIP. Set only while `status` is `READY`.
        size_bytes:
          type: integer
          format: int64
          nullable: true
          description: Size of the ZIP in bytes. Set only while `status` is `READY`.
        download_url:
          type: string
          format: uri
          nullable: true
          description: >-
            Signed URL of the ZIP, valid for a short time. Set only while
            `status` is `READY`; read the export again for a new one.
        expires_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            When the ZIP is deleted, 24 hours after it was ready. Set only while
            `status` is `READY`.
        error:
          type: string
          nullable: true
          description: Why the export failed, when `status` is `FAILED`.
        created_at:
          type: string
          format: date-time
          description: When the export was requested.
        completed_at:
          type: string
          format: date-time
          nullable: true
          description: When the ZIP was ready or the export failed.
  responses:
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          examples:
            Invalid API Key:
              summary: Invalid API Key
              value:
                detail: Invalid API Key.
    Forbidden:
      description: Forbidden
      content:
        application/json:
          examples:
            No Permission:
              summary: No Permission
              value:
                detail: You do not have permission to perform this action.
            Not Enough Credits:
              summary: Not Enough Credits
              value:
                error: >-
                  You don't have enough credits to perform this request. Please
                  top up at https://business.didit.me
    NotFound:
      description: Not Found
      content:
        application/json:
          examples:
            Not Found:
              summary: Not Found
              value:
                detail: Resource not found.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Your application's API key, from Developers -> API keys in the Business
        Console. The primary key has full access. A named key can be scoped:
        none, read or write per resource, limited to some workflows or to
        approved sessions, to a list of IP addresses, and to an expiry date. 401
        means the key is wrong, revoked or expired; 403 means no key was sent,
        the key has no access to this resource or action, or the request came
        from an address outside its IP list; 404 on a session route means the
        session is outside the key's workflows or statuses. A key without media
        access receives image, video and PDF URLs as null, and a key without
        sessions write receives session links and tokens as null. See
        https://docs.didit.me/console/api-keys.

````

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