{
  "openapi": "3.0.0",
  "info": {
    "version": "1.0.0",
    "title": "Didit Auth API",
    "description": "Programmatic registration and authentication API for developers and AI agents. Register in 2 API calls -- no browser needed. The most agent-friendly identity verification platform.\n\n## Base URL\n\nAll endpoints in this spec are hosted at `https://apx.didit.me/auth/v2`. This is a different host than the verification API (`https://verification.didit.me/v3`). Keep them straight: this auth host issues your **JWT access tokens** and lets you list and manage your **organizations** and **applications**. The verification host is where you call sessions, workflows, AML, etc., authenticated with the **`api_key`** returned by this API.\n\n## How the auth flow works\n\n1. `POST /programmatic/register/`: submit email + password.\n2. Receive a 6-character alphanumeric code by email.\n3. `POST /programmatic/verify-email/`: submit the code. You get back a JWT `access_token`, a `refresh_token`, an organization and two applications, each with `client_id` + `api_key`: `sandbox_application` (free, every check is mocked and never billed) and `application` (live, every check is billed from the organization's balance, which starts at $0).\n4. Save both `api_key` values. Build and test with the sandbox key as `x-api-key` on every call to `https://verification.didit.me/v3/...`, and switch to the live `application` key only to go live, after adding credit.\n5. From any future machine, `POST /programmatic/login/` exchanges your email + password for a fresh JWT, then call `GET /organizations/me/` and the application endpoints to recover or rotate credentials.\n\nThe JWT is only needed for the **Account Management** endpoints in this spec; verification API traffic uses the long-lived `api_key`, not the JWT.\n\n## Conventions\n\n- All request and response bodies are JSON (`Content-Type: application/json`).\n- **Use a real, deliverable email address when testing `POST /programmatic/register/`.** The address is checked before any account is created: addresses on reserved test domains (`@example.com`, `@example.org`, `@*.test`, `@*.example`, `@*.invalid`) and others that cannot receive the code return `400` with `\"code\": \"email_undeliverable\"` and a `reason`. Substitute the `you@yourdomain.com` placeholder in the samples with an inbox you can actually read.\n- Validation errors return HTTP `400` with one of two envelopes: `{\"field\": [\"message\", ...]}` for field-level problems, or `{\"detail\": \"message\"}` for business-rule errors. A handful of validators (password strength on register, code expiry on verify-email) currently respond with a bare array `[\"message\"]` instead of the field-keyed form -- this is a known server-side inconsistency, so client code should accept both shapes.\n- Authentication errors come back as `{\"detail\": \"...\"}` with HTTP `401` (invalid bearer token) or `403` (missing bearer token / insufficient privileges).\n- Rate-limit responses include a `wait` field with the cooldown in seconds.\n\n## Console identity recovery\n\nIdentity actions are console-only and require a console session; account API tokens, application API keys and end-user access tokens do not grant access. They are not public server SDK operations. See [admin identity actions](https://docs.didit.me/authentication/sign-in-methods#admin-identity-actions) for reset MFA, sign-in links, password reset and bulk status changes. The x-console-identity-actions extension references their request and result schemas without adding callable SDK paths."
  },
  "servers": [
    {
      "url": "https://apx.didit.me/auth/v2",
      "description": "Production auth server"
    }
  ],
  "tags": [
    {
      "name": "Programmatic Auth",
      "description": "Email-and-password account lifecycle: register, verify, login. Returns the JWT `access_token` you use against the Account Management endpoints, plus (on verify) your first application's `client_id` and `api_key`."
    },
    {
      "name": "Account Management",
      "description": "Authenticated endpoints (JWT bearer) that list organizations and create, fetch, or update applications. Use these to recover or rotate the `api_key` you authenticate verification API calls with."
    }
  ],
  "paths": {
    "/programmatic/register/": {
      "post": {
        "summary": "Register Account",
        "description": "Step 1 of programmatic onboarding. Creates a pending account and emails a 6-char code (10 min TTL). The address is checked before any account is created: one that cannot receive the code returns 400 `email_undeliverable`. Rate limits: 5/IP/hour, plus a shared hourly budget per network (/24 for IPv4, /64 for IPv6).",
        "operationId": "programmatic_register",
        "x-didit-sdk": {
          "resource": "account",
          "method": "register",
          "auth": "none",
          "server": true
        },
        "tags": [
          "Programmatic Auth"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterRequest"
              },
              "examples": {
                "Gmail": {
                  "summary": "Register with a personal Gmail",
                  "value": {
                    "email": "you@yourdomain.com",
                    "password": "MyStr0ng!Pass"
                  }
                },
                "Work": {
                  "summary": "Register with a work email",
                  "value": {
                    "email": "you@yourcompany.com",
                    "password": "C0mplex#Pass1"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "An account with this email is already registered but not verified yet. A new 6-character verification code was emailed (valid for 10 minutes) and nothing else changes: the password sent in this request is ignored. Call `POST /programmatic/verify-email/` next with the new code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegisterResponse"
                },
                "examples": {
                  "New code sent": {
                    "value": {
                      "message": "A new verification code has been sent to your email.",
                      "email": "you@yourdomain.com"
                    }
                  }
                }
              }
            }
          },
          "201": {
            "description": "Registration successful. A 6-character alphanumeric verification code (e.g., `A3K9F2`) was emailed to the supplied address and is valid for 10 minutes. Call `POST /programmatic/verify-email/` next.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegisterResponse"
                },
                "examples": {
                  "Success": {
                    "value": {
                      "message": "Registration successful. Check your email for the verification code.",
                      "email": "you@yourdomain.com"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error. The intended envelope is `{\"field\": [\"...\"]}` for field-level errors and `{\"detail\": \"...\"}` for business-rule errors (e.g. duplicate email). Password-strength rules currently respond with a bare array `[\"...\"]`, one rule at a time -- known server-side inconsistency; treat it as `{\"password\": [\"...\"]}` until fixed. When the address cannot receive the code (disposable, reserved or test domain, no mail server, a likely typo, or a previously bounced address), the body is `EmailUndeliverableError` with `code: \"email_undeliverable\"`; no account is created or changed.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/ValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/EmailUndeliverableError"
                    }
                  ]
                },
                "examples": {
                  "MissingFields": {
                    "summary": "Empty body",
                    "value": {
                      "email": [
                        "This field is required."
                      ],
                      "password": [
                        "This field is required."
                      ]
                    }
                  },
                  "InvalidEmail": {
                    "summary": "Malformed email",
                    "value": {
                      "email": [
                        "Enter a valid email address."
                      ]
                    }
                  },
                  "PasswordTooShort": {
                    "summary": "Password under 8 chars",
                    "value": {
                      "password": [
                        "Ensure this field has at least 8 characters."
                      ]
                    }
                  },
                  "PasswordMissingUppercase": {
                    "summary": "Password missing an uppercase letter",
                    "value": [
                      "Password must contain at least one uppercase letter."
                    ]
                  },
                  "PasswordMissingLowercase": {
                    "summary": "Password missing a lowercase letter",
                    "value": [
                      "Password must contain at least one lowercase letter."
                    ]
                  },
                  "PasswordMissingDigit": {
                    "summary": "Password missing a digit",
                    "value": [
                      "Password must contain at least one digit."
                    ]
                  },
                  "PasswordMissingSpecial": {
                    "summary": "Password missing a special character",
                    "value": [
                      "Password must contain at least one special character (!@#$%^&*()_+-=[]{}|;:,.<>?)."
                    ]
                  },
                  "Duplicate": {
                    "summary": "Email already has an account",
                    "value": {
                      "detail": "An account with this email already exists."
                    }
                  },
                  "EmailUndeliverable": {
                    "summary": "Address cannot receive email (disposable domain)",
                    "value": {
                      "detail": "This email can't receive messages. Please use a different email address.",
                      "code": "email_undeliverable",
                      "reason": "disposable_domain"
                    }
                  },
                  "EmailLikelyTypo": {
                    "summary": "Likely typo in the domain",
                    "value": {
                      "detail": "This email can't receive messages. Please use a different email address.",
                      "code": "email_undeliverable",
                      "reason": "possible_typo",
                      "suggestion": "gmail.com"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. More than 5 registration attempts from the same IP in the last hour, or the hourly budget for the caller's network (/24 for IPv4, /64 for IPv6, shared by registration and code resends) is used up. Both carry `Retry-After: 3600`. Also returned, with a `Retry-After: 5` header, when the service is momentarily checking as many passwords or codes as it can at once; retry after the indicated number of seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                },
                "examples": {
                  "RateLimited": {
                    "value": {
                      "detail": "Too many registration attempts. Please try again later."
                    }
                  },
                  "PasswordChecksBusy": {
                    "summary": "Too many password checks in progress",
                    "value": {
                      "detail": "Too many sign-in attempts are being processed right now. Please try again in a few seconds."
                    }
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "cURL",
            "source": "curl -X POST https://apx.didit.me/auth/v2/programmatic/register/ \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"email\": \"you@yourdomain.com\",\n    \"password\": \"MyStr0ng!Pass\"\n  }'"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from didit import Didit\n\n# This call needs no API key.\nclient = Didit()\n\nresult = client.account.register(\n    email=\"you@yourdomain.com\",\n    password=\"MyStr0ng!Pass\",\n)\nprint(result)"
          },
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// This call needs no API key.\nconst didit = new Didit();\n\nconst result = await didit.account.register({\n  email: \"you@yourdomain.com\",\n  password: \"MyStr0ng!Pass\",\n});\nconsole.log(result);"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "ctx := context.Background()\n// This call needs no API key.\nclient := didit.NewClient()\n\nresult, err := client.Account.Register(ctx, didit.RegisterRequest{\n\tEmail:    \"you@yourdomain.com\",\n\tPassword: \"MyStr0ng!Pass\",\n})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "import me.didit.Didit;\nimport me.didit.types.RegisterRequest;\n\n// This call needs no API key.\nDidit client = new Didit();\n\nvar result = client.account().register(RegisterRequest.builder()\n        .email(\"you@yourdomain.com\")\n        .password(\"MyStr0ng!Pass\")\n        .build());\nSystem.out.println(result);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\nrequire 'vendor/autoload.php';\n\nuse Didit\\DiditClient;\n\n// This call needs no API key.\n$didit = new DiditClient();\n\n$result = $didit->account->register([\n    'email' => 'you@yourdomain.com',\n    'password' => 'MyStr0ng!Pass',\n]);\nprint_r($result->toArray());"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "require \"didit\"\n\n# This call needs no API key.\ndidit = Didit::Client.new\n\nresult = didit.account.register(\n  email: \"you@yourdomain.com\",\n  password: \"MyStr0ng!Pass\"\n)\nputs result.to_h"
          },
          {
            "lang": "csharp",
            "label": ".NET",
            "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// This call needs no API key.\nusing var client = new DiditClient();\n\nvar result = await client.Account.RegisterAsync(new RegisterRequest\n{\n    Email = \"you@yourdomain.com\",\n    Password = \"MyStr0ng!Pass\",\n});\nConsole.WriteLine(JsonSerializer.Serialize(result));"
          }
        ],
        "security": [
          {}
        ]
      }
    },
    "/programmatic/verify-email/": {
      "post": {
        "summary": "Verify Email and Issue Credentials",
        "description": "Step 2 of onboarding. Exchanges the 6-char code for a verified account, a default org+app, and a JWT pair. Persist the returned `api_key`. An account that already has an authenticator app or a passkey gets the same second-factor step as the login instead: `2fa_required: true` and a `temp_token`, with no tokens and no application keys.",
        "operationId": "programmatic_verify_email",
        "x-didit-sdk": {
          "resource": "account",
          "method": "verify_email",
          "auth": "none",
          "server": true
        },
        "tags": [
          "Programmatic Auth"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VerifyEmailRequest"
              },
              "examples": {
                "Default": {
                  "summary": "Submit the code from the registration email",
                  "value": {
                    "email": "you@yourdomain.com",
                    "code": "A3K9F2"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email verified. The response contains tokens for this auth API plus the brand-new application's `client_id` and `api_key`. Persist the `api_key` securely — it is the long-lived credential used by every verification API call. When the account already has an authenticator app or a passkey, the response carries `2fa_required: true`, a `temp_token`, `has_authenticator` and `has_passkeys` instead of tokens and application keys: finish the sign-in with the second factor, then read the organization and its applications from `/organizations/me/`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerifyEmailResponse"
                },
                "examples": {
                  "Success": {
                    "value": {
                      "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
                      "refresh_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
                      "expires_in": 86400,
                      "organization": {
                        "uuid": "a1b2c3d4-5678-90ab-cdef-111111111111",
                        "name": "developer"
                      },
                      "application": {
                        "uuid": "b2c3d4e5-6789-01bc-defg-222222222222",
                        "name": "developer",
                        "client_id": "S9LIYGSoWNuGMLHsvEt9dQ",
                        "api_key": "sk_live_example_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
                        "data_location": "eu",
                        "mode": "live"
                      },
                      "sandbox_application": {
                        "uuid": "c3d4e5f6-7890-12cd-efgh-333333333333",
                        "name": "developer (Sandbox)",
                        "client_id": "T0MJZHTpXOvHNMItwFu0eR",
                        "api_key": "sk_test_example_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
                        "data_location": "eu",
                        "mode": "sandbox"
                      }
                    }
                  },
                  "SecondFactorRequired": {
                    "summary": "The account already has an authenticator app or a passkey",
                    "value": {
                      "2fa_required": true,
                      "temp_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
                      "has_passkeys": false,
                      "has_authenticator": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error. The intended envelope is `{\"field\": [\"...\"]}` for field-level problems and `{\"detail\": \"...\"}` for business-rule errors (e.g. user not found). Wrong-or-expired-code errors currently respond with a bare array `[\"Invalid or expired verification code.\"]` -- known server-side inconsistency; treat it as `{\"code\": [\"...\"]}` until fixed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationError"
                },
                "examples": {
                  "MissingFields": {
                    "summary": "Empty body",
                    "value": {
                      "email": [
                        "This field is required."
                      ],
                      "code": [
                        "This field is required."
                      ]
                    }
                  },
                  "CodeTooShort": {
                    "summary": "Code under 6 characters",
                    "value": {
                      "code": [
                        "Ensure this field has at least 6 characters."
                      ]
                    }
                  },
                  "InvalidEmail": {
                    "summary": "Malformed email",
                    "value": {
                      "email": [
                        "Enter a valid email address."
                      ]
                    }
                  },
                  "InvalidCode": {
                    "summary": "Wrong or expired code",
                    "value": [
                      "Invalid or expired verification code."
                    ]
                  },
                  "UserNotFound": {
                    "summary": "No pending account for that email",
                    "value": {
                      "detail": "User not found."
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "The account was recovered and must set up a new sign-in method first. No tokens are issued; a link to do that was emailed to the account's address. An account whose organization enforces SSO gets `403` with `error: sso_required`, `organization_name`, `organization_slug` and `sso_url`, with no tokens and no new organization.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/RecoverySetupRequiredError"
                    },
                    {
                      "$ref": "#/components/schemas/SsoRequiredError"
                    }
                  ]
                },
                "examples": {
                  "RecoverySetupRequired": {
                    "summary": "Recovered account with no sign-in method yet",
                    "value": {
                      "recovery_setup_required": true,
                      "setup_link_sent": true,
                      "message": "You recovered your account. Open the link we emailed you to set up a new sign-in method.",
                      "code": "recovery_setup_required"
                    }
                  },
                  "SSORequired": {
                    "summary": "The account belongs to an organization that requires SSO",
                    "value": {
                      "error": "sso_required",
                      "message": "Your organization 'Acme Corp' requires SSO login.",
                      "organization_name": "Acme Corp",
                      "organization_slug": "acme-corp",
                      "sso_url": "/sso/acme-corp"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "The service is momentarily checking as many passwords or codes as it can at once. Sent with a `Retry-After: 5` header; retry after the indicated number of seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                },
                "examples": {
                  "PasswordChecksBusy": {
                    "summary": "Too many password checks in progress",
                    "value": {
                      "detail": "Too many sign-in attempts are being processed right now. Please try again in a few seconds."
                    }
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "cURL",
            "source": "curl -X POST https://apx.didit.me/auth/v2/programmatic/verify-email/ \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"email\": \"you@yourdomain.com\",\n    \"code\": \"A3K9F2\"\n  }'"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from didit import Didit\n\n# This call needs no API key.\nclient = Didit()\n\nresult = client.account.verify_email(\n    email=\"you@yourdomain.com\",\n    code=\"A3K9F2\",\n)\nprint(result)"
          },
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// This call needs no API key.\nconst didit = new Didit();\n\nconst result = await didit.account.verifyEmail({\n  email: \"you@yourdomain.com\",\n  code: \"A3K9F2\",\n});\nconsole.log(result);"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "ctx := context.Background()\n// This call needs no API key.\nclient := didit.NewClient()\n\nresult, err := client.Account.VerifyEmail(ctx, didit.VerifyEmailRequest{\n\tEmail: \"you@yourdomain.com\",\n\tCode:  \"A3K9F2\",\n})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "import me.didit.Didit;\nimport me.didit.types.VerifyEmailRequest;\n\n// This call needs no API key.\nDidit client = new Didit();\n\nvar result = client.account().verifyEmail(VerifyEmailRequest.builder()\n        .email(\"you@yourdomain.com\")\n        .code(\"A3K9F2\")\n        .build());\nSystem.out.println(result);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\nrequire 'vendor/autoload.php';\n\nuse Didit\\DiditClient;\n\n// This call needs no API key.\n$didit = new DiditClient();\n\n$result = $didit->account->verifyEmail([\n    'email' => 'you@yourdomain.com',\n    'code' => 'A3K9F2',\n]);\nprint_r($result->toArray());"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "require \"didit\"\n\n# This call needs no API key.\ndidit = Didit::Client.new\n\nresult = didit.account.verify_email(\n  email: \"you@yourdomain.com\",\n  code: \"A3K9F2\"\n)\nputs result.to_h"
          },
          {
            "lang": "csharp",
            "label": ".NET",
            "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// This call needs no API key.\nusing var client = new DiditClient();\n\nvar result = await client.Account.VerifyEmailAsync(new VerifyEmailRequest\n{\n    Email = \"you@yourdomain.com\",\n    Code = \"A3K9F2\",\n});\nConsole.WriteLine(JsonSerializer.Serialize(result));"
          }
        ],
        "security": [
          {}
        ]
      }
    },
    "/programmatic/login/": {
      "post": {
        "summary": "Programmatic Login",
        "description": "Authenticate any verified email/password Didit account and receive an RS256 JWT pair (default lifetime 86400s). Console-created email/password accounts can use this endpoint; OAuth-only console accounts must set a password first.",
        "operationId": "programmatic_login",
        "x-didit-sdk": {
          "resource": "account",
          "method": "login",
          "auth": "none",
          "server": true
        },
        "tags": [
          "Programmatic Auth"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginRequest"
              },
              "examples": {
                "Default": {
                  "summary": "Programmatic login",
                  "value": {
                    "email": "you@yourdomain.com",
                    "password": "MyStr0ng!Pass"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Login successful. Returns a fresh JWT pair. Use the `access_token` as `Authorization: Bearer <token>` against `/organizations/me/...` to look up the `org_id`, `app_id`, and `api_key`. When the account has an authenticator app or a passkey, the response carries `2fa_required: true` and a `temp_token` instead of tokens.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoginResponse"
                },
                "examples": {
                  "Success": {
                    "value": {
                      "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
                      "refresh_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
                      "expires_in": 86400,
                      "message": "Login successful"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Field-level problems with the request body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationError"
                },
                "examples": {
                  "MissingFields": {
                    "summary": "Empty body",
                    "value": {
                      "email": [
                        "This field is required."
                      ],
                      "password": [
                        "This field is required."
                      ]
                    }
                  },
                  "InvalidEmail": {
                    "summary": "Malformed email",
                    "value": {
                      "email": [
                        "Enter a valid email address."
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authentication refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthError"
                },
                "examples": {
                  "InvalidCredentials": {
                    "summary": "Email + password did not match (also returned when the account does not exist, to avoid user-enumeration)",
                    "value": {
                      "detail": "Invalid email or password."
                    }
                  },
                  "NotVerified": {
                    "summary": "Account exists but email is not yet verified",
                    "value": {
                      "detail": "Please verify your email address before logging in."
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "The account was recovered and must set up a new sign-in method before it can log in. A link to do that was emailed to the account's address. An account whose organization enforces SSO gets `403` with `error: sso_required`, `organization_name`, `organization_slug` and `sso_url`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/RecoverySetupRequiredError"
                    },
                    {
                      "$ref": "#/components/schemas/SsoRequiredError"
                    }
                  ]
                },
                "examples": {
                  "RecoverySetupRequired": {
                    "summary": "Recovered account with no sign-in method yet",
                    "value": {
                      "recovery_setup_required": true,
                      "setup_link_sent": true,
                      "message": "You recovered your account. Open the link we emailed you to set up a new sign-in method.",
                      "code": "recovery_setup_required"
                    }
                  },
                  "SSORequired": {
                    "summary": "The account belongs to an organization that requires SSO",
                    "value": {
                      "error": "sso_required",
                      "message": "Your organization 'Acme Corp' requires SSO login.",
                      "organization_name": "Acme Corp",
                      "organization_slug": "acme-corp",
                      "sso_url": "/sso/acme-corp"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Account locked (too many recent failures on this email) or IP rate-limited (too many attempts from this address). Also returned, with a `Retry-After: 5` header, when the service is momentarily checking as many passwords or codes as it can at once; retry after the indicated number of seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                },
                "examples": {
                  "AccountLocked": {
                    "summary": "Progressive lockout tripped",
                    "value": {
                      "detail": "Account temporarily locked due to too many failed login attempts. Please try again later."
                    }
                  },
                  "IPRateLimited": {
                    "summary": "More than 20/min or 100/hour from this IP",
                    "value": {
                      "detail": "Too many login attempts from this IP address. Please wait before trying again."
                    }
                  },
                  "PasswordChecksBusy": {
                    "summary": "Too many password checks in progress",
                    "value": {
                      "detail": "Too many sign-in attempts are being processed right now. Please try again in a few seconds."
                    }
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "cURL",
            "source": "curl -X POST https://apx.didit.me/auth/v2/programmatic/login/ \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"email\": \"you@yourdomain.com\",\n    \"password\": \"MyStr0ng!Pass\"\n  }'"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from didit import Didit\n\n# This call needs no API key.\nclient = Didit()\n\nresult = client.account.login(\n    email=\"you@yourdomain.com\",\n    password=\"MyStr0ng!Pass\",\n)\nprint(result)"
          },
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// This call needs no API key.\nconst didit = new Didit();\n\nconst result = await didit.account.login({\n  email: \"you@yourdomain.com\",\n  password: \"MyStr0ng!Pass\",\n});\nconsole.log(result);"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "ctx := context.Background()\n// This call needs no API key.\nclient := didit.NewClient()\n\nresult, err := client.Account.Login(ctx, didit.LoginRequest{\n\tEmail:    \"you@yourdomain.com\",\n\tPassword: \"MyStr0ng!Pass\",\n})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "import me.didit.Didit;\nimport me.didit.types.LoginRequest;\n\n// This call needs no API key.\nDidit client = new Didit();\n\nvar result = client.account().login(LoginRequest.builder()\n        .email(\"you@yourdomain.com\")\n        .password(\"MyStr0ng!Pass\")\n        .build());\nSystem.out.println(result);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\nrequire 'vendor/autoload.php';\n\nuse Didit\\DiditClient;\n\n// This call needs no API key.\n$didit = new DiditClient();\n\n$result = $didit->account->login([\n    'email' => 'you@yourdomain.com',\n    'password' => 'MyStr0ng!Pass',\n]);\nprint_r($result->toArray());"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "require \"didit\"\n\n# This call needs no API key.\ndidit = Didit::Client.new\n\nresult = didit.account.login(\n  email: \"you@yourdomain.com\",\n  password: \"MyStr0ng!Pass\"\n)\nputs result.to_h"
          },
          {
            "lang": "csharp",
            "label": ".NET",
            "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// This call needs no API key.\nusing var client = new DiditClient();\n\nvar result = await client.Account.LoginAsync(new LoginRequest\n{\n    Email = \"you@yourdomain.com\",\n    Password = \"MyStr0ng!Pass\",\n});\nConsole.WriteLine(JsonSerializer.Serialize(result));"
          }
        ],
        "security": [
          {}
        ]
      }
    },
    "/organizations/me/": {
      "get": {
        "summary": "List My Organizations",
        "description": "List organizations the authenticated user belongs to. Each entry's `uuid` is the `org_id` used on the application endpoints.",
        "operationId": "list_my_organizations",
        "x-didit-sdk": {
          "resource": "account.organizations",
          "method": "list",
          "auth": "account_token",
          "server": true
        },
        "tags": [
          "Account Management"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Page of organizations the authenticated user belongs to (`limit`/`offset`, 50 per page by default). Use the `uuid` of an entry as `{org_id}` on the application endpoints.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedOrganizationList"
                },
                "examples": {
                  "Success": {
                    "summary": "A freshly-registered programmatic account",
                    "value": {
                      "count": 1,
                      "next": null,
                      "previous": null,
                      "results": [
                        {
                          "uuid": "a1b2c3d4-5678-90ab-cdef-111111111111",
                          "name": "developer",
                          "contact_email": "developer@gmail.com",
                          "created_at": "2025-06-01T10:00:00Z"
                        }
                      ]
                    }
                  },
                  "Multi": {
                    "summary": "A reseller account that manages several customer organizations",
                    "value": {
                      "count": 2,
                      "next": null,
                      "previous": null,
                      "results": [
                        {
                          "uuid": "a1b2c3d4-5678-90ab-cdef-111111111111",
                          "name": "Acme HQ",
                          "contact_email": "ops@acme.example",
                          "created_at": "2025-06-01T10:00:00Z"
                        },
                        {
                          "uuid": "f9e8d7c6-5432-10ab-cdef-444444444444",
                          "name": "Acme Customer A",
                          "contact_email": "ops@acme.example",
                          "created_at": "2025-06-12T08:11:00Z"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Access token is missing, malformed, or expired. Re-authenticate with `POST /programmatic/login/`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthError"
                },
                "examples": {
                  "InvalidToken": {
                    "value": {
                      "detail": "Invalid access token"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "No bearer token was supplied, or the token belongs to an account without the required privileges.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthError"
                },
                "examples": {
                  "Forbidden": {
                    "value": {
                      "detail": "You do not have permission to perform this action."
                    }
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "cURL",
            "source": "curl https://apx.didit.me/auth/v2/organizations/me/ \\\n  -H \"Authorization: Bearer $ACCESS_TOKEN\""
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from didit import Didit\n\n# Use the access token that account.login returns.\nclient = Didit(account_token=\"YOUR_ACCESS_TOKEN\")\n\nfor item in client.account.organizations.list():\n    print(item)"
          },
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Use the access token that account.login returns.\nconst didit = new Didit({ accountToken: \"YOUR_ACCESS_TOKEN\" });\n\nfor await (const item of didit.account.organizations.list()) {\n  console.log(item);\n}"
          },
          {
            "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\niter := client.Account.Organizations.ListAutoPaging(ctx, didit.AccountOrganizationsListParams{})\nfor iter.Next() {\n\tfmt.Printf(\"%+v\\n\", iter.Current())\n}\nif err := iter.Err(); err != nil {\n\tlog.Fatal(err)\n}"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "import me.didit.Didit;\n\n// Use the access token that account.login returns.\nDidit client = Didit.builder().accountToken(\"YOUR_ACCESS_TOKEN\").build();\n\nfor (var item : client.account().organizations().list()) {\n    System.out.println(item);\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\nrequire 'vendor/autoload.php';\n\nuse Didit\\DiditClient;\n\n// Use the access token that account.login returns.\n$didit = new DiditClient(accountToken: 'YOUR_ACCESS_TOKEN');\n\nforeach ($didit->account->organizations->list() as $item) {\n    print_r($item->toArray());\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "require \"didit\"\n\n# Use the access token that account.login returns.\ndidit = Didit::Client.new(account_token: \"YOUR_ACCESS_TOKEN\")\n\ndidit.account.organizations.list.auto_paging_each do |item|\n  puts item.to_h\nend"
          },
          {
            "lang": "csharp",
            "label": ".NET",
            "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Use the access token that account.login returns.\nusing var client = new DiditClient(new DiditClientOptions { AccountToken = \"YOUR_ACCESS_TOKEN\" });\n\nawait foreach (var item in await client.Account.Organizations.ListAsync())\n{\n    Console.WriteLine(JsonSerializer.Serialize(item));\n}"
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 50
            },
            "description": "Page size. Defaults to 50."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            },
            "description": "Zero-based offset of the first result."
          }
        ]
      }
    },
    "/organizations/me/{org_id}/applications/": {
      "post": {
        "summary": "Create Application",
        "description": "Create an application inside an organization, in the data location you choose (`data_location`, the European Union by default; it can't be changed afterwards). The response includes `api_key`; persist it now (recoverable via GET). Requires owner/admin JWT.\n\nSet initiate_login_uri to your HTTPS sign-in page on the exact website_url hostname, or an empty string to disable admin-sent sign-in links. Changing website_url also revalidates the saved sign-in URI. Invalid values return 400 with an initiate_login_uri field error; hostname and URI policy failures use https_url_on_registered_website_required. An MCP token (a \"Log in with Didit\" grant, `token_use` `mcp`) also needs the `didit:management` scope, which carries the `applications` resource; a grant limited to `didit:verification` is refused with 403 before anything is created.",
        "operationId": "create_organization_application",
        "x-didit-sdk": {
          "resource": "account.applications",
          "method": "create",
          "auth": "account_token",
          "server": true
        },
        "tags": [
          "Account Management"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "description": "UUID of the organization. Look it up with `GET /organizations/me/`.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "example": "a1b2c3d4-5678-90ab-cdef-111111111111"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "description": "All fields are optional. Omitting the body creates an application with default name `\"<organization name> App\"` and no public URLs configured.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplicationCreateRequest"
              },
              "examples": {
                "ResellerCustomer": {
                  "summary": "Reseller spinning up a customer-scoped application",
                  "value": {
                    "name": "Acme Customer App",
                    "website_url": "https://acme.example",
                    "redirect_uris": [
                      "https://acme.example/callback"
                    ],
                    "terms_url": "https://acme.example/terms",
                    "privacy_url": "https://acme.example/privacy",
                    "data_location": "eu"
                  }
                },
                "Minimal": {
                  "summary": "Minimal create -- accept all defaults",
                  "value": {
                    "name": "Sandbox App"
                  }
                },
                "Empty": {
                  "summary": "No body at all -- defaults to <org name> App",
                  "value": {}
                },
                "AdminSignInURL": {
                  "summary": "Configure the admin sign-in handoff",
                  "value": {
                    "website_url": "https://acme.example",
                    "initiate_login_uri": "https://acme.example/login"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Application created. The response includes the long-lived `api_key`; persist it now and use it as the `x-api-key` header on every `https://verification.didit.me/v3/...` call.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Application"
                },
                "examples": {
                  "Success": {
                    "value": {
                      "uuid": "b2c3d4e5-6789-01bc-defg-222222222222",
                      "name": "Acme Customer App",
                      "client_id": "S9LIYGSoWNuGMLHsvEt9dQ",
                      "api_key": "sk_live_example_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
                      "website_url": "https://acme.example",
                      "redirect_uris": [
                        "https://acme.example/callback"
                      ],
                      "terms_url": "https://acme.example/terms",
                      "privacy_url": "https://acme.example/privacy",
                      "description": null,
                      "created_at": "2025-06-01T10:00:00Z",
                      "data_location": "eu",
                      "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": {}
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error in the request body: for example a malformed redirect URI, a `data_location` that is not available yet (`au`, `mx`, `ae`) or one that does not exist. Nothing is created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationError"
                },
                "examples": {
                  "InvalidUrl": {
                    "value": {
                      "website_url": [
                        "Enter a valid URL."
                      ]
                    }
                  },
                  "DataLocationNotAvailable": {
                    "summary": "A data location that is coming soon",
                    "value": {
                      "data_location": [
                        "This data location is not available yet."
                      ]
                    }
                  },
                  "UnknownDataLocation": {
                    "summary": "A data location that does not exist",
                    "value": {
                      "data_location": [
                        "\"us\" is not a valid choice."
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Access token malformed, invalid, or expired. Get a new one with `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": "You cannot create applications in this organization. A member of the organization who is not an owner or admin gets `Only organization owners and admins can manage applications.` An owner or admin whose access to the organization is suspended gets `Your access to this organization is suspended.` A request without an `Authorization` header gets `You do not have permission to perform this action.` For 72 hours after you recovered your account the request is refused with `code` `recovery_hold` and `until`, the time the hold ends. A token issued to an AI agent (MCP) whose consent does not include application management gets `This token's scope does not permit this action.`, and a token limited to verification cannot read or change applications or their API keys. An MCP token whose grant lacks the `applications` resource (for example one limited to `didit:verification`, or `didit:staff` alone) gets `This token's scope does not permit this action.`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/AuthError"
                    },
                    {
                      "$ref": "#/components/schemas/RecoveryHoldError"
                    }
                  ]
                },
                "examples": {
                  "NotOwnerOrAdmin": {
                    "summary": "Member who is not an owner or admin",
                    "value": {
                      "detail": "Only organization owners and admins can manage applications."
                    }
                  },
                  "Suspended": {
                    "summary": "Membership suspended",
                    "value": {
                      "detail": "Your access to this organization is suspended."
                    }
                  },
                  "MissingToken": {
                    "summary": "No Authorization header",
                    "value": {
                      "detail": "You do not have permission to perform this action."
                    }
                  },
                  "RecoveryHold": {
                    "summary": "Account recovered less than 72 hours ago",
                    "value": {
                      "detail": "This action is on hold because you recovered your account.",
                      "code": "recovery_hold",
                      "until": "2026-11-04T10:15:00+00:00"
                    }
                  },
                  "McpScope": {
                    "summary": "Agent token without application management",
                    "value": {
                      "detail": "This token's scope does not permit this action."
                    }
                  },
                  "McpScopeDenied": {
                    "summary": "MCP grant without the applications scope",
                    "value": {
                      "detail": "This token's scope does not permit this action."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "The organization does not exist or you are not a member of it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthError"
                },
                "examples": {
                  "OrganizationNotFound": {
                    "summary": "Organization not found, or you are not a member",
                    "value": {
                      "detail": "Organization not found."
                    }
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "cURL",
            "source": "curl -X POST \"https://apx.didit.me/auth/v2/organizations/me/$ORG_ID/applications/\" \\\n  -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"name\": \"Acme Customer App\",\n    \"website_url\": \"https://acme.example\",\n    \"redirect_uris\": [\"https://acme.example/callback\"],\n    \"data_location\": \"eu\"\n  }'"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from didit import Didit\n\n# Use the access token that account.login returns.\nclient = Didit(account_token=\"YOUR_ACCESS_TOKEN\")\n\nresult = client.account.applications.create(\n    \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n    name=\"Acme Customer App\",\n    website_url=\"https://acme.example\",\n    redirect_uris=[\"https://acme.example/callback\"],\n    terms_url=\"https://acme.example/terms\",\n    privacy_url=\"https://acme.example/privacy\",\n    data_location=\"eu\",\n)\nprint(result)"
          },
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Use the access token that account.login returns.\nconst didit = new Didit({ accountToken: \"YOUR_ACCESS_TOKEN\" });\n\nconst result = await didit.account.applications.create(\"a1b2c3d4-5678-90ab-cdef-111111111111\", {\n  name: \"Acme Customer App\",\n  website_url: \"https://acme.example\",\n  redirect_uris: [\"https://acme.example/callback\"],\n  terms_url: \"https://acme.example/terms\",\n  privacy_url: \"https://acme.example/privacy\",\n  data_location: \"eu\",\n});\nconsole.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.Create(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", didit.ApplicationCreateRequest{\n\tName:         didit.String(\"Acme Customer App\"),\n\tWebsiteURL:   didit.String(\"https://acme.example\"),\n\tRedirectURIs: didit.Some([]string{\"https://acme.example/callback\"}),\n\tTermsURL:     didit.String(\"https://acme.example/terms\"),\n\tPrivacyURL:   didit.String(\"https://acme.example/privacy\"),\n\tDataLocation: didit.Some(didit.ApplicationDataLocation(\"eu\")),\n})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "import java.util.List;\nimport me.didit.Didit;\nimport me.didit.types.ApplicationCreateRequest;\nimport me.didit.types.ApplicationDataLocation;\n\n// Use the access token that account.login returns.\nDidit client = Didit.builder().accountToken(\"YOUR_ACCESS_TOKEN\").build();\n\nvar result = client.account().applications().create(\"a1b2c3d4-5678-90ab-cdef-111111111111\", ApplicationCreateRequest.builder()\n        .name(\"Acme Customer App\")\n        .websiteUrl(\"https://acme.example\")\n        .redirectUris(List.of(\"https://acme.example/callback\"))\n        .termsUrl(\"https://acme.example/terms\")\n        .privacyUrl(\"https://acme.example/privacy\")\n        .dataLocation(ApplicationDataLocation.of(\"eu\"))\n        .build());\nSystem.out.println(result);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\nrequire 'vendor/autoload.php';\n\nuse Didit\\DiditClient;\n\n// Use the access token that account.login returns.\n$didit = new DiditClient(accountToken: 'YOUR_ACCESS_TOKEN');\n\n$result = $didit->account->applications->create('a1b2c3d4-5678-90ab-cdef-111111111111', [\n    'name' => 'Acme Customer App',\n    'website_url' => 'https://acme.example',\n    'redirect_uris' => ['https://acme.example/callback'],\n    'terms_url' => 'https://acme.example/terms',\n    'privacy_url' => 'https://acme.example/privacy',\n    'data_location' => 'eu',\n]);\nprint_r($result->toArray());"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "require \"didit\"\n\n# Use the access token that account.login returns.\ndidit = Didit::Client.new(account_token: \"YOUR_ACCESS_TOKEN\")\n\nresult = didit.account.applications.create(\n  \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n  name: \"Acme Customer App\",\n  website_url: \"https://acme.example\",\n  redirect_uris: [\"https://acme.example/callback\"],\n  terms_url: \"https://acme.example/terms\",\n  privacy_url: \"https://acme.example/privacy\",\n  data_location: \"eu\"\n)\nputs result.to_h"
          },
          {
            "lang": "csharp",
            "label": ".NET",
            "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Use the access token that account.login returns.\nusing var client = new DiditClient(new DiditClientOptions { AccountToken = \"YOUR_ACCESS_TOKEN\" });\n\nvar result = await client.Account.Applications.CreateAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", new ApplicationCreateRequest\n{\n    Name = \"Acme Customer App\",\n    WebsiteUrl = \"https://acme.example\",\n    RedirectUris = new string[] { \"https://acme.example/callback\" },\n    TermsUrl = \"https://acme.example/terms\",\n    PrivacyUrl = \"https://acme.example/privacy\",\n    DataLocation = new ApplicationDataLocation(\"eu\"),\n});\nConsole.WriteLine(JsonSerializer.Serialize(result));"
          }
        ]
      },
      "get": {
        "summary": "List the organization's applications",
        "operationId": "get_org_applications_list",
        "x-didit-sdk": {
          "resource": "account.applications",
          "method": "list",
          "auth": "account_token",
          "server": true
        },
        "tags": [
          "Account Management"
        ],
        "description": "List the organization's applications, 50 per page by default. Use this to discover `app_id` values when recovering credentials from a new machine, then call `GET /organizations/me/{org_id}/applications/{app_id}/` for the API key. Requires an owner or admin Bearer token. An MCP token (a \"Log in with Didit\" grant, `token_use` `mcp`) also needs the `didit:management` scope, which carries the `applications` resource; a grant limited to `didit:verification` is refused with 403 before any application is listed.",
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "description": "UUID of the organization. Look it up with `GET /organizations/me/`.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "example": "a1b2c3d4-5678-90ab-cdef-111111111111"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 50
            },
            "description": "Page size. Defaults to 50."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            },
            "description": "Zero-based offset of the first result."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Number of applications per page. Defaults to 50.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 50,
              "example": 50
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "Number of applications to skip before the page starts. Defaults to 0.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "example": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Page of the organization's applications (`limit`/`offset`, 50 per page by default), each with the same shape as the application detail response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedApplicationList",
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer",
                      "description": "Total number of applications in the organization.",
                      "example": 1
                    },
                    "next": {
                      "type": "string",
                      "format": "uri",
                      "nullable": true,
                      "description": "URL of the next page, or `null` on the last page.",
                      "example": null
                    },
                    "previous": {
                      "type": "string",
                      "format": "uri",
                      "nullable": true,
                      "description": "URL of the previous page, or `null` on the first page.",
                      "example": null
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Application"
                      }
                    }
                  },
                  "required": [
                    "count",
                    "next",
                    "previous",
                    "results"
                  ]
                },
                "examples": {
                  "Success": {
                    "summary": "An organization with one application",
                    "value": {
                      "count": 1,
                      "next": null,
                      "previous": null,
                      "results": [
                        {
                          "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",
                          "data_location": "eu",
                          "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": "Access token malformed, invalid, or expired. Get a new one with `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": "You cannot list this organization's applications. A member of the organization who is not an owner or admin gets `Only organization owners and admins can manage applications.` An owner or admin whose access to the organization is suspended gets `Your access to this organization is suspended.` A request without an `Authorization` header gets `You do not have permission to perform this action.` A token issued to an AI agent (MCP) whose consent does not include application management gets `This token's scope does not permit this action.`, and a token limited to verification cannot read or change applications or their API keys. An MCP token whose grant lacks the `applications` resource (for example one limited to `didit:verification`, or `didit:staff` alone) gets `This token's scope does not permit this action.`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthError"
                },
                "examples": {
                  "NotOwnerOrAdmin": {
                    "summary": "Member who is not an owner or admin",
                    "value": {
                      "detail": "Only organization owners and admins can manage applications."
                    }
                  },
                  "Suspended": {
                    "summary": "Membership suspended",
                    "value": {
                      "detail": "Your access to this organization is suspended."
                    }
                  },
                  "MissingToken": {
                    "summary": "No Authorization header",
                    "value": {
                      "detail": "You do not have permission to perform this action."
                    }
                  },
                  "McpScope": {
                    "summary": "Agent token without application management",
                    "value": {
                      "detail": "This token's scope does not permit this action."
                    }
                  },
                  "McpScopeDenied": {
                    "summary": "MCP grant without the applications scope",
                    "value": {
                      "detail": "This token's scope does not permit this action."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "The organization does not exist or you are not a member of it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthError"
                },
                "examples": {
                  "OrganizationNotFound": {
                    "summary": "Organization not found, or you are not a member",
                    "value": {
                      "detail": "Organization not found."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-codeSamples": [
          {
            "lang": "python",
            "label": "Python",
            "source": "from didit import Didit\n\n# Use the access token that account.login returns.\nclient = Didit(account_token=\"YOUR_ACCESS_TOKEN\")\n\nfor item in client.account.applications.list(\n    \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n):\n    print(item)"
          },
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Use the access token that account.login returns.\nconst didit = new Didit({ accountToken: \"YOUR_ACCESS_TOKEN\" });\n\nfor await (const item of didit.account.applications.list(\"a1b2c3d4-5678-90ab-cdef-111111111111\")) {\n  console.log(item);\n}"
          },
          {
            "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\niter := client.Account.Applications.ListAutoPaging(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", didit.AccountApplicationsListParams{})\nfor iter.Next() {\n\tfmt.Printf(\"%+v\\n\", iter.Current())\n}\nif err := iter.Err(); err != nil {\n\tlog.Fatal(err)\n}"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "import me.didit.Didit;\n\n// Use the access token that account.login returns.\nDidit client = Didit.builder().accountToken(\"YOUR_ACCESS_TOKEN\").build();\n\nfor (var item : client.account().applications().list(\"a1b2c3d4-5678-90ab-cdef-111111111111\")) {\n    System.out.println(item);\n}"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\nrequire 'vendor/autoload.php';\n\nuse Didit\\DiditClient;\n\n// Use the access token that account.login returns.\n$didit = new DiditClient(accountToken: 'YOUR_ACCESS_TOKEN');\n\nforeach ($didit->account->applications->list('a1b2c3d4-5678-90ab-cdef-111111111111') as $item) {\n    print_r($item->toArray());\n}"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "require \"didit\"\n\n# Use the access token that account.login returns.\ndidit = Didit::Client.new(account_token: \"YOUR_ACCESS_TOKEN\")\n\ndidit.account.applications.list(\"a1b2c3d4-5678-90ab-cdef-111111111111\").auto_paging_each do |item|\n  puts item.to_h\nend"
          },
          {
            "lang": "csharp",
            "label": ".NET",
            "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Use the access token that account.login returns.\nusing var client = new DiditClient(new DiditClientOptions { AccountToken = \"YOUR_ACCESS_TOKEN\" });\n\nawait foreach (var item in await client.Account.Applications.ListAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\"))\n{\n    Console.WriteLine(JsonSerializer.Serialize(item));\n}"
          }
        ]
      }
    },
    "/organizations/me/{org_id}/applications/{app_id}/": {
      "get": {
        "summary": "Get Application Credentials",
        "description": "Read one application's full record including `client_id` and `api_key`. Use this to recover a lost `api_key`. An MCP token (a \"Log in with Didit\" grant, `token_use` `mcp`) also needs the `didit:management` scope, which carries the `applications` resource; a grant limited to `didit:verification` is refused with 403 before the application is read.",
        "operationId": "get_application_credentials",
        "x-didit-sdk": {
          "resource": "account.applications",
          "method": "retrieve",
          "auth": "account_token",
          "server": true
        },
        "tags": [
          "Account Management"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "description": "UUID of the organization that owns the application.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "example": "a1b2c3d4-5678-90ab-cdef-111111111111"
            }
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "description": "UUID of the application whose credentials you want to read.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "example": "b2c3d4e5-6789-01bc-defg-222222222222"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Application record including its `client_id` and `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",
                      "data_location": "eu",
                      "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": "Access token malformed, invalid, or expired. Get a new one with `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": "You cannot read this application. A member of the organization who is not an owner or admin gets `Only organization owners and admins can manage applications.` An owner or admin whose access to the organization is suspended gets `Your access to this organization is suspended.` A request without an `Authorization` header gets `You do not have permission to perform this action.` A token issued to an AI agent (MCP) whose consent does not include application management gets `This token's scope does not permit this action.`, and a token limited to verification cannot read or change applications or their API keys. An MCP token whose grant lacks the `applications` resource (for example one limited to `didit:verification`, or `didit:staff` alone) gets `This token's scope does not permit this action.`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthError"
                },
                "examples": {
                  "NotOwnerOrAdmin": {
                    "summary": "Member who is not an owner or admin",
                    "value": {
                      "detail": "Only organization owners and admins can manage applications."
                    }
                  },
                  "Suspended": {
                    "summary": "Membership suspended",
                    "value": {
                      "detail": "Your access to this organization is suspended."
                    }
                  },
                  "MissingToken": {
                    "summary": "No Authorization header",
                    "value": {
                      "detail": "You do not have permission to perform this action."
                    }
                  },
                  "McpScope": {
                    "summary": "Agent token without application management",
                    "value": {
                      "detail": "This token's scope does not permit this action."
                    }
                  },
                  "McpScopeDenied": {
                    "summary": "MCP grant without the applications scope",
                    "value": {
                      "detail": "This token's scope does not permit this action."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "The organization does not exist or you are not a member of it, or the application does not exist in that organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthError"
                },
                "examples": {
                  "OrganizationNotFound": {
                    "summary": "Organization not found, or you are not a member",
                    "value": {
                      "detail": "Organization not found."
                    }
                  },
                  "ApplicationNotFound": {
                    "summary": "No such application in this organization",
                    "value": {
                      "detail": "Application not found."
                    }
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "cURL",
            "source": "curl \"https://apx.didit.me/auth/v2/organizations/me/$ORG_ID/applications/$APP_ID/\" \\\n  -H \"Authorization: Bearer $ACCESS_TOKEN\""
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from didit import Didit\n\n# Use the access token that account.login returns.\nclient = Didit(account_token=\"YOUR_ACCESS_TOKEN\")\n\nresult = client.account.applications.retrieve(\n    \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n    \"b2c3d4e5-6789-01bc-defg-222222222222\",\n)\nprint(result)"
          },
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Use the access token that account.login returns.\nconst didit = new Didit({ accountToken: \"YOUR_ACCESS_TOKEN\" });\n\nconst result = await didit.account.applications.retrieve(\n  \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n  \"b2c3d4e5-6789-01bc-defg-222222222222\",\n);\nconsole.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;\n\n// Use the access token that account.login returns.\nDidit client = Didit.builder().accountToken(\"YOUR_ACCESS_TOKEN\").build();\n\nvar result = client.account().applications().retrieve(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"b2c3d4e5-6789-01bc-defg-222222222222\");\nSystem.out.println(result);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\nrequire 'vendor/autoload.php';\n\nuse Didit\\DiditClient;\n\n// Use the access token that account.login returns.\n$didit = new DiditClient(accountToken: 'YOUR_ACCESS_TOKEN');\n\n$result = $didit->account->applications->retrieve('a1b2c3d4-5678-90ab-cdef-111111111111', 'b2c3d4e5-6789-01bc-defg-222222222222');\nprint_r($result->toArray());"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "require \"didit\"\n\n# Use the access token that account.login returns.\ndidit = Didit::Client.new(account_token: \"YOUR_ACCESS_TOKEN\")\n\nresult = didit.account.applications.retrieve(\n  \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n  \"b2c3d4e5-6789-01bc-defg-222222222222\"\n)\nputs result.to_h"
          },
          {
            "lang": "csharp",
            "label": ".NET",
            "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Use the access token that account.login returns.\nusing var client = new DiditClient(new DiditClientOptions { AccountToken = \"YOUR_ACCESS_TOKEN\" });\n\nvar result = await client.Account.Applications.RetrieveAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"b2c3d4e5-6789-01bc-defg-222222222222\");\nConsole.WriteLine(JsonSerializer.Serialize(result));"
          }
        ]
      },
      "patch": {
        "summary": "Update Application",
        "description": "Update application metadata (name, URLs, redirect URIs). `api_key` and `client_id` are never rotated. `products` is read-only: a `products` key in the body is ignored. `data_location` can't be changed after the application is created, except once on the live application created with your organization, while it is unused (see the request body). Requires owner/admin JWT.\n\nSet initiate_login_uri to your HTTPS sign-in page on the exact website_url hostname, or an empty string to disable admin-sent sign-in links. Changing website_url also revalidates the saved sign-in URI. Invalid values return 400 with an initiate_login_uri field error; hostname and URI policy failures use https_url_on_registered_website_required. An MCP token (a \"Log in with Didit\" grant, `token_use` `mcp`) also needs the `didit:management` scope, which carries the `applications` resource; a grant limited to `didit:verification` is refused with 403 before anything is changed.",
        "operationId": "update_organization_application",
        "x-didit-sdk": {
          "resource": "account.applications",
          "method": "update",
          "auth": "account_token",
          "server": true
        },
        "tags": [
          "Account Management"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "description": "UUID of the organization that owns the application.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "example": "a1b2c3d4-5678-90ab-cdef-111111111111"
            }
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "description": "UUID of the application to update.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "example": "b2c3d4e5-6789-01bc-defg-222222222222"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "Send only the fields you want to change. PATCH semantics: missing fields are preserved.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplicationUpdateRequest"
              },
              "examples": {
                "RenameCustomerApplication": {
                  "summary": "Rename and move domains when no admin sign-in URL is set; otherwise update or clear that URI in the same request.",
                  "value": {
                    "name": "Acme Production App",
                    "website_url": "https://app.acme.example"
                  }
                },
                "UpdateRedirectUris": {
                  "summary": "Add a second redirect URI",
                  "value": {
                    "redirect_uris": [
                      "https://acme.example/callback",
                      "https://staging.acme.example/callback"
                    ]
                  }
                },
                "UpdatePolicies": {
                  "summary": "Refresh terms and privacy URLs",
                  "value": {
                    "terms_url": "https://acme.example/v2/terms",
                    "privacy_url": "https://acme.example/v2/privacy"
                  }
                },
                "AdminSignInURL": {
                  "summary": "Configure the admin sign-in handoff",
                  "value": {
                    "website_url": "https://acme.example",
                    "initiate_login_uri": "https://acme.example/login"
                  }
                },
                "ClearAdminSignInURL": {
                  "summary": "Disable admin-sent sign-in links",
                  "value": {
                    "initiate_login_uri": ""
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Application updated. The response is the full application record after the change, including `products`; `uuid`, `client_id`, and `api_key` are unchanged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Application"
                },
                "examples": {
                  "Success": {
                    "value": {
                      "uuid": "b2c3d4e5-6789-01bc-defg-222222222222",
                      "name": "Acme Production App",
                      "client_id": "S9LIYGSoWNuGMLHsvEt9dQ",
                      "api_key": "sk_live_example_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
                      "website_url": "https://app.acme.example",
                      "redirect_uris": [
                        "https://acme.example/callback"
                      ],
                      "terms_url": "https://acme.example/terms",
                      "privacy_url": "https://acme.example/privacy",
                      "description": null,
                      "created_at": "2025-06-01T10:00:00Z",
                      "data_location": "eu",
                      "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": {}
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error in the request body: for example a malformed URL, a `data_location` that is not available yet, or a `data_location` other than the application's own. Nothing is changed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationError"
                },
                "examples": {
                  "InvalidUrl": {
                    "value": {
                      "website_url": [
                        "Enter a valid URL."
                      ]
                    }
                  },
                  "DataLocationFixed": {
                    "summary": "Another data location than the application's own",
                    "value": {
                      "data_location": [
                        "An application's data location can't be changed after it is created."
                      ]
                    }
                  },
                  "DataLocationNotAvailable": {
                    "summary": "A data location that is coming soon",
                    "value": {
                      "data_location": [
                        "This data location is not available yet."
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Access token malformed, invalid, or expired. Get a new one with `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": "You cannot update this application. A member of the organization who is not an owner or admin gets `Only organization owners and admins can manage applications.` An owner or admin whose access to the organization is suspended gets `Your access to this organization is suspended.` A request without an `Authorization` header gets `You do not have permission to perform this action.` A token issued to an AI agent (MCP) whose consent does not include application management gets `This token's scope does not permit this action.`, and a token limited to verification cannot read or change applications or their API keys. An MCP token whose grant lacks the `applications` resource (for example one limited to `didit:verification`, or `didit:staff` alone) gets `This token's scope does not permit this action.`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthError"
                },
                "examples": {
                  "NotOwnerOrAdmin": {
                    "summary": "Member who is not an owner or admin",
                    "value": {
                      "detail": "Only organization owners and admins can manage applications."
                    }
                  },
                  "Suspended": {
                    "summary": "Membership suspended",
                    "value": {
                      "detail": "Your access to this organization is suspended."
                    }
                  },
                  "MissingToken": {
                    "summary": "No Authorization header",
                    "value": {
                      "detail": "You do not have permission to perform this action."
                    }
                  },
                  "McpScope": {
                    "summary": "Agent token without application management",
                    "value": {
                      "detail": "This token's scope does not permit this action."
                    }
                  },
                  "McpScopeDenied": {
                    "summary": "MCP grant without the applications scope",
                    "value": {
                      "detail": "This token's scope does not permit this action."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "The organization does not exist or you are not a member of it, or the application does not exist in that organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthError"
                },
                "examples": {
                  "OrganizationNotFound": {
                    "summary": "Organization not found, or you are not a member",
                    "value": {
                      "detail": "Organization not found."
                    }
                  },
                  "ApplicationNotFound": {
                    "summary": "No such application in this organization",
                    "value": {
                      "detail": "Application not found."
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Only when the update chooses another data location for the live application created with your organization: Didit could not confirm that the application has no verification session yet, so nothing was changed. Retry the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceUnavailableError"
                },
                "examples": {
                  "DataLocationCheckUnavailable": {
                    "value": {
                      "detail": "We couldn't confirm that this application is unused. Try again in a moment.",
                      "code": "data_location_check_unavailable"
                    }
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "cURL",
            "source": "curl -X PATCH \"https://apx.didit.me/auth/v2/organizations/me/$ORG_ID/applications/$APP_ID/\" \\\n  -H \"Authorization: Bearer $ACCESS_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"name\": \"Acme Production App\",\n    \"website_url\": \"https://app.acme.example\"\n  }'"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from didit import Didit\n\n# Use the access token that account.login returns.\nclient = Didit(account_token=\"YOUR_ACCESS_TOKEN\")\n\nresult = client.account.applications.update(\n    \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n    \"b2c3d4e5-6789-01bc-defg-222222222222\",\n    name=\"Acme Production App\",\n    website_url=\"https://app.acme.example\",\n)\nprint(result)"
          },
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Use the access token that account.login returns.\nconst didit = new Didit({ accountToken: \"YOUR_ACCESS_TOKEN\" });\n\nconst result = await didit.account.applications.update(\n  \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n  \"b2c3d4e5-6789-01bc-defg-222222222222\",\n  {\n    name: \"Acme Production App\",\n    website_url: \"https://app.acme.example\",\n  },\n);\nconsole.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.Update(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"b2c3d4e5-6789-01bc-defg-222222222222\", didit.ApplicationUpdateRequest{\n\tName:       didit.String(\"Acme Production App\"),\n\tWebsiteURL: didit.String(\"https://app.acme.example\"),\n})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "import me.didit.Didit;\nimport me.didit.types.ApplicationUpdateRequest;\n\n// Use the access token that account.login returns.\nDidit client = Didit.builder().accountToken(\"YOUR_ACCESS_TOKEN\").build();\n\nvar result = client.account().applications().update(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"b2c3d4e5-6789-01bc-defg-222222222222\", ApplicationUpdateRequest.builder()\n        .name(\"Acme Production App\")\n        .websiteUrl(\"https://app.acme.example\")\n        .build());\nSystem.out.println(result);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\nrequire 'vendor/autoload.php';\n\nuse Didit\\DiditClient;\n\n// Use the access token that account.login returns.\n$didit = new DiditClient(accountToken: 'YOUR_ACCESS_TOKEN');\n\n$result = $didit->account->applications->update('a1b2c3d4-5678-90ab-cdef-111111111111', 'b2c3d4e5-6789-01bc-defg-222222222222', [\n    'name' => 'Acme Production App',\n    'website_url' => 'https://app.acme.example',\n]);\nprint_r($result->toArray());"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "require \"didit\"\n\n# Use the access token that account.login returns.\ndidit = Didit::Client.new(account_token: \"YOUR_ACCESS_TOKEN\")\n\nresult = didit.account.applications.update(\n  \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n  \"b2c3d4e5-6789-01bc-defg-222222222222\",\n  name: \"Acme Production App\",\n  website_url: \"https://app.acme.example\"\n)\nputs result.to_h"
          },
          {
            "lang": "csharp",
            "label": ".NET",
            "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Use the access token that account.login returns.\nusing var client = new DiditClient(new DiditClientOptions { AccountToken = \"YOUR_ACCESS_TOKEN\" });\n\nvar result = await client.Account.Applications.UpdateAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"b2c3d4e5-6789-01bc-defg-222222222222\", new ApplicationUpdateRequest\n{\n    Name = \"Acme Production App\",\n    WebsiteUrl = \"https://app.acme.example\",\n});\nConsole.WriteLine(JsonSerializer.Serialize(result));"
          }
        ]
      }
    },
    "/programmatic/resend-otp/": {
      "post": {
        "summary": "Resend the email verification code",
        "operationId": "post_programmatic_resend_otp",
        "x-didit-sdk": {
          "resource": "account",
          "method": "resend_otp",
          "auth": "none",
          "server": true
        },
        "tags": [
          "Programmatic Auth"
        ],
        "description": "Resend the 6-character verification code for an unverified programmatic account. Requires the account's email and password so only the owner can trigger a new code (no console Basic Auth). A fresh code replaces the previous one and is valid for 10 minutes.\n\nRate limits: a per-email cooldown of 60 seconds between resends (HTTP 429 with `Retry-After`), and the same 5-per-IP-per-hour and per-network hourly budgets as registration.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email",
                  "password"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email",
                    "description": "Email of the pending (unverified) account.",
                    "example": "dev@example.com"
                  },
                  "password": {
                    "type": "string",
                    "description": "Password chosen at registration.",
                    "example": "S3cure-Passw0rd!"
                  }
                }
              },
              "example": {
                "email": "dev@example.com",
                "password": "S3cure-Passw0rd!"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A new code was emailed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "message",
                    "email"
                  ],
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Always `A new verification code has been sent to your email.`"
                    },
                    "email": {
                      "type": "string",
                      "format": "email",
                      "description": "The address the code was sent to, normalized: lowercased, with any `+tag` removed from the local part (`Dev+test@Example.com` becomes `dev@example.com`)."
                    }
                  }
                },
                "example": {
                  "message": "A new verification code has been sent to your email.",
                  "email": "you@yourdomain.com"
                }
              }
            }
          },
          "400": {
            "description": "Invalid email/password, or the email is already verified.",
            "content": {
              "application/json": {
                "examples": {
                  "Bad credentials": {
                    "value": {
                      "detail": "Invalid email or password."
                    }
                  },
                  "Already verified": {
                    "value": {
                      "detail": "This email address is already verified."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Cooldown active (60s between resends) or IP or network budget exhausted (5/IP/hour and an hourly per-network budget, both shared with registration). Also returned, with a `Retry-After: 5` header, when the service is momentarily checking as many passwords or codes as it can at once; retry after the indicated number of seconds.",
            "content": {
              "application/json": {
                "examples": {
                  "CooldownActive": {
                    "summary": "Cooldown or IP budget",
                    "value": {
                      "detail": "Please wait before requesting a new code."
                    }
                  },
                  "PasswordChecksBusy": {
                    "summary": "Too many password checks in progress",
                    "value": {
                      "detail": "Too many sign-in attempts are being processed right now. Please try again in a few seconds."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {}
        ],
        "x-codeSamples": [
          {
            "lang": "python",
            "label": "Python",
            "source": "from didit import Didit\n\n# This call needs no API key.\nclient = Didit()\n\nresult = client.account.resend_otp(\n    email=\"dev@example.com\",\n    password=\"S3cure-Passw0rd!\",\n)\nprint(result)"
          },
          {
            "lang": "javascript",
            "label": "Node.js",
            "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// This call needs no API key.\nconst didit = new Didit();\n\nconst result = await didit.account.resendOtp({\n  email: \"dev@example.com\",\n  password: \"S3cure-Passw0rd!\",\n});\nconsole.log(result);"
          },
          {
            "lang": "go",
            "label": "Go",
            "source": "ctx := context.Background()\n// This call needs no API key.\nclient := didit.NewClient()\n\nresult, err := client.Account.ResendOTP(ctx, didit.AccountResendOTPParams{\n\tEmail:    \"dev@example.com\",\n\tPassword: \"S3cure-Passw0rd!\",\n})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)"
          },
          {
            "lang": "java",
            "label": "Java",
            "source": "import me.didit.Didit;\nimport me.didit.types.AccountResendOtpParams;\n\n// This call needs no API key.\nDidit client = new Didit();\n\nvar result = client.account().resendOtp(AccountResendOtpParams.builder()\n        .email(\"dev@example.com\")\n        .password(\"S3cure-Passw0rd!\")\n        .build());\nSystem.out.println(result);"
          },
          {
            "lang": "php",
            "label": "PHP",
            "source": "<?php\n\nrequire 'vendor/autoload.php';\n\nuse Didit\\DiditClient;\n\n// This call needs no API key.\n$didit = new DiditClient();\n\n$result = $didit->account->resendOtp([\n    'email' => 'dev@example.com',\n    'password' => 'S3cure-Passw0rd!',\n]);\nprint_r($result->toArray());"
          },
          {
            "lang": "ruby",
            "label": "Ruby",
            "source": "require \"didit\"\n\n# This call needs no API key.\ndidit = Didit::Client.new\n\nresult = didit.account.resend_otp(\n  email: \"dev@example.com\",\n  password: \"S3cure-Passw0rd!\"\n)\nputs result.to_h"
          },
          {
            "lang": "csharp",
            "label": ".NET",
            "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// This call needs no API key.\nusing var client = new DiditClient();\n\nvar result = await client.Account.ResendOtpAsync(new AccountResendOtpParams\n{\n    Email = \"dev@example.com\",\n    Password = \"S3cure-Passw0rd!\",\n});\nConsole.WriteLine(JsonSerializer.Serialize(result));"
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "RS256-signed JWT `access_token` returned by `POST /programmatic/login/` or `POST /programmatic/verify-email/`. Send as `Authorization: Bearer <access_token>`. Default lifetime is 86400 seconds (24h). This token is only valid against the Account Management endpoints on `apx.didit.me/auth/v2`. The verification API (`verification.didit.me/v3`) uses the long-lived `api_key` as `x-api-key` instead."
      }
    },
    "schemas": {
      "RegisterRequest": {
        "type": "object",
        "required": [
          "email",
          "password"
        ],
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "description": "Any valid email address (personal, work, alias). Used as the unique account identifier.",
            "example": "you@yourdomain.com"
          },
          "password": {
            "type": "string",
            "minLength": 8,
            "description": "Minimum 8 characters. Must contain at least one uppercase letter (`A-Z`), one lowercase letter (`a-z`), one digit (`0-9`), and one special character from `!@#$%^&*()_+-=[]{}|;:,.<>?`. Validation reports one failed rule at a time.",
            "example": "MyStr0ng!Pass"
          }
        }
      },
      "RegisterResponse": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "Human-readable confirmation that the verification code was sent.",
            "example": "Registration successful. Check your email for the verification code."
          },
          "email": {
            "type": "string",
            "format": "email",
            "description": "The email the verification code was sent to.",
            "example": "you@yourdomain.com"
          }
        }
      },
      "VerifyEmailRequest": {
        "type": "object",
        "required": [
          "email",
          "code"
        ],
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "description": "Email used during `POST /programmatic/register/`.",
            "example": "you@yourdomain.com"
          },
          "code": {
            "type": "string",
            "minLength": 6,
            "maxLength": 6,
            "description": "6-character alphanumeric code from the verification email. Codes expire 10 minutes after the most recent code was sent.",
            "example": "A3K9F2"
          }
        }
      },
      "VerifyEmailResponse": {
        "type": "object",
        "properties": {
          "access_token": {
            "type": "string",
            "description": "RS256-signed JWT. Use as `Authorization: Bearer <token>` for Account Management endpoints on `apx.didit.me/auth/v2`."
          },
          "refresh_token": {
            "type": "string",
            "description": "Refresh token paired with the access token."
          },
          "expires_in": {
            "type": "integer",
            "description": "Lifetime of the access token in seconds (default 86400).",
            "example": 86400
          },
          "organization": {
            "$ref": "#/components/schemas/OrganizationSummary"
          },
          "application": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ApplicationCredentialsSummary"
              }
            ],
            "description": "The organization's live application (`mode: live`): the credentials a production integration ships with. Every check created with its key is billed from the organization's balance."
          },
          "sandbox_application": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ApplicationCredentialsSummary"
              }
            ],
            "nullable": true,
            "description": "The organization's sandbox application (`mode: sandbox`). Use its `api_key` to build and test the integration for free: every check is mocked and never billed. Switch to the live `application` key to go live."
          },
          "2fa_required": {
            "type": "boolean",
            "description": "Present and `true` when the account already has an authenticator app or a passkey. The response then carries `temp_token` instead of tokens and application keys.",
            "example": true
          },
          "temp_token": {
            "type": "string",
            "description": "Short-lived token for the second-factor step, sent only with `2fa_required`. It is not an access token."
          },
          "has_authenticator": {
            "type": "boolean",
            "description": "With `2fa_required`: whether the account has an authenticator app."
          },
          "has_passkeys": {
            "type": "boolean",
            "description": "With `2fa_required`: whether the account has a passkey."
          }
        }
      },
      "LoginRequest": {
        "type": "object",
        "required": [
          "email",
          "password"
        ],
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "example": "you@yourdomain.com"
          },
          "password": {
            "type": "string",
            "example": "MyStr0ng!Pass"
          }
        }
      },
      "LoginResponse": {
        "type": "object",
        "properties": {
          "access_token": {
            "type": "string",
            "description": "RS256-signed JWT. Use as `Authorization: Bearer <token>` for Account Management endpoints."
          },
          "refresh_token": {
            "type": "string"
          },
          "expires_in": {
            "type": "integer",
            "description": "Lifetime of the access token in seconds (default 86400).",
            "example": 86400
          },
          "message": {
            "type": "string",
            "example": "Login successful"
          }
        }
      },
      "Organization": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "format": "uuid",
            "description": "Use as `{org_id}` on the application endpoints.",
            "example": "a1b2c3d4-5678-90ab-cdef-111111111111"
          },
          "name": {
            "type": "string",
            "description": "Display name of the organization.",
            "example": "developer"
          },
          "contact_email": {
            "type": "string",
            "format": "email",
            "description": "Primary contact email for the organization.",
            "example": "developer@gmail.com"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "example": "2025-06-01T10:00:00Z"
          }
        }
      },
      "OrganizationSummary": {
        "type": "object",
        "description": "Minimal organization shape returned inline by `POST /programmatic/verify-email/`.",
        "properties": {
          "uuid": {
            "type": "string",
            "format": "uuid",
            "example": "a1b2c3d4-5678-90ab-cdef-111111111111"
          },
          "name": {
            "type": "string",
            "example": "developer"
          }
        }
      },
      "ApplicationCredentialsSummary": {
        "type": "object",
        "description": "Minimal application shape returned inline by `POST /programmatic/verify-email/`. Persist the `api_key` immediately.",
        "properties": {
          "uuid": {
            "type": "string",
            "format": "uuid",
            "example": "b2c3d4e5-6789-01bc-defg-222222222222"
          },
          "name": {
            "type": "string",
            "example": "developer"
          },
          "client_id": {
            "type": "string",
            "example": "S9LIYGSoWNuGMLHsvEt9dQ"
          },
          "api_key": {
            "type": "string",
            "description": "Use this as `x-api-key` on every verification API call. New keys start with `sk_live_` (live application) or `sk_test_` (sandbox application), followed by 43 URL-safe characters (letters, digits, `-` and `_`). Keys created before this format have no prefix and keep working unchanged.",
            "example": "sk_live_example_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
          },
          "data_location": {
            "$ref": "#/components/schemas/ApplicationDataLocation"
          },
          "mode": {
            "type": "string",
            "enum": [
              "live",
              "sandbox"
            ],
            "description": "The application's environment. A `live` application bills every verification session and check created with its key. A `sandbox` application mocks every check and is never billed, so it is where you test (each sandbox application can create 500 test sessions every 24 hours). Read this field to pick the application: never infer the environment from the name.",
            "example": "live"
          }
        }
      },
      "Application": {
        "type": "object",
        "description": "Full application record. `uuid`, `client_id`, and `api_key` never change after creation. `data_location` doesn't either, except once on the live application created with your organization, before it is used (see the update request).",
        "properties": {
          "uuid": {
            "type": "string",
            "format": "uuid",
            "description": "Application UUID. Use as `{app_id}` in subsequent calls.",
            "example": "b2c3d4e5-6789-01bc-defg-222222222222"
          },
          "name": {
            "type": "string",
            "description": "Application display name shown in the Didit console.",
            "example": "Acme Production App"
          },
          "client_id": {
            "type": "string",
            "description": "Public client identifier, safe to embed in OAuth-style flows.",
            "example": "S9LIYGSoWNuGMLHsvEt9dQ"
          },
          "api_key": {
            "type": "string",
            "description": "Long-lived secret (also called `client_secret`). Use as the `x-api-key` header for every call to `https://verification.didit.me/v3/...` (sessions, workflows, AML, etc.). Treat as a credential; never expose client-side. New keys start with `sk_live_` (live application) or `sk_test_` (sandbox application), followed by 43 URL-safe characters (letters, digits, `-` and `_`). Keys created before this format have no prefix and keep working unchanged. For 72 hours after you recovered your account, list, retrieve and update return an empty string here instead of the key.",
            "example": "sk_live_example_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
          },
          "website_url": {
            "type": "string",
            "nullable": true,
            "description": "Website or app URL associated with this application.",
            "example": "https://acme.example"
          },
          "redirect_uris": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Allowed redirect URIs for OAuth-style and verification redirect flows.",
            "example": [
              "https://acme.example/callback"
            ]
          },
          "terms_url": {
            "type": "string",
            "nullable": true,
            "description": "Terms of service URL shown in the verification flow.",
            "example": "https://acme.example/terms"
          },
          "privacy_url": {
            "type": "string",
            "nullable": true,
            "description": "Privacy policy URL shown in the verification flow.",
            "example": "https://acme.example/privacy"
          },
          "description": {
            "type": "string",
            "nullable": true,
            "description": "Internal description for the application (not shown to end users)."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "example": "2025-06-01T10:00:00Z"
          },
          "data_location": {
            "$ref": "#/components/schemas/ApplicationDataLocation"
          },
          "products": {
            "type": "array",
            "readOnly": true,
            "description": "The application's products. Always all three, in this order: `identity`, `transactions`, `authentication`. A new application has `identity` enabled with every module on, and `transactions` and `authentication` disabled. Read-only: a `products` key in a create or update body is ignored.",
            "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": {}
              }
            ]
          },
          "mode": {
            "type": "string",
            "enum": [
              "live",
              "sandbox"
            ],
            "description": "The application's environment. A `live` application bills every verification session and check created with its key. A `sandbox` application mocks every check and is never billed, so it is where you test (each sandbox application can create 500 test sessions every 24 hours). Read this field to pick the application: never infer the environment from the name.",
            "example": "live",
            "readOnly": true
          },
          "initiate_login_uri": {
            "$ref": "#/components/schemas/ApplicationInitiateLoginURI"
          }
        }
      },
      "ApplicationCreateRequest": {
        "type": "object",
        "description": "All fields are optional. Sending an empty body creates an application with a default name, in the European Union.",
        "properties": {
          "name": {
            "type": "string",
            "description": "Application display name. Defaults to `\"<organization name> App\"`.",
            "example": "Acme Customer App"
          },
          "website_url": {
            "type": "string",
            "description": "Website or app URL associated with this application.",
            "example": "https://acme.example"
          },
          "redirect_uris": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Allowed redirect URIs for OAuth-style and verification redirect flows.",
            "example": [
              "https://acme.example/callback"
            ]
          },
          "terms_url": {
            "type": "string",
            "description": "Terms of service URL shown in the verification flow.",
            "example": "https://acme.example/terms"
          },
          "privacy_url": {
            "type": "string",
            "description": "Privacy policy URL shown in the verification flow.",
            "example": "https://acme.example/privacy"
          },
          "description": {
            "type": "string",
            "description": "Internal description for the application (not shown to end users)."
          },
          "data_location": {
            "$ref": "#/components/schemas/ApplicationDataLocation"
          },
          "initiate_login_uri": {
            "$ref": "#/components/schemas/ApplicationInitiateLoginURI"
          }
        }
      },
      "ApplicationUpdateRequest": {
        "type": "object",
        "description": "PATCH body for application metadata. Send only the fields you want to change; omitted fields are preserved. `uuid`, `client_id`, and `api_key` cannot be updated. `products` is read-only: a `products` key in the body is ignored. `data_location` can't be changed after the application is created: naming the location it already has is accepted, and any other location answers 400. The one exception is the live application created with your organization: the first update that names a `data_location` chooses it, once, while no API key of the application has been used and it has no verification session.",
        "properties": {
          "name": {
            "type": "string",
            "description": "Application display name.",
            "example": "Acme Production App"
          },
          "website_url": {
            "type": "string",
            "description": "Website or app URL associated with this application.",
            "example": "https://app.acme.example"
          },
          "redirect_uris": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Allowed redirect URIs for OAuth-style and verification redirect flows.",
            "example": [
              "https://acme.example/callback"
            ]
          },
          "terms_url": {
            "type": "string",
            "description": "Terms of service URL shown in the verification flow."
          },
          "privacy_url": {
            "type": "string",
            "description": "Privacy policy URL shown in the verification flow."
          },
          "description": {
            "type": "string",
            "description": "Internal description for the application."
          },
          "data_location": {
            "$ref": "#/components/schemas/ApplicationDataLocation"
          },
          "initiate_login_uri": {
            "$ref": "#/components/schemas/ApplicationInitiateLoginURI"
          }
        }
      },
      "ApplicationDataLocation": {
        "type": "string",
        "enum": [
          "eu",
          "au",
          "mx",
          "ae"
        ],
        "description": "Where the application's verification data is stored and processed, chosen when the application is created. `eu` is the European Union (Ireland), the default. `au` (Australia, Sydney), `mx` (Mexico) and `ae` (United Arab Emirates) are coming soon: a request that names them answers 400 `This data location is not available yet.` An organization's Sandbox application is always in the European Union.",
        "example": "eu"
      },
      "ValidationError": {
        "description": "Validation error body. The intended envelope is a `{field: [\"message\", ...]}` map for field-level errors or a `{detail: \"...\"}` single-key envelope for business-rule errors. A handful of validators (password strength on register, code validity on verify-email) currently respond with a bare array `[\"message\"]` -- known server-side inconsistency. The schema below keeps that bare-array branch so client code generated from this spec deserializes today's responses, but new client code should treat it as the relevant field-keyed form (`{password: [...]}` or `{code: [...]}`) and the server contract will converge on that shape.",
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "example": {
              "email": [
                "Enter a valid email address."
              ]
            }
          },
          {
            "type": "object",
            "properties": {
              "detail": {
                "type": "string"
              }
            },
            "example": {
              "detail": "An account with this email already exists."
            }
          },
          {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "Invalid or expired verification code."
            ]
          }
        ]
      },
      "AuthError": {
        "type": "object",
        "description": "Authentication / authorization / not-found error envelope.",
        "properties": {
          "detail": {
            "type": "string",
            "example": "Invalid access token"
          }
        }
      },
      "RateLimitError": {
        "type": "object",
        "description": "Rate-limit or progressive-lockout response. `wait` is the cooldown in seconds.",
        "properties": {
          "detail": {
            "type": "string",
            "example": "Too many login attempts from this IP address. Please wait before trying again."
          }
        }
      },
      "PaginatedOrganizationList": {
        "type": "object",
        "required": [
          "count",
          "next",
          "previous",
          "results"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "description": "Total number of organizations."
          },
          "next": {
            "type": "string",
            "format": "uri",
            "nullable": true,
            "description": "URL of the next page, or `null` on the last page."
          },
          "previous": {
            "type": "string",
            "format": "uri",
            "nullable": true,
            "description": "URL of the previous page, or `null` on the first page."
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Organization"
            }
          }
        }
      },
      "PaginatedApplicationList": {
        "type": "object",
        "required": [
          "count",
          "next",
          "previous",
          "results"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "description": "Total number of applications."
          },
          "next": {
            "type": "string",
            "format": "uri",
            "nullable": true,
            "description": "URL of the next page, or `null` on the last page."
          },
          "previous": {
            "type": "string",
            "format": "uri",
            "nullable": true,
            "description": "URL of the previous page, or `null` on the first page."
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Application"
            }
          }
        }
      },
      "ApplicationProduct": {
        "type": "object",
        "description": "One product of an application and its state. Read-only: the application endpoints return it and ignore it in a request body.",
        "properties": {
          "product": {
            "type": "string",
            "enum": [
              "identity",
              "transactions",
              "authentication"
            ],
            "description": "`identity` (Identity verification), `transactions` (Transaction monitoring) or `authentication` (Authentication).",
            "example": "identity"
          },
          "status": {
            "type": "string",
            "enum": [
              "enabled",
              "early_access",
              "disabled"
            ],
            "description": "Whether the product is on for this application. `early_access` applies only to `authentication`, which Didit turns on for you.",
            "example": "enabled"
          },
          "modules": {
            "type": "object",
            "additionalProperties": {
              "type": "boolean"
            },
            "description": "Module switches of the product, each `true` or `false`. `identity` has `user_verification`, `business_verification` and `case_management`. `transactions` has `travel_rule` and `case_management`. `authentication` has none (`{}`). `case_management` is one setting shown under both `identity` and `transactions`, so it has the same value on both.",
            "example": {
              "user_verification": true,
              "business_verification": true,
              "case_management": true
            }
          }
        },
        "required": [
          "product",
          "status",
          "modules"
        ]
      },
      "EmailUndeliverableError": {
        "type": "object",
        "description": "Returned by `POST /programmatic/register/` when the address cannot receive the verification code. The check runs before any account is created or changed, so nothing is left behind.",
        "required": [
          "detail",
          "code",
          "reason"
        ],
        "properties": {
          "detail": {
            "type": "string",
            "description": "Human-readable message.",
            "example": "This email can't receive messages. Please use a different email address."
          },
          "code": {
            "type": "string",
            "enum": [
              "email_undeliverable"
            ],
            "description": "Always `email_undeliverable`."
          },
          "reason": {
            "type": "string",
            "enum": [
              "invalid_address",
              "reserved_domain",
              "no_mail_records",
              "disposable_domain",
              "possible_typo",
              "suppressed"
            ],
            "description": "Why the address was refused: `invalid_address` (not a valid address), `reserved_domain` (a reserved or test domain such as `example.com`), `no_mail_records` (the domain has no mail server), `disposable_domain` (a throwaway mailbox provider), `possible_typo` (a likely misspelling of a common provider; see `suggestion`), `suppressed` (the address previously bounced or complained)."
          },
          "suggestion": {
            "type": "string",
            "description": "The likely intended domain, present only when the domain looks like a typo (for example `gmail.com` for `gmial.com`). The API does not accept a confirmation: register again with the corrected address.",
            "example": "gmail.com"
          }
        }
      },
      "RecoveryHoldError": {
        "type": "object",
        "description": "Returned for 72 hours after the account was recovered (lost sign-in methods were reset). Actions that create organizations, applications or secrets are refused until `until`; read operations keep working.",
        "required": [
          "detail",
          "code",
          "until"
        ],
        "properties": {
          "detail": {
            "type": "string",
            "example": "This action is on hold because you recovered your account."
          },
          "code": {
            "type": "string",
            "enum": [
              "recovery_hold"
            ],
            "example": "recovery_hold"
          },
          "until": {
            "type": "string",
            "format": "date-time",
            "description": "When the hold ends (ISO 8601). Retry the request after this time.",
            "example": "2026-11-04T10:15:00+00:00"
          }
        }
      },
      "SsoRequiredError": {
        "type": "object",
        "description": "The account belongs to an organization that requires SSO sign-in. No tokens, API keys or organizations are issued; sign in through the organization's SSO in a browser instead.",
        "required": [
          "error",
          "message",
          "organization_name",
          "organization_slug",
          "sso_url"
        ],
        "properties": {
          "error": {
            "type": "string",
            "enum": [
              "sso_required"
            ],
            "example": "sso_required"
          },
          "message": {
            "type": "string",
            "example": "Your organization 'Acme Corp' requires SSO login."
          },
          "organization_name": {
            "type": "string",
            "example": "Acme Corp"
          },
          "organization_slug": {
            "type": "string",
            "example": "acme-corp"
          },
          "sso_url": {
            "type": "string",
            "description": "Path of the organization's SSO sign-in page, relative to the console.",
            "example": "/sso/acme-corp"
          }
        }
      },
      "RecoverySetupRequiredError": {
        "type": "object",
        "description": "The account was recovered and has no sign-in method set up yet. No tokens are issued; a one-time link to set up a new method was emailed to the account's address. Open it, set up the method, then log in again.",
        "required": [
          "recovery_setup_required",
          "setup_link_sent",
          "message",
          "code"
        ],
        "properties": {
          "recovery_setup_required": {
            "type": "boolean",
            "example": true
          },
          "setup_link_sent": {
            "type": "boolean",
            "example": true
          },
          "message": {
            "type": "string",
            "example": "You recovered your account. Open the link we emailed you to set up a new sign-in method."
          },
          "code": {
            "type": "string",
            "enum": [
              "recovery_setup_required"
            ],
            "example": "recovery_setup_required"
          }
        }
      },
      "ServiceUnavailableError": {
        "type": "object",
        "description": "The request could not be completed right now and nothing was changed. Retry it in a moment.",
        "properties": {
          "detail": {
            "type": "string",
            "example": "We couldn't confirm that this application is unused. Try again in a moment."
          },
          "code": {
            "type": "string",
            "example": "data_location_check_unavailable"
          }
        }
      },
      "ApplicationInitiateLoginURI": {
        "type": "string",
        "maxLength": 2048,
        "default": "",
        "example": "https://acme.example/login",
        "description": "Application sign-in URL for an admin-sent sign-in link. Optional; an empty string disables sending. A nonempty value must use HTTPS and the exact hostname of website_url (subdomains must match), with no userinfo, query, fragment or whitespace and no port other than 443. The server also revalidates the saved URI when website_url changes; update or clear initiate_login_uri in the same PATCH if needed. The hosted handoff adds iss and login_hint, but creates no session or tokens. See /authentication/sign-in-methods#admin-sent-sign-in-link."
      },
      "ConsoleIdentityActionRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "action"
        ],
        "description": "Console-only action. reset_mfa deletes TOTP, passkeys and recovery codes, invalidates pending challenges, revokes sessions and agent grants, and queues a notice and audit when anything changes. It leaves the password unchanged. send_sign_in_link sends only to the identity email and requires initiate_login_uri. send_password_reset uses the existing 30-minute password-reset flow; it is limited to once per minute per identity. Status actions return the identity; reset and send actions return the corresponding result.",
        "properties": {
          "action": {
            "type": "string",
            "enum": [
              "block",
              "unblock",
              "unlock",
              "revoke_sessions",
              "send_password_reset",
              "reset_mfa",
              "send_sign_in_link"
            ],
            "description": "Identity action to perform."
          },
          "notify_users": {
            "type": "boolean",
            "default": false,
            "description": "Only block and unblock accept true. Emails the person when their blocked status changes. Repeating an unchanged status does not send another notice. Requires an email address."
          }
        },
        "example": {
          "action": "reset_mfa"
        }
      },
      "ConsoleBulkIdentityActionRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "action",
          "ids"
        ],
        "description": "Console-only bulk action. Each identity is handled independently. send_password_reset is single-identity only. Duplicate IDs or an invalid request reject the entire request before processing.",
        "properties": {
          "action": {
            "type": "string",
            "enum": [
              "block",
              "unblock",
              "unlock",
              "revoke_sessions",
              "reset_mfa",
              "send_sign_in_link"
            ],
            "description": "Action applied to each identity."
          },
          "ids": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "One to 100 distinct identity IDs in this application."
          },
          "notify_users": {
            "type": "boolean",
            "default": false,
            "description": "Only block and unblock accept true. Emails the person when their blocked status changes. Repeating an unchanged status does not send another notice. Requires an email address."
          }
        },
        "example": {
          "action": "reset_mfa",
          "ids": [
            "00000000-0000-4000-8000-000000000001"
          ]
        }
      },
      "ConsoleMFAResetResult": {
        "type": "object",
        "required": [
          "status",
          "requires_sign_in_link"
        ],
        "description": "Successful console MFA reset. A repeated reset with nothing remaining to reset returns the same result without duplicate notices or audit events. An identity without email cannot be reset.",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "applied"
            ]
          },
          "requires_sign_in_link": {
            "type": "boolean",
            "description": "True when the person has no usable password. Offer a sign-in link after resetting MFA so they can sign in and enroll a new factor."
          }
        },
        "example": {
          "status": "applied",
          "requires_sign_in_link": true
        }
      },
      "ConsoleSignInLinkResult": {
        "type": "object",
        "required": [
          "status",
          "expires_in"
        ],
        "description": "Console sign-in email sent. Never contains the link or token. Missing application URI returns HTTP 400 with error initiate_login_uri_required. An identity without email or a blocked identity is rejected. Rate limits return 429 and delivery failure returns 503.",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "sent"
            ]
          },
          "expires_in": {
            "type": "integer",
            "enum": [
              900
            ],
            "description": "Single-use handoff lifetime in seconds; the handoff does not authenticate the person."
          }
        },
        "example": {
          "status": "sent",
          "expires_in": 900
        }
      },
      "ConsoleBulkIdentityActionResult": {
        "type": "object",
        "required": [
          "id",
          "status"
        ],
        "description": "Per-identity result. Successful sign-in email uses sent, not applied. Missing identities, including identities from another application, return not_found. An action-level error returns invalid_request; error is included for failed sign-in-link actions only.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "enum": [
              "applied",
              "sent",
              "not_found",
              "invalid_request"
            ]
          },
          "requires_sign_in_link": {
            "type": "boolean",
            "description": "Present only for a successful reset_mfa."
          },
          "expires_in": {
            "type": "integer",
            "enum": [
              900
            ],
            "description": "Present only for a successful send_sign_in_link."
          },
          "error": {
            "type": "string",
            "description": "Sign-in-link failure code, such as initiate_login_uri_required, identity_has_no_email, identity_blocked, rate_limited or delivery_unavailable."
          }
        }
      },
      "ConsoleBulkIdentityActionResponse": {
        "type": "object",
        "required": [
          "results"
        ],
        "properties": {
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConsoleBulkIdentityActionResult"
            },
            "description": "One result per requested identity, in request order. Check each status even when the HTTP response is 200."
          }
        },
        "example": {
          "results": [
            {
              "id": "00000000-0000-4000-8000-000000000001",
              "status": "applied",
              "requires_sign_in_link": true
            }
          ]
        }
      }
    }
  },
  "x-console-identity-actions": {
    "description": "Console-only identity recovery and status actions. Requires write:authentication; reset_mfa and send_sign_in_link additionally require write:authentication_mfa, assigned to Owner/Admin. No public SDK method is exposed.",
    "request": {
      "$ref": "#/components/schemas/ConsoleIdentityActionRequest"
    },
    "bulkRequest": {
      "$ref": "#/components/schemas/ConsoleBulkIdentityActionRequest"
    },
    "mfaResetResponse": {
      "$ref": "#/components/schemas/ConsoleMFAResetResult"
    },
    "signInLinkResponse": {
      "$ref": "#/components/schemas/ConsoleSignInLinkResult"
    },
    "bulkResponse": {
      "$ref": "#/components/schemas/ConsoleBulkIdentityActionResponse"
    }
  }
}
