> ## 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/session/{id}/share/로 재사용 가능한 KYC 또는 KYB용 시간 제한 공유 토큰을 생성하세요. JWT 서명, 파트너 연동 가능, 호출당 과금, 계약 불필요.



세션 공유 프롬프트
        프롬프트를 클립보드에 복사



      
      

\<pre>

\`Mint a short-lived share token so another Didit application can import this finished verification session (Reusable KYC / KYB).

Endpoint:
POST https://verification.didit.me/v3/session/{session_id}/share/

Authentication:
Use the x-api-key header with your Didit API key. Privilege: write:sessions.

Path parameter:
\- session_id (UUID) — works for both User Verification (KYC) and Business Verification (KYB).

Request body:
\- for_application_id (string, UUID, required) — UUID of the receiving Didit application. Must exist, must not be deleted, and must be different from the calling application.
\- ttl_in_seconds (integer, optional, default 3600) — Lifetime of the share token. Min 60, max 86400 (24 hours).

Prerequisites:
\- Session status must be one of "Approved", "Declined", "In Review". Any other status returns 400 ("Only finished sessions ... can be shared.").

curl example:
curl -X POST https://verification.didit.me/v3/session/<SESSION_ID>/share/ \
-H "x-api-key: <API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"for_application_id": "<PARTNER_APP_UUID>",
"ttl_in_seconds": 3600
}'

Response:
\- share_token (string) — HS256-signed JWT with payload { session_id, session_kind, from_application_id, for_application_id, iat, exp }.
\- for_application_id (UUID) — echoed back.
\- session_kind ("user" | "business") — embedded so the receiver clones the right kind.

Token characteristics:
\- Bound to for_application_id — only that application can redeem it via POST /v3/session/import-shared/.
\- Cannot be revoked via API — it simply expires after ttl_in_seconds.
\- You can mint multiple tokens for the same session (e.g. one per partner). Each call returns a fresh JWT with a new iat.

Failure modes:
\- 400 — { "detail": "Only finished sessions ... can be shared." } when the session isn't Approved/Declined/In Review.
\- 400 — { "for_application_id": ["..."] } for unknown or self application UUIDs.
\- 401 — invalid API key.
\- 403 — { "detail": "You do not have permission to perform this action." } when the key lacks write:sessions.
\- 404 — { "detail": "Not found." } when the session_id is not visible to this application.

Send the share_token to the receiving partner through your own secure channel (HTTPS API call, webhook, signed email link, etc.).

Next step:
The receiving application calls POST https://verification.didit.me/v3/session/import-shared/ with the share_token to clone the session — see /sessions-api/share-session/import.

For end-to-end Didit integration, paste in the full prompt at /integration/integration-prompt.`

\</pre>



      
      

붙여넣을 곳

