> ## 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 Management APIで、トラベルルール送金の取引相手VASPにメッセージや書類リクエストを送信できます。添付ファイルの追加も可能です。



トラベルルールメッセージ送信APIのプロンプト
        プロンプトをクリップボードにコピー



      
      

\<pre>

\`Send a message or a document request to the counterparty VASP of a Travel Rule transfer, so a disputed transfer is resolved inside Didit.

Endpoint:
POST https://verification.didit.me/v3/transactions/{transaction_id}/travel-rule/messages/

Authentication:
Use the x-api-key header with my Didit API key. {transaction_id} is the Didit transaction uuid on my application.

Request body (JSON, or multipart/form-data when attaching files):
\- kind - MESSAGE (default) or DOCUMENT_REQUEST.
\- body - up to 5000 characters. A MESSAGE needs a body or a file.
\- requested_documents - up to 10 names. A DOCUMENT_REQUEST needs at least one; a MESSAGE must not have any.
\- reply_to - uuid of an earlier message of the same transfer. A reply carrying a document fulfils the request it answers.
\- files - multipart only, up to 5 files of 10 MB each.

Example call:
curl -X POST "https://verification.didit.me/v3/transactions/{transaction_id}/travel-rule/messages/" \
-H "x-api-key: YOUR_API_KEY" -H "Content-Type: application/json" \
-d '{"kind": "DOCUMENT_REQUEST", "body": "Please confirm the beneficiary date of birth.", "requested_documents": ["Proof of address"]}'

Behavior:
\- Works on INTERNAL transfers (the other Didit customer sees it on its side) and EMAIL transfers (the counterparty is emailed and answers in the pickup portal).
\- A transfer holds up to 100 messages.

Failure modes:
\- 400 - invalid body, file rejected, 100 messages reached, or reply_to is not a message of this transfer.
\- 404 - unknown transaction, or no Travel Rule transfer on it.
\- 409 - no message can reach the counterparty; detail gives the reason: a network rail (TRP, GTR, TRUST, VerifyVASP, Sygna) carries no messages, no counterparty yet, an INTERNAL transfer whose data did not match the wallet holder, an INTERNAL transfer whose recipient has not proved control of the wallet yet, an EMAIL transfer whose counterparty no longer has a compliance email address, or an EMAIL transfer whose pickup link expired or whose transfer is closed.

Full guide: /transaction-monitoring/travel-rule#messages-and-document-requests.`

\</pre>



      
      

貼り付け先



## OpenAPI

