> ## 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：client_idとapi_keyを取得

> Diditアプリケーションのclient_idとapi_keyをGETで取得します。すべての検証API呼び出しでは、api_keyをx-api-keyヘッダーに指定します。従量課金制で、契約は不要です。



アプリケーション認証情報取得用プロンプト
        プロンプトをクリップボードにコピー



      
      

\<pre>

\`Read one application's full record — including its client_id and api_key (client_secret). Use this to RECOVER an api_key you've misplaced.

Endpoint:
GET https://apx.didit.me/auth/v2/organizations/me/{org_id}/applications/{app_id}/

Authentication:
Authorization: Bearer <access_token>
Get a token via POST /programmatic/login/.

Path parameters:
\- org_id (UUID, required) — Organization that owns the application. Get via GET /organizations/me/.
\- app_id (UUID, required) — Application UUID. Returned by POST /programmatic/verify-email/ (in the application.uuid field), by POST /organizations/me/{org_id}/applications/, or visible in the Didit console.

curl example:
curl "https://apx.didit.me/auth/v2/organizations/me/<ORG_ID>/applications/<APP_ID>/" \
-H "Authorization: Bearer <ACCESS_TOKEN>"

Response (200 OK):
\{
"uuid": "b2c3d4e5-6789-...",
"name": "My App",
"client_id": "S9LIYGSoWNuGMLHsvEt9dQ",
"api_key": "sk_live_example_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"website_url": "https://example.com",
"redirect_uris": ["https://example.com/callback"],
"terms_url": "https://example.com/terms",
"privacy_url": "https://example.com/privacy",
"description": "Production application",
"created_at": "2025-06-01T10:00:00Z",
"products": [
\{ "product": "identity", "status": "enabled", "modules": { "user_verification": true, "business_verification": true, "case_management": true } },
\{ "product": "transactions", "status": "disabled", "modules": { "travel_rule": true, "case_management": true } },
\{ "product": "authentication", "status": "disabled", "modules": {} }
]
}

How to use the response:
\- api_key → set as the x-api-key header on EVERY call to https://verification.didit.me/v3/... (sessions, workflows, questionnaires, AML monitoring, billing, etc.).
\- client_id → shown alongside api_key for OAuth-style introspection scenarios. Routine verification calls only need api_key.
\- products → read-only. Always all three products in this order: identity, transactions, authentication. Each has a status (enabled, early_access or disabled) and its module switches (true or false). identity modules: user_verification, business_verification, case_management. transactions modules: travel_rule, case_management. authentication has none ({}).

Failure modes:
\- 401: { "detail": "Invalid access token" } or { "detail": "Expired access token" } when the token is malformed or expired.
\- 403: { "detail": "Only organization owners and admins can manage applications." } when you are a member of the organization but not an owner or admin.
\- 403: { "detail": "Your access to this organization is suspended." } when your membership in the organization is suspended.
\- 403: { "detail": "You do not have permission to perform this action." } when the request has no Authorization header.
\- 404: { "detail": "Organization not found." } when the organization does not exist or you are not a member of it, or { "detail": "Application not found." } when the application is not in that organization.

When to call:
\- After programmatic login from a new machine — you have an access_token but not the api_key, and you need x-api-key to start calling verification.didit.me.
\- Auditing your applications — list all apps with GET /organizations/me/{org_id}/applications/, then read each.

Note:
This endpoint does not rotate the credential. It returns the application's current api_key on every GET, so there is no "show api_key once" model.

For end-to-end Didit integration, paste in the full prompt at /integration/integration-prompt.`

\</pre>



      
      

貼り付け先



## OpenAPI

