> ## 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 para enviar mensagem da Travel Rule

> Envie com a API da Didit uma mensagem ou solicitação de documento à VASP contraparte de uma transferência Travel Rule, com anexos opcionais.



Prompt da API para enviar uma mensagem de Travel Rule
        Copiar o prompt para a área de transferência



      
      

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



      
      

Colar em



## OpenAPI

````yaml pt-br/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 de verificação de identidade. Autentique-se com o cabeçalho x-api-key.
servers:
  - url: https://verification.didit.me
security: []
tags: []
paths:
  /v3/transactions/{transaction_id}/travel-rule/messages/:
    post:
      tags:
        - Travel Rule
      summary: Enviar uma mensagem de Travel Rule ou uma solicitação de documento
      description: >-
        Envia uma mensagem ou uma requisição de documentos à VASP contraparte.
        Funciona em transferências INTERNAL (o outro cliente da Didit a vê no
        seu lado do par) e EMAIL (a contraparte recebe um e-mail e responde no
        portal de retirada). Uma transferência por TRP, GTR, TRUST, VerifyVASP
        ou Sygna não contém mensagens, porque esses protocolos não têm
        mensagens. Limites: 100 mensagens por transferência, 5000 caracteres por
        corpo, 10 documentos solicitados, 5 arquivos de 10 MB cada.
      operationId: createTravelRuleMessage
      parameters:
        - name: transaction_id
          in: path
          required: true
          description: UUID estável da transação na Didit à qual a transferência pertence.
          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: A mensagem armazenada.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TravelRuleMessage'
        '400':
          description: >-
            Corpo inválido, um tipo ou tamanho de arquivo não aceito, mais de
            100 mensagens na transferência ou um `reply_to` que não é uma
            mensagem desta transferência.
          content:
            application/json:
              schema:
                type: object
              example:
                requested_documents:
                  - Name at least one document the counterparty should send.
        '404':
          description: >-
            Transação ou token desconhecido, ou não há transferência de Travel
            Rule na transação.
        '409':
          description: >-
            Nenhuma mensagem consegue chegar à contraparte. `detail` informa o
            motivo: a transferência passa por um trilho de rede (TRP, GTR,
            TRUST, VerifyVASP ou Sygna), ainda não tem contraparte, os dados de
            uma transferência INTERNAL não corresponderam ao titular da carteira
            e por isso nada chegou ao destinatário, ou o link de retirada de uma
            transferência EMAIL expirou ou a transferência está encerrada.
          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: Envie como JSON ou como multipart/form-data com os anexos em `files`.
      properties:
        kind:
          type: string
          enum:
            - MESSAGE
            - DOCUMENT_REQUEST
          default: MESSAGE
        body:
          type: string
          maxLength: 5000
          description: Obrigatório para uma MESSAGE, a menos que um arquivo seja anexado.
        requested_documents:
          type: array
          items:
            type: string
            maxLength: 255
          maxItems: 10
          description: >-
            Obrigatório (pelo menos um) para um DOCUMENT_REQUEST, e permitido
            somente nele.
        reply_to:
          type: string
          format: uuid
          nullable: true
          description: >-
            Uma mensagem da mesma transferência. Uma resposta que traz um
            documento atende à solicitação de documento à qual responde.
        files:
          type: array
          items:
            type: string
            format: binary
          maxItems: 5
          description: Somente multipart. Até 5 arquivos de 10 MB cada.
    TravelRuleMessage:
      type: object
      properties:
        id:
          type: string
          format: uuid
        kind:
          type: string
          enum:
            - MESSAGE
            - DOCUMENT_REQUEST
        direction:
          type: string
          enum:
            - INBOUND
            - OUTBOUND
          description: >-
            `OUTBOUND` é o que o próprio lado do leitor enviou. No portal de
            retirada, a direção é a partir do lado da contraparte.
        author:
          type: string
          description: >-
            Quem o escreveu do próprio lado: o e-mail de um usuário do console
            ou o rótulo de uma chave de API, ou o nome do outro VASP.
        body:
          type: string
        requested_documents:
          type: array
          items:
            type: string
          description: O que um DOCUMENT_REQUEST solicita, nas palavras do solicitante.
        reply_to:
          type: string
          format: uuid
          nullable: true
        fulfilled_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            Definido em um DOCUMENT_REQUEST assim que uma resposta a ele contém
            um documento.
        attachment:
          $ref: '#/components/schemas/TravelRuleMessageAttachment'
        created_at:
          type: string
          format: date-time
    TravelRuleMessageAttachment:
      type: object
      nullable: true
      description: >-
        O documento anexado a uma mensagem, armazenado como qualquer outro
        documento de transação.
      properties:
        uuid:
          type: string
          format: uuid
        label:
          type: string
          nullable: true
        note:
          type: string
          nullable: true
        uploaded_by:
          type: string
          nullable: true
          description: >-
            Quem o anexou. No portal de retirada, um arquivo que você enviou
            mostra o nome do seu VASP, nunca a pessoa ou a chave de API por trás
            dele.
        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 de download com tempo limitado.
              original_filename:
                type: string
              file_size:
                type: integer
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Chave de API da sua aplicação, em Developers -> API keys no Business
        Console. A chave principal tem acesso total. Uma chave nomeada pode ter
        escopo restrito: nenhum acesso, leitura ou escrita por recurso, limitada
        a alguns fluxos ou a sessões aprovadas, a uma lista de endereços IP e a
        uma data de validade. 401 significa que a chave está errada, revogada ou
        expirada; 403 significa que nenhuma chave foi enviada, que a chave não
        tem acesso a este recurso ou ação, ou que a requisição veio de um
        endereço fora da sua lista de IPs; 404 em uma rota de sessão significa
        que a sessão está fora dos fluxos ou status da chave. Uma chave sem
        acesso a mídia recebe URLs de imagem, vídeo e PDF como null, e uma chave
        sem permissão de escrita em sessões recebe links e tokens de sessão como
        null. Consulte https://docs.didit.me/console/api-keys.

````

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