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

# Share-Token API: Session teilen und Token erstellen

> Didit: POST /v3/session/{id}/share/ erstellt zeitlich begrenzten Share-Token für wiederverwendbares KYC oder KYB. JWT-signiert, ohne Verträge.



Prompt für Sitzungsfreigabe
        Prompt in die Zwischenablage kopieren



      
      

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



      
      

Einfügen in

## Unterstützung für KYC und KYBFunktioniert sowohl für Sitzungen zur **Benutzerverifizierung (KYC)** als auch zur **Unternehmensverifizierung (KYB)**. Didit gleicht die `session_id` mit beiden Sitzungstypen ab und erzeugt ein JWT-Freigabe-Token, das Folgendes enthält:```json theme={null}
{
  "session_id": "...",
  "session_kind": "user" | "business",
  "from_application_id": "...",
  "for_application_id": "...",
  "iat": ...,
  "exp": ...
}
```Wenn der empfangende Partner das Token importiert, klont Didit die entsprechende Sitzungsart (KYC oder KYB) samt ihrer Beziehungen.## Anforderungen- Die Sitzung muss einen **abgeschlossenen** Status haben (`APPROVED`, `DECLINED`, `IN_REVIEW`).
- Sie müssen über die Berechtigung `write:sessions` verfügen.
- Die `for_application_id` muss eine gültige Didit-Anwendung sein (in der Regel die Anwendung eines Partners).## Beispiele> [tab] Eine Sitzung zur Benutzerverifizierung (KYC) teilen
>
> ```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
>   }'
> ```
>
> **Antwort:**
>
> ```json theme={null}
> {
>   "share_token": "eyJhbGciOiJIUzI1NiJ9...",
>   "for_application_id": "partner-app-uuid",
>   "session_kind": "user"
> }
> ```> [tab] Eine Sitzung zur Unternehmensverifizierung (KYB) teilen
>
> ```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
>   }'
> ```
>
> **Antwort:**
>
> ```json theme={null}
> {
>   "share_token": "eyJhbGciOiJIUzI1NiJ9...",
>   "for_application_id": "partner-app-uuid",
>   "session_kind": "business"
> }
> ```## TTL-Grenzen| Parameter | Min | Max | Standard |
| - | - | - | - |
| `ttl_in_seconds` | 60 | 86400 | 3600 |## Verwandte Themen- [Geteilte Sitzung importieren](https://docs.didit.me/de/sessions-api/share-session/import.md)
- [Leitfaden zu wiederverwendbarem KYC](https://docs.didit.me/de/core-technology/reusable-kyc/share-kyc-via-api.md)
- [Übersicht über Sitzungen](https://docs.didit.me/de/sessions-api/overview.md)


## OpenAPI

````yaml de/openapi-25.json POST /v3/session/{sessionId}/share/
openapi: 3.0.0
info:
  version: 3.0.0
  title: Didit Verification API
  description: API für Ausweisverifizierung. Authentifizierung über den x-api-key-Header.
servers:
  - url: https://verification.didit.me
security: []
tags: []
paths:
  /v3/session/{sessionId}/share/:
    post:
      tags:
        - Sessions
      summary: >-
        Erstellen Sie ein Freigabe-Token für eine abgeschlossene
        Verifizierungssitzung
      description: >-
        Erstellen Sie ein kurzlebiges JWT, mit dem eine bestimmte
        Didit-Anwendung diese abgeschlossene Sitzung importieren kann. In
        Kombination mit `POST /v3/session/import-shared/` verwenden.
      operationId: post_v3_session_share
      parameters:
        - in: path
          name: sessionId
          required: true
          description: >-
            UUID der Quell-Verifizierungssitzung, für die ein Token ausgestellt
            werden soll.
          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: >-
                    UUID der Didit-Anwendung, die das Token einlösen wird. Muss
                    existieren, darf nicht gelöscht sein und muss sich von der
                    aufrufenden Anwendung unterscheiden. Sie finden sie in der
                    Business Console unter **Settings → Application**.
                  example: a5f3bca2-46e2-411e-90ef-a580900a57ee
                ttl_in_seconds:
                  type: integer
                  description: >-
                    Token-Lebensdauer in Sekunden. Minimum `60`, Maximum `86400`
                    (24 Std.). Standardmäßig `3600` (1 Std.).
                  minimum: 60
                  maximum: 86400
                  default: 3600
                  example: 3600
            example:
              for_application_id: a5f3bca2-46e2-411e-90ef-a580900a57ee
              ttl_in_seconds: 7200
      responses:
        '200':
          description: Share-Token erstellt.
          content:
            application/json:
              schema:
                type: object
                properties:
                  share_token:
                    type: string
                    description: >-
                      HS256-signiertes JWT. Übergeben Sie dies unverändert als
                      `share_token` an [`POST
                      /v3/session/import-shared/`](/sessions-api/import-shared-session)
                      in der Zielanwendung.
                    example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
                  for_application_id:
                    type: string
                    format: uuid
                    description: >-
                      Gibt die Ziel-Anwendungs-UUID wieder, an die das Token
                      gebunden ist.
                    example: a5f3bca2-46e2-411e-90ef-a580900a57ee
                  session_kind:
                    type: string
                    enum:
                      - user
                      - business
                    description: >-
                      Gibt an, ob die Quellsitzung eine Sitzung der
                      Benutzerverifizierung (KYC) oder der
                      Unternehmensverifizierung (KYB) ist.
              examples:
                User session:
                  summary: Eine KYC-Sitzung teilen
                  value:
                    share_token: >-
                      eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzZXNzaW9uX2lkIjoiMjBiYjNjM2ItNjE0Ni00MzlmLTg0YTQtYmQzMGQwMGFjNmEyIiwiZnJvbV9hcHBsaWNhdGlvbl9pZCI6ImRiZDIwZTM0LTQyZTktNGYyYy1iYTkxLWNmMDc2MjAxNmY2NCIsImZvcl9hcHBsaWNhdGlvbl9pZCI6ImE1ZjNiY2EyLTQ2ZTItNDExZS05MGVmLWE1ODA5MDBhNTdlZSIsImlhdCI6MTc1MzYzMDY2NiwiZXhwIjoxNzUzNjM0MjY2fQ.JJ9pNE_hqZsOtbR0XYZIWw4JzidjdEl279iUrsIkhGE
                    for_application_id: a5f3bca2-46e2-411e-90ef-a580900a57ee
                    session_kind: user
                Business session:
                  summary: Eine KYB-Sitzung teilen
                  value:
                    share_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
                    for_application_id: a5f3bca2-46e2-411e-90ef-a580900a57ee
                    session_kind: business
        '400':
          description: >-
            Validierungsfehler. Feldfehler werden nach Feldname aufgeschlüsselt;
            der Fehler wegen nicht abgeschlossener Verarbeitung wird unter einem
            `detail`-Schlüssel (als Array) zurückgegeben.
          content:
            application/json:
              examples:
                Wrong status:
                  summary: Quellsitzung ist nicht beendet
                  value:
                    detail:
                      - >-
                        Only finished sessions ("Approved", "Declined", "In
                        Review") can be shared.
                Target missing:
                  summary: Zielanwendung existiert nicht
                  value:
                    for_application_id:
                      - Target application does not exist.
                Self-share:
                  summary: Ziel ist die aufrufende Anwendung
                  value:
                    for_application_id:
                      - Cannot share a session with the same application.
                TTL bounds:
                  summary: ttl_in_seconds außerhalb des zulässigen Bereichs
                  value:
                    ttl_in_seconds:
                      - Ensure this value is greater than or equal to 60.
        '401':
          description: >-
            Fehlende oder ungültige Anmeldedaten. Im Gegensatz zu den meisten
            v3-Endpoints authentifiziert dieser Endpoint über den
            Berechtigungs-Decorator und gibt `401` zurück, wenn kein gültiges
            Token bzw. kein gültiger Schlüssel übergeben wird.
          content:
            application/json:
              examples:
                Unauthorized:
                  summary: Nicht autorisiert
                  value:
                    detail: >-
                      Authentication credentials were not provided or are
                      invalid.
        '403':
          description: >-
            Die Anmeldedaten sind gültig, verfügen jedoch nicht über die
            Berechtigung `write:sessions` für diese Anwendung.
          content:
            application/json:
              examples:
                No Permission:
                  summary: Keine Berechtigung
                  value:
                    detail: You do not have permission to perform this action.
        '404':
          description: >-
            In Ihrer Anwendung existiert keine Sitzung mit der angegebenen
            `session_id`.
          content:
            application/json:
              examples:
                Not Found:
                  summary: Sitzung nicht gefunden
                  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: >-
        Der API-Schlüssel Ihrer Anwendung, aus Entwickler -> API-Schlüssel in
        der Business Console. Der Primärschlüssel hat Vollzugriff. Ein benannter
        Schlüssel kann im Geltungsbereich eingeschränkt werden: keine, Lese-
        oder Schreibberechtigung pro Ressource, beschränkt auf bestimmte
        Workflows oder genehmigte Sitzungen, auf eine Liste von IP-Adressen und
        auf ein Ablaufdatum. 401 bedeutet, dass der Schlüssel falsch, widerrufen
        oder abgelaufen ist; 403 bedeutet, dass kein Schlüssel gesendet wurde,
        der Schlüssel keinen Zugriff auf diese Ressource oder Aktion hat oder
        die Anfrage von einer Adresse außerhalb seiner IP-Liste stammte; 404 bei
        einer Sitzungsroute bedeutet, dass die Sitzung außerhalb der Workflows
        oder Status des Schlüssels liegt. Ein Schlüssel ohne Medienzugriff
        erhält Bild-, Video- und PDF-URLs als null, und ein Schlüssel ohne
        Schreibberechtigung für Sitzungen erhält Sitzungslinks und Token als
        null. Siehe https://docs.didit.me/console/api-keys.

````

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