````yaml ja/openapi-auth.json GET /organizations/me/{org_id}/applications/{app_id}/
openapi: 3.0.0
info:
  version: 1.0.0
  title: Didit Auth API
  description: >-
    開発者とAIエージェント向けの、プログラムによる登録・認証APIです。2回のAPI呼び出しで登録でき、ブラウザは不要です。最もエージェントに適した本人確認プラットフォームです。


    ## ベースURL


    この仕様のすべてのエンドポイントは`https://apx.didit.me/auth/v2`でホストされています。これは検証API（`https://verification.didit.me/v3`）とは別のホストです。両者を混同しないでください。この認証ホストは**JWTアクセストークン**を発行し、**組織**と**アプリケーション**の一覧表示と管理を行えます。検証ホストはセッション、ワークフロー、AMLなどを呼び出す先であり、このAPIが返す**`api_key`**で認証します。


    ## 認証フローの仕組み


    1. `POST /programmatic/register/`：メールアドレスとパスワードを送信します。

    2. 6文字の英数字のコードをメールで受け取ります。

    3. `POST
    /programmatic/verify-email/`：コードを送信します。JWTの`access_token`、`refresh_token`、組織、および`client_id`と`api_key`を持つデフォルトのアプリケーションが返されます。

    4.
    `api_key`を保存します。`https://verification.didit.me/v3/...`へのすべての呼び出しで`x-api-key`として使用します。

    5. 今後は任意のマシンから、`POST /programmatic/login/`でメールアドレスとパスワードを新しいJWTと交換し、続けて`GET
    /organizations/me/`とアプリケーションのエンドポイントを呼び出して、認証情報を復元またはローテーションできます。


    JWTが必要なのは、この仕様の**アカウント管理**エンドポイントだけです。検証APIのトラフィックにはJWTではなく、長期間有効な`api_key`を使用します。


    ## 規約


    - すべてのリクエストボディとレスポンスボディはJSON（`Content-Type: application/json`）です。

    - **`POST /programmatic/register/`をテストする際は、実在する配信可能なメールアドレスを使用してください。**
    このエンドポイントは認証コードを同期的に送信するため、予約済みのテスト用ドメイン（`@example.com`、`@example.org`、`@*.test`、`@*.example`、`@*.invalid`）のアドレスはメール配信で拒否され、リクエストは`500`を返します。サンプル内のプレースホルダー`you@yourdomain.com`は、実際に読める受信箱に置き換えてください。

    - バリデーションエラーはHTTP `400`で、2種類のエンベロープのいずれかを返します。フィールド単位の問題には`{"field":
    ["message", ...]}`、ビジネスルールのエラーには`{"detail":
    "message"}`です。一部のバリデーター（登録時のパスワード強度、verify-emailでのコードの有効期限）は現在、フィールドをキーとする形式ではなく、単純な配列`["message"]`で応答します。これはサーバー側の既知の不整合のため、クライアントコードは両方の形式を受け入れる必要があります。

    - 認証エラーは、HTTP
    `401`（無効なBearerトークン）または`403`（Bearerトークンがない、または権限不足）とともに`{"detail":
    "..."}`として返されます。

    - レート制限のレスポンスには、クールダウン時間を秒単位で示す`wait`フィールドが含まれます。
servers:
  - url: https://apx.didit.me/auth/v2
    description: 本番環境の認証サーバー
security: []
tags:
  - name: Programmatic Auth
    description: >-
      メールアドレスとパスワードによるアカウントのライフサイクル：登録、認証、ログイン。Account
      Managementエンドポイントで使用するJWTの`access_token`を返します。また、認証時には最初のアプリケーションの`client_id`と`api_key`も返します。
  - name: Account Management
    description: >-
      組織の一覧取得と、アプリケーションの作成・取得・更新を行う認証付きエンドポイント（JWT
      Bearer）です。検証API呼び出しの認証に使用する`api_key`の再取得やローテーションに利用します。
