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

# Create or email a Travel Rule end-user link

> Issue a new Travel Rule end-user link or email it to the user's recorded address, with link expiry, revocation and delivery outcome fields.

Didit's Travel Rule end-user link API issues a link for the user to complete their wallet or counterparty choice and can email it to their recorded address.

Send `{"channel": "link"}` to copy a link, or `{"channel": "email"}` to also attempt email delivery. Omitting `channel` defaults to `link`. Email uses the end user's Didit-record address and their verification-session language when available. You cannot supply an arbitrary recipient.

The API requires write access to transactions and an outbound transfer in `AWAITING_COUNTERPARTY`, `COUNTERPARTY_VASP_NOT_FOUND`, `COUNTERPARTY_VASP_NOT_REACHABLE`, `UNCONFIRMED_OWNERSHIP` or `ON_HOLD`. Other states return `409`; an unknown transaction or missing transfer returns `404`.

The response contains `end_user_link`, `expires_at`, `emailed_to` and `email_available`. A new link revokes previous open end-user links for that transfer. Share it only with the intended end user.

When no recorded email exists, `channel: email` returns `409` with `code: end_user_email_missing`; request `channel: link` instead. If sending fails, the API still returns a usable link with an empty `emailed_to`. `email_available` means an address exists, not that delivery succeeded.

For explicit user choice during creation, see [Create a transaction](https://docs.didit.me/management-api/transactions/create.md) and the [Travel Rule guide](https://docs.didit.me/transaction-monitoring/travel-rule.md#counterparty-discovery). For transfer actions, see [Update a transfer](https://docs.didit.me/management-api/travel-rule/update-transfer.md).


## OpenAPI

````yaml openapi-25.json POST /v3/transactions/{transaction_id}/travel-rule/user-link/
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/transactions/{transaction_id}/travel-rule/user-link/:
    post:
      tags:
        - Travel Rule
      summary: Create or email a Travel Rule end-user link
      description: >-
        Issue a new link and revoke previous open links for this transfer.
        Requires write access to transactions and an outbound transfer in
        AWAITING_COUNTERPARTY, COUNTERPARTY_VASP_NOT_FOUND,
        COUNTERPARTY_VASP_NOT_REACHABLE, UNCONFIRMED_OWNERSHIP or ON_HOLD.
        channel=email uses the end user's Didit-record email and
        verification-session language when available. A send failure returns the
        link with emailed_to empty; email_available reports address
        availability, not delivery. See [User
        links](/management-api/travel-rule/create-user-link).
      operationId: createTravelRuleUserLink
      parameters:
        - name: transaction_id
          in: path
          required: true
          description: Didit-stable transaction UUID that owns the transfer.
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TravelRuleUserLinkRequest'
            example:
              channel: link
      responses:
        '200':
          description: Successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TravelRuleUserLinkResponse'
        '400':
          description: Invalid request fields.
        '403':
          description: Missing permission to write transactions.
        '404':
          description: Unknown transaction or no Travel Rule transfer.
        '409':
          description: >-
            Transfer direction/status does not allow a link, or channel=email
            has no end-user address. For the latter,
            code=end_user_email_missing; retry with channel=link.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: Conflict explanation.
                  code:
                    type: string
                    description: Present when email is unavailable.
                    enum:
                      - end_user_email_missing
                required:
                  - detail
              example:
                detail: >-
                  This end user has no email on their Didit record. Copy the
                  link instead.
                code: end_user_email_missing
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: curl
          source: >-
            curl -X POST
            'https://verification.didit.me/v3/transactions/{transaction_id}/travel-rule/user-link/'
            \
              -H 'x-api-key: YOUR_API_KEY' -H 'Content-Type: application/json' \
              -d '{"channel": "link"}'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            result = client.transactions.travel_rule.create_user_link(
                "11111111-2222-3333-4444-555555555555",
                channel="link",
            )
            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.transactions.travelRule.createUserLink("11111111-2222-3333-4444-555555555555",
            {
              channel: "link",
            });

            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.Transactions.TravelRule.CreateUserLink(ctx, \"11111111-2222-3333-4444-555555555555\", didit.TravelRuleUserLinkRequest{\n\tChannel: didit.Some(didit.TravelRuleUserLinkRequestChannel(\"link\")),\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.TravelRuleUserLinkRequest;


            // Reads DIDIT_API_KEY.

            Didit client = new Didit();


            var result =
            client.transactions().travelRule().createUserLink("11111111-2222-3333-4444-555555555555",
            TravelRuleUserLinkRequest.builder()
                    .channel(TravelRuleUserLinkRequest.Channel.of("link"))
                    .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->transactions->travelRule->createUserLink('11111111-2222-3333-4444-555555555555',
            [
                'channel' => 'link',
            ]);

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

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

            result = didit.transactions.travel_rule.create_user_link(
              "11111111-2222-3333-4444-555555555555",
              channel: "link"
            )
            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.Transactions.TravelRule.CreateUserLinkAsync("11111111-2222-3333-4444-555555555555",
            new TravelRuleUserLinkRequest

            {
                Channel = new TravelRuleUserLinkRequestChannel("link"),
            });

            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  schemas:
    TravelRuleUserLinkRequest:
      type: object
      properties:
        channel:
          type: string
          description: >-
            link returns a new link; email also attempts to send it to the end
            user's Didit-record email.
          enum:
            - link
            - email
          default: link
    TravelRuleUserLinkResponse:
      type: object
      properties:
        end_user_link:
          type: string
          description: >-
            New end-user link. Previous open links for this transfer are
            revoked.
          format: uri
        expires_at:
          type: string
          description: Link expiry.
          format: date-time
        emailed_to:
          type: string
          description: >-
            Recipient when sending succeeded, otherwise an empty string. An
            email failure still returns a usable link.
        email_available:
          type: boolean
          description: Whether the end user has an email on their Didit record.
      required:
        - end_user_link
        - expires_at
        - emailed_to
        - email_available
  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.