> ## 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 - Travel Rule 免费加入

> Didit 管理 API：向工作邮箱发送一次性验证码，证明您对邮箱域名的控制权。

发送域名验证码 API 提示词
将提示词复制到剪贴板

<pre>
  \`Emails a single-use code to the workspace's work address to prove it controls the email domain. Throttled, and a limited number of wrong attempts is accepted per code. Also returns the TXT record for the DNS alternative.

  Endpoint:
  POST [https://verification.didit.me/v3/travel-rule/workspace/domain/code/](https://verification.didit.me/v3/travel-rule/workspace/domain/code/)

  Authentication:
  Use the x-api-key header with the API key returned when the account was created.

  Failure modes:

  * 404 - This application did not join free, so it has no free workspace.

  Guide: /transaction-monitoring/travel-rule-interoperability#email-pickup.\`
</pre>

粘贴到


## OpenAPI

````yaml zh/openapi-25.json POST /v3/travel-rule/workspace/domain/code/
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/travel-rule/workspace/domain/code/:
    post:
      tags:
        - Travel Rule
      summary: 发送域名验证码邮件
      description: >-
        向工作区的工作邮箱发送一次性验证码，以证明其控制该邮箱域名。受速率限制，且每个验证码仅允许有限次数的错误尝试。同时返回 DNS 替代方案的
        TXT 记录。
      operationId: sendTravelRuleWorkspaceDomainCode
      responses:
        '200':
          description: 域名、其状态及 TXT 记录。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TravelRuleWorkspaceDomainCodeResponse'
        '404':
          description: 此应用未加入免费额度，因此没有免费工作区。
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: curl
          source: >-
            curl -X POST
            https://verification.didit.me/v3/travel-rule/workspace/domain/code/
            \
              -H 'x-api-key: YOUR_API_KEY'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            result = client.travel_rule.workspace.send_domain_code()
            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.travelRule.workspace.sendDomainCode();
            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.TravelRule.Workspace.SendDomainCode(ctx)\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)"
        - lang: java
          label: Java
          source: |-
            import me.didit.Didit;

            // Reads DIDIT_API_KEY.
            Didit client = new Didit();

            var result = client.travelRule().workspace().sendDomainCode();
            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->travelRule->workspace->sendDomainCode();
            print_r($result->toArray());
        - lang: ruby
          label: Ruby
          source: |-
            require "didit"

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

            result = didit.travel_rule.workspace.send_domain_code
            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.TravelRule.Workspace.SendDomainCodeAsync();

            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  schemas:
    TravelRuleWorkspaceDomainCodeResponse:
      type: object
      properties:
        domain:
          type: string
        status:
          type: string
          enum:
            - unverified
            - code_sent
            - verified
        txt:
          $ref: '#/components/schemas/TravelRuleWorkspaceTxtRecord'
    TravelRuleWorkspaceTxtRecord:
      type: object
      description: 为 DNS 证明而发布的 TXT 记录。在证明启动前为空。
      properties:
        host:
          type: string
          example: didit-tr-verify.example.com
        value:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        您的应用 API 密钥，可在 Business Console 的“开发者 -> API
        密钥”中获取。主密钥拥有完整访问权限。指定名称的密钥可设置作用域：针对每个资源设为无权限、只读或读写，限定于特定工作流或已通过的会话、限定于
        IP 地址列表，以及设置到期日期。401 表示密钥错误、已撤销或已过期；403 表示未发送密钥、密钥无权访问该资源或操作，或请求来自其 IP
        列表之外的地址；在会话路由上返回 404 表示该会话不在该密钥允许的工作流或状态范围内。没有媒体访问权限的密钥获取到的图片、视频和 PDF
        URL 将为 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.