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

# إرسال رسالة Travel Rule عبر واجهة API

> أرسل عبر Didit رسالة أو طلب مستندات إلى VASP الطرف المقابل في تحويل Travel Rule، مع إمكانية إرفاق مرفقات اختيارية بالرسالة.



موجّه API لإرسال رسالة Travel Rule
        نسخ الموجّه إلى الحافظة



      
      

\<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 ar/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: إرسال رسالة Travel Rule أو طلب مستند
      description: >-
        يرسل رسالة أو طلب مستند إلى VASP الطرف المقابل. يعمل مع التحويلات
        INTERNAL (يراها عميل Didit الآخر على جانبه من الثنائي) وتحويلات EMAIL
        (يتم إرسال بريد إلكتروني إلى الطرف المقابل ويجيب في بوابة الاستلام). لا
        يحمل أي تحويل عبر TRP أو GTR أو TRUST أو VerifyVASP أو Sygna أي رسائل،
        لأن هذه البروتوكولات لا تدعمها. الحدود: 100 رسالة لكل تحويل، و5000 حرف
        لكل نص، و10 مستندات مطلوبة، و5 ملفات بحجم 10 ميجابايت لكل منها.
      operationId: createTravelRuleMessage
      parameters:
        - name: transaction_id
          in: path
          required: true
          description: معرّف UUID الثابت للمعاملة من Didit التي تملك التحويل.
          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: معاملة أو token غير معروف، أو لا يوجد تحويل Travel Rule في المعاملة.
        '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، أو كـ multipart/form-data مع وضع المرفقات في `files`.
      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، ومسموح به هناك فقط.
        reply_to:
          type: string
          format: uuid
          nullable: true
          description: >-
            رسالة خاصة بالتحويل نفسه. الرد الذي يتضمن مستنداً يلبي طلب المستند
            الذي يجيب عليه.
        files:
          type: array
          items:
            type: string
            format: binary
          maxItems: 5
          description: >-
            للطلبات متعددة الأجزاء فقط. ما يصل إلى 5 ملفات بحجم 10 ميغابايت لكل
            منها.
    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 بمجرد أن يتضمن الرد عليه مستنداً.
        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 الخاص بتطبيقك، من Developers -> API keys في Business Console.
        يمتلك المفتاح الأساسي وصولاً كاملاً. يمكن تحديد نطاق المفتاح المسمى: لا
        شيء، أو قراءة، أو كتابة لكل مورد، ومحدوداً ببعض مسارات العمل أو بالجلسات
        المقبولة، وبقائمة من عناوين IP، وبتاريخ انتهاء الصلاحية. يشير 401 إلى أن
        المفتاح غير صحيح أو ملغى أو منتهي الصلاحية؛ ويشير 403 إلى أنه لم يتم
        إرسال أي مفتاح، أو أن المفتاح ليس لديه حق الوصول إلى هذا المورد أو
        الإجراء، أو أن الطلب جاء من عنوان خارج قائمة عناوين IP الخاصة به؛ ويشير
        404 في مسار جلسة إلى أن الجلسة خارج مسارات العمل أو الحالات الخاصة
        بالمفتاح. يتلقى المفتاح الذي لا يمتلك حق الوصول إلى الوسائط عناوين URL
        للصور ومقاطع الفيديو وملفات PDF كـ null، ويتلقى المفتاح الذي لا يمتلك
        إذن كتابة للجلسات روابط الجلسة وtoken كـ null. راجع
        https://docs.didit.me/console/api-keys.

````

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