paths:
  /organizations/me/{org_id}/applications/{app_id}/:
    get:
      tags:
        - Account Management
      summary: アプリケーションの認証情報を取得
      description: >-
        `client_id`と`api_key`を含む、1つのアプリケーションの完全なレコードを取得します。紛失した`api_key`を復元する際に使用します。
      operationId: get_application_credentials
      parameters:
        - name: org_id
          in: path
          required: true
          description: アプリケーションを所有する組織のUUIDです。
          schema:
            type: string
            format: uuid
            example: a1b2c3d4-5678-90ab-cdef-111111111111
        - name: app_id
          in: path
          required: true
          description: 認証情報を取得するアプリケーションのUUIDです。
          schema:
            type: string
            format: uuid
            example: b2c3d4e5-6789-01bc-defg-222222222222
      responses:
        '200':
          description: '`client_id`と`api_key`を含むアプリケーションレコード。'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Application'
              examples:
                Success:
                  value:
                    uuid: b2c3d4e5-6789-01bc-defg-222222222222
                    name: My App
                    client_id: S9LIYGSoWNuGMLHsvEt9dQ
                    api_key: sk_live_example_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                    website_url: https://example.com
                    redirect_uris:
                      - https://example.com/callback
                    terms_url: https://example.com/terms
                    privacy_url: https://example.com/privacy
                    description: Production application
                    created_at: '2025-06-01T10:00:00Z'
                    products:
                      - product: identity
                        status: enabled
                        modules:
                          user_verification: true
                          business_verification: true
                          case_management: true
                      - product: transactions
                        status: disabled
                        modules:
                          travel_rule: true
                          case_management: true
                      - product: authentication
                        status: disabled
                        modules: {}
        '401':
          description: >-
            アクセストークンの形式が不正、無効、または期限切れです。`POST
            /programmatic/login/`で新しいトークンを取得してください。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthError'
              examples:
                InvalidToken:
                  value:
                    detail: Invalid access token
                ExpiredToken:
                  value:
                    detail: Expired access token
        '403':
          description: >-
            このアプリケーションを読み取れません。オーナーまたは管理者ではない組織のメンバーには`Only organization owners
            and admins can manage
            applications.`が返されます。組織へのアクセスが停止されているオーナーまたは管理者には`Your access to
            this organization is
            suspended.`が返されます。`Authorization`ヘッダーのないリクエストには`You do not have
            permission to perform this action.`が返されます。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthError'
              examples:
                NotOwnerOrAdmin:
                  summary: オーナーでも管理者でもないメンバー
                  value:
                    detail: >-
                      Only organization owners and admins can manage
                      applications.
                Suspended:
                  summary: メンバーシップが停止されています
                  value:
                    detail: Your access to this organization is suspended.
                MissingToken:
                  summary: Authorizationヘッダーがありません
                  value:
                    detail: You do not have permission to perform this action.
        '404':
          description: 組織が存在しないか、あなたがその組織のメンバーではありません。またはアプリケーションがその組織に存在しません。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthError'
              examples:
                OrganizationNotFound:
                  summary: 組織が見つからないか、あなたがメンバーではありません
                  value:
                    detail: Organization not found.
                ApplicationNotFound:
                  summary: この組織にそのようなアプリケーションはありません
                  value:
                    detail: Application not found.
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl
            "https://apx.didit.me/auth/v2/organizations/me/$ORG_ID/applications/$APP_ID/"
            \
              -H "Authorization: Bearer $ACCESS_TOKEN"
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Use the access token that account.login returns.
            client = Didit(account_token="YOUR_ACCESS_TOKEN")

            result = client.account.applications.retrieve(
                "a1b2c3d4-5678-90ab-cdef-111111111111",
                "b2c3d4e5-6789-01bc-defg-222222222222",
            )
            print(result)
        - lang: javascript
          label: Node.js
          source: |-
            import Didit from "@didit-protocol/sdk-node";

            // Use the access token that account.login returns.
            const didit = new Didit({ accountToken: "YOUR_ACCESS_TOKEN" });

            const result = await didit.account.applications.retrieve(
              "a1b2c3d4-5678-90ab-cdef-111111111111",
              "b2c3d4e5-6789-01bc-defg-222222222222",
            );
            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Use the access token that account.login returns.\nclient := didit.NewClient(option.WithAccountToken(\"YOUR_ACCESS_TOKEN\"))\n\nresult, err := client.Account.Applications.Retrieve(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"b2c3d4e5-6789-01bc-defg-222222222222\")\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)"
        - lang: java
          label: Java
          source: >-
            import me.didit.Didit;


            // Use the access token that account.login returns.

            Didit client =
            Didit.builder().accountToken("YOUR_ACCESS_TOKEN").build();


            var result =
            client.account().applications().retrieve("a1b2c3d4-5678-90ab-cdef-111111111111",
            "b2c3d4e5-6789-01bc-defg-222222222222");

            System.out.println(result);
        - lang: php
          label: PHP
          source: >-
            <?php


            require 'vendor/autoload.php';


            use Didit\DiditClient;


            // Use the access token that account.login returns.

            $didit = new DiditClient(accountToken: 'YOUR_ACCESS_TOKEN');


            $result =
            $didit->account->applications->retrieve('a1b2c3d4-5678-90ab-cdef-111111111111',
            'b2c3d4e5-6789-01bc-defg-222222222222');

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

            # Use the access token that account.login returns.
            didit = Didit::Client.new(account_token: "YOUR_ACCESS_TOKEN")

            result = didit.account.applications.retrieve(
              "a1b2c3d4-5678-90ab-cdef-111111111111",
              "b2c3d4e5-6789-01bc-defg-222222222222"
            )
            puts result.to_h
        - lang: csharp
          label: .NET
          source: >-
            using System;

            using System.Text.Json;

            using Didit;


            // Use the access token that account.login returns.

            using var client = new DiditClient(new DiditClientOptions {
            AccountToken = "YOUR_ACCESS_TOKEN" });


            var result = await
            client.Account.Applications.RetrieveAsync("a1b2c3d4-5678-90ab-cdef-111111111111",
            "b2c3d4e5-6789-01bc-defg-222222222222");

            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  schemas:
    Application:
      type: object
      description: アプリケーションの完全なレコード。`uuid`、`client_id`、`api_key`は作成後に変更されることはありません。
      properties:
        uuid:
          type: string
          format: uuid
          description: アプリケーションのUUID。以降の呼び出しで`{app_id}`として使用します。
          example: b2c3d4e5-6789-01bc-defg-222222222222
        name:
          type: string
          description: Diditコンソールに表示されるアプリケーションの表示名。
          example: Acme Production App
        client_id:
          type: string
          description: 公開クライアント識別子で、OAuth形式のフローに埋め込んでも安全です。
          example: S9LIYGSoWNuGMLHsvEt9dQ
        api_key:
          type: string
          description: >-
            長期間有効なシークレット（`client_secret`とも呼ばれます）。`https://verification.didit.me/v3/...`へのすべての呼び出し（セッション、ワークフロー、AMLなど）で`x-api-key`ヘッダーとして使用します。認証情報として扱い、クライアント側には決して公開しないでください。新しいキーは`sk_live_`（本番アプリケーション）または`sk_test_`（サンドボックスアプリケーション）で始まり、その後に43文字のURLセーフな文字（英字、数字、`-`、`_`）が続きます。この形式より前に作成されたキーにはプレフィックスがなく、変更なしで引き続き使用できます。アカウントを復旧してから72時間は、一覧取得、取得、更新でキーの代わりに空文字列が返されます。
          example: sk_live_example_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
        website_url:
          type: string
          nullable: true
          description: このアプリケーションに関連付けられたWebサイトまたはアプリのURL。
          example: https://acme.example
        redirect_uris:
          type: array
          items:
            type: string
          description: OAuth形式および認証リダイレクトフローで許可されるリダイレクトURIです。
          example:
            - https://acme.example/callback
        terms_url:
          type: string
          nullable: true
          description: 認証フローに表示される利用規約のURL。
          example: https://acme.example/terms
        privacy_url:
          type: string
          nullable: true
          description: 検証フローに表示されるプライバシーポリシーのURL。
          example: https://acme.example/privacy
        description:
          type: string
          nullable: true
          description: アプリケーションの内部説明（エンドユーザーには表示されません）。
        created_at:
          type: string
          format: date-time
          example: '2025-06-01T10:00:00Z'
        products:
          type: array
          readOnly: true
          description: >-
            アプリケーションのプロダクト。常に3つすべてが、`identity`、`transactions`、`authentication`の順に含まれます。新しいアプリケーションでは、`identity`がすべてのモジュールをオンにした状態で有効になり、`transactions`と`authentication`は無効です。読み取り専用です。作成または更新のボディに含まれる`products`キーは無視されます。
          items:
            $ref: '#/components/schemas/ApplicationProduct'
          example:
            - product: identity
              status: enabled
              modules:
                user_verification: true
                business_verification: true
                case_management: true
            - product: transactions
              status: disabled
              modules:
                travel_rule: true
                case_management: true
            - product: authentication
              status: disabled
              modules: {}
    AuthError:
      type: object
      description: 認証/認可/未検出エラーのエンベロープ。
      properties:
        detail:
          type: string
          example: Invalid access token
    ApplicationProduct:
      type: object
      description: >-
        アプリケーションのプロダクト1つとその状態です。読み取り専用です。アプリケーションのエンドポイントはこれを返し、リクエストボディ内では無視します。
      properties:
        product:
          type: string
          enum:
            - identity
            - transactions
            - authentication
          description: >-
            `identity`（本人確認）、`transactions`（トランザクションモニタリング）または`authentication`（認証）。
          example: identity
        status:
          type: string
          enum:
            - enabled
            - early_access
            - disabled
          description: >-
            このアプリケーションで製品が有効かどうか。`early_access`は`authentication`にのみ適用され、Diditが有効化します。
          example: enabled
        modules:
          type: object
          additionalProperties:
            type: boolean
          description: >-
            プロダクトのモジュールのスイッチで、それぞれ`true`または`false`です。`identity`には`user_verification`、`business_verification`、`case_management`があります。`transactions`には`travel_rule`と`case_management`があります。`authentication`には何もありません（`{}`）。`case_management`は`identity`と`transactions`の両方に表示される1つの設定であるため、両方で同じ値になります。
          example:
            user_verification: true
            business_verification: true
            case_management: true
      required:
        - product
        - status
        - modules
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        `POST /programmatic/login/`または`POST
        /programmatic/verify-email/`から返される、RS256で署名されたJWTの`access_token`。`Authorization:
        Bearer
        <access_token>`として送信します。デフォルトの有効期間は86400秒（24時間）です。このトークンは`apx.didit.me/auth/v2`のアカウント管理エンドポイントに対してのみ有効です。認証API（`verification.didit.me/v3`）では、代わりに長期間有効な`api_key`を`x-api-key`として使用します。

````

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