## KYC 및 KYB 지원**사용자 인증(KYC)**과 **기업 확인(KYB)** 세션 모두에서 사용할 수 있습니다. Didit은 두 세션 유형 모두에서 `session_id`를 조회하고, 다음을 포함하는 JWT 공유 토큰을 생성합니다:```json theme={null}
{
  "session_id": "...",
  "session_kind": "user" | "business",
  "from_application_id": "...",
  "for_application_id": "...",
  "iat": ...,
  "exp": ...
}
```수신 파트너가 토큰을 가져오면 Didit은 해당 유형의 세션(KYC 또는 KYB)을 연관 관계와 함께 복제합니다.## 요구 사항- 세션이 **완료된** 상태(`APPROVED`, `DECLINED`, `IN_REVIEW`)여야 합니다.
- `write:sessions` 권한이 있어야 합니다.
- `for_application_id`는 유효한 Didit 애플리케이션이어야 합니다(보통 파트너의 애플리케이션).## 예시> [tab] 사용자 인증(KYC) 세션 공유
>
> ```bash theme={null}
> curl -X POST https://verification.didit.me/v3/session/4c5c7f3a-.../share/ \
>   -H "x-api-key: YOUR_API_KEY" \
>   -H "Content-Type: application/json" \
>   -d '{
>     "for_application_id": "partner-app-uuid",
>     "ttl_in_seconds": 3600
>   }'
> ```
>
> **응답:**
>
> ```json theme={null}
> {
>   "share_token": "eyJhbGciOiJIUzI1NiJ9...",
>   "for_application_id": "partner-app-uuid",
>   "session_kind": "user"
> }
> ```> [tab] 기업 확인(KYB) 세션 공유
>
> ```bash theme={null}
> curl -X POST https://verification.didit.me/v3/session/bs-01HJX1.../share/ \
>   -H "x-api-key: YOUR_API_KEY" \
>   -H "Content-Type: application/json" \
>   -d '{
>     "for_application_id": "partner-app-uuid",
>     "ttl_in_seconds": 7200
>   }'
> ```
>
> **응답:**
>
> ```json theme={null}
> {
>   "share_token": "eyJhbGciOiJIUzI1NiJ9...",
>   "for_application_id": "partner-app-uuid",
>   "session_kind": "business"
> }
> ```## TTL 범위| 파라미터 | 최소 | 최대 | 기본값 |
| - | - | - | - |
| `ttl_in_seconds` | 60 | 86400 | 3600 |## 관련 문서- [공유 세션 가져오기](https://docs.didit.me/ko/sessions-api/share-session/import.md)
- [재사용 가능한 KYC 가이드](https://docs.didit.me/ko/core-technology/reusable-kyc/share-kyc-via-api.md)
- [세션 개요](https://docs.didit.me/ko/sessions-api/overview.md)


## OpenAPI

````yaml ko/openapi-25.json POST /v3/session/{sessionId}/share/
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}/share/:
    post:
      tags:
        - Sessions
      summary: 완료된 인증 세션에 대한 공유 토큰 생성
      description: >-
        특정 Didit 애플리케이션이 이 완료된 세션을 가져올 수 있도록 수명이 짧은 JWT를 생성합니다. `POST
        /v3/session/import-shared/`와 함께 사용하십시오.
      operationId: post_v3_session_share
      parameters:
        - in: path
          name: sessionId
          required: true
          description: 토큰을 발급할 소스 인증 세션의 UUID입니다.
          schema:
            type: string
            format: uuid
            example: 11111111-2222-3333-4444-555555555555
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - for_application_id
              properties:
                for_application_id:
                  type: string
                  format: uuid
                  description: >-
                    token을 사용할 Didit 애플리케이션의 UUID입니다. 반드시 존재해야 하고, 삭제되지 않아야 하며,
                    호출하는 애플리케이션과 달라야 합니다. Business Console의 **Settings →
                    Application**에서 확인할 수 있습니다.
                  example: a5f3bca2-46e2-411e-90ef-a580900a57ee
                ttl_in_seconds:
                  type: integer
                  description: >-
                    token 유효 기간(초 단위)입니다. 최소 `60`, 최대 `86400`(24시간)입니다. 기본값은
                    `3600`(1시간)입니다.
                  minimum: 60
                  maximum: 86400
                  default: 3600
                  example: 3600
            example:
              for_application_id: a5f3bca2-46e2-411e-90ef-a580900a57ee
              ttl_in_seconds: 7200
      responses:
        '200':
          description: 공유 token이 발행되었습니다.
          content:
            application/json:
              schema:
                type: object
                properties:
                  share_token:
                    type: string
                    description: >-
                      HS256 서명된 JWT입니다. 대상 애플리케이션의 [`POST
                      /v3/session/import-shared/`](/sessions-api/import-shared-session)에
                      `share_token`으로 그대로 전달하십시오.
                    example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
                  for_application_id:
                    type: string
                    format: uuid
                    description: token이 바인딩된 대상 애플리케이션 UUID를 반환합니다.
                    example: a5f3bca2-46e2-411e-90ef-a580900a57ee
                  session_kind:
                    type: string
                    enum:
                      - user
                      - business
                    description: 소스 세션이 사용자 인증(KYC) 또는 기업 확인(KYB) 세션인지 여부입니다.
              examples:
                User session:
                  summary: KYC 세션 공유
                  value:
                    share_token: >-
                      eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzZXNzaW9uX2lkIjoiMjBiYjNjM2ItNjE0Ni00MzlmLTg0YTQtYmQzMGQwMGFjNmEyIiwiZnJvbV9hcHBsaWNhdGlvbl9pZCI6ImRiZDIwZTM0LTQyZTktNGYyYy1iYTkxLWNmMDc2MjAxNmY2NCIsImZvcl9hcHBsaWNhdGlvbl9pZCI6ImE1ZjNiY2EyLTQ2ZTItNDExZS05MGVmLWE1ODA5MDBhNTdlZSIsImlhdCI6MTc1MzYzMDY2NiwiZXhwIjoxNzUzNjM0MjY2fQ.JJ9pNE_hqZsOtbR0XYZIWw4JzidjdEl279iUrsIkhGE
                    for_application_id: a5f3bca2-46e2-411e-90ef-a580900a57ee
                    session_kind: user
                Business session:
                  summary: KYB 세션 공유
                  value:
                    share_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
                    for_application_id: a5f3bca2-46e2-411e-90ef-a580900a57ee
                    session_kind: business
        '400':
          description: >-
            유효성 검사 오류입니다. 필드 오류는 필드 이름을 키로 하며, 완료되지 않음 오류는 `detail` 키 아래에 배열로
            전달됩니다.
          content:
            application/json:
              examples:
                Wrong status:
                  summary: 소스 세션이 완료되지 않았습니다
                  value:
                    detail:
                      - >-
                        Only finished sessions ("Approved", "Declined", "In
                        Review") can be shared.
                Target missing:
                  summary: 대상 애플리케이션이 존재하지 않음
                  value:
                    for_application_id:
                      - Target application does not exist.
                Self-share:
                  summary: 대상이 호출 애플리케이션임
                  value:
                    for_application_id:
                      - Cannot share a session with the same application.
                TTL bounds:
                  summary: ttl_in_seconds가 허용 범위를 벗어났습니다
                  value:
                    ttl_in_seconds:
                      - Ensure this value is greater than or equal to 60.
        '401':
          description: >-
            자격 증명이 누락되었거나 유효하지 않습니다. 대부분의 v3 endpoint와 달리, 이 endpoint는 권한 데코레이터를
            통해 인증하며 유효한 token/키가 제공되지 않으면 `401`을 반환합니다.
          content:
            application/json:
              examples:
                Unauthorized:
                  summary: 권한 없음
                  value:
                    detail: >-
                      Authentication credentials were not provided or are
                      invalid.
        '403':
          description: 자격 증명이 유효하지만 이 애플리케이션에 대한 `write:sessions` 권한이 없습니다.
          content:
            application/json:
              examples:
                No Permission:
                  summary: 권한 없음
                  value:
                    detail: You do not have permission to perform this action.
        '404':
          description: 애플리케이션에 해당 `session_id`를 가진 세션이 존재하지 않습니다.
          content:
            application/json:
              examples:
                Not Found:
                  summary: 세션을 찾을 수 없습니다
                  value:
                    detail: Not found.
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: curl
          source: |-
            curl -X POST \
              https://verification.didit.me/v3/session/11111111-2222-3333-4444-555555555555/share/ \
              -H 'x-api-key: YOUR_API_KEY' \
              -H 'Content-Type: application/json' \
              -d '{
                "for_application_id": "a5f3bca2-46e2-411e-90ef-a580900a57ee",
                "ttl_in_seconds": 7200
              }'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            result = client.sessions.share(
                "11111111-2222-3333-4444-555555555555",
                for_application_id="a5f3bca2-46e2-411e-90ef-a580900a57ee",
                ttl_in_seconds=7200,
            )
            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.share("11111111-2222-3333-4444-555555555555", {
              for_application_id: "a5f3bca2-46e2-411e-90ef-a580900a57ee",
              ttl_in_seconds: 7200,
            });

            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.Sessions.Share(ctx, \"11111111-2222-3333-4444-555555555555\", didit.SessionsShareParams{\n\tForApplicationID: \"a5f3bca2-46e2-411e-90ef-a580900a57ee\",\n\tTTLInSeconds:     didit.Int(7200),\n})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)"
        - lang: java
          label: Java
          source: >-
            import me.didit.Didit;

            import me.didit.types.SessionsShareParams;


            // Reads DIDIT_API_KEY.

            Didit client = new Didit();


            var result =
            client.sessions().share("11111111-2222-3333-4444-555555555555",
            SessionsShareParams.builder()
                    .forApplicationId("a5f3bca2-46e2-411e-90ef-a580900a57ee")
                    .ttlInSeconds(7200L)
                    .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->sessions->share('11111111-2222-3333-4444-555555555555', [
                'for_application_id' => 'a5f3bca2-46e2-411e-90ef-a580900a57ee',
                'ttl_in_seconds' => 7200,
            ]);

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

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

            result = didit.sessions.share(
              "11111111-2222-3333-4444-555555555555",
              for_application_id: "a5f3bca2-46e2-411e-90ef-a580900a57ee",
              ttl_in_seconds: 7200
            )
            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.ShareAsync("11111111-2222-3333-4444-555555555555",
            new SessionsShareParams

            {
                ForApplicationId = "a5f3bca2-46e2-411e-90ef-a580900a57ee",
                TtlInSeconds = 7200,
            });

            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.