````yaml ja/openapi-25.json POST /v3/transactions/{transaction_id}/travel-rule/messages/
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/transactions/{transaction_id}/travel-rule/messages/:
    post:
      tags:
        - Travel Rule
      summary: トラベルルールのメッセージまたは書類リクエストを送信
      description: >-
        取引相手のVASPにメッセージまたは書類リクエストを送信します。INTERNAL転送（もう一方のDidit顧客がペアの自社側で確認します）とEMAIL転送（取引相手にメールが送られ、受け取りポータルで回答します）で機能します。TRP、GTR、TRUST、VerifyVASPまたはSygna経由の転送にはメッセージはありません。これらのプロトコルにはメッセージ機能がないためです。上限：転送1件あたりメッセージ100件、本文1件あたり5000文字、リクエストできる書類10件、ファイル5件（各10MB）。
      operationId: createTravelRuleMessage
      parameters:
        - name: transaction_id
          in: path
          required: true
          description: この送金を所有する取引の、Diditの安定したUUIDです。
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TravelRuleMessageCreateRequest'
            example:
              kind: DOCUMENT_REQUEST
              body: Please confirm the date of birth of the beneficiary.
              requested_documents:
                - Proof of address
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TravelRuleMessageCreateRequest'
      responses:
        '201':
          description: 保存されたメッセージ。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TravelRuleMessage'
        '400':
          description: >-
            リクエストボディが無効である、受け付けられないファイル形式またはサイズである、転送のメッセージが100件を超えている、または`reply_to`がこの転送のメッセージではありません。
          content:
            application/json:
              schema:
                type: object
              example:
                requested_documents:
                  - Name at least one document the counterparty should send.
        '404':
          description: 不明な取引またはトークン、もしくは取引にトラベルルールの送金がありません。
        '409':
          description: >-
            取引相手にメッセージを届けることができません。`detail`に理由が示されます。送金がネットワークレール（TRP、GTR、TRUST、VerifyVASP、Sygna）上で行われている、まだ取引相手がいない、INTERNAL送金のデータがウォレット保有者と一致しなかったため受取人に何も届かなかった、またはEMAIL送金の受け取りリンクの有効期限が切れているか送金が終了している、のいずれかです。
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: curl
          source: >-
            curl -X POST
            https://verification.didit.me/v3/transactions/{transaction_id}/travel-rule/messages/
            \
              -H 'x-api-key: YOUR_API_KEY' -H 'Content-Type: application/json' \
              -d '{"kind": "DOCUMENT_REQUEST", "body": "Please confirm the date of birth of the beneficiary.", "requested_documents": ["Proof of address"]}'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            result = client.transactions.travel_rule.create_message(
                "11111111-2222-3333-4444-555555555555",
                kind="DOCUMENT_REQUEST",
                body="Please confirm the date of birth of the beneficiary.",
                requested_documents=["Proof of address"],
            )
            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.createMessage("11111111-2222-3333-4444-555555555555",
            {
              kind: "DOCUMENT_REQUEST",
              body: "Please confirm the date of birth of the beneficiary.",
              requested_documents: ["Proof of address"],
            });

            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.CreateMessage(ctx, \"11111111-2222-3333-4444-555555555555\", didit.TravelRuleMessageCreateRequest{\n\tKind:               didit.Some(didit.TravelRuleMessageCreateRequestKind(\"DOCUMENT_REQUEST\")),\n\tBody:               didit.String(\"Please confirm the date of birth of the beneficiary.\"),\n\tRequestedDocuments: didit.Some([]string{\"Proof of address\"}),\n})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)"
        - lang: java
          label: Java
          source: >-
            import java.util.List;

            import me.didit.Didit;

            import me.didit.types.TravelRuleMessageCreateRequest;


            // Reads DIDIT_API_KEY.

            Didit client = new Didit();


            var result =
            client.transactions().travelRule().createMessage("11111111-2222-3333-4444-555555555555",
            TravelRuleMessageCreateRequest.builder()
                    .kind(TravelRuleMessageCreateRequest.Kind.of("DOCUMENT_REQUEST"))
                    .body("Please confirm the date of birth of the beneficiary.")
                    .requestedDocuments(List.of("Proof of address"))
                    .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->createMessage('11111111-2222-3333-4444-555555555555',
            [
                'kind' => 'DOCUMENT_REQUEST',
                'body' => 'Please confirm the date of birth of the beneficiary.',
                'requested_documents' => ['Proof of address'],
            ]);

            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_message(
              "11111111-2222-3333-4444-555555555555",
              kind: "DOCUMENT_REQUEST",
              body: "Please confirm the date of birth of the beneficiary.",
              requested_documents: ["Proof of address"]
            )
            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.CreateMessageAsync("11111111-2222-3333-4444-555555555555",
            new TravelRuleMessageCreateRequest

            {
                Kind = new TravelRuleMessageCreateRequestKind("DOCUMENT_REQUEST"),
                Body = "Please confirm the date of birth of the beneficiary.",
                RequestedDocuments = new string[] { "Proof of address" },
            });

            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  schemas:
    TravelRuleMessageCreateRequest:
      type: object
      description: JSON、または添付ファイルを`files`に含めたmultipart/form-dataとして送信します。
      properties:
        kind:
          type: string
          enum:
            - MESSAGE
            - DOCUMENT_REQUEST
          default: MESSAGE
        body:
          type: string
          maxLength: 5000
          description: ファイルが添付されていない場合、MESSAGEでは必須です。
        requested_documents:
          type: array
          items:
            type: string
            maxLength: 255
          maxItems: 10
          description: DOCUMENT_REQUESTでは必須（1つ以上）で、それ以外では指定できません。
        reply_to:
          type: string
          format: uuid
          nullable: true
          description: 同じ送金のメッセージ。書類を含む返信は、それが応答する書類リクエストを満たします。
        files:
          type: array
          items:
            type: string
            format: binary
          maxItems: 5
          description: multipart形式のみ。1ファイルあたり10MBまで、最大5ファイルです。
    TravelRuleMessage:
      type: object
      properties:
        id:
          type: string
          format: uuid
        kind:
          type: string
          enum:
            - MESSAGE
            - DOCUMENT_REQUEST
        direction:
          type: string
          enum:
            - INBOUND
            - OUTBOUND
          description: '`OUTBOUND`は閲覧者自身の側が送信したものです。受け取りポータルでは、方向は取引相手の側から見たものになります。'
        author:
          type: string
          description: それぞれの側でこれを記入した者です。コンソールユーザーのメールアドレスまたはAPIキーのラベル、あるいは相手方VASPの名前です。
        body:
          type: string
        requested_documents:
          type: array
          items:
            type: string
          description: DOCUMENT_REQUESTが求めている内容（依頼者の言葉で記載）。
        reply_to:
          type: string
          format: uuid
          nullable: true
        fulfilled_at:
          type: string
          format: date-time
          nullable: true
          description: DOCUMENT_REQUESTへの返信に書類が含まれた時点で、そのDOCUMENT_REQUESTに設定されます。
        attachment:
          $ref: '#/components/schemas/TravelRuleMessageAttachment'
        created_at:
          type: string
          format: date-time
    TravelRuleMessageAttachment:
      type: object
      nullable: true
      description: メッセージに添付された書類です。他の取引書類と同様に保存されます。
      properties:
        uuid:
          type: string
          format: uuid
        label:
          type: string
          nullable: true
        note:
          type: string
          nullable: true
        uploaded_by:
          type: string
          nullable: true
          description: >-
            添付した主体。受け取りポータルでは、送信したファイルにはVASP名が表示され、その背後にいる人物やAPIキーが表示されることはありません。
        created_at:
          type: string
          format: date-time
        files:
          type: array
          items:
            type: object
            properties:
              uuid:
                type: string
                format: uuid
              file_url:
                type: string
                nullable: true
                description: 期限付きのダウンロードURL。
              original_filename:
                type: string
              file_size:
                type: integer
  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.