From 87af64dfa361e3122db524c468a9ffd46a161792 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 21 Nov 2026 12:15:10 +0000 Subject: [PATCH] feat(spec): sync API spec 2026-11-21 --- openapi/SOURCE.json | 10 +- openapi/account.json | 6719 +++++++++++++++-- openapi/verification.json | 130 +- src/didit/resources/__init__.py | 13 + src/didit/resources/authentication_setup.py | 2261 ++++++ src/didit/resources/investigator.py | 77 +- src/didit/types/__init__.py | 230 + .../types/authentication_setup/__init__.py | 1 + .../authentication_setup/set_domain_params.py | 11 + .../authentication_setup/set_method_params.py | 25 + .../update_branding_params.py | 20 + .../update_configuration_params.py | 34 + .../update_native_apps_params.py | 18 + .../update_onboarding_params.py | 18 + .../update_protection_params.py | 19 + .../update_settings_params.py | 34 + .../update_verified_params.py | 44 + .../components/investigator_queue_row.py | 8 +- .../types/components/setup_android_app.py | 22 + src/didit/types/components/setup_brand.py | 36 + src/didit/types/components/setup_branding.py | 48 + .../types/components/setup_branding_texts.py | 28 + .../types/components/setup_configuration.py | 53 + .../types/components/setup_custom_domain.py | 42 + .../setup_didit_test_credentials.py | 18 + src/didit/types/components/setup_domain.py | 32 + src/didit/types/components/setup_email.py | 23 + .../types/components/setup_email_summary.py | 22 + src/didit/types/components/setup_emails.py | 39 + .../types/components/setup_method_result.py | 24 + .../types/components/setup_method_summary.py | 49 + .../types/components/setup_native_apps.py | 14 + .../types/components/setup_onboarding.py | 22 + .../types/components/setup_protection.py | 135 + .../components/setup_protection_policy.py | 30 + .../components/setup_provider_credentials.py | 14 + src/didit/types/components/setup_settings.py | 47 + src/didit/types/components/setup_verified.py | 69 + .../types/components/setup_verified_rule.py | 29 + .../investigator/retrieve_offer_response.py | 22 + .../investigator/retrieve_summary_response.py | 16 +- tests/generated/test_authentication_setup.py | 1085 +++ tests/generated/test_investigator.py | 36 +- 43 files changed, 10896 insertions(+), 731 deletions(-) create mode 100644 src/didit/resources/authentication_setup.py create mode 100644 src/didit/types/authentication_setup/__init__.py create mode 100644 src/didit/types/authentication_setup/set_domain_params.py create mode 100644 src/didit/types/authentication_setup/set_method_params.py create mode 100644 src/didit/types/authentication_setup/update_branding_params.py create mode 100644 src/didit/types/authentication_setup/update_configuration_params.py create mode 100644 src/didit/types/authentication_setup/update_native_apps_params.py create mode 100644 src/didit/types/authentication_setup/update_onboarding_params.py create mode 100644 src/didit/types/authentication_setup/update_protection_params.py create mode 100644 src/didit/types/authentication_setup/update_settings_params.py create mode 100644 src/didit/types/authentication_setup/update_verified_params.py create mode 100644 src/didit/types/components/setup_android_app.py create mode 100644 src/didit/types/components/setup_brand.py create mode 100644 src/didit/types/components/setup_branding.py create mode 100644 src/didit/types/components/setup_branding_texts.py create mode 100644 src/didit/types/components/setup_configuration.py create mode 100644 src/didit/types/components/setup_custom_domain.py create mode 100644 src/didit/types/components/setup_didit_test_credentials.py create mode 100644 src/didit/types/components/setup_domain.py create mode 100644 src/didit/types/components/setup_email.py create mode 100644 src/didit/types/components/setup_email_summary.py create mode 100644 src/didit/types/components/setup_emails.py create mode 100644 src/didit/types/components/setup_method_result.py create mode 100644 src/didit/types/components/setup_method_summary.py create mode 100644 src/didit/types/components/setup_native_apps.py create mode 100644 src/didit/types/components/setup_onboarding.py create mode 100644 src/didit/types/components/setup_protection.py create mode 100644 src/didit/types/components/setup_protection_policy.py create mode 100644 src/didit/types/components/setup_provider_credentials.py create mode 100644 src/didit/types/components/setup_settings.py create mode 100644 src/didit/types/components/setup_verified.py create mode 100644 src/didit/types/components/setup_verified_rule.py create mode 100644 src/didit/types/investigator/retrieve_offer_response.py create mode 100644 tests/generated/test_authentication_setup.py diff --git a/openapi/SOURCE.json b/openapi/SOURCE.json index 5c3c570..f68e8fa 100644 --- a/openapi/SOURCE.json +++ b/openapi/SOURCE.json @@ -1,13 +1,13 @@ { "verification.json": { "url": "https://docs.didit.me/openapi-25.json", - "sha256": "2b0b333987cf2026b56d1ac6a2093ddb5888b6c98495d12d49be96e4cb0a37fd", - "fetched_at": "2026-11-20T19:12:24Z" + "sha256": "eb023f313be71c3ad514cc69387cb03a903e094ba1565dc219fa3735c044005e", + "fetched_at": "2026-11-21T12:14:16Z" }, "account.json": { "url": "https://docs.didit.me/openapi-auth.json", - "sha256": "38ce5a0dda5a0843c95c606819eb65e5d4f6ca474f9e453595cdf2e1c0eae572", - "fetched_at": "2026-11-20T19:12:24Z" + "sha256": "ad62ebe753a36a98b8a7516e099efe7f1fae4229491c6702248c02c61afbc220", + "fetched_at": "2026-11-21T12:14:16Z" }, "webhook-vectors.json": { "generator": "product-automations scripts/server-sdks/make_vectors.py (seeded 2026-10-17)", @@ -16,6 +16,6 @@ "authentication.json": { "url": "https://docs.didit.me/openapi-authentication.json", "sha256": "e365ac52a28d8a68d8c1b9497509f882ea075ecdfad491aa5b36dc720c33405b", - "fetched_at": "2026-11-20T19:12:24Z" + "fetched_at": "2026-11-21T12:14:16Z" } } \ No newline at end of file diff --git a/openapi/account.json b/openapi/account.json index ebe5a61..8f77598 100644 --- a/openapi/account.json +++ b/openapi/account.json @@ -19,6 +19,10 @@ { "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." + }, + { + "name": "Setup", + "description": "Set up Didit Authentication by API: the sign-in methods, the application settings, branding, bot protection, verified sign-in, the sign-up emails, the hosted domain and the native apps. These routes live on `https://apx.didit.me/auth/v2/organizations/{organization_id}/applications/{application_id}/authentication/`, not on the application's issuer, and they take a credential an owner approved: a management grant, or a named API key with the `authentication` scope. The console session of an owner or admin with `write:authentication` still works. End-user data, organizations, roles, imports and agent sessions stay console-only." } ], "paths": { @@ -2215,976 +2219,6253 @@ } ] } - } - }, - "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 `. 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" - } + "/organizations/{organization_id}/applications/{application_id}/authentication/": { + "servers": [ + { + "url": "https://apx.didit.me/auth/v2", + "description": "The management API, on the account host. Setup routes are not served on the application's issuer." } - }, - "RegisterResponse": { - "type": "object", - "properties": { - "message": { + ], + "parameters": [ + { + "name": "organization_id", + "in": "path", + "required": true, + "description": "UUID of the organization that owns the application.", + "schema": { "type": "string", - "description": "Human-readable confirmation that the verification code was sent.", - "example": "Registration successful. Check your email for the verification code." - }, - "email": { + "format": "uuid", + "example": "a1b2c3d4-5678-90ab-cdef-111111111111" + } + }, + { + "name": "application_id", + "in": "path", + "required": true, + "description": "UUID of the application: live or sandbox. A named key configures its own application only.", + "schema": { "type": "string", - "format": "email", - "description": "The email the verification code was sent to.", - "example": "you@yourdomain.com" + "format": "uuid", + "example": "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" } } - }, - "VerifyEmailRequest": { - "type": "object", - "required": [ - "email", - "code" + ], + "get": { + "tags": [ + "Setup" ], - "properties": { - "email": { - "type": "string", - "format": "email", - "description": "Email used during `POST /programmatic/register/`.", - "example": "you@yourdomain.com" + "summary": "Get the Authentication setup", + "description": "Returns the application's Authentication configuration and every sign-in method with its `enabled` state and `credential_source`, which is how an agent verifies the setup it made. Disabled methods are listed too, and `credential_source` is `null` for a method that holds no social credentials. The top-level `enabled` is `false` when Authentication is disabled for the application.", + "operationId": "authentication_get_configuration", + "security": [ + { + "ManagementGrant": [] }, - "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" + { + "ManagementApiKey": [] } - } - }, - "VerifyEmailResponse": { - "type": "object", - "properties": { - "access_token": { - "type": "string", - "description": "RS256-signed JWT. Use as `Authorization: Bearer ` for Account Management endpoints on `apx.didit.me/auth/v2`." + ], + "x-didit-sdk": { + "resource": "authentication_setup", + "method": "get_configuration", + "auth": "api_key", + "server": true + }, + "responses": { + "200": { + "description": "The configuration and its methods.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupConfiguration" + }, + "examples": { + "SetupConfiguration": { + "summary": "A sandbox application with email code on and Didit's test Google app", + "value": { + "enabled": true, + "publishable_key": "pk_test_ZG9jcy1kZW1vLnNhbmRib3guYXV0aC5kaWRpdC5tZQ", + "methods": [ + { + "name": "code", + "enabled": true, + "credential_source": null + }, + { + "name": "google", + "enabled": true, + "credential_source": "didit_test", + "configured": true, + "client_id": "didit-test-google", + "callback_uri": "https://auth.didit.test/social/google/callback" + }, + { + "name": "password", + "enabled": false, + "credential_source": null + } + ], + "didit_test_credentials": { + "google": true, + "microsoft": true, + "apple": true, + "github": true + }, + "redirect_uris": [ + "https://app.example.com/auth/callback" + ], + "allowed_origins": [], + "post_logout_redirect_uri": "", + "session_lifetime": 2592000, + "idle_timeout": 86400, + "multiple_sessions": true, + "password_min_length": 10, + "revoke_on_password_change": true, + "allow_subaddresses": false, + "signup_policy": "anyone", + "allowed_email_domains": [] + } + } + } + } + } }, - "refresh_token": { - "type": "string", - "description": "Refresh token paired with the access token." + "401": { + "$ref": "#/components/responses/SetupNotAuthenticated" }, - "expires_in": { - "type": "integer", - "description": "Lifetime of the access token in seconds (default 86400).", - "example": 86400 + "403": { + "$ref": "#/components/responses/SetupPermissionDenied" }, - "organization": { - "$ref": "#/components/schemas/OrganizationSummary" + "404": { + "$ref": "#/components/responses/SetupNotFound" }, - "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." + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.authentication_setup.get_configuration(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n)\nprint(result)" }, - "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." + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.authenticationSetup.getConfiguration(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n);\nconsole.log(result);" }, - "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 + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.AuthenticationSetup.GetConfiguration(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\")\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)" }, - "temp_token": { - "type": "string", - "description": "Short-lived token for the second-factor step, sent only with `2fa_required`. It is not an access token." + { + "lang": "java", + "label": "Java", + "source": "import me.didit.Didit;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.authenticationSetup().getConfiguration(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nSystem.out.println(result);" }, - "has_authenticator": { - "type": "boolean", - "description": "With `2fa_required`: whether the account has an authenticator app." + { + "lang": "php", + "label": "PHP", + "source": "authenticationSetup->getConfiguration('a1b2c3d4-5678-90ab-cdef-111111111111', '7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d');\nprint_r($result->toArray());" }, - "has_passkeys": { - "type": "boolean", - "description": "With `2fa_required`: whether the account has a passkey." + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.authentication_setup.get_configuration(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\"\n)\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.AuthenticationSetup.GetConfigurationAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nConsole.WriteLine(JsonSerializer.Serialize(result));" } - } + ] }, - "LoginRequest": { - "type": "object", - "required": [ - "email", - "password" + "patch": { + "tags": [ + "Setup" ], - "properties": { - "email": { - "type": "string", - "format": "email", - "example": "you@yourdomain.com" + "summary": "Update the Authentication setup", + "description": "Changes the settings in the body: callback URLs, allowed origins, session lifetime, idle timeout, password rules and the sign-up policy. Send only the fields you change. `enabled` is refused with `{\"enabled\": \"follows_product\"}` because the product's state decides it, and an unknown field with `{\"\": \"unknown_field\"}`.", + "operationId": "authentication_update_configuration", + "security": [ + { + "ManagementGrant": [] }, - "password": { - "type": "string", - "example": "MyStr0ng!Pass" + { + "ManagementApiKey": [] } - } - }, - "LoginResponse": { - "type": "object", - "properties": { - "access_token": { - "type": "string", - "description": "RS256-signed JWT. Use as `Authorization: Bearer ` for Account Management endpoints." + ], + "x-didit-sdk": { + "resource": "authentication_setup", + "method": "update_configuration", + "auth": "api_key", + "server": true + }, + "requestBody": { + "required": false, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupConfigurationUpdate" + }, + "examples": { + "InvitedSignUp": { + "summary": "One-week sessions, sign-up by invitation only", + "value": { + "session_lifetime": 604800, + "signup_policy": "invited" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "The configuration as it now stands.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupConfiguration" + }, + "examples": { + "InvitedSignUp": { + "summary": "Configuration after setting a 7-day session and invited sign-up", + "value": { + "enabled": true, + "publishable_key": "pk_test_ZG9jcy1kZW1vLnNhbmRib3guYXV0aC5kaWRpdC5tZQ", + "methods": [ + { + "name": "code", + "enabled": true, + "credential_source": null + }, + { + "name": "google", + "enabled": true, + "credential_source": "didit_test", + "configured": true, + "client_id": "didit-test-google", + "callback_uri": "https://auth.didit.test/social/google/callback" + }, + { + "name": "password", + "enabled": false, + "credential_source": null + } + ], + "didit_test_credentials": { + "google": true, + "microsoft": true, + "apple": true, + "github": true + }, + "redirect_uris": [ + "https://app.example.com/auth/callback" + ], + "allowed_origins": [], + "post_logout_redirect_uri": "", + "session_lifetime": 604800, + "idle_timeout": 86400, + "multiple_sessions": true, + "password_min_length": 10, + "revoke_on_password_change": true, + "allow_subaddresses": false, + "signup_policy": "invited", + "allowed_email_domains": [] + } + } + } + } + } }, - "refresh_token": { - "type": "string" + "400": { + "$ref": "#/components/responses/SetupValidation" }, - "expires_in": { - "type": "integer", - "description": "Lifetime of the access token in seconds (default 86400).", - "example": 86400 + "401": { + "$ref": "#/components/responses/SetupNotAuthenticated" }, - "message": { - "type": "string", - "example": "Login successful" - } + "403": { + "$ref": "#/components/responses/SetupPermissionDenied" + }, + "404": { + "$ref": "#/components/responses/SetupNotFound" + }, + "409": { + "$ref": "#/components/responses/SetupProductDisabled" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.authentication_setup.update_configuration(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n session_lifetime=604800,\n signup_policy=\"invited\",\n)\nprint(result)" + }, + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.authenticationSetup.updateConfiguration(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n {\n session_lifetime: 604800,\n signup_policy: \"invited\",\n },\n);\nconsole.log(result);" + }, + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.AuthenticationSetup.UpdateConfiguration(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", didit.SetupConfigurationUpdate{\n\tSessionLifetime: didit.Int(604800),\n\tSignupPolicy: didit.Some(didit.SetupConfigurationUpdateSignupPolicy(\"invited\")),\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.SetupConfigurationUpdate;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.authenticationSetup().updateConfiguration(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", SetupConfigurationUpdate.builder()\n .sessionLifetime(604800L)\n .signupPolicy(SetupConfigurationUpdate.SignupPolicy.of(\"invited\"))\n .build());\nSystem.out.println(result);" + }, + { + "lang": "php", + "label": "PHP", + "source": "authenticationSetup->updateConfiguration('a1b2c3d4-5678-90ab-cdef-111111111111', '7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d', [\n 'session_lifetime' => 604800,\n 'signup_policy' => 'invited',\n]);\nprint_r($result->toArray());" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.authentication_setup.update_configuration(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n session_lifetime: 604800,\n signup_policy: \"invited\"\n)\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.AuthenticationSetup.UpdateConfigurationAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", new SetupConfigurationUpdate\n{\n SessionLifetime = 604800,\n SignupPolicy = new SetupConfigurationUpdateSignupPolicy(\"invited\"),\n});\nConsole.WriteLine(JsonSerializer.Serialize(result));" + } + ] + } + }, + "/organizations/{organization_id}/applications/{application_id}/authentication/methods/{name}/": { + "servers": [ + { + "url": "https://apx.didit.me/auth/v2", + "description": "The management API, on the account host. Setup routes are not served on the application's issuer." + } + ], + "parameters": [ + { + "name": "organization_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": "application_id", + "in": "path", + "required": true, + "description": "UUID of the application: live or sandbox. A named key configures its own application only.", + "schema": { + "type": "string", + "format": "uuid", + "example": "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" + } + } + ], + "put": { + "tags": [ + "Setup" + ], + "summary": "Enable or disable a sign-in method", + "description": "Enables or disables one method; `enabled` is required. A social method (`google`, `microsoft`, `apple`, `github`) takes either your own `credentials` or `credential_source: \"didit_test\"`, which uses Didit's own sandbox app and is refused on a live application with `{\"credential_source\": \"sandbox_only\"}`; a test app the application cannot use answers `{\"credential_source\": \"unavailable\"}`. `phone` takes the `workflow_id` of a phone verification workflow. `credentials`, `workflow_id` or `credential_source` on a method that does not use them answer `not_supported`, turning off a method that is always on answers `{\"enabled\": \"always_on\"}`, and an unknown method answers `{\"name\": \"method_unavailable\"}`.", + "operationId": "authentication_set_method", + "security": [ + { + "ManagementGrant": [] + }, + { + "ManagementApiKey": [] + } + ], + "x-didit-sdk": { + "resource": "authentication_setup", + "method": "set_method", + "auth": "api_key", + "server": true + }, + "parameters": [ + { + "name": "name", + "in": "path", + "required": true, + "description": "The method: `password`, `code`, `magic`, `phone`, `passkey`, `google`, `microsoft`, `apple`, `github`, `sso` or `wallet`.", + "schema": { + "type": "string", + "enum": [ + "password", + "code", + "magic", + "phone", + "passkey", + "google", + "microsoft", + "apple", + "github", + "sso", + "wallet" + ], + "example": "code" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupMethodUpdate" + }, + "examples": { + "EmailCode": { + "summary": "Email code", + "value": { + "enabled": true + } + }, + "OwnGoogleApp": { + "summary": "Your own Google app", + "value": { + "enabled": true, + "credentials": { + "client_id": "1234.apps.googleusercontent.com", + "client_secret": "GOCSPX-..." + } + } + }, + "DiditTestGoogle": { + "summary": "Didit's test app, on a sandbox application only", + "value": { + "enabled": true, + "credential_source": "didit_test" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "The method as it now stands. The secret is never returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupMethodResult" + }, + "examples": { + "SetupMethodResult": { + "summary": "Didit's test Google app on a sandbox application", + "value": { + "name": "google", + "enabled": true, + "credential_source": "didit_test", + "configured": true, + "client_id": "didit-test-google", + "callback_uri": "https://auth.didit.test/social/google/callback" + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/SetupValidation" + }, + "401": { + "$ref": "#/components/responses/SetupNotAuthenticated" + }, + "403": { + "$ref": "#/components/responses/SetupPermissionDenied" + }, + "404": { + "$ref": "#/components/responses/SetupNotFound" + }, + "409": { + "$ref": "#/components/responses/SetupProductDisabled" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.authentication_setup.set_method(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n \"code\",\n enabled=True,\n)\nprint(result)" + }, + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.authenticationSetup.setMethod(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n \"code\",\n {\n enabled: true,\n },\n);\nconsole.log(result);" + }, + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.AuthenticationSetup.SetMethod(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", \"code\", didit.SetupMethodUpdate{\n\tEnabled: true,\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.SetupMethodUpdate;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.authenticationSetup().setMethod(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", \"code\", SetupMethodUpdate.builder()\n .enabled(true)\n .build());\nSystem.out.println(result);" + }, + { + "lang": "php", + "label": "PHP", + "source": "authenticationSetup->setMethod('a1b2c3d4-5678-90ab-cdef-111111111111', '7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d', 'code', [\n 'enabled' => true,\n]);\nprint_r($result->toArray());" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.authentication_setup.set_method(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n \"code\",\n enabled: true\n)\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.AuthenticationSetup.SetMethodAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", \"code\", new SetupMethodUpdate\n{\n Enabled = true,\n});\nConsole.WriteLine(JsonSerializer.Serialize(result));" + } + ] + } + }, + "/organizations/{organization_id}/applications/{application_id}/authentication/onboarding/": { + "servers": [ + { + "url": "https://apx.didit.me/auth/v2", + "description": "The management API, on the account host. Setup routes are not served on the application's issuer." + } + ], + "parameters": [ + { + "name": "organization_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": "application_id", + "in": "path", + "required": true, + "description": "UUID of the application: live or sandbox. A named key configures its own application only.", + "schema": { + "type": "string", + "format": "uuid", + "example": "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" + } + } + ], + "get": { + "tags": [ + "Setup" + ], + "summary": "Get the onboarding progress", + "description": "Returns which setup steps are done, whether the application is ready and how people sign in. A grant or a key gets progress only: the console session's sample sign-in details, which name an end user, are left out.", + "operationId": "authentication_get_onboarding", + "security": [ + { + "ManagementGrant": [] + }, + { + "ManagementApiKey": [] + } + ], + "x-didit-sdk": { + "resource": "authentication_setup", + "method": "get_onboarding", + "auth": "api_key", + "server": true + }, + "responses": { + "200": { + "description": "The onboarding progress.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupOnboarding" + }, + "examples": { + "SetupOnboarding": { + "summary": "Response", + "value": { + "completed": [ + "methods", + "redirects" + ], + "ready": false, + "sign_in_ui": "hosted", + "test_status": "not_started" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/SetupNotAuthenticated" + }, + "403": { + "$ref": "#/components/responses/SetupPermissionDenied" + }, + "404": { + "$ref": "#/components/responses/SetupNotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.authentication_setup.get_onboarding(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n)\nprint(result)" + }, + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.authenticationSetup.getOnboarding(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n);\nconsole.log(result);" + }, + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.AuthenticationSetup.GetOnboarding(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\")\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)" + }, + { + "lang": "java", + "label": "Java", + "source": "import me.didit.Didit;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.authenticationSetup().getOnboarding(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nSystem.out.println(result);" + }, + { + "lang": "php", + "label": "PHP", + "source": "authenticationSetup->getOnboarding('a1b2c3d4-5678-90ab-cdef-111111111111', '7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d');\nprint_r($result->toArray());" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.authentication_setup.get_onboarding(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\"\n)\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.AuthenticationSetup.GetOnboardingAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nConsole.WriteLine(JsonSerializer.Serialize(result));" + } + ] + }, + "patch": { + "tags": [ + "Setup" + ], + "summary": "Update the onboarding progress", + "description": "Records a setup step: skip the test sign-in, skip the user import, or choose the hosted sign-in page or your own screens. An empty body answers `{\"non_field_errors\": [\"empty_update\"]}`.", + "operationId": "authentication_update_onboarding", + "security": [ + { + "ManagementGrant": [] + }, + { + "ManagementApiKey": [] + } + ], + "x-didit-sdk": { + "resource": "authentication_setup", + "method": "update_onboarding", + "auth": "api_key", + "server": true + }, + "requestBody": { + "required": false, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupOnboardingUpdate" + }, + "examples": { + "OwnScreens": { + "summary": "Build your own sign-in screens", + "value": { + "sign_in_ui": "own" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "The onboarding progress after the change.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupOnboarding" + }, + "examples": { + "OwnScreens": { + "summary": "Onboarding after choosing your own sign-in screens", + "value": { + "completed": [ + "methods", + "redirects" + ], + "ready": false, + "sign_in_ui": "own", + "test_status": "not_started" + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/SetupValidation" + }, + "401": { + "$ref": "#/components/responses/SetupNotAuthenticated" + }, + "403": { + "$ref": "#/components/responses/SetupPermissionDenied" + }, + "404": { + "$ref": "#/components/responses/SetupNotFound" + }, + "409": { + "$ref": "#/components/responses/SetupProductDisabled" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.authentication_setup.update_onboarding(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n sign_in_ui=\"own\",\n)\nprint(result)" + }, + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.authenticationSetup.updateOnboarding(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n {\n sign_in_ui: \"own\",\n },\n);\nconsole.log(result);" + }, + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.AuthenticationSetup.UpdateOnboarding(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", didit.SetupOnboardingUpdate{\n\tSignInUI: didit.Some(didit.SetupOnboardingUpdateSignInUI(\"own\")),\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.SetupOnboardingUpdate;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.authenticationSetup().updateOnboarding(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", SetupOnboardingUpdate.builder()\n .signInUi(SetupOnboardingUpdate.SignInUi.of(\"own\"))\n .build());\nSystem.out.println(result);" + }, + { + "lang": "php", + "label": "PHP", + "source": "authenticationSetup->updateOnboarding('a1b2c3d4-5678-90ab-cdef-111111111111', '7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d', [\n 'sign_in_ui' => 'own',\n]);\nprint_r($result->toArray());" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.authentication_setup.update_onboarding(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n sign_in_ui: \"own\"\n)\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.AuthenticationSetup.UpdateOnboardingAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", new SetupOnboardingUpdate\n{\n SignInUi = new SetupOnboardingUpdateSignInUi(\"own\"),\n});\nConsole.WriteLine(JsonSerializer.Serialize(result));" + } + ] + } + }, + "/organizations/{organization_id}/applications/{application_id}/authentication/settings/": { + "servers": [ + { + "url": "https://apx.didit.me/auth/v2", + "description": "The management API, on the account host. Setup routes are not served on the application's issuer." + } + ], + "parameters": [ + { + "name": "organization_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": "application_id", + "in": "path", + "required": true, + "description": "UUID of the application: live or sandbox. A named key configures its own application only.", + "schema": { + "type": "string", + "format": "uuid", + "example": "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" + } + } + ], + "get": { + "tags": [ + "Setup" + ], + "summary": "Get the application settings", + "description": "Returns agent access, organizations, the MFA policy, the default member role and the webhook events switched off.", + "operationId": "authentication_get_settings", + "security": [ + { + "ManagementGrant": [] + }, + { + "ManagementApiKey": [] + } + ], + "x-didit-sdk": { + "resource": "authentication_setup", + "method": "get_settings", + "auth": "api_key", + "server": true + }, + "responses": { + "200": { + "description": "The application settings.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupSettings" + }, + "examples": { + "SetupSettings": { + "summary": "Default settings of a new application", + "value": { + "sign_in_ui": "hosted", + "agent_humans_only": false, + "agents_enabled": false, + "agent_scopes": [], + "agent_lifetime": 604800, + "agent_idle_timeout": 7200, + "agent_approval": "passkey", + "organizations_enabled": false, + "mfa_policy": "organization_admins", + "default_member_role": "member", + "webhook_events_disabled": [] + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/SetupNotAuthenticated" + }, + "403": { + "$ref": "#/components/responses/SetupPermissionDenied" + }, + "404": { + "$ref": "#/components/responses/SetupNotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.authentication_setup.get_settings(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n)\nprint(result)" + }, + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.authenticationSetup.getSettings(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n);\nconsole.log(result);" + }, + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.AuthenticationSetup.GetSettings(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\")\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)" + }, + { + "lang": "java", + "label": "Java", + "source": "import me.didit.Didit;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.authenticationSetup().getSettings(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nSystem.out.println(result);" + }, + { + "lang": "php", + "label": "PHP", + "source": "authenticationSetup->getSettings('a1b2c3d4-5678-90ab-cdef-111111111111', '7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d');\nprint_r($result->toArray());" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.authentication_setup.get_settings(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\"\n)\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.AuthenticationSetup.GetSettingsAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nConsole.WriteLine(JsonSerializer.Serialize(result));" + } + ] + }, + "patch": { + "tags": [ + "Setup" + ], + "summary": "Update the application settings", + "description": "Changes the settings in the body. `agent_humans_only` needs a person: a named API key answers 403 `owner_or_admin_required`, and turning it on needs an owner or admin with an enrolled passkey.", + "operationId": "authentication_update_settings", + "security": [ + { + "ManagementGrant": [] + }, + { + "ManagementApiKey": [] + } + ], + "x-didit-sdk": { + "resource": "authentication_setup", + "method": "update_settings", + "auth": "api_key", + "server": true + }, + "requestBody": { + "required": false, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupSettingsUpdate" + }, + "examples": { + "EveryoneMfa": { + "summary": "Require MFA for everyone", + "value": { + "mfa_policy": "everyone", + "default_member_role": "member" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "The settings as they now stand.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupSettings" + }, + "examples": { + "EveryoneMfa": { + "summary": "Settings after requiring two factors for everyone", + "value": { + "sign_in_ui": "hosted", + "agent_humans_only": false, + "agents_enabled": false, + "agent_scopes": [], + "agent_lifetime": 604800, + "agent_idle_timeout": 7200, + "agent_approval": "passkey", + "organizations_enabled": false, + "mfa_policy": "everyone", + "default_member_role": "member", + "webhook_events_disabled": [] + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/SetupValidation" + }, + "401": { + "$ref": "#/components/responses/SetupNotAuthenticated" + }, + "403": { + "$ref": "#/components/responses/SetupPermissionDenied" + }, + "404": { + "$ref": "#/components/responses/SetupNotFound" + }, + "409": { + "$ref": "#/components/responses/SetupProductDisabled" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.authentication_setup.update_settings(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n mfa_policy=\"everyone\",\n default_member_role=\"member\",\n)\nprint(result)" + }, + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.authenticationSetup.updateSettings(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n {\n mfa_policy: \"everyone\",\n default_member_role: \"member\",\n },\n);\nconsole.log(result);" + }, + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.AuthenticationSetup.UpdateSettings(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", didit.SetupSettingsUpdate{\n\tMFAPolicy: didit.Some(didit.SetupSettingsUpdateMFAPolicy(\"everyone\")),\n\tDefaultMemberRole: didit.Some(didit.SetupSettingsUpdateDefaultMemberRole(\"member\")),\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.SetupSettingsUpdate;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.authenticationSetup().updateSettings(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", SetupSettingsUpdate.builder()\n .mfaPolicy(SetupSettingsUpdate.MfaPolicy.of(\"everyone\"))\n .defaultMemberRole(SetupSettingsUpdate.DefaultMemberRole.of(\"member\"))\n .build());\nSystem.out.println(result);" + }, + { + "lang": "php", + "label": "PHP", + "source": "authenticationSetup->updateSettings('a1b2c3d4-5678-90ab-cdef-111111111111', '7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d', [\n 'mfa_policy' => 'everyone',\n 'default_member_role' => 'member',\n]);\nprint_r($result->toArray());" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.authentication_setup.update_settings(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n mfa_policy: \"everyone\",\n default_member_role: \"member\"\n)\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.AuthenticationSetup.UpdateSettingsAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", new SetupSettingsUpdate\n{\n MfaPolicy = new SetupSettingsUpdateMfaPolicy(\"everyone\"),\n DefaultMemberRole = new SetupSettingsUpdateDefaultMemberRole(\"member\"),\n});\nConsole.WriteLine(JsonSerializer.Serialize(result));" + } + ] + } + }, + "/organizations/{organization_id}/applications/{application_id}/authentication/branding/": { + "servers": [ + { + "url": "https://apx.didit.me/auth/v2", + "description": "The management API, on the account host. Setup routes are not served on the application's issuer." + } + ], + "parameters": [ + { + "name": "organization_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": "application_id", + "in": "path", + "required": true, + "description": "UUID of the application: live or sandbox. A named key configures its own application only.", + "schema": { + "type": "string", + "format": "uuid", + "example": "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" + } + } + ], + "get": { + "tags": [ + "Setup" + ], + "summary": "Get the hosted pages' branding", + "description": "Returns the application's brand as the hosted pages show it, the texts set per language, the legal links and the hosted URL.", + "operationId": "authentication_get_branding", + "security": [ + { + "ManagementGrant": [] + }, + { + "ManagementApiKey": [] + } + ], + "x-didit-sdk": { + "resource": "authentication_setup", + "method": "get_branding", + "auth": "api_key", + "server": true + }, + "parameters": [ + { + "name": "language", + "in": "query", + "required": false, + "description": "Language of the default texts and the previews: an unsupported code falls back to `en`.", + "schema": { + "type": "string", + "example": "es" + } + } + ], + "responses": { + "200": { + "description": "The branding.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupBranding" + }, + "examples": { + "SetupBranding": { + "summary": "Branding of a sandbox application with the organization's own look", + "value": { + "brand": { + "source": "customization", + "name": "Docs Demo", + "logo": null, + "logo_dark": null, + "brand_colour": "#2567FF", + "brand_colour_dark": "#6191FF", + "button_text_colour": "#FFFFFF", + "background": "#FFFFFF", + "background_dark": "#0E0F12", + "corner_radius": 12, + "font": "Inter", + "theme": "device" + }, + "texts": {}, + "defaults": { + "sign_in_title": "Sign in to Docs Demo (Sandbox)", + "subtitle": "Welcome back! Sign in to continue.", + "sign_up_title": "Create your Docs Demo (Sandbox) account" + }, + "terms_url": null, + "privacy_url": null, + "languages": [ + "en", + "es", + "fr", + "de", + "ja" + ], + "badge": { + "visible": true, + "plan": "free", + "early_access": false + }, + "hosted_url": "https://docs-demo.sandbox.auth.didit.me/sign-in" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/SetupNotAuthenticated" + }, + "403": { + "$ref": "#/components/responses/SetupPermissionDenied" + }, + "404": { + "$ref": "#/components/responses/SetupNotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.authentication_setup.get_branding(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n)\nprint(result)" + }, + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.authenticationSetup.getBranding(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n);\nconsole.log(result);" + }, + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.AuthenticationSetup.GetBranding(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", didit.AuthenticationSetupGetBrandingParams{})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)" + }, + { + "lang": "java", + "label": "Java", + "source": "import me.didit.Didit;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.authenticationSetup().getBranding(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nSystem.out.println(result);" + }, + { + "lang": "php", + "label": "PHP", + "source": "authenticationSetup->getBranding('a1b2c3d4-5678-90ab-cdef-111111111111', '7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d');\nprint_r($result->toArray());" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.authentication_setup.get_branding(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\"\n)\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.AuthenticationSetup.GetBrandingAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nConsole.WriteLine(JsonSerializer.Serialize(result));" + } + ] + }, + "patch": { + "tags": [ + "Setup" + ], + "summary": "Update the hosted pages' branding", + "description": "Changes the hosted pages' own texts and legal links. The logo, colours and fonts are read-only here: they come from Customization. A language Didit does not publish answers `{\"\": \"unsupported_language\"}`, and a legal link that is not `https://` answers `https_required`.", + "operationId": "authentication_update_branding", + "security": [ + { + "ManagementGrant": [] + }, + { + "ManagementApiKey": [] + } + ], + "x-didit-sdk": { + "resource": "authentication_setup", + "method": "update_branding", + "auth": "api_key", + "server": true + }, + "requestBody": { + "required": false, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupBrandingUpdate" + }, + "examples": { + "LegalLinks": { + "summary": "Terms and privacy links", + "value": { + "terms_url": "https://example.com/terms", + "privacy_url": "https://example.com/privacy" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "The branding as it now stands.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupBranding" + }, + "examples": { + "LegalLinks": { + "summary": "Branding after adding the legal links", + "value": { + "brand": { + "source": "customization", + "name": "Docs Demo", + "logo": null, + "logo_dark": null, + "brand_colour": "#2567FF", + "brand_colour_dark": "#6191FF", + "button_text_colour": "#FFFFFF", + "background": "#FFFFFF", + "background_dark": "#0E0F12", + "corner_radius": 12, + "font": "Inter", + "theme": "device" + }, + "texts": {}, + "defaults": { + "sign_in_title": "Sign in to Docs Demo (Sandbox)", + "subtitle": "Welcome back! Sign in to continue.", + "sign_up_title": "Create your Docs Demo (Sandbox) account" + }, + "terms_url": "https://example.com/terms", + "privacy_url": "https://example.com/privacy", + "languages": [ + "en", + "es", + "fr", + "de", + "ja" + ], + "badge": { + "visible": true, + "plan": "free", + "early_access": false + }, + "hosted_url": "https://docs-demo.sandbox.auth.didit.me/sign-in" + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/SetupValidation" + }, + "401": { + "$ref": "#/components/responses/SetupNotAuthenticated" + }, + "403": { + "$ref": "#/components/responses/SetupPermissionDenied" + }, + "404": { + "$ref": "#/components/responses/SetupNotFound" + }, + "409": { + "$ref": "#/components/responses/SetupProductDisabled" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.authentication_setup.update_branding(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n terms_url=\"https://example.com/terms\",\n privacy_url=\"https://example.com/privacy\",\n)\nprint(result)" + }, + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.authenticationSetup.updateBranding(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n {\n terms_url: \"https://example.com/terms\",\n privacy_url: \"https://example.com/privacy\",\n },\n);\nconsole.log(result);" + }, + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.AuthenticationSetup.UpdateBranding(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", didit.SetupBrandingUpdate{\n\tTermsURL: didit.String(\"https://example.com/terms\"),\n\tPrivacyURL: didit.String(\"https://example.com/privacy\"),\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.SetupBrandingUpdate;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.authenticationSetup().updateBranding(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", SetupBrandingUpdate.builder()\n .termsUrl(\"https://example.com/terms\")\n .privacyUrl(\"https://example.com/privacy\")\n .build());\nSystem.out.println(result);" + }, + { + "lang": "php", + "label": "PHP", + "source": "authenticationSetup->updateBranding('a1b2c3d4-5678-90ab-cdef-111111111111', '7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d', [\n 'terms_url' => 'https://example.com/terms',\n 'privacy_url' => 'https://example.com/privacy',\n]);\nprint_r($result->toArray());" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.authentication_setup.update_branding(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n terms_url: \"https://example.com/terms\",\n privacy_url: \"https://example.com/privacy\"\n)\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.AuthenticationSetup.UpdateBrandingAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", new SetupBrandingUpdate\n{\n TermsUrl = \"https://example.com/terms\",\n PrivacyUrl = \"https://example.com/privacy\",\n});\nConsole.WriteLine(JsonSerializer.Serialize(result));" + } + ] + } + }, + "/organizations/{organization_id}/applications/{application_id}/authentication/emails/": { + "servers": [ + { + "url": "https://apx.didit.me/auth/v2", + "description": "The management API, on the account host. Setup routes are not served on the application's issuer." + } + ], + "parameters": [ + { + "name": "organization_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": "application_id", + "in": "path", + "required": true, + "description": "UUID of the application: live or sandbox. A named key configures its own application only.", + "schema": { + "type": "string", + "format": "uuid", + "example": "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" + } + } + ], + "get": { + "tags": [ + "Setup" + ], + "summary": "List the sign-in emails", + "description": "Lists the emails Didit Authentication sends, with the ones this application sends switched on and their subject in the language you ask for. The senders in the response are read-only here: they come from Customization.", + "operationId": "authentication_get_emails", + "security": [ + { + "ManagementGrant": [] + }, + { + "ManagementApiKey": [] + } + ], + "x-didit-sdk": { + "resource": "authentication_setup", + "method": "get_emails", + "auth": "api_key", + "server": true + }, + "parameters": [ + { + "name": "language", + "in": "query", + "required": false, + "description": "Language of the subjects and previews: an unsupported code falls back to `en`.", + "schema": { + "type": "string", + "example": "en" + } + } + ], + "responses": { + "200": { + "description": "The emails and senders.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupEmails" + }, + "examples": { + "SetupEmails": { + "summary": "Response", + "value": { + "senders": { + "email": { + "name": "Example", + "email": "no-reply@example.com", + "header": "Example ", + "own": false + }, + "sms": { + "name": null + } + }, + "emails": [ + { + "key": "code", + "icon": "mail", + "sent": true, + "enabled": true, + "subject": "Your Example code: 123456" + } + ], + "language": "en" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/SetupNotAuthenticated" + }, + "403": { + "$ref": "#/components/responses/SetupPermissionDenied" + }, + "404": { + "$ref": "#/components/responses/SetupNotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.authentication_setup.get_emails(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n)\nprint(result)" + }, + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.authenticationSetup.getEmails(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n);\nconsole.log(result);" + }, + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.AuthenticationSetup.GetEmails(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", didit.AuthenticationSetupGetEmailsParams{})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)" + }, + { + "lang": "java", + "label": "Java", + "source": "import me.didit.Didit;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.authenticationSetup().getEmails(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nSystem.out.println(result);" + }, + { + "lang": "php", + "label": "PHP", + "source": "authenticationSetup->getEmails('a1b2c3d4-5678-90ab-cdef-111111111111', '7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d');\nprint_r($result->toArray());" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.authentication_setup.get_emails(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\"\n)\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.AuthenticationSetup.GetEmailsAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nConsole.WriteLine(JsonSerializer.Serialize(result));" + } + ] + } + }, + "/organizations/{organization_id}/applications/{application_id}/authentication/emails/{key}/": { + "servers": [ + { + "url": "https://apx.didit.me/auth/v2", + "description": "The management API, on the account host. Setup routes are not served on the application's issuer." + } + ], + "parameters": [ + { + "name": "organization_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": "application_id", + "in": "path", + "required": true, + "description": "UUID of the application: live or sandbox. A named key configures its own application only.", + "schema": { + "type": "string", + "format": "uuid", + "example": "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" + } + } + ], + "get": { + "tags": [ + "Setup" + ], + "summary": "Preview a sign-in email", + "description": "Returns one email as it renders, with sample codes and links. An invitation preview uses a sample organization for a grant or named key. A console session can see a customer organization's name. The address of a console member is left out for a grant or a key, which have no mailbox. An email Authentication does not send answers `{\"error\": \"email_not_sent_by_authentication\"}`.", + "operationId": "authentication_get_email", + "security": [ + { + "ManagementGrant": [] + }, + { + "ManagementApiKey": [] + } + ], + "x-didit-sdk": { + "resource": "authentication_setup", + "method": "get_email", + "auth": "api_key", + "server": true + }, + "parameters": [ + { + "name": "key", + "in": "path", + "required": true, + "description": "The email: `code`, `magic`, `reset`, `device`, `invite`, `org`, `agent` or `agentoff`.", + "schema": { + "type": "string", + "enum": [ + "code", + "magic", + "reset", + "device", + "invite", + "org", + "agent", + "agentoff" + ], + "example": "code" + } + } + ], + "responses": { + "200": { + "description": "The rendered email.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupEmail" + }, + "examples": { + "SetupEmail": { + "summary": "Response", + "value": { + "key": "code", + "from": "Example ", + "to": "", + "subject": "Your Example code: 123456", + "html": "...", + "enabled": true + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/SetupValidation" + }, + "401": { + "$ref": "#/components/responses/SetupNotAuthenticated" + }, + "403": { + "$ref": "#/components/responses/SetupPermissionDenied" + }, + "404": { + "$ref": "#/components/responses/SetupNotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.authentication_setup.get_email(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n \"code\",\n)\nprint(result)" + }, + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.authenticationSetup.getEmail(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n \"code\",\n);\nconsole.log(result);" + }, + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.AuthenticationSetup.GetEmail(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", \"code\")\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)" + }, + { + "lang": "java", + "label": "Java", + "source": "import me.didit.Didit;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.authenticationSetup().getEmail(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", \"code\");\nSystem.out.println(result);" + }, + { + "lang": "php", + "label": "PHP", + "source": "authenticationSetup->getEmail('a1b2c3d4-5678-90ab-cdef-111111111111', '7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d', 'code');\nprint_r($result->toArray());" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.authentication_setup.get_email(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n \"code\"\n)\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.AuthenticationSetup.GetEmailAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", \"code\");\nConsole.WriteLine(JsonSerializer.Serialize(result));" + } + ] + } + }, + "/organizations/{organization_id}/applications/{application_id}/authentication/protection/": { + "servers": [ + { + "url": "https://apx.didit.me/auth/v2", + "description": "The management API, on the account host. Setup routes are not served on the application's issuer." + } + ], + "parameters": [ + { + "name": "organization_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": "application_id", + "in": "path", + "required": true, + "description": "UUID of the application: live or sandbox. A named key configures its own application only.", + "schema": { + "type": "string", + "format": "uuid", + "example": "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" + } + } + ], + "get": { + "tags": [ + "Setup" + ], + "summary": "Get bot protection", + "description": "Returns whether protection is on, each policy's mode and the last 14 days of detections. Console sessions, grants and named keys receive the same aggregate counters.", + "operationId": "authentication_get_protection", + "security": [ + { + "ManagementGrant": [] + }, + { + "ManagementApiKey": [] + } + ], + "x-didit-sdk": { + "resource": "authentication_setup", + "method": "get_protection", + "auth": "api_key", + "server": true + }, + "responses": { + "200": { + "description": "Protection settings and their counters.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupProtection" + }, + "examples": { + "SetupProtection": { + "summary": "Response", + "value": { + "enabled": true, + "breached_password_check": true, + "protections": [ + { + "key": "bots", + "mode": "block", + "available": true, + "counts": { + "log": 0, + "challenge": 12, + "block": 3 + }, + "accounts": 9 + } + ], + "daily": [ + { + "date": "2026-11-19", + "protection": "bots", + "action": "block", + "count": 3 + } + ], + "challenges_daily": [ + { + "date": "2026-11-19", + "passed": 10, + "failed": 2 + } + ], + "period_days": 14, + "calendar_month": { + "start": "2026-11-01T00:00:00Z", + "as_of": "2026-11-20T10:00:00Z", + "previous_start": "2026-10-01T00:00:00Z", + "previous_end": "2026-11-01T00:00:00Z", + "protections": [ + { + "key": "bots", + "counts": { + "log": 0, + "challenge": 4, + "block": 1 + }, + "previous_counts": { + "log": 0, + "challenge": 2, + "block": 0 + }, + "counts_delta": { + "log": 0, + "challenge": 2, + "block": 1 + }, + "accounts": 4, + "previous_accounts": 2, + "accounts_delta": 2 + } + ], + "challenges": { + "passed": 4, + "failed": 1, + "previous_passed": 2, + "previous_failed": 0 + } + }, + "attack_mode": { + "active": false, + "started_at": null, + "expires_at": null + }, + "selfie_available": false + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/SetupNotAuthenticated" + }, + "403": { + "$ref": "#/components/responses/SetupPermissionDenied" + }, + "404": { + "$ref": "#/components/responses/SetupNotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.authentication_setup.get_protection(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n)\nprint(result)" + }, + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.authenticationSetup.getProtection(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n);\nconsole.log(result);" + }, + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.AuthenticationSetup.GetProtection(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\")\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)" + }, + { + "lang": "java", + "label": "Java", + "source": "import me.didit.Didit;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.authenticationSetup().getProtection(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nSystem.out.println(result);" + }, + { + "lang": "php", + "label": "PHP", + "source": "authenticationSetup->getProtection('a1b2c3d4-5678-90ab-cdef-111111111111', '7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d');\nprint_r($result->toArray());" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.authentication_setup.get_protection(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\"\n)\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.AuthenticationSetup.GetProtectionAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nConsole.WriteLine(JsonSerializer.Serialize(result));" + } + ] + }, + "patch": { + "tags": [ + "Setup" + ], + "summary": "Update bot protection", + "description": "Turns protection on or off, turns the breached-password check on or off and sets a mode per policy. The policies you send are merged into the stored ones. An unknown policy answers `{\"policies\": [\"unknown_protection\"]}`.", + "operationId": "authentication_update_protection", + "security": [ + { + "ManagementGrant": [] + }, + { + "ManagementApiKey": [] + } + ], + "x-didit-sdk": { + "resource": "authentication_setup", + "method": "update_protection", + "auth": "api_key", + "server": true + }, + "requestBody": { + "required": false, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupProtectionUpdate" + }, + "examples": { + "BlockBots": { + "summary": "Block bots and challenge credential stuffing", + "value": { + "enabled": true, + "policies": { + "bots": "block", + "stuffing": "challenge", + "brute": "challenge" + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Protection settings as they now stand.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupProtection" + }, + "examples": { + "SetupProtection": { + "summary": "Response", + "value": { + "enabled": true, + "breached_password_check": true, + "protections": [ + { + "key": "bots", + "mode": "block", + "available": true, + "counts": { + "log": 0, + "challenge": 12, + "block": 3 + }, + "accounts": 9 + } + ], + "daily": [ + { + "date": "2026-11-19", + "protection": "bots", + "action": "block", + "count": 3 + } + ], + "challenges_daily": [ + { + "date": "2026-11-19", + "passed": 10, + "failed": 2 + } + ], + "period_days": 14, + "calendar_month": { + "start": "2026-11-01T00:00:00Z", + "as_of": "2026-11-20T10:00:00Z", + "previous_start": "2026-10-01T00:00:00Z", + "previous_end": "2026-11-01T00:00:00Z", + "protections": [ + { + "key": "bots", + "counts": { + "log": 0, + "challenge": 4, + "block": 1 + }, + "previous_counts": { + "log": 0, + "challenge": 2, + "block": 0 + }, + "counts_delta": { + "log": 0, + "challenge": 2, + "block": 1 + }, + "accounts": 4, + "previous_accounts": 2, + "accounts_delta": 2 + } + ], + "challenges": { + "passed": 4, + "failed": 1, + "previous_passed": 2, + "previous_failed": 0 + } + }, + "attack_mode": { + "active": false, + "started_at": null, + "expires_at": null + }, + "selfie_available": false + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/SetupValidation" + }, + "401": { + "$ref": "#/components/responses/SetupNotAuthenticated" + }, + "403": { + "$ref": "#/components/responses/SetupPermissionDenied" + }, + "404": { + "$ref": "#/components/responses/SetupNotFound" + }, + "409": { + "$ref": "#/components/responses/SetupProductDisabled" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.authentication_setup.update_protection(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n enabled=True,\n policies={\"bots\": \"block\", \"stuffing\": \"challenge\", \"brute\": \"challenge\"},\n)\nprint(result)" + }, + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.authenticationSetup.updateProtection(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n {\n enabled: true,\n policies: { bots: \"block\", stuffing: \"challenge\", brute: \"challenge\" },\n },\n);\nconsole.log(result);" + }, + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.AuthenticationSetup.UpdateProtection(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", didit.SetupProtectionUpdate{\n\tEnabled: didit.Bool(true),\n\tPolicies: didit.Some(map[string]string{\"bots\": \"block\", \"stuffing\": \"challenge\", \"brute\": \"challenge\"}),\n})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)" + }, + { + "lang": "java", + "label": "Java", + "source": "import java.util.Map;\nimport me.didit.Didit;\nimport me.didit.types.SetupProtectionUpdate;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.authenticationSetup().updateProtection(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", SetupProtectionUpdate.builder()\n .enabled(true)\n .policies(Map.of(\"bots\", \"block\", \"stuffing\", \"challenge\", \"brute\", \"challenge\"))\n .build());\nSystem.out.println(result);" + }, + { + "lang": "php", + "label": "PHP", + "source": "authenticationSetup->updateProtection('a1b2c3d4-5678-90ab-cdef-111111111111', '7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d', [\n 'enabled' => true,\n 'policies' => ['bots' => 'block', 'stuffing' => 'challenge', 'brute' => 'challenge'],\n]);\nprint_r($result->toArray());" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.authentication_setup.update_protection(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n enabled: true,\n policies: { bots: \"block\", stuffing: \"challenge\", brute: \"challenge\" }\n)\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Collections.Generic;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.AuthenticationSetup.UpdateProtectionAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", new SetupProtectionUpdate\n{\n Enabled = true,\n Policies = new Dictionary { [\"bots\"] = \"block\", [\"stuffing\"] = \"challenge\", [\"brute\"] = \"challenge\" },\n});\nConsole.WriteLine(JsonSerializer.Serialize(result));" + } + ] + } + }, + "/organizations/{organization_id}/applications/{application_id}/authentication/verified/": { + "servers": [ + { + "url": "https://apx.didit.me/auth/v2", + "description": "The management API, on the account host. Setup routes are not served on the application's issuer." + } + ], + "parameters": [ + { + "name": "organization_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": "application_id", + "in": "path", + "required": true, + "description": "UUID of the application: live or sandbox. A named key configures its own application only.", + "schema": { + "type": "string", + "format": "uuid", + "example": "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" + } + } + ], + "get": { + "tags": [ + "Setup" + ], + "summary": "Get verified sign-in", + "description": "Returns the sign-up verification level, the step-up rules with this month's counters, the claims your tokens carry and the verification workflows behind them.", + "operationId": "authentication_get_verified", + "security": [ + { + "ManagementGrant": [] + }, + { + "ManagementApiKey": [] + } + ], + "x-didit-sdk": { + "resource": "authentication_setup", + "method": "get_verified", + "auth": "api_key", + "server": true + }, + "responses": { + "200": { + "description": "Verified sign-in settings and counters.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupVerified" + }, + "examples": { + "SetupVerified": { + "summary": "Response", + "value": { + "signup_level": "liveness", + "signup": { + "checks": 41, + "passed": 39, + "failed": 2 + }, + "rules": [ + { + "rule": "payout", + "enabled": true, + "method": "selfie", + "threshold": "500.00", + "currency": "EUR", + "checks": 6, + "passed": 5, + "failed": 1 + } + ], + "claims": [ + "over_18", + "given_name", + "country" + ], + "available_claims": [ + "over_18", + "over_21", + "given_name", + "family_name", + "birthdate", + "nationality", + "country", + "document_verified", + "liveness" + ], + "workflows": { + "liveness": null, + "selfie": null, + "full_id": null + }, + "wallet": { + "enabled": false, + "sign_ins": 0, + "people": 0 + }, + "since": "2026-11-01T00:00:00Z" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/SetupNotAuthenticated" + }, + "403": { + "$ref": "#/components/responses/SetupPermissionDenied" + }, + "404": { + "$ref": "#/components/responses/SetupNotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.authentication_setup.get_verified(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n)\nprint(result)" + }, + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.authenticationSetup.getVerified(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n);\nconsole.log(result);" + }, + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.AuthenticationSetup.GetVerified(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\")\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)" + }, + { + "lang": "java", + "label": "Java", + "source": "import me.didit.Didit;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.authenticationSetup().getVerified(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nSystem.out.println(result);" + }, + { + "lang": "php", + "label": "PHP", + "source": "authenticationSetup->getVerified('a1b2c3d4-5678-90ab-cdef-111111111111', '7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d');\nprint_r($result->toArray());" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.authentication_setup.get_verified(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\"\n)\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.AuthenticationSetup.GetVerifiedAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nConsole.WriteLine(JsonSerializer.Serialize(result));" + } + ] + }, + "patch": { + "tags": [ + "Setup" + ], + "summary": "Update verified sign-in", + "description": "Sets the sign-up verification level, the step-up rules, the claims your tokens carry and the workflows the rules use. Each supplied rule updates only the fields you send for its kind. Omitted rules keep their settings. Two rules of the same kind answer `duplicate_rule`, and `threshold` or `currency` on a rule other than `payout` answer `not_supported`.", + "operationId": "authentication_update_verified", + "security": [ + { + "ManagementGrant": [] + }, + { + "ManagementApiKey": [] + } + ], + "x-didit-sdk": { + "resource": "authentication_setup", + "method": "update_verified", + "auth": "api_key", + "server": true + }, + "requestBody": { + "required": false, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupVerifiedUpdate" + }, + "examples": { + "SelfieOnPayout": { + "summary": "A selfie before a payout over EUR 500", + "value": { + "signup_level": "liveness", + "rules": [ + { + "rule": "payout", + "enabled": true, + "method": "selfie", + "threshold": "500.00", + "currency": "EUR" + } + ], + "claims": [ + "over_18", + "given_name", + "country" + ] + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Verified sign-in settings as they now stand.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupVerified" + }, + "examples": { + "SetupVerified": { + "summary": "Response", + "value": { + "signup_level": "liveness", + "signup": { + "checks": 41, + "passed": 39, + "failed": 2 + }, + "rules": [ + { + "rule": "payout", + "enabled": true, + "method": "selfie", + "threshold": "500.00", + "currency": "EUR", + "checks": 6, + "passed": 5, + "failed": 1 + } + ], + "claims": [ + "over_18", + "given_name", + "country" + ], + "available_claims": [ + "over_18", + "over_21", + "given_name", + "family_name", + "birthdate", + "nationality", + "country", + "document_verified", + "liveness" + ], + "workflows": { + "liveness": null, + "selfie": null, + "full_id": null + }, + "wallet": { + "enabled": false, + "sign_ins": 0, + "people": 0 + }, + "since": "2026-11-01T00:00:00Z" + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/SetupValidation" + }, + "401": { + "$ref": "#/components/responses/SetupNotAuthenticated" + }, + "403": { + "$ref": "#/components/responses/SetupPermissionDenied" + }, + "404": { + "$ref": "#/components/responses/SetupNotFound" + }, + "409": { + "$ref": "#/components/responses/SetupProductDisabled" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.authentication_setup.update_verified(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n signup_level=\"liveness\",\n rules=[{\n \"rule\": \"payout\",\n \"enabled\": True,\n \"method\": \"selfie\",\n \"threshold\": \"500.00\",\n \"currency\": \"EUR\",\n }],\n claims=[\"over_18\", \"given_name\", \"country\"],\n)\nprint(result)" + }, + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.authenticationSetup.updateVerified(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n {\n signup_level: \"liveness\",\n rules: [{\n rule: \"payout\",\n enabled: true,\n method: \"selfie\",\n threshold: \"500.00\",\n currency: \"EUR\",\n }],\n claims: [\"over_18\", \"given_name\", \"country\"],\n },\n);\nconsole.log(result);" + }, + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.AuthenticationSetup.UpdateVerified(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", didit.SetupVerifiedUpdate{\n\tSignupLevel: didit.Some(didit.SetupVerifiedUpdateSignupLevel(\"liveness\")),\n\tRules: didit.Some([]didit.SetupVerifiedUpdateRules{{\n\t\tRule: \"payout\",\n\t\tEnabled: didit.Bool(true),\n\t\tMethod: didit.Some(didit.SetupVerifiedUpdateRulesMethod(\"selfie\")),\n\t\tThreshold: didit.String(\"500.00\"),\n\t\tCurrency: didit.String(\"EUR\"),\n\t}}),\n\tClaims: didit.Some([]string{\"over_18\", \"given_name\", \"country\"}),\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.SetupVerifiedUpdate;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.authenticationSetup().updateVerified(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", SetupVerifiedUpdate.builder()\n .signupLevel(SetupVerifiedUpdate.SignupLevel.of(\"liveness\"))\n .rules(List.of(SetupVerifiedUpdate.Rules.builder()\n .rule(SetupVerifiedUpdate.Rules.Rule.of(\"payout\"))\n .enabled(true)\n .method(SetupVerifiedUpdate.Rules.Method.of(\"selfie\"))\n .threshold(\"500.00\")\n .currency(\"EUR\")\n .build()))\n .claims(List.of(\"over_18\", \"given_name\", \"country\"))\n .build());\nSystem.out.println(result);" + }, + { + "lang": "php", + "label": "PHP", + "source": "authenticationSetup->updateVerified('a1b2c3d4-5678-90ab-cdef-111111111111', '7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d', [\n 'signup_level' => 'liveness',\n 'rules' => [[\n 'rule' => 'payout',\n 'enabled' => true,\n 'method' => 'selfie',\n 'threshold' => '500.00',\n 'currency' => 'EUR',\n ]],\n 'claims' => ['over_18', 'given_name', 'country'],\n]);\nprint_r($result->toArray());" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.authentication_setup.update_verified(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n signup_level: \"liveness\",\n rules: [{\n rule: \"payout\",\n enabled: true,\n method: \"selfie\",\n threshold: \"500.00\",\n currency: \"EUR\",\n }],\n claims: [\"over_18\", \"given_name\", \"country\"]\n)\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.AuthenticationSetup.UpdateVerifiedAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", new SetupVerifiedUpdate\n{\n SignupLevel = new SetupVerifiedUpdateSignupLevel(\"liveness\"),\n Rules = new SetupVerifiedUpdateRules[]\n {\n new()\n {\n Rule = \"payout\",\n Enabled = true,\n Method = new SetupVerifiedUpdateRulesMethod(\"selfie\"),\n Threshold = \"500.00\",\n Currency = \"EUR\",\n },\n },\n Claims = new string[] { \"over_18\", \"given_name\", \"country\" },\n});\nConsole.WriteLine(JsonSerializer.Serialize(result));" + } + ] + } + }, + "/organizations/{organization_id}/applications/{application_id}/authentication/domain/": { + "servers": [ + { + "url": "https://apx.didit.me/auth/v2", + "description": "The management API, on the account host. Setup routes are not served on the application's issuer." + } + ], + "parameters": [ + { + "name": "organization_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": "application_id", + "in": "path", + "required": true, + "description": "UUID of the application: live or sandbox. A named key configures its own application only.", + "schema": { + "type": "string", + "format": "uuid", + "example": "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" + } + } + ], + "get": { + "tags": [ + "Setup" + ], + "summary": "Get the hosted domain", + "description": "Returns the hosted origin, the issuer and passkey relying party that follow from it, and the custom domain with its DNS record, certificate and status. `origin` names the custom domain once it is active and the default host until then.", + "operationId": "authentication_get_domain", + "security": [ + { + "ManagementGrant": [] + }, + { + "ManagementApiKey": [] + } + ], + "x-didit-sdk": { + "resource": "authentication_setup", + "method": "get_domain", + "auth": "api_key", + "server": true + }, + "responses": { + "200": { + "description": "The hosted domain.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupDomain" + }, + "examples": { + "SetupDomain": { + "summary": "Response", + "value": { + "host": "demo.auth.didit.me", + "default_origin": "https://demo.auth.didit.me", + "origin": "https://login.example.com", + "hosted_url": "https://login.example.com/sign-in", + "issuer": "https://login.example.com", + "passkey_rp_id": "login.example.com", + "sandbox": false, + "sandbox_origin": "https://demo.sandbox.auth.didit.me", + "custom_domains_available": true, + "custom_domain": { + "domain": "login.example.com", + "status": "verified", + "failure_reason": "", + "dns_record": { + "type": "CNAME", + "name": "login.example.com", + "value": "demo.auth.didit.me" + }, + "certificate": { + "status": "issued", + "expires_at": "2027-02-18T00:00:00Z" + }, + "dns_checked_at": "2026-11-20T10:00:00Z", + "verified_at": "2026-11-20T10:05:00Z", + "activated_at": null + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/SetupNotAuthenticated" + }, + "403": { + "$ref": "#/components/responses/SetupPermissionDenied" + }, + "404": { + "$ref": "#/components/responses/SetupNotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.authentication_setup.get_domain(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n)\nprint(result)" + }, + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.authenticationSetup.getDomain(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n);\nconsole.log(result);" + }, + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.AuthenticationSetup.GetDomain(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\")\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)" + }, + { + "lang": "java", + "label": "Java", + "source": "import me.didit.Didit;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.authenticationSetup().getDomain(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nSystem.out.println(result);" + }, + { + "lang": "php", + "label": "PHP", + "source": "authenticationSetup->getDomain('a1b2c3d4-5678-90ab-cdef-111111111111', '7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d');\nprint_r($result->toArray());" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.authentication_setup.get_domain(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\"\n)\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.AuthenticationSetup.GetDomainAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nConsole.WriteLine(JsonSerializer.Serialize(result));" + } + ] + }, + "put": { + "tags": [ + "Setup" + ], + "summary": "Claim a custom domain", + "description": "Claims a domain for the application's hosted pages: `pending` until DNS points at the application's default host. Claiming a second domain while one is claimed, verified or active answers 409 `{\"domain\": \"custom_domain_exists\"}`; an apex, an IP or one of Didit's own hosts answers `{\"domain\": \"invalid_domain\"}`.", + "operationId": "authentication_set_domain", + "security": [ + { + "ManagementGrant": [] + }, + { + "ManagementApiKey": [] + } + ], + "x-didit-sdk": { + "resource": "authentication_setup", + "method": "set_domain", + "auth": "api_key", + "server": true + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupDomainRequest" + }, + "examples": { + "LoginDomain": { + "summary": "Claim a sign-in domain", + "value": { + "domain": "login.example.com" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "The domain as it now stands.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupDomain" + }, + "examples": { + "SetupDomain": { + "summary": "Response", + "value": { + "host": "demo.auth.didit.me", + "default_origin": "https://demo.auth.didit.me", + "origin": "https://login.example.com", + "hosted_url": "https://login.example.com/sign-in", + "issuer": "https://login.example.com", + "passkey_rp_id": "login.example.com", + "sandbox": false, + "sandbox_origin": "https://demo.sandbox.auth.didit.me", + "custom_domains_available": true, + "custom_domain": { + "domain": "login.example.com", + "status": "verified", + "failure_reason": "", + "dns_record": { + "type": "CNAME", + "name": "login.example.com", + "value": "demo.auth.didit.me" + }, + "certificate": { + "status": "issued", + "expires_at": "2027-02-18T00:00:00Z" + }, + "dns_checked_at": "2026-11-20T10:00:00Z", + "verified_at": "2026-11-20T10:05:00Z", + "activated_at": null + } + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/SetupValidation" + }, + "409": { + "$ref": "#/components/responses/SetupConflict" + }, + "503": { + "$ref": "#/components/responses/SetupUnavailable" + }, + "401": { + "$ref": "#/components/responses/SetupNotAuthenticated" + }, + "403": { + "$ref": "#/components/responses/SetupPermissionDenied" + }, + "404": { + "$ref": "#/components/responses/SetupNotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.authentication_setup.set_domain(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n domain=\"login.example.com\",\n)\nprint(result)" + }, + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.authenticationSetup.setDomain(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n {\n domain: \"login.example.com\",\n },\n);\nconsole.log(result);" + }, + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.AuthenticationSetup.SetDomain(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", didit.SetupDomainRequest{\n\tDomain: \"login.example.com\",\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.SetupDomainRequest;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.authenticationSetup().setDomain(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", SetupDomainRequest.builder()\n .domain(\"login.example.com\")\n .build());\nSystem.out.println(result);" + }, + { + "lang": "php", + "label": "PHP", + "source": "authenticationSetup->setDomain('a1b2c3d4-5678-90ab-cdef-111111111111', '7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d', [\n 'domain' => 'login.example.com',\n]);\nprint_r($result->toArray());" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.authentication_setup.set_domain(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n domain: \"login.example.com\"\n)\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.AuthenticationSetup.SetDomainAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", new SetupDomainRequest\n{\n Domain = \"login.example.com\",\n});\nConsole.WriteLine(JsonSerializer.Serialize(result));" + } + ] + }, + "delete": { + "tags": [ + "Setup" + ], + "summary": "Remove the custom domain", + "description": "Removes the custom domain and returns the application to its default host. When the edge does not confirm the removal the call answers 503 and the domain stays claimed; retry it.", + "operationId": "authentication_remove_domain", + "security": [ + { + "ManagementGrant": [] + }, + { + "ManagementApiKey": [] + } + ], + "x-didit-sdk": { + "resource": "authentication_setup", + "method": "remove_domain", + "auth": "api_key", + "server": true + }, + "responses": { + "200": { + "description": "The hosted domain without a custom domain.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupDomain" + }, + "examples": { + "Removed": { + "summary": "Domain after removing the custom domain: the default origin serves again", + "value": { + "host": "demo.auth.didit.me", + "default_origin": "https://demo.auth.didit.me", + "origin": "https://demo.auth.didit.me", + "hosted_url": "https://demo.auth.didit.me/sign-in", + "issuer": "https://demo.auth.didit.me", + "passkey_rp_id": "demo.auth.didit.me", + "sandbox": false, + "sandbox_origin": "https://demo.sandbox.auth.didit.me", + "custom_domains_available": true, + "custom_domain": null + } + } + } + } + } + }, + "503": { + "$ref": "#/components/responses/SetupUnavailable" + }, + "401": { + "$ref": "#/components/responses/SetupNotAuthenticated" + }, + "403": { + "$ref": "#/components/responses/SetupPermissionDenied" + }, + "404": { + "$ref": "#/components/responses/SetupNotFound" + }, + "409": { + "$ref": "#/components/responses/SetupProductDisabled" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.authentication_setup.remove_domain(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n)\nprint(result)" + }, + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.authenticationSetup.removeDomain(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n);\nconsole.log(result);" + }, + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.AuthenticationSetup.RemoveDomain(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\")\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)" + }, + { + "lang": "java", + "label": "Java", + "source": "import me.didit.Didit;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.authenticationSetup().removeDomain(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nSystem.out.println(result);" + }, + { + "lang": "php", + "label": "PHP", + "source": "authenticationSetup->removeDomain('a1b2c3d4-5678-90ab-cdef-111111111111', '7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d');\nprint_r($result->toArray());" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.authentication_setup.remove_domain(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\"\n)\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.AuthenticationSetup.RemoveDomainAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nConsole.WriteLine(JsonSerializer.Serialize(result));" + } + ] + } + }, + "/organizations/{organization_id}/applications/{application_id}/authentication/domain/verify/": { + "servers": [ + { + "url": "https://apx.didit.me/auth/v2", + "description": "The management API, on the account host. Setup routes are not served on the application's issuer." + } + ], + "parameters": [ + { + "name": "organization_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": "application_id", + "in": "path", + "required": true, + "description": "UUID of the application: live or sandbox. A named key configures its own application only.", + "schema": { + "type": "string", + "format": "uuid", + "example": "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" + } + } + ], + "post": { + "tags": [ + "Setup" + ], + "summary": "Verify the custom domain", + "description": "Checks the DNS record now and asks the edge for the certificate. A missing or mismatched DNS record returns 200 with a `failure_reason`. Read `domain/` afterwards for the result: `verified` once the certificate is issued, `failed` with a `failure_reason` when it cannot be issued.", + "operationId": "authentication_verify_domain", + "security": [ + { + "ManagementGrant": [] + }, + { + "ManagementApiKey": [] + } + ], + "x-didit-sdk": { + "resource": "authentication_setup", + "method": "verify_domain", + "auth": "api_key", + "server": true + }, + "responses": { + "200": { + "description": "The domain as it now stands.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupDomain" + }, + "examples": { + "SetupDomain": { + "summary": "Response", + "value": { + "host": "demo.auth.didit.me", + "default_origin": "https://demo.auth.didit.me", + "origin": "https://login.example.com", + "hosted_url": "https://login.example.com/sign-in", + "issuer": "https://login.example.com", + "passkey_rp_id": "login.example.com", + "sandbox": false, + "sandbox_origin": "https://demo.sandbox.auth.didit.me", + "custom_domains_available": true, + "custom_domain": { + "domain": "login.example.com", + "status": "verified", + "failure_reason": "", + "dns_record": { + "type": "CNAME", + "name": "login.example.com", + "value": "demo.auth.didit.me" + }, + "certificate": { + "status": "issued", + "expires_at": "2027-02-18T00:00:00Z" + }, + "dns_checked_at": "2026-11-20T10:00:00Z", + "verified_at": "2026-11-20T10:05:00Z", + "activated_at": null + } + } + } + } + } + } + }, + "400": { + "description": "Set a custom domain before verifying it.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FieldErrors" + }, + "example": { + "domain": "custom_domain_missing" + } + } + } + }, + "401": { + "$ref": "#/components/responses/SetupNotAuthenticated" + }, + "403": { + "$ref": "#/components/responses/SetupPermissionDenied" + }, + "404": { + "$ref": "#/components/responses/SetupNotFound" + }, + "409": { + "description": "The domain is already in use (`domain_in_use`), changed during verification (`custom_domain_changed`), or needs to be removed and added again after a failed certificate (`custom_domain_failed`). With a management grant or a named key, `{\"detail\": \"product_disabled\"}` means Authentication is turned off for the application; a person turns it on in the console.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FieldErrors" + }, + "examples": { + "Conflict": { + "summary": "The domain cannot change in its current state", + "value": { + "domain": "domain_in_use" + } + }, + "ProductDisabled": { + "summary": "Authentication is turned off for the application", + "value": { + "detail": "product_disabled" + } + } + } + } + } + }, + "429": { + "$ref": "#/components/responses/RateLimited" + }, + "503": { + "description": "Domain verification is unavailable. Retry when DNS or the custom domain service is available.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FieldErrors" + }, + "example": { + "domain": "dns_unavailable" + } + } + } + } + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.authentication_setup.verify_domain(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n)\nprint(result)" + }, + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.authenticationSetup.verifyDomain(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n);\nconsole.log(result);" + }, + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.AuthenticationSetup.VerifyDomain(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\")\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)" + }, + { + "lang": "java", + "label": "Java", + "source": "import me.didit.Didit;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.authenticationSetup().verifyDomain(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nSystem.out.println(result);" + }, + { + "lang": "php", + "label": "PHP", + "source": "authenticationSetup->verifyDomain('a1b2c3d4-5678-90ab-cdef-111111111111', '7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d');\nprint_r($result->toArray());" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.authentication_setup.verify_domain(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\"\n)\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.AuthenticationSetup.VerifyDomainAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nConsole.WriteLine(JsonSerializer.Serialize(result));" + } + ] + } + }, + "/organizations/{organization_id}/applications/{application_id}/authentication/domain/activate/": { + "servers": [ + { + "url": "https://apx.didit.me/auth/v2", + "description": "The management API, on the account host. Setup routes are not served on the application's issuer." + } + ], + "parameters": [ + { + "name": "organization_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": "application_id", + "in": "path", + "required": true, + "description": "UUID of the application: live or sandbox. A named key configures its own application only.", + "schema": { + "type": "string", + "format": "uuid", + "example": "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" + } + } + ], + "post": { + "tags": [ + "Setup" + ], + "summary": "Activate the custom domain", + "description": "Makes the verified domain the application's canonical origin, which moves the issuer and the passkey relying party to it. After activation, `/session/` immediately rejects access tokens issued under the old host. Refresh them to obtain access tokens for the new issuer.", + "operationId": "authentication_activate_domain", + "security": [ + { + "ManagementGrant": [] + }, + { + "ManagementApiKey": [] + } + ], + "x-didit-sdk": { + "resource": "authentication_setup", + "method": "activate_domain", + "auth": "api_key", + "server": true + }, + "responses": { + "200": { + "description": "The domain as it now stands.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupDomain" + }, + "examples": { + "SetupDomain": { + "summary": "Response", + "value": { + "host": "demo.auth.didit.me", + "default_origin": "https://demo.auth.didit.me", + "origin": "https://login.example.com", + "hosted_url": "https://login.example.com/sign-in", + "issuer": "https://login.example.com", + "passkey_rp_id": "login.example.com", + "sandbox": false, + "sandbox_origin": "https://demo.sandbox.auth.didit.me", + "custom_domains_available": true, + "custom_domain": { + "domain": "login.example.com", + "status": "verified", + "failure_reason": "", + "dns_record": { + "type": "CNAME", + "name": "login.example.com", + "value": "demo.auth.didit.me" + }, + "certificate": { + "status": "issued", + "expires_at": "2027-02-18T00:00:00Z" + }, + "dns_checked_at": "2026-11-20T10:00:00Z", + "verified_at": "2026-11-20T10:05:00Z", + "activated_at": null + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/SetupNotAuthenticated" + }, + "403": { + "$ref": "#/components/responses/SetupPermissionDenied" + }, + "404": { + "$ref": "#/components/responses/SetupNotFound" + }, + "409": { + "description": "Verify the custom domain before activating it. With a management grant or a named key, `{\"detail\": \"product_disabled\"}` means Authentication is turned off for the application; a person turns it on in the console.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FieldErrors" + }, + "examples": { + "Conflict": { + "summary": "The domain cannot change in its current state", + "value": { + "domain": "custom_domain_not_verified" + } + }, + "ProductDisabled": { + "summary": "Authentication is turned off for the application", + "value": { + "detail": "product_disabled" + } + } + } + } + } + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.authentication_setup.activate_domain(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n)\nprint(result)" + }, + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.authenticationSetup.activateDomain(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n);\nconsole.log(result);" + }, + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.AuthenticationSetup.ActivateDomain(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\")\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)" + }, + { + "lang": "java", + "label": "Java", + "source": "import me.didit.Didit;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.authenticationSetup().activateDomain(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nSystem.out.println(result);" + }, + { + "lang": "php", + "label": "PHP", + "source": "authenticationSetup->activateDomain('a1b2c3d4-5678-90ab-cdef-111111111111', '7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d');\nprint_r($result->toArray());" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.authentication_setup.activate_domain(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\"\n)\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.AuthenticationSetup.ActivateDomainAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nConsole.WriteLine(JsonSerializer.Serialize(result));" + } + ] + } + }, + "/organizations/{organization_id}/applications/{application_id}/authentication/native-apps/": { + "servers": [ + { + "url": "https://apx.didit.me/auth/v2", + "description": "The management API, on the account host. Setup routes are not served on the application's issuer." + } + ], + "parameters": [ + { + "name": "organization_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": "application_id", + "in": "path", + "required": true, + "description": "UUID of the application: live or sandbox. A named key configures its own application only.", + "schema": { + "type": "string", + "format": "uuid", + "example": "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" + } + } + ], + "get": { + "tags": [ + "Setup" + ], + "summary": "Get the native apps", + "description": "Returns the iOS app IDs and Android apps that share this application's passkeys, as the association files at the hosted origin publish them.", + "operationId": "authentication_get_native_apps", + "security": [ + { + "ManagementGrant": [] + }, + { + "ManagementApiKey": [] + } + ], + "x-didit-sdk": { + "resource": "authentication_setup", + "method": "get_native_apps", + "auth": "api_key", + "server": true + }, + "responses": { + "200": { + "description": "The native apps.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupNativeApps" + }, + "examples": { + "SetupNativeApps": { + "summary": "Response", + "value": { + "ios_app_ids": [ + "A1B2C3D4E5.com.example.app" + ], + "android_apps": [ + { + "package_name": "com.example.app", + "sha256_cert_fingerprints": [ + "AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89" + ] + } + ] + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/SetupNotAuthenticated" + }, + "403": { + "$ref": "#/components/responses/SetupPermissionDenied" + }, + "404": { + "$ref": "#/components/responses/SetupNotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.authentication_setup.get_native_apps(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n)\nprint(result)" + }, + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.authenticationSetup.getNativeApps(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n);\nconsole.log(result);" + }, + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.AuthenticationSetup.GetNativeApps(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\")\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)" + }, + { + "lang": "java", + "label": "Java", + "source": "import me.didit.Didit;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.authenticationSetup().getNativeApps(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nSystem.out.println(result);" + }, + { + "lang": "php", + "label": "PHP", + "source": "authenticationSetup->getNativeApps('a1b2c3d4-5678-90ab-cdef-111111111111', '7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d');\nprint_r($result->toArray());" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.authentication_setup.get_native_apps(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\"\n)\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.AuthenticationSetup.GetNativeAppsAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nConsole.WriteLine(JsonSerializer.Serialize(result));" + } + ] + }, + "put": { + "tags": [ + "Setup" + ], + "summary": "Update the native apps", + "description": "Replaces the lists of iOS app IDs and Android apps. A malformed entry answers a field error in the shape `{\"ios_app_ids\": [\"This field is invalid.\"]}`; duplicates are dropped.", + "operationId": "authentication_update_native_apps", + "security": [ + { + "ManagementGrant": [] + }, + { + "ManagementApiKey": [] + } + ], + "x-didit-sdk": { + "resource": "authentication_setup", + "method": "update_native_apps", + "auth": "api_key", + "server": true + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupNativeAppsUpdate" + }, + "examples": { + "OneAppPerPlatform": { + "summary": "One iOS app and one Android app", + "value": { + "ios_app_ids": [ + "A1B2C3D4E5.com.example.app" + ], + "android_apps": [ + { + "package_name": "com.example.app", + "sha256_cert_fingerprints": [ + "AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89" + ] + } + ] + } + } + } + } + } + }, + "responses": { + "200": { + "description": "The native apps as they now stand.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupNativeApps" + }, + "examples": { + "SetupNativeApps": { + "summary": "Response", + "value": { + "ios_app_ids": [ + "A1B2C3D4E5.com.example.app" + ], + "android_apps": [ + { + "package_name": "com.example.app", + "sha256_cert_fingerprints": [ + "AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89" + ] + } + ] + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/SetupValidation" + }, + "401": { + "$ref": "#/components/responses/SetupNotAuthenticated" + }, + "403": { + "$ref": "#/components/responses/SetupPermissionDenied" + }, + "404": { + "$ref": "#/components/responses/SetupNotFound" + }, + "409": { + "$ref": "#/components/responses/SetupProductDisabled" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.authentication_setup.update_native_apps(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n ios_app_ids=[\"A1B2C3D4E5.com.example.app\"],\n android_apps=[{\n \"package_name\": \"com.example.app\",\n \"sha256_cert_fingerprints\": [\"AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89\"],\n }],\n)\nprint(result)" + }, + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.authenticationSetup.updateNativeApps(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n {\n ios_app_ids: [\"A1B2C3D4E5.com.example.app\"],\n android_apps: [{\n package_name: \"com.example.app\",\n sha256_cert_fingerprints: [\"AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89\"],\n }],\n },\n);\nconsole.log(result);" + }, + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.AuthenticationSetup.UpdateNativeApps(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", didit.SetupNativeAppsUpdate{\n\tIosAppIDs: []string{\"A1B2C3D4E5.com.example.app\"},\n\tAndroidApps: []didit.SetupAndroidAppParam{{\n\t\tPackageName: \"com.example.app\",\n\t\tSha256CertFingerprints: []string{\"AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89\"},\n\t}},\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.SetupAndroidApp;\nimport me.didit.types.SetupNativeAppsUpdate;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.authenticationSetup().updateNativeApps(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", SetupNativeAppsUpdate.builder()\n .iosAppIds(List.of(\"A1B2C3D4E5.com.example.app\"))\n .androidApps(List.of(SetupAndroidApp.builder()\n .packageName(\"com.example.app\")\n .sha256CertFingerprints(List.of(\"AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89\"))\n .build()))\n .build());\nSystem.out.println(result);" + }, + { + "lang": "php", + "label": "PHP", + "source": "authenticationSetup->updateNativeApps('a1b2c3d4-5678-90ab-cdef-111111111111', '7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d', [\n 'ios_app_ids' => ['A1B2C3D4E5.com.example.app'],\n 'android_apps' => [[\n 'package_name' => 'com.example.app',\n 'sha256_cert_fingerprints' => ['AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89'],\n ]],\n]);\nprint_r($result->toArray());" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.authentication_setup.update_native_apps(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n ios_app_ids: [\"A1B2C3D4E5.com.example.app\"],\n android_apps: [{\n package_name: \"com.example.app\",\n sha256_cert_fingerprints: [\"AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89\"],\n }]\n)\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.AuthenticationSetup.UpdateNativeAppsAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", new SetupNativeAppsUpdate\n{\n IosAppIds = new string[] { \"A1B2C3D4E5.com.example.app\" },\n AndroidApps = new SetupAndroidApp[]\n {\n new()\n {\n PackageName = \"com.example.app\",\n Sha256CertFingerprints = new string[] { \"AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89\" },\n },\n },\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 `. 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." + }, + "ManagementApiKey": { + "type": "apiKey", + "in": "header", + "name": "x-api-key", + "description": "A **named** application API key whose scopes give `authentication` the level the request needs: `read` to read the setup, `write` to read and change it. It configures its own application only, within its IP allowlist and expiry. The application's primary secret, an unscoped key and a token from `POST /programmatic/login` are refused with 403." + }, + "ManagementGrant": { + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT", + "description": "An OAuth grant an owner approved for this application, carrying `didit:management`: the MCP connector's grant (`Log in with Didit`) or the device-code grant an owner without a password approves. Send it as `Authorization: Bearer `. The grant keeps the scopes, organizations and role chosen at consent, so it cannot reach an organization or an action the person did not approve. A grant limited to `didit:verification` is refused with 403." + } + }, + "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 ` 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 ` 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 `\" 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", + "us" + ], + "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), `ae` (United Arab Emirates) and `us` (United States, N. Virginia) 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 + } + ] + } + }, + "Detail": { + "type": "object", + "required": [ + "detail" + ], + "properties": { + "detail": { + "type": "string", + "example": "invalid_token" + } } }, - "Organization": { + "FieldErrors": { + "title": "Field errors", + "type": "object", + "description": "Validation errors by field. A value is a list of messages, or a single code (`unknown_field`, `invalid_redirect_uri`). `non_field_errors` holds rules across fields.", + "additionalProperties": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + }, + "SetupAndroidApp": { + "title": "Android app", "type": "object", + "required": [ + "package_name", + "sha256_cert_fingerprints" + ], "properties": { - "uuid": { - "type": "string", - "format": "uuid", - "description": "Use as `{org_id}` on the application endpoints.", - "example": "a1b2c3d4-5678-90ab-cdef-111111111111" + "package_name": { + "type": "string" + }, + "sha256_cert_fingerprints": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string" + } + } + } + }, + "SetupBrand": { + "title": "Brand", + "type": "object", + "description": "The brand as Customization sets it. Read-only here.", + "properties": { + "source": { + "type": "string" }, "name": { + "type": "string" + }, + "logo": { "type": "string", - "description": "Display name of the organization.", - "example": "developer" + "nullable": true }, - "contact_email": { + "logo_dark": { "type": "string", - "format": "email", - "description": "Primary contact email for the organization.", - "example": "developer@gmail.com" + "nullable": true }, - "created_at": { + "brand_colour": { + "type": "string" + }, + "brand_colour_dark": { + "type": "string" + }, + "button_text_colour": { + "type": "string" + }, + "background": { + "type": "string" + }, + "background_dark": { + "type": "string" + }, + "corner_radius": { + "type": "integer" + }, + "font": { + "type": "string" + }, + "theme": { "type": "string", - "format": "date-time", - "example": "2025-06-01T10:00:00Z" + "enum": [ + "device" + ] } } }, - "OrganizationSummary": { + "SetupBranding": { + "title": "Hosted pages branding", "type": "object", - "description": "Minimal organization shape returned inline by `POST /programmatic/verify-email/`.", + "required": [ + "brand", + "texts", + "defaults", + "languages", + "badge", + "hosted_url" + ], "properties": { - "uuid": { + "brand": { + "$ref": "#/components/schemas/SetupBrand" + }, + "texts": { + "type": "object", + "description": "The texts this application set, by language code.", + "additionalProperties": { + "$ref": "#/components/schemas/SetupBrandingTexts" + } + }, + "defaults": { + "type": "object", + "description": "Didit's own copy for the language you asked for.", + "properties": { + "sign_in_title": { + "type": "string" + }, + "subtitle": { + "type": "string" + }, + "sign_up_title": { + "type": "string" + } + } + }, + "terms_url": { + "type": "string", + "nullable": true + }, + "privacy_url": { + "type": "string", + "nullable": true + }, + "languages": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The language codes the hosted pages can show." + }, + "badge": { + "type": "object", + "properties": { + "visible": { + "type": "boolean" + }, + "plan": { + "type": "string" + }, + "early_access": { + "type": "boolean" + } + } + }, + "hosted_url": { + "type": "string", + "format": "uri" + } + } + }, + "SetupBrandingTexts": { + "title": "Hosted page texts", + "type": "object", + "description": "The texts of the hosted sign-in, sign-up and subtitle lines. A field left empty falls back to Didit's copy.", + "properties": { + "sign_in_title": { + "type": "string", + "maxLength": 120 + }, + "subtitle": { + "type": "string", + "maxLength": 160 + }, + "sign_up_title": { + "type": "string", + "maxLength": 120 + } + } + }, + "SetupBrandingUpdate": { + "title": "Branding update", + "type": "object", + "description": "Every field is optional. A language Didit does not publish answers `unsupported_language`, and a legal link that is not `https://` answers `https_required`.", + "properties": { + "texts": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/SetupBrandingTexts" + } + }, + "terms_url": { + "type": "string", + "maxLength": 500 + }, + "privacy_url": { + "type": "string", + "maxLength": 500 + } + } + }, + "SetupConfiguration": { + "title": "Authentication configuration", + "type": "object", + "required": [ + "application_id", + "enabled", + "methods", + "didit_test_credentials", + "redirect_uris", + "allowed_origins", + "session_lifetime", + "idle_timeout", + "signup_policy" + ], + "properties": { + "application_id": { + "type": "string", + "format": "uuid" + }, + "publishable_key": { + "type": "string", + "nullable": true, + "description": "`pk_live_` or `pk_test_` followed by the base64url issuer. A public identifier, not a credential; `null` when the hosted origin is not usable yet.", + "example": "pk_live_ZG9jcy1kZW1vLmF1dGguZGlkaXQubWU" + }, + "enabled": { + "type": "boolean", + "description": "Whether Authentication is on for this application. Read-only: it follows the product." + }, + "methods": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SetupMethodSummary" + } + }, + "didit_test_credentials": { + "$ref": "#/components/schemas/SetupDiditTestCredentials" + }, + "redirect_uris": { + "type": "array", + "maxItems": 50, + "items": { + "type": "string", + "maxLength": 2048 + }, + "description": "Where `POST authorize/` may send the browser after sign-in. Exact match, and `https://` only on a live application." + }, + "allowed_origins": { + "type": "array", + "maxItems": 50, + "items": { + "type": "string", + "maxLength": 2048 + }, + "description": "Origins allowed to embed or call the hosted pages and the browser SDK. Scheme, host and optional port only." + }, + "post_logout_redirect_uri": { + "type": "string", + "maxLength": 2048, + "description": "Where hosted sign-out sends the browser. Empty for none." + }, + "session_lifetime": { + "type": "integer", + "enum": [ + 86400, + 604800, + 2592000, + 7776000 + ] + }, + "idle_timeout": { + "type": "integer", + "enum": [ + 1800, + 7200, + 86400, + 604800 + ] + }, + "multiple_sessions": { + "type": "boolean", + "description": "`false` signs the person out of their other sessions at each new sign-in." + }, + "password_min_length": { + "type": "integer", + "enum": [ + 8, + 10, + 12, + 14 + ] + }, + "revoke_on_password_change": { + "type": "boolean" + }, + "allow_subaddresses": { + "type": "boolean", + "description": "Accept a `+` in the email's local part." + }, + "signup_policy": { + "type": "string", + "enum": [ + "anyone", + "invited", + "allowed_domains" + ] + }, + "allowed_email_domains": { + "type": "array", + "maxItems": 100, + "items": { + "type": "string", + "maxLength": 253 + }, + "description": "The domains `signup_policy: \"allowed_domains\"` accepts." + } + } + }, + "SetupConfigurationUpdate": { + "title": "Configuration update", + "type": "object", + "description": "Every field is optional; send only what changes. `enabled`, `publishable_key`, `methods` and `didit_test_credentials` are read-only and answer `follows_product` or `unknown_field`.", + "properties": { + "redirect_uris": { + "type": "array", + "maxItems": 50, + "items": { + "type": "string" + } + }, + "allowed_origins": { + "type": "array", + "maxItems": 50, + "items": { + "type": "string" + } + }, + "post_logout_redirect_uri": { + "type": "string" + }, + "session_lifetime": { + "type": "integer", + "enum": [ + 86400, + 604800, + 2592000, + 7776000 + ] + }, + "idle_timeout": { + "type": "integer", + "enum": [ + 1800, + 7200, + 86400, + 604800 + ] + }, + "multiple_sessions": { + "type": "boolean" + }, + "password_min_length": { + "type": "integer", + "enum": [ + 8, + 10, + 12, + 14 + ] + }, + "revoke_on_password_change": { + "type": "boolean" + }, + "allow_subaddresses": { + "type": "boolean" + }, + "signup_policy": { + "type": "string", + "enum": [ + "anyone", + "invited", + "allowed_domains" + ] + }, + "allowed_email_domains": { + "type": "array", + "maxItems": 100, + "items": { + "type": "string" + } + } + } + }, + "SetupCustomDomain": { + "title": "Custom domain", + "type": "object", + "required": [ + "domain", + "status", + "dns_record", + "certificate" + ], + "properties": { + "domain": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "pending", + "issuing", + "verified", + "active", + "failed" + ] + }, + "failure_reason": { + "type": "string" + }, + "dns_record": { + "type": "object", + "required": [ + "type", + "name", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "CNAME" + ] + }, + "name": { + "type": "string" + }, + "value": { + "type": "string", + "description": "The application's default host the domain points at." + } + } + }, + "certificate": { + "type": "object", + "properties": { + "status": { + "type": "string" + }, + "expires_at": { + "type": "string", + "nullable": true, + "format": "date-time" + } + } + }, + "dns_checked_at": { "type": "string", - "format": "uuid", - "example": "a1b2c3d4-5678-90ab-cdef-111111111111" + "nullable": true, + "format": "date-time" }, - "name": { + "verified_at": { "type": "string", - "example": "developer" + "nullable": true, + "format": "date-time" + }, + "activated_at": { + "type": "string", + "nullable": true, + "format": "date-time" } } }, - "ApplicationCredentialsSummary": { + "SetupDiditTestCredentials": { + "title": "Didit test apps", "type": "object", - "description": "Minimal application shape returned inline by `POST /programmatic/verify-email/`. Persist the `api_key` immediately.", + "description": "Which social providers Didit's own sandbox apps can serve for this application. Every value is `false` on a live application.", "properties": { - "uuid": { - "type": "string", - "format": "uuid", - "example": "b2c3d4e5-6789-01bc-defg-222222222222" - }, - "name": { - "type": "string", - "example": "developer" - }, - "client_id": { - "type": "string", - "example": "S9LIYGSoWNuGMLHsvEt9dQ" + "google": { + "type": "boolean" }, - "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" + "microsoft": { + "type": "boolean" }, - "data_location": { - "$ref": "#/components/schemas/ApplicationDataLocation" + "apple": { + "type": "boolean" }, - "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" + "github": { + "type": "boolean" } } }, - "Application": { + "SetupDomain": { + "title": "Hosted domain", "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).", + "required": [ + "host", + "default_origin", + "origin", + "hosted_url", + "issuer", + "passkey_rp_id", + "sandbox", + "custom_domains_available" + ], "properties": { - "uuid": { - "type": "string", - "format": "uuid", - "description": "Application UUID. Use as `{app_id}` in subsequent calls.", - "example": "b2c3d4e5-6789-01bc-defg-222222222222" + "host": { + "type": "string" }, - "name": { + "default_origin": { "type": "string", - "description": "Application display name shown in the Didit console.", - "example": "Acme Production App" + "format": "uri" }, - "client_id": { + "origin": { "type": "string", - "description": "Public client identifier, safe to embed in OAuth-style flows.", - "example": "S9LIYGSoWNuGMLHsvEt9dQ" + "format": "uri", + "description": "The custom domain once it is active, the default origin until then." }, - "api_key": { + "hosted_url": { "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" + "format": "uri" }, - "website_url": { + "issuer": { "type": "string", - "nullable": true, - "description": "Website or app URL associated with this application.", - "example": "https://acme.example" + "format": "uri" }, - "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" + "passkey_rp_id": { + "type": "string" }, - "privacy_url": { - "type": "string", - "nullable": true, - "description": "Privacy policy URL shown in the verification flow.", - "example": "https://acme.example/privacy" + "sandbox": { + "type": "boolean" }, - "description": { + "sandbox_origin": { "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" + "format": "uri", + "description": "A live application's sandbox origin, shown beside its own." }, - "data_location": { - "$ref": "#/components/schemas/ApplicationDataLocation" + "custom_domains_available": { + "type": "boolean", + "description": "Whether this deployment can serve a custom domain." }, - "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 - } - }, + "custom_domain": { + "type": "object", + "nullable": true, + "allOf": [ { - "product": "authentication", - "status": "disabled", - "modules": {} + "$ref": "#/components/schemas/SetupCustomDomain" } ] - }, - "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": { + "SetupDomainRequest": { + "title": "Custom domain", "type": "object", - "description": "All fields are optional. Sending an empty body creates an application with a default name, in the European Union.", + "required": [ + "domain" + ], "properties": { - "name": { - "type": "string", - "description": "Application display name. Defaults to `\" 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": { + "domain": { "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" + "maxLength": 253, + "description": "The domain to serve the hosted pages on. It must be a host under a zone: a CNAME cannot sit at an apex.", + "example": "login.example.com" } } }, - "ApplicationUpdateRequest": { + "SetupEmail": { + "title": "Rendered sign-in email", "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.", + "required": [ + "key", + "from", + "to", + "subject", + "html", + "enabled" + ], "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" - ] + "key": { + "type": "string" }, - "terms_url": { - "type": "string", - "description": "Terms of service URL shown in the verification flow." + "from": { + "type": "string" }, - "privacy_url": { + "to": { "type": "string", - "description": "Privacy policy URL shown in the verification flow." + "description": "The console member's address. Empty for a grant or a key." }, - "description": { - "type": "string", - "description": "Internal description for the application." + "subject": { + "type": "string" }, - "data_location": { - "$ref": "#/components/schemas/ApplicationDataLocation" + "html": { + "type": "string" }, - "initiate_login_uri": { - "$ref": "#/components/schemas/ApplicationInitiateLoginURI" + "enabled": { + "type": "boolean" } } }, - "ApplicationDataLocation": { - "type": "string", - "enum": [ - "eu", - "au", - "mx", - "ae", - "us" + "SetupEmailSummary": { + "title": "Sign-in email", + "type": "object", + "required": [ + "key", + "sent", + "enabled" ], - "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), `ae` (United Arab Emirates) and `us` (United States, N. Virginia) 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." - ] - } + "properties": { + "key": { + "type": "string", + "enum": [ + "code", + "magic", + "reset", + "device", + "invite", + "org", + "agent", + "agentoff" + ] + }, + "icon": { + "type": "string" }, - { + "sent": { + "type": "boolean", + "description": "Whether Authentication sends this email at all. `false` for `device`, `agent` and `agentoff`, which are listing placeholders." + }, + "enabled": { + "type": "boolean", + "description": "Whether this application sends it." + }, + "subject": { + "type": "string" + } + } + }, + "SetupEmails": { + "title": "Sign-in emails", + "type": "object", + "required": [ + "senders", + "emails", + "language" + ], + "properties": { + "senders": { "type": "object", + "description": "Read-only: they come from Customization.", "properties": { - "detail": { - "type": "string" + "email": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "email": { + "type": "string" + }, + "header": { + "type": "string" + }, + "own": { + "type": "boolean", + "description": "Whether the application sends from its own verified domain." + } + } + }, + "sms": { + "type": "object", + "properties": { + "name": { + "type": "string", + "nullable": true + } + } } - }, - "example": { - "detail": "An account with this email already exists." } }, - { + "emails": { "type": "array", "items": { - "type": "string" - }, - "example": [ - "Invalid or expired verification code." - ] + "$ref": "#/components/schemas/SetupEmailSummary" + } + }, + "language": { + "type": "string" } - ] + } }, - "AuthError": { + "SetupMethodResult": { + "title": "Sign-in method", "type": "object", - "description": "Authentication / authorization / not-found error envelope.", + "required": [ + "name", + "enabled" + ], "properties": { - "detail": { + "name": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "credential_source": { "type": "string", - "example": "Invalid access token" + "enum": [ + "own", + "didit_test" + ], + "description": "Returned only for social methods." + }, + "configured": { + "type": "boolean", + "description": "Whether the method can now sign anyone in." + }, + "client_id": { + "type": "string" + }, + "callback_uri": { + "type": "string" } } }, - "RateLimitError": { + "SetupMethodSummary": { + "title": "Sign-in method", "type": "object", - "description": "Rate-limit or progressive-lockout response. `wait` is the cooldown in seconds.", + "description": "One sign-in method. `credential_source` is `null` for a method that holds no social credentials, and `always_on` appears on the methods that are on for every application.", + "required": [ + "name", + "enabled", + "credential_source" + ], "properties": { - "detail": { + "name": { "type": "string", - "example": "Too many login attempts from this IP address. Please wait before trying again." + "enum": [ + "password", + "code", + "magic", + "phone", + "passkey", + "google", + "microsoft", + "apple", + "github", + "sso", + "wallet" + ] + }, + "enabled": { + "type": "boolean" + }, + "credential_source": { + "type": "string", + "nullable": true, + "enum": [ + "own", + "didit_test", + null + ], + "description": "`own` for the application's credentials, `didit_test` for Didit's sandbox app, `null` for a method that takes no social credentials." + }, + "always_on": { + "type": "boolean", + "description": "Present and `true` on a method no application can switch off." + }, + "available": { + "type": "boolean", + "description": "`wallet` only: whether Didit ID Wallet sign-in can be offered." + }, + "configured": { + "type": "boolean", + "description": "Whether the method has the credentials it needs to sign anyone in." + }, + "client_id": { + "type": "string", + "description": "The social client ID in use, or an empty string." + }, + "callback_uri": { + "type": "string", + "description": "The redirect URI to register with the provider; Didit's own broker for `didit_test`." } } }, - "PaginatedOrganizationList": { + "SetupMethodUpdate": { + "title": "Sign-in method update", "type": "object", "required": [ - "count", - "next", - "previous", - "results" + "enabled" ], + "description": "`enabled` is required. `credentials` belongs to a social method, `workflow_id` to `phone`, and `credential_source` to a social method; anywhere else they answer `not_supported`. An unknown field answers `unknown_field`.", "properties": { - "count": { - "type": "integer", - "description": "Total number of organizations." + "enabled": { + "type": "boolean" }, - "next": { + "credentials": { + "$ref": "#/components/schemas/SetupProviderCredentials" + }, + "credential_source": { "type": "string", - "format": "uri", - "nullable": true, - "description": "URL of the next page, or `null` on the last page." + "enum": [ + "own", + "didit_test" + ], + "description": "`didit_test` uses Didit's own sandbox app, and is refused on a live application with `sandbox_only`. Omitted: `own` when you send `credentials`, the stored source otherwise, and `didit_test` for a sandbox application's social method that was never configured." }, - "previous": { + "workflow_id": { "type": "string", - "format": "uri", - "nullable": true, - "description": "URL of the previous page, or `null` on the first page." + "format": "uuid", + "description": "`phone` only: the phone verification workflow whose codes it sends." + } + } + }, + "SetupNativeApps": { + "title": "Native apps", + "type": "object", + "required": [ + "ios_app_ids", + "android_apps" + ], + "properties": { + "ios_app_ids": { + "type": "array", + "maxItems": 10, + "items": { + "type": "string" + }, + "description": "Apple team ID and bundle identifier, as `webcredentials` names an app." }, - "results": { + "android_apps": { "type": "array", + "maxItems": 10, "items": { - "$ref": "#/components/schemas/Organization" + "$ref": "#/components/schemas/SetupAndroidApp" } } } }, - "PaginatedApplicationList": { + "SetupNativeAppsUpdate": { + "title": "Native apps update", "type": "object", "required": [ - "count", - "next", - "previous", - "results" + "ios_app_ids", + "android_apps" ], + "description": "Both lists are replaced. Duplicates are dropped.", "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." + "ios_app_ids": { + "type": "array", + "maxItems": 10, + "items": { + "type": "string" + } }, - "results": { + "android_apps": { "type": "array", + "maxItems": 10, "items": { - "$ref": "#/components/schemas/Application" + "$ref": "#/components/schemas/SetupAndroidApp" } } } }, - "ApplicationProduct": { + "SetupOnboarding": { + "title": "Onboarding progress", "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.", + "required": [ + "completed", + "ready", + "sign_in_ui", + "test_status" + ], "properties": { - "product": { + "completed": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "methods", + "redirects", + "import", + "test" + ] + } + }, + "ready": { + "type": "boolean", + "description": "Every setup step is done." + }, + "sign_in_ui": { "type": "string", "enum": [ - "identity", - "transactions", - "authentication" - ], - "description": "`identity` (Identity verification), `transactions` (Transaction monitoring) or `authentication` (Authentication).", - "example": "identity" + "hosted", + "own" + ] }, - "status": { + "test_sign_in": { + "type": "object", + "nullable": true, + "description": "Console session only: the sample sign-in the console shows, naming an end user. Left out for a grant or a key." + }, + "test_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" + "verified", + "skipped", + "not_started" + ] + } + } + }, + "SetupOnboardingUpdate": { + "title": "Onboarding update", + "type": "object", + "description": "At least one field is required; an empty body answers `{\"non_field_errors\": [\"empty_update\"]}`.", + "properties": { + "test_skipped": { + "type": "boolean" + }, + "import_skipped": { + "type": "boolean" + }, + "sign_in_ui": { + "type": "string", + "enum": [ + "hosted", + "own" + ] + } + } + }, + "SetupProtection": { + "title": "Bot protection", + "type": "object", + "required": [ + "enabled", + "breached_password_check", + "protections", + "period_days" + ], + "properties": { + "enabled": { + "type": "boolean" + }, + "breached_password_check": { + "type": "boolean" + }, + "protections": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SetupProtectionPolicy" + } + }, + "daily": { + "type": "array", + "description": "Detections per day, policy and action.", + "items": { + "type": "object", + "properties": { + "date": { + "type": "string", + "format": "date" + }, + "protection": { + "type": "string" + }, + "action": { + "type": "string" + }, + "count": { + "type": "integer" + } + } + } + }, + "challenges_daily": { + "type": "array", + "description": "Extra proofs asked for and how they ended.", + "items": { + "type": "object", + "properties": { + "date": { + "type": "string", + "format": "date" + }, + "passed": { + "type": "integer" + }, + "failed": { + "type": "integer" + } + } + } + }, + "period_days": { + "type": "integer", + "enum": [ + 14 + ] + }, + "calendar_month": { + "type": "object", + "description": "This calendar month against the previous one.", + "properties": { + "start": { + "type": "string", + "format": "date-time" + }, + "as_of": { + "type": "string", + "format": "date-time" + }, + "previous_start": { + "type": "string", + "format": "date-time" + }, + "previous_end": { + "type": "string", + "format": "date-time" + }, + "protections": { + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "counts": { + "type": "object", + "properties": { + "log": { + "type": "integer" + }, + "challenge": { + "type": "integer" + }, + "block": { + "type": "integer" + } + } + }, + "previous_counts": { + "type": "object", + "properties": { + "log": { + "type": "integer" + }, + "challenge": { + "type": "integer" + }, + "block": { + "type": "integer" + } + } + }, + "counts_delta": { + "type": "object", + "properties": { + "log": { + "type": "integer" + }, + "challenge": { + "type": "integer" + }, + "block": { + "type": "integer" + } + } + }, + "accounts": { + "type": "integer" + }, + "previous_accounts": { + "type": "integer" + }, + "accounts_delta": { + "type": "integer" + } + } + } + }, + "challenges": { + "type": "object", + "properties": { + "passed": { + "type": "integer" + }, + "failed": { + "type": "integer" + }, + "previous_passed": { + "type": "integer" + }, + "previous_failed": { + "type": "integer" + } + } + } + } }, - "modules": { + "attack_mode": { "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": [ + "active" + ], + "properties": { + "active": { + "type": "boolean" + }, + "started_at": { + "type": "string", + "nullable": true, + "format": "date-time" + }, + "expires_at": { + "type": "string", + "nullable": true, + "format": "date-time" + } } + }, + "selfie_available": { + "type": "boolean" } - }, - "required": [ - "product", - "status", - "modules" - ] + } }, - "EmailUndeliverableError": { + "SetupProtectionPolicy": { + "title": "Protection policy", "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" + "key", + "mode", + "available", + "counts", + "accounts" ], "properties": { - "detail": { - "type": "string", - "description": "Human-readable message.", - "example": "This email can't receive messages. Please use a different email address." - }, - "code": { + "key": { "type": "string", "enum": [ - "email_undeliverable" - ], - "description": "Always `email_undeliverable`." + "bots", + "stuffing", + "brute", + "disposable", + "vpn", + "travel" + ] }, - "reason": { + "mode": { "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)." + "off", + "log", + "challenge", + "block" + ] }, - "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" + "available": { + "type": "boolean", + "description": "`vpn` and `travel` need the IP lookup; `false` when it cannot be attempted." + }, + "counts": { + "type": "object", + "properties": { + "log": { + "type": "integer" + }, + "challenge": { + "type": "integer" + }, + "block": { + "type": "integer" + } + } + }, + "accounts": { + "type": "integer", + "description": "How many people the policy matched in the last 14 days." } } }, - "RecoveryHoldError": { + "SetupProtectionUpdate": { + "title": "Bot protection update", "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" - ], + "description": "Every field is optional. The policies you send are merged into the stored ones; an unknown policy answers `unknown_protection`.", "properties": { - "detail": { - "type": "string", - "example": "This action is on hold because you recovered your account." + "enabled": { + "type": "boolean" }, - "code": { - "type": "string", - "enum": [ - "recovery_hold" - ], - "example": "recovery_hold" + "breached_password_check": { + "type": "boolean" }, - "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" + "policies": { + "type": "object", + "additionalProperties": { + "type": "string", + "enum": [ + "off", + "log", + "challenge", + "block" + ] + }, + "description": "A mode per policy: `bots`, `stuffing`, `brute`, `disposable`, `vpn` and `travel`." } } }, - "SsoRequiredError": { + "SetupProviderCredentials": { + "title": "Social app credentials", "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" + "client_id", + "client_secret" ], + "description": "Your own OAuth app's credentials. The secret is write-only: no response returns it.", "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": { + "client_id": { "type": "string", - "example": "acme-corp" + "maxLength": 255 }, - "sso_url": { + "client_secret": { "type": "string", - "description": "Path of the organization's SSO sign-in page, relative to the console.", - "example": "/sso/acme-corp" + "maxLength": 8192, + "writeOnly": true } } }, - "RecoverySetupRequiredError": { + "SetupSettings": { + "title": "Application settings", "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 + "sign_in_ui": { + "type": "string", + "enum": [ + "hosted", + "own" + ] }, - "setup_link_sent": { - "type": "boolean", - "example": true + "agent_humans_only": { + "type": "boolean" }, - "message": { - "type": "string", - "example": "You recovered your account. Open the link we emailed you to set up a new sign-in method." + "agents_enabled": { + "type": "boolean" }, - "code": { + "agent_scopes": { + "type": "array", + "maxItems": 2, + "items": { + "type": "string", + "enum": [ + "read", + "act" + ] + } + }, + "agent_lifetime": { + "type": "integer", + "enum": [ + 86400, + 604800, + 2592000 + ] + }, + "agent_idle_timeout": { + "type": "integer", + "enum": [ + 1800, + 7200, + 86400 + ] + }, + "agent_approval": { "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": { + "passkey", + "sign_in" + ] + }, + "organizations_enabled": { + "type": "boolean" + }, + "mfa_policy": { "type": "string", - "example": "We couldn't confirm that this application is unused. Try again in a moment." + "enum": [ + "optional", + "everyone", + "organization_admins" + ] }, - "code": { + "default_member_role": { "type": "string", - "example": "data_location_check_unavailable" + "enum": [ + "admin", + "member", + "billing" + ] + }, + "webhook_events_disabled": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "auth.sign_in", + "auth.sign_in_failed", + "auth.new_device", + "auth.account_locked", + "auth.two_factor_changed", + "auth.session_revoked", + "auth.agent_access_approved", + "auth.agent_access_revoked" + ] + } } } }, - "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": { + "SetupSettingsUpdate": { + "title": "Application settings update", "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.", + "description": "Every field is optional. Changing the application’s `agent_humans_only` setting requires an owner or admin. Enabling it also requires an enrolled passkey. A named key receives 403 `owner_or_admin_required`.", "properties": { - "action": { + "sign_in_ui": { "type": "string", "enum": [ - "block", - "unblock", - "unlock", - "revoke_sessions", - "send_password_reset", - "reset_mfa", - "send_sign_in_link" - ], - "description": "Identity action to perform." + "hosted", + "own" + ] }, - "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": { + "agent_humans_only": { + "type": "boolean" + }, + "agents_enabled": { + "type": "boolean" + }, + "agent_scopes": { + "type": "array", + "maxItems": 2, + "items": { + "type": "string", + "enum": [ + "read", + "act" + ] + } + }, + "agent_lifetime": { + "type": "integer", + "enum": [ + 86400, + 604800, + 2592000 + ] + }, + "agent_idle_timeout": { + "type": "integer", + "enum": [ + 1800, + 7200, + 86400 + ] + }, + "agent_approval": { "type": "string", "enum": [ - "block", - "unblock", - "unlock", - "revoke_sessions", - "reset_mfa", - "send_sign_in_link" - ], - "description": "Action applied to each identity." + "passkey", + "sign_in" + ] + }, + "organizations_enabled": { + "type": "boolean" + }, + "mfa_policy": { + "type": "string", + "enum": [ + "optional", + "everyone", + "organization_admins" + ] }, - "ids": { + "default_member_role": { + "type": "string", + "enum": [ + "admin", + "member", + "billing" + ] + }, + "webhook_events_disabled": { "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." + "type": "string" + } } - }, - "example": { - "action": "reset_mfa", - "ids": [ - "00000000-0000-4000-8000-000000000001" - ] } }, - "ConsoleMFAResetResult": { + "SetupVerified": { + "title": "Verified sign-in", "type": "object", "required": [ - "status", - "requires_sign_in_link" + "signup_level", + "rules", + "claims", + "available_claims", + "workflows", + "wallet", + "since" ], - "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": { + "signup_level": { "type": "string", "enum": [ - "applied" + "none", + "liveness", + "full_id" ] }, - "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." + "signup": { + "type": "object", + "properties": { + "checks": { + "type": "integer" + }, + "passed": { + "type": "integer" + }, + "failed": { + "type": "integer" + } + } + }, + "rules": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SetupVerifiedRule" + } + }, + "claims": { + "type": "array", + "description": "The claims your tokens carry once the person is verified.", + "items": { + "type": "string", + "enum": [ + "over_18", + "over_21", + "given_name", + "family_name", + "birthdate", + "nationality", + "country", + "document_verified", + "liveness" + ] + } + }, + "available_claims": { + "type": "array", + "items": { + "type": "string" + } + }, + "workflows": { + "type": "object", + "description": "The verification workflow behind each method; `null` until one is created.", + "properties": { + "liveness": { + "type": "string", + "nullable": true, + "format": "uuid" + }, + "selfie": { + "type": "string", + "nullable": true, + "format": "uuid" + }, + "full_id": { + "type": "string", + "nullable": true, + "format": "uuid" + } + } + }, + "wallet": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "sign_ins": { + "type": "integer" + }, + "people": { + "type": "integer" + } + } + }, + "since": { + "type": "string", + "format": "date-time" } - }, - "example": { - "status": "applied", - "requires_sign_in_link": true } }, - "ConsoleSignInLinkResult": { + "SetupVerifiedRule": { + "title": "Step-up rule", "type": "object", "required": [ - "status", - "expires_in" + "rule" ], - "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": { + "rule": { "type": "string", "enum": [ - "sent" + "payout", + "bank", + "contact", + "device", + "sign_in" ] }, - "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" + "enabled": { + "type": "boolean" }, - "status": { + "method": { "type": "string", "enum": [ - "applied", - "sent", - "not_found", - "invalid_request" + "liveness", + "selfie", + "full_id" ] }, - "requires_sign_in_link": { - "type": "boolean", - "description": "Present only for a successful reset_mfa." + "threshold": { + "type": "string", + "description": "`payout` only: the amount above which the rule applies, as a decimal string.", + "example": "500.00" }, - "expires_in": { + "currency": { + "type": "string", + "description": "`payout` only: the ISO 4217 currency of `threshold`.", + "example": "EUR" + }, + "checks": { "type": "integer", - "enum": [ - 900 - ], - "description": "Present only for a successful send_sign_in_link." + "description": "Checks this month." }, - "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." + "passed": { + "type": "integer" + }, + "failed": { + "type": "integer" } } }, - "ConsoleBulkIdentityActionResponse": { + "SetupVerifiedUpdate": { + "title": "Verified sign-in update", "type": "object", - "required": [ - "results" - ], + "description": "Every field is optional. Each supplied rule updates only the fields you send for its kind. Omitted rules keep their settings. Two rules of the same kind answer `duplicate_rule`, and `threshold` or `currency` on a rule other than `payout` answer `not_supported`.", "properties": { - "results": { + "signup_level": { + "type": "string", + "enum": [ + "none", + "liveness", + "full_id" + ] + }, + "rules": { "type": "array", "items": { - "$ref": "#/components/schemas/ConsoleBulkIdentityActionResult" + "title": "Step-up rule update", + "type": "object", + "required": [ + "rule" + ], + "properties": { + "rule": { + "type": "string", + "enum": [ + "payout", + "bank", + "contact", + "device", + "sign_in" + ] + }, + "enabled": { + "type": "boolean" + }, + "method": { + "type": "string", + "enum": [ + "liveness", + "selfie", + "full_id" + ] + }, + "threshold": { + "type": "string" + }, + "currency": { + "type": "string", + "pattern": "^[A-Z]{3}$" + } + } + } + }, + "claims": { + "type": "array", + "items": { + "type": "string" + } + }, + "workflows": { + "type": "object", + "properties": { + "liveness": { + "type": "string", + "nullable": true, + "format": "uuid" + }, + "selfie": { + "type": "string", + "nullable": true, + "format": "uuid" + }, + "full_id": { + "type": "string", + "nullable": true, + "format": "uuid" + } + } + } + } + } + }, + "responses": { + "RateLimited": { + "description": "Too many requests from this IP address for this endpoint, or, on a `POST` or `DELETE`, a bot protection bucket is empty. Nothing ran: wait `Retry-After` seconds, then retry.", + "headers": { + "Retry-After": { + "description": "Seconds to wait before retrying.", + "schema": { + "type": "integer", + "example": 60 + } + }, + "Cache-Control": { + "description": "Always `no-store`: never cache this response.", + "schema": { + "type": "string", + "example": "no-store" + } + }, + "Pragma": { + "description": "Always `no-cache`.", + "schema": { + "type": "string", + "example": "no-cache" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Detail" }, - "description": "One result per requested identity, in request order. Check each status even when the HTTP response is 200." + "examples": { + "RateLimited": { + "summary": "Endpoint limit", + "value": { + "detail": "Too many requests from this IP address. Please wait before trying again. Expected available in 60 seconds." + } + }, + "BotProtection": { + "summary": "Bot protection limit (POST and DELETE)", + "value": { + "detail": "rate_limited Expected available in 2 seconds." + } + } + } + } + } + }, + "SetupConflict": { + "description": "The application already holds a custom domain that is claimed, verified or active. Remove it before claiming another. With a management grant or a named key, `{\"detail\": \"product_disabled\"}` means Authentication is turned off for the application; a person turns it on in the console.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FieldErrors" + }, + "examples": { + "CustomDomainExists": { + "summary": "A custom domain is already claimed", + "value": { + "domain": "custom_domain_exists" + } + }, + "ProductDisabled": { + "summary": "Authentication is turned off for the application", + "value": { + "detail": "product_disabled" + } + } + } + } + } + }, + "SetupNotAuthenticated": { + "description": "The request carried no credential. Send a management grant as `Authorization: Bearer `, or a named key as `x-api-key`.", + "headers": { + "WWW-Authenticate": { + "description": "`Bearer`.", + "schema": { + "type": "string", + "example": "Bearer" + } } }, - "example": { - "results": [ - { - "id": "00000000-0000-4000-8000-000000000001", - "status": "applied", - "requires_sign_in_link": true + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Detail" + }, + "examples": { + "NoCredential": { + "summary": "No credential", + "value": { + "detail": "Authentication credentials were not provided." + } + } } - ] + } + } + }, + "SetupNotFound": { + "description": "The requested setup resource could not be found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Detail" + } + } + } + }, + "SetupPermissionDenied": { + "description": "The credential cannot set up this application: a grant without `didit:management`, a grant approved for another organization, a key without the `authentication` scope, a read-only key on a write route, a key of another application, the application's primary secret, a `/programmatic/login` token, a key outside its IP allowlist or past its expiry, or a person whose role in the organization is not allowed. The body is `{\"detail\": \"\"}`; a named key's own limit answers with its reason, such as `ip_not_allowed`. A console session that changes the setup while Authentication is turned off gets `authentication_product_disabled`; a management grant or a named key gets `409 product_disabled` instead.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Detail" + }, + "examples": { + "NotPermitted": { + "summary": "A credential that cannot configure this application", + "value": { + "detail": "You do not have permission to perform this action." + } + }, + "OwnerOrAdmin": { + "summary": "A setting only a person can change", + "value": { + "detail": "owner_or_admin_required" + } + }, + "ProductDisabled": { + "summary": "A console session while Authentication is turned off", + "value": { + "detail": "authentication_product_disabled" + } + } + } + } + } + }, + "SetupProductDisabled": { + "description": "Authentication is turned off for this application, so a management grant or a named API key cannot change its setup (`{\"detail\": \"product_disabled\"}`). Nothing is written. Reads still answer, and the root `GET` shows `enabled: false`. No setup call turns the product on: a person turns Authentication on for the application in the console.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Detail" + }, + "examples": { + "ProductDisabled": { + "summary": "Authentication is turned off for the application", + "value": { + "detail": "product_disabled" + } + } + } + } + } + }, + "SetupUnavailable": { + "description": "The edge that serves custom domains is briefly unavailable, or has not finished removing the previous one. The domain is unchanged; retry with backoff.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FieldErrors" + }, + "examples": { + "EdgeUnavailable": { + "summary": "The edge is unavailable", + "value": { + "domain": "edge_deletion_pending" + } + } + } + } + } + }, + "SetupValidation": { + "description": "A field failed validation, in the body shape of `FieldErrors`. A value is a code (`sandbox_only`, `unavailable`, `not_supported`, `required`, `always_on`, `method_unavailable`, `unknown_field`, `invalid_domain`, `follows_product`) or a list of messages.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FieldErrors" + }, + "examples": { + "SandboxOnly": { + "summary": "Didit's test app on a live application", + "value": { + "credential_source": "sandbox_only" + } + }, + "Unavailable": { + "summary": "A test app this application cannot use", + "value": { + "credential_source": "unavailable" + } + }, + "NotSupported": { + "summary": "Credentials on a method that does not take them", + "value": { + "credentials": "not_supported" + } + }, + "SecretRequired": { + "summary": "A social method switched on without credentials", + "value": { + "credentials": "required" + } + } + } + } } } } diff --git a/openapi/verification.json b/openapi/verification.json index 165a7d8..312ef4e 100644 --- a/openapi/verification.json +++ b/openapi/verification.json @@ -87086,7 +87086,8 @@ "additionalProperties": true, "properties": { "stage": { - "type": "string" + "type": "string", + "description": "`none` (not set up; free reports still run while `free_reports.remaining` is above 0), `shadow` or `live`." }, "last_report_at": { "type": "string", @@ -87111,6 +87112,21 @@ }, "preparing": { "type": "integer" + }, + "free_reports": { + "type": "object", + "description": "The organization's free reports: the first reports run with no setup, on any plan, and are never charged.", + "properties": { + "limit": { + "type": "integer" + }, + "used": { + "type": "integer" + }, + "remaining": { + "type": "integer" + } + } } } } @@ -99436,6 +99452,109 @@ } ] } + }, + "/v3/investigator/offer/": { + "get": { + "operationId": "investigator_offer", + "summary": "Investigator agent offer", + "description": "Whether to offer the Investigator agent to this application: its decisions taken by hand in the last 30 days, the average handling time, the people who stopped halfway and whether follow-ups are on. Read from the daily analytics, never from a scan of sessions. `show` is true when 20 or more decisions were taken by hand and the agent is not set up, or when follow-ups are off and 50 or more people stopped halfway.", + "tags": [ + "Investigator" + ], + "security": [ + { + "ApiKeyAuth": [] + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "show": { + "type": "boolean" + }, + "manual_decisions_30d": { + "type": "integer" + }, + "avg_handling_seconds": { + "type": "integer", + "nullable": true + }, + "stopped_halfway_30d": { + "type": "integer" + }, + "stage": { + "type": "string", + "enum": [ + "none", + "shadow", + "live" + ] + }, + "followups_on": { + "type": "boolean" + } + } + } + } + } + }, + "401": { + "description": "Missing or invalid API key." + }, + "403": { + "description": "The key lacks read access to the application settings." + } + }, + "parameters": [], + "x-didit-sdk": { + "resource": "investigator", + "method": "retrieve_offer", + "auth": "api_key", + "server": true + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.investigator.retrieve_offer()\nprint(result)" + }, + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.investigator.retrieveOffer();\nconsole.log(result);" + }, + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.Investigator.RetrieveOffer(ctx)\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)" + }, + { + "lang": "java", + "label": "Java", + "source": "import me.didit.Didit;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.investigator().retrieveOffer();\nSystem.out.println(result);" + }, + { + "lang": "php", + "label": "PHP", + "source": "investigator->retrieveOffer();\nprint_r($result->toArray());" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.investigator.retrieve_offer\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.Investigator.RetrieveOfferAsync();\nConsole.WriteLine(JsonSerializer.Serialize(result));" + } + ] + } } }, "components": { @@ -132090,6 +132209,7 @@ "stage": { "type": "string", "enum": [ + "none", "shadow", "live" ] @@ -132145,6 +132265,14 @@ "type": "string", "format": "date-time", "nullable": true + }, + "free_report": { + "type": "boolean", + "description": "True for one of the organization's free reports: a review run at stage `none`, with no setup, never charged." + }, + "example": { + "type": "boolean", + "description": "True for an example report shown on a sandbox application. Example reports are read only and never cost anything." } } }, diff --git a/src/didit/resources/__init__.py b/src/didit/resources/__init__.py index 9867731..57e1ef9 100644 --- a/src/didit/resources/__init__.py +++ b/src/didit/resources/__init__.py @@ -15,6 +15,7 @@ from didit.resources.aml import Aml, AsyncAml from didit.resources.aml_monitoring import AmlMonitoring, AsyncAmlMonitoring from didit.resources.analytics import Analytics, AsyncAnalytics + from didit.resources.authentication_setup import AsyncAuthenticationSetup, AuthenticationSetup from didit.resources.bank import AsyncBank, Bank from didit.resources.billing import AsyncBilling, Billing from didit.resources.biometric_templates import AsyncBiometricTemplates, BiometricTemplates @@ -96,6 +97,12 @@ def analytics(self) -> Analytics: return Analytics(self) + @cached_property + def authentication_setup(self) -> AuthenticationSetup: + from didit.resources.authentication_setup import AuthenticationSetup + + return AuthenticationSetup(self) + @cached_property def bank(self) -> Bank: from didit.resources.bank import Bank @@ -364,6 +371,12 @@ def analytics(self) -> AsyncAnalytics: return AsyncAnalytics(self) + @cached_property + def authentication_setup(self) -> AsyncAuthenticationSetup: + from didit.resources.authentication_setup import AsyncAuthenticationSetup + + return AsyncAuthenticationSetup(self) + @cached_property def bank(self) -> AsyncBank: from didit.resources.bank import AsyncBank diff --git a/src/didit/resources/authentication_setup.py b/src/didit/resources/authentication_setup.py new file mode 100644 index 0000000..4916a49 --- /dev/null +++ b/src/didit/resources/authentication_setup.py @@ -0,0 +1,2261 @@ +# Code generated by codegen from openapi/*.json. DO NOT EDIT. +"""The ``authentication_setup`` resource.""" + +from __future__ import annotations + +from functools import cached_property +from typing import Literal, Mapping, Sequence, cast + +import httpx + +from didit._resource import AsyncAPIResource, SyncAPIResource +from didit._response import ( + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, + to_raw_response_wrapper, + to_streamed_response_wrapper, +) +from didit._types import NOT_GIVEN, Body, Headers, NotGiven, Query +from didit.types.authentication_setup.update_verified_params import ( + AuthenticationSetupUpdateVerifiedParamsRules, + AuthenticationSetupUpdateVerifiedParamsWorkflows, +) +from didit.types.components.setup_android_app import SetupAndroidAppParam +from didit.types.components.setup_branding import SetupBranding +from didit.types.components.setup_branding_texts import SetupBrandingTextsParam +from didit.types.components.setup_configuration import SetupConfiguration +from didit.types.components.setup_domain import SetupDomain +from didit.types.components.setup_email import SetupEmail +from didit.types.components.setup_emails import SetupEmails +from didit.types.components.setup_method_result import SetupMethodResult +from didit.types.components.setup_native_apps import SetupNativeApps +from didit.types.components.setup_onboarding import SetupOnboarding +from didit.types.components.setup_protection import SetupProtection +from didit.types.components.setup_provider_credentials import SetupProviderCredentials +from didit.types.components.setup_settings import SetupSettings +from didit.types.components.setup_verified import SetupVerified + +__all__ = [ + "AuthenticationSetup", + "AsyncAuthenticationSetup", + "AuthenticationSetupWithRawResponse", + "AsyncAuthenticationSetupWithRawResponse", + "AuthenticationSetupWithStreamingResponse", + "AsyncAuthenticationSetupWithStreamingResponse", +] + + +class AuthenticationSetup(SyncAPIResource): + """The ``authentication_setup`` resource of the Didit API. + + Methods: ``activate_domain``, ``get_branding``, ``get_configuration``, ``get_domain``, ``get_email``, ``get_emails``, ``get_native_apps``, ``get_onboarding``, ``get_protection``, ``get_settings``, ``get_verified``, ``remove_domain``, ``set_domain``, ``set_method``, ``update_branding``, ``update_configuration``, ``update_native_apps``, ``update_onboarding``, ``update_protection``, ``update_settings``, ``update_verified``, ``verify_domain``. + """ + + @cached_property + def with_raw_response(self) -> AuthenticationSetupWithRawResponse: + """Every method of this resource, returning the raw HTTP response.""" + return AuthenticationSetupWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AuthenticationSetupWithStreamingResponse: + """Every method of this resource, returning the HTTP response before reading its body.""" + return AuthenticationSetupWithStreamingResponse(self) + + def get_configuration( + self, + organization_id: str, + application_id: str, + *, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SetupConfiguration: + """Get the Authentication setup. + + Returns the application's Authentication configuration and every sign-in method with its `enabled` state and `credential_source`, which is how an agent verifies the setup it made. Disabled methods are listed too, and `credential_source` is `null` for a method that holds no social credentials. The top-level `enabled` is `false` when Authentication is disabled for the application. + + ``GET /organizations/{organization_id}/applications/{application_id}/authentication/`` + + Args: + organization_id: UUID of the organization that owns the application. + application_id: UUID of the application: live or sandbox. A named key configures its own application only. + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "SetupConfiguration", + self._client.request( + "get", + "/organizations/{organization_id}/applications/{application_id}/authentication/", + cast_to=SetupConfiguration, + path_params={"organization_id": organization_id, "application_id": application_id}, + auth="api_key", + api="account", + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + + def update_configuration( + self, + organization_id: str, + application_id: str, + *, + redirect_uris: Sequence[str] | NotGiven = NOT_GIVEN, + allowed_origins: Sequence[str] | NotGiven = NOT_GIVEN, + post_logout_redirect_uri: str | NotGiven = NOT_GIVEN, + session_lifetime: int | NotGiven = NOT_GIVEN, + idle_timeout: int | NotGiven = NOT_GIVEN, + multiple_sessions: bool | NotGiven = NOT_GIVEN, + password_min_length: int | NotGiven = NOT_GIVEN, + revoke_on_password_change: bool | NotGiven = NOT_GIVEN, + allow_subaddresses: bool | NotGiven = NOT_GIVEN, + signup_policy: Literal["anyone", "invited", "allowed_domains"] | str | NotGiven = NOT_GIVEN, + allowed_email_domains: Sequence[str] | NotGiven = NOT_GIVEN, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SetupConfiguration: + """Update the Authentication setup. + + Changes the settings in the body: callback URLs, allowed origins, session lifetime, idle timeout, password rules and the sign-up policy. Send only the fields you change. `enabled` is refused with `{"enabled": "follows_product"}` because the product's state decides it, and an unknown field with `{"": "unknown_field"}`. + + ``PATCH /organizations/{organization_id}/applications/{application_id}/authentication/`` + + Args: + organization_id: UUID of the organization that owns the application. + application_id: UUID of the application: live or sandbox. A named key configures its own application only. + redirect_uris + allowed_origins + post_logout_redirect_uri + session_lifetime + idle_timeout + multiple_sessions + password_min_length + revoke_on_password_change + allow_subaddresses + signup_policy + allowed_email_domains + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "SetupConfiguration", + self._client.request( + "patch", + "/organizations/{organization_id}/applications/{application_id}/authentication/", + cast_to=SetupConfiguration, + path_params={"organization_id": organization_id, "application_id": application_id}, + auth="api_key", + api="account", + body={ + "redirect_uris": redirect_uris, + "allowed_origins": allowed_origins, + "post_logout_redirect_uri": post_logout_redirect_uri, + "session_lifetime": session_lifetime, + "idle_timeout": idle_timeout, + "multiple_sessions": multiple_sessions, + "password_min_length": password_min_length, + "revoke_on_password_change": revoke_on_password_change, + "allow_subaddresses": allow_subaddresses, + "signup_policy": signup_policy, + "allowed_email_domains": allowed_email_domains, + }, + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + + def set_method( + self, + organization_id: str, + application_id: str, + name: str, + *, + enabled: bool, + credentials: SetupProviderCredentials | NotGiven = NOT_GIVEN, + credential_source: Literal["own", "didit_test"] | str | NotGiven = NOT_GIVEN, + workflow_id: str | NotGiven = NOT_GIVEN, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SetupMethodResult: + """Enable or disable a sign-in method. + + Enables or disables one method; `enabled` is required. A social method (`google`, `microsoft`, `apple`, `github`) takes either your own `credentials` or `credential_source: "didit_test"`, which uses Didit's own sandbox app and is refused on a live application with `{"credential_source": "sandbox_only"}`; a test app the application cannot use answers `{"credential_source": "unavailable"}`. `phone` takes the `workflow_id` of a phone verification workflow. `credentials`, `workflow_id` or `credential_source` on a method that does not use them answer `not_supported`, turning off a method that is always on answers `{"enabled": "always_on"}`, and an unknown method answers `{"name": "method_unavailable"}`. + + ``PUT /organizations/{organization_id}/applications/{application_id}/authentication/methods/{name}/`` + + Args: + organization_id: UUID of the organization that owns the application. + application_id: UUID of the application: live or sandbox. A named key configures its own application only. + name: The method: `password`, `code`, `magic`, `phone`, `passkey`, `google`, `microsoft`, `apple`, `github`, `sso` or `wallet`. + enabled + credentials: Your own OAuth app's credentials. The secret is write-only: no response returns it. + credential_source: `didit_test` uses Didit's own sandbox app, and is refused on a live application with `sandbox_only`. Omitted: `own` when you send `credentials`, the stored source otherwise, and `didit_test` for a sandbox application's social method that was never configured. + workflow_id: `phone` only: the phone verification workflow whose codes it sends. + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "SetupMethodResult", + self._client.request( + "put", + "/organizations/{organization_id}/applications/{application_id}/authentication/methods/{name}/", + cast_to=SetupMethodResult, + path_params={ + "organization_id": organization_id, + "application_id": application_id, + "name": name, + }, + auth="api_key", + api="account", + body={ + "enabled": enabled, + "credentials": credentials, + "credential_source": credential_source, + "workflow_id": workflow_id, + }, + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + + def get_onboarding( + self, + organization_id: str, + application_id: str, + *, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SetupOnboarding: + """Get the onboarding progress. + + Returns which setup steps are done, whether the application is ready and how people sign in. A grant or a key gets progress only: the console session's sample sign-in details, which name an end user, are left out. + + ``GET /organizations/{organization_id}/applications/{application_id}/authentication/onboarding/`` + + Args: + organization_id: UUID of the organization that owns the application. + application_id: UUID of the application: live or sandbox. A named key configures its own application only. + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "SetupOnboarding", + self._client.request( + "get", + "/organizations/{organization_id}/applications/{application_id}/authentication/onboarding/", + cast_to=SetupOnboarding, + path_params={"organization_id": organization_id, "application_id": application_id}, + auth="api_key", + api="account", + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + + def update_onboarding( + self, + organization_id: str, + application_id: str, + *, + test_skipped: bool | NotGiven = NOT_GIVEN, + import_skipped: bool | NotGiven = NOT_GIVEN, + sign_in_ui: Literal["hosted", "own"] | str | NotGiven = NOT_GIVEN, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SetupOnboarding: + """Update the onboarding progress. + + Records a setup step: skip the test sign-in, skip the user import, or choose the hosted sign-in page or your own screens. An empty body answers `{"non_field_errors": ["empty_update"]}`. + + ``PATCH /organizations/{organization_id}/applications/{application_id}/authentication/onboarding/`` + + Args: + organization_id: UUID of the organization that owns the application. + application_id: UUID of the application: live or sandbox. A named key configures its own application only. + test_skipped + import_skipped + sign_in_ui + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "SetupOnboarding", + self._client.request( + "patch", + "/organizations/{organization_id}/applications/{application_id}/authentication/onboarding/", + cast_to=SetupOnboarding, + path_params={"organization_id": organization_id, "application_id": application_id}, + auth="api_key", + api="account", + body={ + "test_skipped": test_skipped, + "import_skipped": import_skipped, + "sign_in_ui": sign_in_ui, + }, + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + + def get_settings( + self, + organization_id: str, + application_id: str, + *, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SetupSettings: + """Get the application settings. + + Returns agent access, organizations, the MFA policy, the default member role and the webhook events switched off. + + ``GET /organizations/{organization_id}/applications/{application_id}/authentication/settings/`` + + Args: + organization_id: UUID of the organization that owns the application. + application_id: UUID of the application: live or sandbox. A named key configures its own application only. + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "SetupSettings", + self._client.request( + "get", + "/organizations/{organization_id}/applications/{application_id}/authentication/settings/", + cast_to=SetupSettings, + path_params={"organization_id": organization_id, "application_id": application_id}, + auth="api_key", + api="account", + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + + def update_settings( + self, + organization_id: str, + application_id: str, + *, + sign_in_ui: Literal["hosted", "own"] | str | NotGiven = NOT_GIVEN, + agent_humans_only: bool | NotGiven = NOT_GIVEN, + agents_enabled: bool | NotGiven = NOT_GIVEN, + agent_scopes: Sequence[Literal["read", "act"] | str] | NotGiven = NOT_GIVEN, + agent_lifetime: int | NotGiven = NOT_GIVEN, + agent_idle_timeout: int | NotGiven = NOT_GIVEN, + agent_approval: Literal["passkey", "sign_in"] | str | NotGiven = NOT_GIVEN, + organizations_enabled: bool | NotGiven = NOT_GIVEN, + mfa_policy: Literal["optional", "everyone", "organization_admins"] + | str + | NotGiven = NOT_GIVEN, + default_member_role: Literal["admin", "member", "billing"] | str | NotGiven = NOT_GIVEN, + webhook_events_disabled: Sequence[str] | NotGiven = NOT_GIVEN, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SetupSettings: + """Update the application settings. + + Changes the settings in the body. `agent_humans_only` needs a person: a named API key answers 403 `owner_or_admin_required`, and turning it on needs an owner or admin with an enrolled passkey. + + ``PATCH /organizations/{organization_id}/applications/{application_id}/authentication/settings/`` + + Args: + organization_id: UUID of the organization that owns the application. + application_id: UUID of the application: live or sandbox. A named key configures its own application only. + sign_in_ui + agent_humans_only + agents_enabled + agent_scopes + agent_lifetime + agent_idle_timeout + agent_approval + organizations_enabled + mfa_policy + default_member_role + webhook_events_disabled + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "SetupSettings", + self._client.request( + "patch", + "/organizations/{organization_id}/applications/{application_id}/authentication/settings/", + cast_to=SetupSettings, + path_params={"organization_id": organization_id, "application_id": application_id}, + auth="api_key", + api="account", + body={ + "sign_in_ui": sign_in_ui, + "agent_humans_only": agent_humans_only, + "agents_enabled": agents_enabled, + "agent_scopes": agent_scopes, + "agent_lifetime": agent_lifetime, + "agent_idle_timeout": agent_idle_timeout, + "agent_approval": agent_approval, + "organizations_enabled": organizations_enabled, + "mfa_policy": mfa_policy, + "default_member_role": default_member_role, + "webhook_events_disabled": webhook_events_disabled, + }, + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + + def get_branding( + self, + organization_id: str, + application_id: str, + *, + language: str | NotGiven = NOT_GIVEN, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SetupBranding: + """Get the hosted pages' branding. + + Returns the application's brand as the hosted pages show it, the texts set per language, the legal links and the hosted URL. + + ``GET /organizations/{organization_id}/applications/{application_id}/authentication/branding/`` + + Args: + organization_id: UUID of the organization that owns the application. + application_id: UUID of the application: live or sandbox. A named key configures its own application only. + language: Language of the default texts and the previews: an unsupported code falls back to `en`. + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "SetupBranding", + self._client.request( + "get", + "/organizations/{organization_id}/applications/{application_id}/authentication/branding/", + cast_to=SetupBranding, + path_params={"organization_id": organization_id, "application_id": application_id}, + auth="api_key", + api="account", + query={"language": language}, + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + + def update_branding( + self, + organization_id: str, + application_id: str, + *, + texts: Mapping[str, SetupBrandingTextsParam] | NotGiven = NOT_GIVEN, + terms_url: str | NotGiven = NOT_GIVEN, + privacy_url: str | NotGiven = NOT_GIVEN, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SetupBranding: + """Update the hosted pages' branding. + + Changes the hosted pages' own texts and legal links. The logo, colours and fonts are read-only here: they come from Customization. A language Didit does not publish answers `{"": "unsupported_language"}`, and a legal link that is not `https://` answers `https_required`. + + ``PATCH /organizations/{organization_id}/applications/{application_id}/authentication/branding/`` + + Args: + organization_id: UUID of the organization that owns the application. + application_id: UUID of the application: live or sandbox. A named key configures its own application only. + texts + terms_url + privacy_url + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "SetupBranding", + self._client.request( + "patch", + "/organizations/{organization_id}/applications/{application_id}/authentication/branding/", + cast_to=SetupBranding, + path_params={"organization_id": organization_id, "application_id": application_id}, + auth="api_key", + api="account", + body={"texts": texts, "terms_url": terms_url, "privacy_url": privacy_url}, + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + + def get_emails( + self, + organization_id: str, + application_id: str, + *, + language: str | NotGiven = NOT_GIVEN, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SetupEmails: + """List the sign-in emails. + + Lists the emails Didit Authentication sends, with the ones this application sends switched on and their subject in the language you ask for. The senders in the response are read-only here: they come from Customization. + + ``GET /organizations/{organization_id}/applications/{application_id}/authentication/emails/`` + + Args: + organization_id: UUID of the organization that owns the application. + application_id: UUID of the application: live or sandbox. A named key configures its own application only. + language: Language of the subjects and previews: an unsupported code falls back to `en`. + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "SetupEmails", + self._client.request( + "get", + "/organizations/{organization_id}/applications/{application_id}/authentication/emails/", + cast_to=SetupEmails, + path_params={"organization_id": organization_id, "application_id": application_id}, + auth="api_key", + api="account", + query={"language": language}, + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + + def get_email( + self, + organization_id: str, + application_id: str, + key: str, + *, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SetupEmail: + """Preview a sign-in email. + + Returns one email as it renders, with sample codes and links. An invitation preview uses a sample organization for a grant or named key. A console session can see a customer organization's name. The address of a console member is left out for a grant or a key, which have no mailbox. An email Authentication does not send answers `{"error": "email_not_sent_by_authentication"}`. + + ``GET /organizations/{organization_id}/applications/{application_id}/authentication/emails/{key}/`` + + Args: + organization_id: UUID of the organization that owns the application. + application_id: UUID of the application: live or sandbox. A named key configures its own application only. + key: The email: `code`, `magic`, `reset`, `device`, `invite`, `org`, `agent` or `agentoff`. + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "SetupEmail", + self._client.request( + "get", + "/organizations/{organization_id}/applications/{application_id}/authentication/emails/{key}/", + cast_to=SetupEmail, + path_params={ + "organization_id": organization_id, + "application_id": application_id, + "key": key, + }, + auth="api_key", + api="account", + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + + def get_protection( + self, + organization_id: str, + application_id: str, + *, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SetupProtection: + """Get bot protection. + + Returns whether protection is on, each policy's mode and the last 14 days of detections. Console sessions, grants and named keys receive the same aggregate counters. + + ``GET /organizations/{organization_id}/applications/{application_id}/authentication/protection/`` + + Args: + organization_id: UUID of the organization that owns the application. + application_id: UUID of the application: live or sandbox. A named key configures its own application only. + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "SetupProtection", + self._client.request( + "get", + "/organizations/{organization_id}/applications/{application_id}/authentication/protection/", + cast_to=SetupProtection, + path_params={"organization_id": organization_id, "application_id": application_id}, + auth="api_key", + api="account", + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + + def update_protection( + self, + organization_id: str, + application_id: str, + *, + enabled: bool | NotGiven = NOT_GIVEN, + breached_password_check: bool | NotGiven = NOT_GIVEN, + policies: Mapping[str, Literal["off", "log", "challenge", "block"] | str] + | NotGiven = NOT_GIVEN, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SetupProtection: + """Update bot protection. + + Turns protection on or off, turns the breached-password check on or off and sets a mode per policy. The policies you send are merged into the stored ones. An unknown policy answers `{"policies": ["unknown_protection"]}`. + + ``PATCH /organizations/{organization_id}/applications/{application_id}/authentication/protection/`` + + Args: + organization_id: UUID of the organization that owns the application. + application_id: UUID of the application: live or sandbox. A named key configures its own application only. + enabled + breached_password_check + policies: A mode per policy: `bots`, `stuffing`, `brute`, `disposable`, `vpn` and `travel`. + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "SetupProtection", + self._client.request( + "patch", + "/organizations/{organization_id}/applications/{application_id}/authentication/protection/", + cast_to=SetupProtection, + path_params={"organization_id": organization_id, "application_id": application_id}, + auth="api_key", + api="account", + body={ + "enabled": enabled, + "breached_password_check": breached_password_check, + "policies": policies, + }, + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + + def get_verified( + self, + organization_id: str, + application_id: str, + *, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SetupVerified: + """Get verified sign-in. + + Returns the sign-up verification level, the step-up rules with this month's counters, the claims your tokens carry and the verification workflows behind them. + + ``GET /organizations/{organization_id}/applications/{application_id}/authentication/verified/`` + + Args: + organization_id: UUID of the organization that owns the application. + application_id: UUID of the application: live or sandbox. A named key configures its own application only. + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "SetupVerified", + self._client.request( + "get", + "/organizations/{organization_id}/applications/{application_id}/authentication/verified/", + cast_to=SetupVerified, + path_params={"organization_id": organization_id, "application_id": application_id}, + auth="api_key", + api="account", + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + + def update_verified( + self, + organization_id: str, + application_id: str, + *, + signup_level: Literal["none", "liveness", "full_id"] | str | NotGiven = NOT_GIVEN, + rules: Sequence[AuthenticationSetupUpdateVerifiedParamsRules] | NotGiven = NOT_GIVEN, + claims: Sequence[str] | NotGiven = NOT_GIVEN, + workflows: AuthenticationSetupUpdateVerifiedParamsWorkflows | NotGiven = NOT_GIVEN, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SetupVerified: + """Update verified sign-in. + + Sets the sign-up verification level, the step-up rules, the claims your tokens carry and the workflows the rules use. Each supplied rule updates only the fields you send for its kind. Omitted rules keep their settings. Two rules of the same kind answer `duplicate_rule`, and `threshold` or `currency` on a rule other than `payout` answer `not_supported`. + + ``PATCH /organizations/{organization_id}/applications/{application_id}/authentication/verified/`` + + Args: + organization_id: UUID of the organization that owns the application. + application_id: UUID of the application: live or sandbox. A named key configures its own application only. + signup_level + rules + claims + workflows + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "SetupVerified", + self._client.request( + "patch", + "/organizations/{organization_id}/applications/{application_id}/authentication/verified/", + cast_to=SetupVerified, + path_params={"organization_id": organization_id, "application_id": application_id}, + auth="api_key", + api="account", + body={ + "signup_level": signup_level, + "rules": rules, + "claims": claims, + "workflows": workflows, + }, + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + + def get_domain( + self, + organization_id: str, + application_id: str, + *, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SetupDomain: + """Get the hosted domain. + + Returns the hosted origin, the issuer and passkey relying party that follow from it, and the custom domain with its DNS record, certificate and status. `origin` names the custom domain once it is active and the default host until then. + + ``GET /organizations/{organization_id}/applications/{application_id}/authentication/domain/`` + + Args: + organization_id: UUID of the organization that owns the application. + application_id: UUID of the application: live or sandbox. A named key configures its own application only. + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "SetupDomain", + self._client.request( + "get", + "/organizations/{organization_id}/applications/{application_id}/authentication/domain/", + cast_to=SetupDomain, + path_params={"organization_id": organization_id, "application_id": application_id}, + auth="api_key", + api="account", + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + + def set_domain( + self, + organization_id: str, + application_id: str, + *, + domain: str, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SetupDomain: + """Claim a custom domain. + + Claims a domain for the application's hosted pages: `pending` until DNS points at the application's default host. Claiming a second domain while one is claimed, verified or active answers 409 `{"domain": "custom_domain_exists"}`; an apex, an IP or one of Didit's own hosts answers `{"domain": "invalid_domain"}`. + + ``PUT /organizations/{organization_id}/applications/{application_id}/authentication/domain/`` + + Args: + organization_id: UUID of the organization that owns the application. + application_id: UUID of the application: live or sandbox. A named key configures its own application only. + domain: The domain to serve the hosted pages on. It must be a host under a zone: a CNAME cannot sit at an apex. + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "SetupDomain", + self._client.request( + "put", + "/organizations/{organization_id}/applications/{application_id}/authentication/domain/", + cast_to=SetupDomain, + path_params={"organization_id": organization_id, "application_id": application_id}, + auth="api_key", + api="account", + body={"domain": domain}, + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + + def remove_domain( + self, + organization_id: str, + application_id: str, + *, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SetupDomain: + """Remove the custom domain. + + Removes the custom domain and returns the application to its default host. When the edge does not confirm the removal the call answers 503 and the domain stays claimed; retry it. + + ``DELETE /organizations/{organization_id}/applications/{application_id}/authentication/domain/`` + + Args: + organization_id: UUID of the organization that owns the application. + application_id: UUID of the application: live or sandbox. A named key configures its own application only. + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "SetupDomain", + self._client.request( + "delete", + "/organizations/{organization_id}/applications/{application_id}/authentication/domain/", + cast_to=SetupDomain, + path_params={"organization_id": organization_id, "application_id": application_id}, + auth="api_key", + api="account", + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + + def verify_domain( + self, + organization_id: str, + application_id: str, + *, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SetupDomain: + """Verify the custom domain. + + Checks the DNS record now and asks the edge for the certificate. A missing or mismatched DNS record returns 200 with a `failure_reason`. Read `domain/` afterwards for the result: `verified` once the certificate is issued, `failed` with a `failure_reason` when it cannot be issued. + + ``POST /organizations/{organization_id}/applications/{application_id}/authentication/domain/verify/`` + + Args: + organization_id: UUID of the organization that owns the application. + application_id: UUID of the application: live or sandbox. A named key configures its own application only. + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "SetupDomain", + self._client.request( + "post", + "/organizations/{organization_id}/applications/{application_id}/authentication/domain/verify/", + cast_to=SetupDomain, + path_params={"organization_id": organization_id, "application_id": application_id}, + auth="api_key", + api="account", + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + + def activate_domain( + self, + organization_id: str, + application_id: str, + *, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SetupDomain: + """Activate the custom domain. + + Makes the verified domain the application's canonical origin, which moves the issuer and the passkey relying party to it. After activation, `/session/` immediately rejects access tokens issued under the old host. Refresh them to obtain access tokens for the new issuer. + + ``POST /organizations/{organization_id}/applications/{application_id}/authentication/domain/activate/`` + + Args: + organization_id: UUID of the organization that owns the application. + application_id: UUID of the application: live or sandbox. A named key configures its own application only. + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "SetupDomain", + self._client.request( + "post", + "/organizations/{organization_id}/applications/{application_id}/authentication/domain/activate/", + cast_to=SetupDomain, + path_params={"organization_id": organization_id, "application_id": application_id}, + auth="api_key", + api="account", + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + + def get_native_apps( + self, + organization_id: str, + application_id: str, + *, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SetupNativeApps: + """Get the native apps. + + Returns the iOS app IDs and Android apps that share this application's passkeys, as the association files at the hosted origin publish them. + + ``GET /organizations/{organization_id}/applications/{application_id}/authentication/native-apps/`` + + Args: + organization_id: UUID of the organization that owns the application. + application_id: UUID of the application: live or sandbox. A named key configures its own application only. + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "SetupNativeApps", + self._client.request( + "get", + "/organizations/{organization_id}/applications/{application_id}/authentication/native-apps/", + cast_to=SetupNativeApps, + path_params={"organization_id": organization_id, "application_id": application_id}, + auth="api_key", + api="account", + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + + def update_native_apps( + self, + organization_id: str, + application_id: str, + *, + ios_app_ids: Sequence[str], + android_apps: Sequence[SetupAndroidAppParam], + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SetupNativeApps: + """Update the native apps. + + Replaces the lists of iOS app IDs and Android apps. A malformed entry answers a field error in the shape `{"ios_app_ids": ["This field is invalid."]}`; duplicates are dropped. + + ``PUT /organizations/{organization_id}/applications/{application_id}/authentication/native-apps/`` + + Args: + organization_id: UUID of the organization that owns the application. + application_id: UUID of the application: live or sandbox. A named key configures its own application only. + ios_app_ids + android_apps + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "SetupNativeApps", + self._client.request( + "put", + "/organizations/{organization_id}/applications/{application_id}/authentication/native-apps/", + cast_to=SetupNativeApps, + path_params={"organization_id": organization_id, "application_id": application_id}, + auth="api_key", + api="account", + body={"ios_app_ids": ios_app_ids, "android_apps": android_apps}, + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + + +class AsyncAuthenticationSetup(AsyncAPIResource): + """The ``authentication_setup`` resource of the Didit API. + + Methods: ``activate_domain``, ``get_branding``, ``get_configuration``, ``get_domain``, ``get_email``, ``get_emails``, ``get_native_apps``, ``get_onboarding``, ``get_protection``, ``get_settings``, ``get_verified``, ``remove_domain``, ``set_domain``, ``set_method``, ``update_branding``, ``update_configuration``, ``update_native_apps``, ``update_onboarding``, ``update_protection``, ``update_settings``, ``update_verified``, ``verify_domain``. + """ + + @cached_property + def with_raw_response(self) -> AsyncAuthenticationSetupWithRawResponse: + """Every method of this resource, returning the raw HTTP response.""" + return AsyncAuthenticationSetupWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncAuthenticationSetupWithStreamingResponse: + """Every method of this resource, returning the HTTP response before reading its body.""" + return AsyncAuthenticationSetupWithStreamingResponse(self) + + async def get_configuration( + self, + organization_id: str, + application_id: str, + *, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SetupConfiguration: + """Get the Authentication setup. + + Returns the application's Authentication configuration and every sign-in method with its `enabled` state and `credential_source`, which is how an agent verifies the setup it made. Disabled methods are listed too, and `credential_source` is `null` for a method that holds no social credentials. The top-level `enabled` is `false` when Authentication is disabled for the application. + + ``GET /organizations/{organization_id}/applications/{application_id}/authentication/`` + + Args: + organization_id: UUID of the organization that owns the application. + application_id: UUID of the application: live or sandbox. A named key configures its own application only. + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "SetupConfiguration", + await self._client.request( + "get", + "/organizations/{organization_id}/applications/{application_id}/authentication/", + cast_to=SetupConfiguration, + path_params={"organization_id": organization_id, "application_id": application_id}, + auth="api_key", + api="account", + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + + async def update_configuration( + self, + organization_id: str, + application_id: str, + *, + redirect_uris: Sequence[str] | NotGiven = NOT_GIVEN, + allowed_origins: Sequence[str] | NotGiven = NOT_GIVEN, + post_logout_redirect_uri: str | NotGiven = NOT_GIVEN, + session_lifetime: int | NotGiven = NOT_GIVEN, + idle_timeout: int | NotGiven = NOT_GIVEN, + multiple_sessions: bool | NotGiven = NOT_GIVEN, + password_min_length: int | NotGiven = NOT_GIVEN, + revoke_on_password_change: bool | NotGiven = NOT_GIVEN, + allow_subaddresses: bool | NotGiven = NOT_GIVEN, + signup_policy: Literal["anyone", "invited", "allowed_domains"] | str | NotGiven = NOT_GIVEN, + allowed_email_domains: Sequence[str] | NotGiven = NOT_GIVEN, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SetupConfiguration: + """Update the Authentication setup. + + Changes the settings in the body: callback URLs, allowed origins, session lifetime, idle timeout, password rules and the sign-up policy. Send only the fields you change. `enabled` is refused with `{"enabled": "follows_product"}` because the product's state decides it, and an unknown field with `{"": "unknown_field"}`. + + ``PATCH /organizations/{organization_id}/applications/{application_id}/authentication/`` + + Args: + organization_id: UUID of the organization that owns the application. + application_id: UUID of the application: live or sandbox. A named key configures its own application only. + redirect_uris + allowed_origins + post_logout_redirect_uri + session_lifetime + idle_timeout + multiple_sessions + password_min_length + revoke_on_password_change + allow_subaddresses + signup_policy + allowed_email_domains + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "SetupConfiguration", + await self._client.request( + "patch", + "/organizations/{organization_id}/applications/{application_id}/authentication/", + cast_to=SetupConfiguration, + path_params={"organization_id": organization_id, "application_id": application_id}, + auth="api_key", + api="account", + body={ + "redirect_uris": redirect_uris, + "allowed_origins": allowed_origins, + "post_logout_redirect_uri": post_logout_redirect_uri, + "session_lifetime": session_lifetime, + "idle_timeout": idle_timeout, + "multiple_sessions": multiple_sessions, + "password_min_length": password_min_length, + "revoke_on_password_change": revoke_on_password_change, + "allow_subaddresses": allow_subaddresses, + "signup_policy": signup_policy, + "allowed_email_domains": allowed_email_domains, + }, + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + + async def set_method( + self, + organization_id: str, + application_id: str, + name: str, + *, + enabled: bool, + credentials: SetupProviderCredentials | NotGiven = NOT_GIVEN, + credential_source: Literal["own", "didit_test"] | str | NotGiven = NOT_GIVEN, + workflow_id: str | NotGiven = NOT_GIVEN, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SetupMethodResult: + """Enable or disable a sign-in method. + + Enables or disables one method; `enabled` is required. A social method (`google`, `microsoft`, `apple`, `github`) takes either your own `credentials` or `credential_source: "didit_test"`, which uses Didit's own sandbox app and is refused on a live application with `{"credential_source": "sandbox_only"}`; a test app the application cannot use answers `{"credential_source": "unavailable"}`. `phone` takes the `workflow_id` of a phone verification workflow. `credentials`, `workflow_id` or `credential_source` on a method that does not use them answer `not_supported`, turning off a method that is always on answers `{"enabled": "always_on"}`, and an unknown method answers `{"name": "method_unavailable"}`. + + ``PUT /organizations/{organization_id}/applications/{application_id}/authentication/methods/{name}/`` + + Args: + organization_id: UUID of the organization that owns the application. + application_id: UUID of the application: live or sandbox. A named key configures its own application only. + name: The method: `password`, `code`, `magic`, `phone`, `passkey`, `google`, `microsoft`, `apple`, `github`, `sso` or `wallet`. + enabled + credentials: Your own OAuth app's credentials. The secret is write-only: no response returns it. + credential_source: `didit_test` uses Didit's own sandbox app, and is refused on a live application with `sandbox_only`. Omitted: `own` when you send `credentials`, the stored source otherwise, and `didit_test` for a sandbox application's social method that was never configured. + workflow_id: `phone` only: the phone verification workflow whose codes it sends. + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "SetupMethodResult", + await self._client.request( + "put", + "/organizations/{organization_id}/applications/{application_id}/authentication/methods/{name}/", + cast_to=SetupMethodResult, + path_params={ + "organization_id": organization_id, + "application_id": application_id, + "name": name, + }, + auth="api_key", + api="account", + body={ + "enabled": enabled, + "credentials": credentials, + "credential_source": credential_source, + "workflow_id": workflow_id, + }, + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + + async def get_onboarding( + self, + organization_id: str, + application_id: str, + *, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SetupOnboarding: + """Get the onboarding progress. + + Returns which setup steps are done, whether the application is ready and how people sign in. A grant or a key gets progress only: the console session's sample sign-in details, which name an end user, are left out. + + ``GET /organizations/{organization_id}/applications/{application_id}/authentication/onboarding/`` + + Args: + organization_id: UUID of the organization that owns the application. + application_id: UUID of the application: live or sandbox. A named key configures its own application only. + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "SetupOnboarding", + await self._client.request( + "get", + "/organizations/{organization_id}/applications/{application_id}/authentication/onboarding/", + cast_to=SetupOnboarding, + path_params={"organization_id": organization_id, "application_id": application_id}, + auth="api_key", + api="account", + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + + async def update_onboarding( + self, + organization_id: str, + application_id: str, + *, + test_skipped: bool | NotGiven = NOT_GIVEN, + import_skipped: bool | NotGiven = NOT_GIVEN, + sign_in_ui: Literal["hosted", "own"] | str | NotGiven = NOT_GIVEN, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SetupOnboarding: + """Update the onboarding progress. + + Records a setup step: skip the test sign-in, skip the user import, or choose the hosted sign-in page or your own screens. An empty body answers `{"non_field_errors": ["empty_update"]}`. + + ``PATCH /organizations/{organization_id}/applications/{application_id}/authentication/onboarding/`` + + Args: + organization_id: UUID of the organization that owns the application. + application_id: UUID of the application: live or sandbox. A named key configures its own application only. + test_skipped + import_skipped + sign_in_ui + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "SetupOnboarding", + await self._client.request( + "patch", + "/organizations/{organization_id}/applications/{application_id}/authentication/onboarding/", + cast_to=SetupOnboarding, + path_params={"organization_id": organization_id, "application_id": application_id}, + auth="api_key", + api="account", + body={ + "test_skipped": test_skipped, + "import_skipped": import_skipped, + "sign_in_ui": sign_in_ui, + }, + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + + async def get_settings( + self, + organization_id: str, + application_id: str, + *, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SetupSettings: + """Get the application settings. + + Returns agent access, organizations, the MFA policy, the default member role and the webhook events switched off. + + ``GET /organizations/{organization_id}/applications/{application_id}/authentication/settings/`` + + Args: + organization_id: UUID of the organization that owns the application. + application_id: UUID of the application: live or sandbox. A named key configures its own application only. + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "SetupSettings", + await self._client.request( + "get", + "/organizations/{organization_id}/applications/{application_id}/authentication/settings/", + cast_to=SetupSettings, + path_params={"organization_id": organization_id, "application_id": application_id}, + auth="api_key", + api="account", + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + + async def update_settings( + self, + organization_id: str, + application_id: str, + *, + sign_in_ui: Literal["hosted", "own"] | str | NotGiven = NOT_GIVEN, + agent_humans_only: bool | NotGiven = NOT_GIVEN, + agents_enabled: bool | NotGiven = NOT_GIVEN, + agent_scopes: Sequence[Literal["read", "act"] | str] | NotGiven = NOT_GIVEN, + agent_lifetime: int | NotGiven = NOT_GIVEN, + agent_idle_timeout: int | NotGiven = NOT_GIVEN, + agent_approval: Literal["passkey", "sign_in"] | str | NotGiven = NOT_GIVEN, + organizations_enabled: bool | NotGiven = NOT_GIVEN, + mfa_policy: Literal["optional", "everyone", "organization_admins"] + | str + | NotGiven = NOT_GIVEN, + default_member_role: Literal["admin", "member", "billing"] | str | NotGiven = NOT_GIVEN, + webhook_events_disabled: Sequence[str] | NotGiven = NOT_GIVEN, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SetupSettings: + """Update the application settings. + + Changes the settings in the body. `agent_humans_only` needs a person: a named API key answers 403 `owner_or_admin_required`, and turning it on needs an owner or admin with an enrolled passkey. + + ``PATCH /organizations/{organization_id}/applications/{application_id}/authentication/settings/`` + + Args: + organization_id: UUID of the organization that owns the application. + application_id: UUID of the application: live or sandbox. A named key configures its own application only. + sign_in_ui + agent_humans_only + agents_enabled + agent_scopes + agent_lifetime + agent_idle_timeout + agent_approval + organizations_enabled + mfa_policy + default_member_role + webhook_events_disabled + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "SetupSettings", + await self._client.request( + "patch", + "/organizations/{organization_id}/applications/{application_id}/authentication/settings/", + cast_to=SetupSettings, + path_params={"organization_id": organization_id, "application_id": application_id}, + auth="api_key", + api="account", + body={ + "sign_in_ui": sign_in_ui, + "agent_humans_only": agent_humans_only, + "agents_enabled": agents_enabled, + "agent_scopes": agent_scopes, + "agent_lifetime": agent_lifetime, + "agent_idle_timeout": agent_idle_timeout, + "agent_approval": agent_approval, + "organizations_enabled": organizations_enabled, + "mfa_policy": mfa_policy, + "default_member_role": default_member_role, + "webhook_events_disabled": webhook_events_disabled, + }, + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + + async def get_branding( + self, + organization_id: str, + application_id: str, + *, + language: str | NotGiven = NOT_GIVEN, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SetupBranding: + """Get the hosted pages' branding. + + Returns the application's brand as the hosted pages show it, the texts set per language, the legal links and the hosted URL. + + ``GET /organizations/{organization_id}/applications/{application_id}/authentication/branding/`` + + Args: + organization_id: UUID of the organization that owns the application. + application_id: UUID of the application: live or sandbox. A named key configures its own application only. + language: Language of the default texts and the previews: an unsupported code falls back to `en`. + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "SetupBranding", + await self._client.request( + "get", + "/organizations/{organization_id}/applications/{application_id}/authentication/branding/", + cast_to=SetupBranding, + path_params={"organization_id": organization_id, "application_id": application_id}, + auth="api_key", + api="account", + query={"language": language}, + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + + async def update_branding( + self, + organization_id: str, + application_id: str, + *, + texts: Mapping[str, SetupBrandingTextsParam] | NotGiven = NOT_GIVEN, + terms_url: str | NotGiven = NOT_GIVEN, + privacy_url: str | NotGiven = NOT_GIVEN, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SetupBranding: + """Update the hosted pages' branding. + + Changes the hosted pages' own texts and legal links. The logo, colours and fonts are read-only here: they come from Customization. A language Didit does not publish answers `{"": "unsupported_language"}`, and a legal link that is not `https://` answers `https_required`. + + ``PATCH /organizations/{organization_id}/applications/{application_id}/authentication/branding/`` + + Args: + organization_id: UUID of the organization that owns the application. + application_id: UUID of the application: live or sandbox. A named key configures its own application only. + texts + terms_url + privacy_url + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "SetupBranding", + await self._client.request( + "patch", + "/organizations/{organization_id}/applications/{application_id}/authentication/branding/", + cast_to=SetupBranding, + path_params={"organization_id": organization_id, "application_id": application_id}, + auth="api_key", + api="account", + body={"texts": texts, "terms_url": terms_url, "privacy_url": privacy_url}, + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + + async def get_emails( + self, + organization_id: str, + application_id: str, + *, + language: str | NotGiven = NOT_GIVEN, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SetupEmails: + """List the sign-in emails. + + Lists the emails Didit Authentication sends, with the ones this application sends switched on and their subject in the language you ask for. The senders in the response are read-only here: they come from Customization. + + ``GET /organizations/{organization_id}/applications/{application_id}/authentication/emails/`` + + Args: + organization_id: UUID of the organization that owns the application. + application_id: UUID of the application: live or sandbox. A named key configures its own application only. + language: Language of the subjects and previews: an unsupported code falls back to `en`. + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "SetupEmails", + await self._client.request( + "get", + "/organizations/{organization_id}/applications/{application_id}/authentication/emails/", + cast_to=SetupEmails, + path_params={"organization_id": organization_id, "application_id": application_id}, + auth="api_key", + api="account", + query={"language": language}, + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + + async def get_email( + self, + organization_id: str, + application_id: str, + key: str, + *, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SetupEmail: + """Preview a sign-in email. + + Returns one email as it renders, with sample codes and links. An invitation preview uses a sample organization for a grant or named key. A console session can see a customer organization's name. The address of a console member is left out for a grant or a key, which have no mailbox. An email Authentication does not send answers `{"error": "email_not_sent_by_authentication"}`. + + ``GET /organizations/{organization_id}/applications/{application_id}/authentication/emails/{key}/`` + + Args: + organization_id: UUID of the organization that owns the application. + application_id: UUID of the application: live or sandbox. A named key configures its own application only. + key: The email: `code`, `magic`, `reset`, `device`, `invite`, `org`, `agent` or `agentoff`. + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "SetupEmail", + await self._client.request( + "get", + "/organizations/{organization_id}/applications/{application_id}/authentication/emails/{key}/", + cast_to=SetupEmail, + path_params={ + "organization_id": organization_id, + "application_id": application_id, + "key": key, + }, + auth="api_key", + api="account", + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + + async def get_protection( + self, + organization_id: str, + application_id: str, + *, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SetupProtection: + """Get bot protection. + + Returns whether protection is on, each policy's mode and the last 14 days of detections. Console sessions, grants and named keys receive the same aggregate counters. + + ``GET /organizations/{organization_id}/applications/{application_id}/authentication/protection/`` + + Args: + organization_id: UUID of the organization that owns the application. + application_id: UUID of the application: live or sandbox. A named key configures its own application only. + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "SetupProtection", + await self._client.request( + "get", + "/organizations/{organization_id}/applications/{application_id}/authentication/protection/", + cast_to=SetupProtection, + path_params={"organization_id": organization_id, "application_id": application_id}, + auth="api_key", + api="account", + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + + async def update_protection( + self, + organization_id: str, + application_id: str, + *, + enabled: bool | NotGiven = NOT_GIVEN, + breached_password_check: bool | NotGiven = NOT_GIVEN, + policies: Mapping[str, Literal["off", "log", "challenge", "block"] | str] + | NotGiven = NOT_GIVEN, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SetupProtection: + """Update bot protection. + + Turns protection on or off, turns the breached-password check on or off and sets a mode per policy. The policies you send are merged into the stored ones. An unknown policy answers `{"policies": ["unknown_protection"]}`. + + ``PATCH /organizations/{organization_id}/applications/{application_id}/authentication/protection/`` + + Args: + organization_id: UUID of the organization that owns the application. + application_id: UUID of the application: live or sandbox. A named key configures its own application only. + enabled + breached_password_check + policies: A mode per policy: `bots`, `stuffing`, `brute`, `disposable`, `vpn` and `travel`. + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "SetupProtection", + await self._client.request( + "patch", + "/organizations/{organization_id}/applications/{application_id}/authentication/protection/", + cast_to=SetupProtection, + path_params={"organization_id": organization_id, "application_id": application_id}, + auth="api_key", + api="account", + body={ + "enabled": enabled, + "breached_password_check": breached_password_check, + "policies": policies, + }, + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + + async def get_verified( + self, + organization_id: str, + application_id: str, + *, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SetupVerified: + """Get verified sign-in. + + Returns the sign-up verification level, the step-up rules with this month's counters, the claims your tokens carry and the verification workflows behind them. + + ``GET /organizations/{organization_id}/applications/{application_id}/authentication/verified/`` + + Args: + organization_id: UUID of the organization that owns the application. + application_id: UUID of the application: live or sandbox. A named key configures its own application only. + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "SetupVerified", + await self._client.request( + "get", + "/organizations/{organization_id}/applications/{application_id}/authentication/verified/", + cast_to=SetupVerified, + path_params={"organization_id": organization_id, "application_id": application_id}, + auth="api_key", + api="account", + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + + async def update_verified( + self, + organization_id: str, + application_id: str, + *, + signup_level: Literal["none", "liveness", "full_id"] | str | NotGiven = NOT_GIVEN, + rules: Sequence[AuthenticationSetupUpdateVerifiedParamsRules] | NotGiven = NOT_GIVEN, + claims: Sequence[str] | NotGiven = NOT_GIVEN, + workflows: AuthenticationSetupUpdateVerifiedParamsWorkflows | NotGiven = NOT_GIVEN, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SetupVerified: + """Update verified sign-in. + + Sets the sign-up verification level, the step-up rules, the claims your tokens carry and the workflows the rules use. Each supplied rule updates only the fields you send for its kind. Omitted rules keep their settings. Two rules of the same kind answer `duplicate_rule`, and `threshold` or `currency` on a rule other than `payout` answer `not_supported`. + + ``PATCH /organizations/{organization_id}/applications/{application_id}/authentication/verified/`` + + Args: + organization_id: UUID of the organization that owns the application. + application_id: UUID of the application: live or sandbox. A named key configures its own application only. + signup_level + rules + claims + workflows + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "SetupVerified", + await self._client.request( + "patch", + "/organizations/{organization_id}/applications/{application_id}/authentication/verified/", + cast_to=SetupVerified, + path_params={"organization_id": organization_id, "application_id": application_id}, + auth="api_key", + api="account", + body={ + "signup_level": signup_level, + "rules": rules, + "claims": claims, + "workflows": workflows, + }, + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + + async def get_domain( + self, + organization_id: str, + application_id: str, + *, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SetupDomain: + """Get the hosted domain. + + Returns the hosted origin, the issuer and passkey relying party that follow from it, and the custom domain with its DNS record, certificate and status. `origin` names the custom domain once it is active and the default host until then. + + ``GET /organizations/{organization_id}/applications/{application_id}/authentication/domain/`` + + Args: + organization_id: UUID of the organization that owns the application. + application_id: UUID of the application: live or sandbox. A named key configures its own application only. + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "SetupDomain", + await self._client.request( + "get", + "/organizations/{organization_id}/applications/{application_id}/authentication/domain/", + cast_to=SetupDomain, + path_params={"organization_id": organization_id, "application_id": application_id}, + auth="api_key", + api="account", + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + + async def set_domain( + self, + organization_id: str, + application_id: str, + *, + domain: str, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SetupDomain: + """Claim a custom domain. + + Claims a domain for the application's hosted pages: `pending` until DNS points at the application's default host. Claiming a second domain while one is claimed, verified or active answers 409 `{"domain": "custom_domain_exists"}`; an apex, an IP or one of Didit's own hosts answers `{"domain": "invalid_domain"}`. + + ``PUT /organizations/{organization_id}/applications/{application_id}/authentication/domain/`` + + Args: + organization_id: UUID of the organization that owns the application. + application_id: UUID of the application: live or sandbox. A named key configures its own application only. + domain: The domain to serve the hosted pages on. It must be a host under a zone: a CNAME cannot sit at an apex. + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "SetupDomain", + await self._client.request( + "put", + "/organizations/{organization_id}/applications/{application_id}/authentication/domain/", + cast_to=SetupDomain, + path_params={"organization_id": organization_id, "application_id": application_id}, + auth="api_key", + api="account", + body={"domain": domain}, + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + + async def remove_domain( + self, + organization_id: str, + application_id: str, + *, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SetupDomain: + """Remove the custom domain. + + Removes the custom domain and returns the application to its default host. When the edge does not confirm the removal the call answers 503 and the domain stays claimed; retry it. + + ``DELETE /organizations/{organization_id}/applications/{application_id}/authentication/domain/`` + + Args: + organization_id: UUID of the organization that owns the application. + application_id: UUID of the application: live or sandbox. A named key configures its own application only. + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "SetupDomain", + await self._client.request( + "delete", + "/organizations/{organization_id}/applications/{application_id}/authentication/domain/", + cast_to=SetupDomain, + path_params={"organization_id": organization_id, "application_id": application_id}, + auth="api_key", + api="account", + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + + async def verify_domain( + self, + organization_id: str, + application_id: str, + *, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SetupDomain: + """Verify the custom domain. + + Checks the DNS record now and asks the edge for the certificate. A missing or mismatched DNS record returns 200 with a `failure_reason`. Read `domain/` afterwards for the result: `verified` once the certificate is issued, `failed` with a `failure_reason` when it cannot be issued. + + ``POST /organizations/{organization_id}/applications/{application_id}/authentication/domain/verify/`` + + Args: + organization_id: UUID of the organization that owns the application. + application_id: UUID of the application: live or sandbox. A named key configures its own application only. + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "SetupDomain", + await self._client.request( + "post", + "/organizations/{organization_id}/applications/{application_id}/authentication/domain/verify/", + cast_to=SetupDomain, + path_params={"organization_id": organization_id, "application_id": application_id}, + auth="api_key", + api="account", + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + + async def activate_domain( + self, + organization_id: str, + application_id: str, + *, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SetupDomain: + """Activate the custom domain. + + Makes the verified domain the application's canonical origin, which moves the issuer and the passkey relying party to it. After activation, `/session/` immediately rejects access tokens issued under the old host. Refresh them to obtain access tokens for the new issuer. + + ``POST /organizations/{organization_id}/applications/{application_id}/authentication/domain/activate/`` + + Args: + organization_id: UUID of the organization that owns the application. + application_id: UUID of the application: live or sandbox. A named key configures its own application only. + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "SetupDomain", + await self._client.request( + "post", + "/organizations/{organization_id}/applications/{application_id}/authentication/domain/activate/", + cast_to=SetupDomain, + path_params={"organization_id": organization_id, "application_id": application_id}, + auth="api_key", + api="account", + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + + async def get_native_apps( + self, + organization_id: str, + application_id: str, + *, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SetupNativeApps: + """Get the native apps. + + Returns the iOS app IDs and Android apps that share this application's passkeys, as the association files at the hosted origin publish them. + + ``GET /organizations/{organization_id}/applications/{application_id}/authentication/native-apps/`` + + Args: + organization_id: UUID of the organization that owns the application. + application_id: UUID of the application: live or sandbox. A named key configures its own application only. + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "SetupNativeApps", + await self._client.request( + "get", + "/organizations/{organization_id}/applications/{application_id}/authentication/native-apps/", + cast_to=SetupNativeApps, + path_params={"organization_id": organization_id, "application_id": application_id}, + auth="api_key", + api="account", + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + + async def update_native_apps( + self, + organization_id: str, + application_id: str, + *, + ios_app_ids: Sequence[str], + android_apps: Sequence[SetupAndroidAppParam], + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SetupNativeApps: + """Update the native apps. + + Replaces the lists of iOS app IDs and Android apps. A malformed entry answers a field error in the shape `{"ios_app_ids": ["This field is invalid."]}`; duplicates are dropped. + + ``PUT /organizations/{organization_id}/applications/{application_id}/authentication/native-apps/`` + + Args: + organization_id: UUID of the organization that owns the application. + application_id: UUID of the application: live or sandbox. A named key configures its own application only. + ios_app_ids + android_apps + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "SetupNativeApps", + await self._client.request( + "put", + "/organizations/{organization_id}/applications/{application_id}/authentication/native-apps/", + cast_to=SetupNativeApps, + path_params={"organization_id": organization_id, "application_id": application_id}, + auth="api_key", + api="account", + body={"ios_app_ids": ios_app_ids, "android_apps": android_apps}, + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + + +class AuthenticationSetupWithRawResponse: + def __init__(self, resource: AuthenticationSetup) -> None: + self._resource = resource + self.get_configuration = to_raw_response_wrapper(resource.get_configuration) + self.update_configuration = to_raw_response_wrapper(resource.update_configuration) + self.set_method = to_raw_response_wrapper(resource.set_method) + self.get_onboarding = to_raw_response_wrapper(resource.get_onboarding) + self.update_onboarding = to_raw_response_wrapper(resource.update_onboarding) + self.get_settings = to_raw_response_wrapper(resource.get_settings) + self.update_settings = to_raw_response_wrapper(resource.update_settings) + self.get_branding = to_raw_response_wrapper(resource.get_branding) + self.update_branding = to_raw_response_wrapper(resource.update_branding) + self.get_emails = to_raw_response_wrapper(resource.get_emails) + self.get_email = to_raw_response_wrapper(resource.get_email) + self.get_protection = to_raw_response_wrapper(resource.get_protection) + self.update_protection = to_raw_response_wrapper(resource.update_protection) + self.get_verified = to_raw_response_wrapper(resource.get_verified) + self.update_verified = to_raw_response_wrapper(resource.update_verified) + self.get_domain = to_raw_response_wrapper(resource.get_domain) + self.set_domain = to_raw_response_wrapper(resource.set_domain) + self.remove_domain = to_raw_response_wrapper(resource.remove_domain) + self.verify_domain = to_raw_response_wrapper(resource.verify_domain) + self.activate_domain = to_raw_response_wrapper(resource.activate_domain) + self.get_native_apps = to_raw_response_wrapper(resource.get_native_apps) + self.update_native_apps = to_raw_response_wrapper(resource.update_native_apps) + + +class AsyncAuthenticationSetupWithRawResponse: + def __init__(self, resource: AsyncAuthenticationSetup) -> None: + self._resource = resource + self.get_configuration = async_to_raw_response_wrapper(resource.get_configuration) + self.update_configuration = async_to_raw_response_wrapper(resource.update_configuration) + self.set_method = async_to_raw_response_wrapper(resource.set_method) + self.get_onboarding = async_to_raw_response_wrapper(resource.get_onboarding) + self.update_onboarding = async_to_raw_response_wrapper(resource.update_onboarding) + self.get_settings = async_to_raw_response_wrapper(resource.get_settings) + self.update_settings = async_to_raw_response_wrapper(resource.update_settings) + self.get_branding = async_to_raw_response_wrapper(resource.get_branding) + self.update_branding = async_to_raw_response_wrapper(resource.update_branding) + self.get_emails = async_to_raw_response_wrapper(resource.get_emails) + self.get_email = async_to_raw_response_wrapper(resource.get_email) + self.get_protection = async_to_raw_response_wrapper(resource.get_protection) + self.update_protection = async_to_raw_response_wrapper(resource.update_protection) + self.get_verified = async_to_raw_response_wrapper(resource.get_verified) + self.update_verified = async_to_raw_response_wrapper(resource.update_verified) + self.get_domain = async_to_raw_response_wrapper(resource.get_domain) + self.set_domain = async_to_raw_response_wrapper(resource.set_domain) + self.remove_domain = async_to_raw_response_wrapper(resource.remove_domain) + self.verify_domain = async_to_raw_response_wrapper(resource.verify_domain) + self.activate_domain = async_to_raw_response_wrapper(resource.activate_domain) + self.get_native_apps = async_to_raw_response_wrapper(resource.get_native_apps) + self.update_native_apps = async_to_raw_response_wrapper(resource.update_native_apps) + + +class AuthenticationSetupWithStreamingResponse: + def __init__(self, resource: AuthenticationSetup) -> None: + self._resource = resource + self.get_configuration = to_streamed_response_wrapper(resource.get_configuration) + self.update_configuration = to_streamed_response_wrapper(resource.update_configuration) + self.set_method = to_streamed_response_wrapper(resource.set_method) + self.get_onboarding = to_streamed_response_wrapper(resource.get_onboarding) + self.update_onboarding = to_streamed_response_wrapper(resource.update_onboarding) + self.get_settings = to_streamed_response_wrapper(resource.get_settings) + self.update_settings = to_streamed_response_wrapper(resource.update_settings) + self.get_branding = to_streamed_response_wrapper(resource.get_branding) + self.update_branding = to_streamed_response_wrapper(resource.update_branding) + self.get_emails = to_streamed_response_wrapper(resource.get_emails) + self.get_email = to_streamed_response_wrapper(resource.get_email) + self.get_protection = to_streamed_response_wrapper(resource.get_protection) + self.update_protection = to_streamed_response_wrapper(resource.update_protection) + self.get_verified = to_streamed_response_wrapper(resource.get_verified) + self.update_verified = to_streamed_response_wrapper(resource.update_verified) + self.get_domain = to_streamed_response_wrapper(resource.get_domain) + self.set_domain = to_streamed_response_wrapper(resource.set_domain) + self.remove_domain = to_streamed_response_wrapper(resource.remove_domain) + self.verify_domain = to_streamed_response_wrapper(resource.verify_domain) + self.activate_domain = to_streamed_response_wrapper(resource.activate_domain) + self.get_native_apps = to_streamed_response_wrapper(resource.get_native_apps) + self.update_native_apps = to_streamed_response_wrapper(resource.update_native_apps) + + +class AsyncAuthenticationSetupWithStreamingResponse: + def __init__(self, resource: AsyncAuthenticationSetup) -> None: + self._resource = resource + self.get_configuration = async_to_streamed_response_wrapper(resource.get_configuration) + self.update_configuration = async_to_streamed_response_wrapper( + resource.update_configuration + ) + self.set_method = async_to_streamed_response_wrapper(resource.set_method) + self.get_onboarding = async_to_streamed_response_wrapper(resource.get_onboarding) + self.update_onboarding = async_to_streamed_response_wrapper(resource.update_onboarding) + self.get_settings = async_to_streamed_response_wrapper(resource.get_settings) + self.update_settings = async_to_streamed_response_wrapper(resource.update_settings) + self.get_branding = async_to_streamed_response_wrapper(resource.get_branding) + self.update_branding = async_to_streamed_response_wrapper(resource.update_branding) + self.get_emails = async_to_streamed_response_wrapper(resource.get_emails) + self.get_email = async_to_streamed_response_wrapper(resource.get_email) + self.get_protection = async_to_streamed_response_wrapper(resource.get_protection) + self.update_protection = async_to_streamed_response_wrapper(resource.update_protection) + self.get_verified = async_to_streamed_response_wrapper(resource.get_verified) + self.update_verified = async_to_streamed_response_wrapper(resource.update_verified) + self.get_domain = async_to_streamed_response_wrapper(resource.get_domain) + self.set_domain = async_to_streamed_response_wrapper(resource.set_domain) + self.remove_domain = async_to_streamed_response_wrapper(resource.remove_domain) + self.verify_domain = async_to_streamed_response_wrapper(resource.verify_domain) + self.activate_domain = async_to_streamed_response_wrapper(resource.activate_domain) + self.get_native_apps = async_to_streamed_response_wrapper(resource.get_native_apps) + self.update_native_apps = async_to_streamed_response_wrapper(resource.update_native_apps) diff --git a/src/didit/resources/investigator.py b/src/didit/resources/investigator.py index 07dcdd0..b059932 100644 --- a/src/didit/resources/investigator.py +++ b/src/didit/resources/investigator.py @@ -32,6 +32,7 @@ from didit.types.investigator.retrieve_dashboard_response import ( InvestigatorRetrieveDashboardResponse, ) +from didit.types.investigator.retrieve_offer_response import InvestigatorRetrieveOfferResponse from didit.types.investigator.retrieve_performance_response import ( InvestigatorRetrievePerformanceResponse, ) @@ -53,7 +54,7 @@ class Investigator(SyncAPIResource): """The ``investigator`` resource of the Didit API. - Methods: ``accept_run``, ``batch_accept_runs``, ``export_activity``, ``list_activity``, ``list_guardrails``, ``list_queue``, ``override_run``, ``retrieve_dashboard``, ``retrieve_performance``, ``retrieve_run``, ``retrieve_settings``, ``retrieve_summary``, ``retrieve_transaction``, ``update_settings``. + Methods: ``accept_run``, ``batch_accept_runs``, ``export_activity``, ``list_activity``, ``list_guardrails``, ``list_queue``, ``override_run``, ``retrieve_dashboard``, ``retrieve_offer``, ``retrieve_performance``, ``retrieve_run``, ``retrieve_settings``, ``retrieve_summary``, ``retrieve_transaction``, ``update_settings``. """ @cached_property @@ -698,11 +699,45 @@ def update_settings( ), ) + def retrieve_offer( + self, + *, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> InvestigatorRetrieveOfferResponse: + """Investigator agent offer. + + Whether to offer the Investigator agent to this application: its decisions taken by hand in the last 30 days, the average handling time, the people who stopped halfway and whether follow-ups are on. Read from the daily analytics, never from a scan of sessions. `show` is true when 20 or more decisions were taken by hand and the agent is not set up, or when follow-ups are off and 50 or more people stopped halfway. + + ``GET /v3/investigator/offer/`` + + Args: + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "InvestigatorRetrieveOfferResponse", + self._client.request( + "get", + "/v3/investigator/offer/", + cast_to=InvestigatorRetrieveOfferResponse, + auth="api_key", + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + class AsyncInvestigator(AsyncAPIResource): """The ``investigator`` resource of the Didit API. - Methods: ``accept_run``, ``batch_accept_runs``, ``export_activity``, ``list_activity``, ``list_guardrails``, ``list_queue``, ``override_run``, ``retrieve_dashboard``, ``retrieve_performance``, ``retrieve_run``, ``retrieve_settings``, ``retrieve_summary``, ``retrieve_transaction``, ``update_settings``. + Methods: ``accept_run``, ``batch_accept_runs``, ``export_activity``, ``list_activity``, ``list_guardrails``, ``list_queue``, ``override_run``, ``retrieve_dashboard``, ``retrieve_offer``, ``retrieve_performance``, ``retrieve_run``, ``retrieve_settings``, ``retrieve_summary``, ``retrieve_transaction``, ``update_settings``. """ @cached_property @@ -1347,6 +1382,40 @@ async def update_settings( ), ) + async def retrieve_offer( + self, + *, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> InvestigatorRetrieveOfferResponse: + """Investigator agent offer. + + Whether to offer the Investigator agent to this application: its decisions taken by hand in the last 30 days, the average handling time, the people who stopped halfway and whether follow-ups are on. Read from the daily analytics, never from a scan of sessions. `show` is true when 20 or more decisions were taken by hand and the agent is not set up, or when follow-ups are off and 50 or more people stopped halfway. + + ``GET /v3/investigator/offer/`` + + Args: + extra_headers: Headers to add to (or, with ``None``, remove from) this request. + extra_query: Query parameters to add to this request. + extra_body: Top-level JSON fields to add to this request's body. + timeout: Overrides the client's timeout for this request, in seconds. + """ + return cast( + "InvestigatorRetrieveOfferResponse", + await self._client.request( + "get", + "/v3/investigator/offer/", + cast_to=InvestigatorRetrieveOfferResponse, + auth="api_key", + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + ) + class InvestigatorWithRawResponse: def __init__(self, resource: Investigator) -> None: @@ -1365,6 +1434,7 @@ def __init__(self, resource: Investigator) -> None: self.export_activity = to_raw_response_wrapper(resource.export_activity) self.retrieve_settings = to_raw_response_wrapper(resource.retrieve_settings) self.update_settings = to_raw_response_wrapper(resource.update_settings) + self.retrieve_offer = to_raw_response_wrapper(resource.retrieve_offer) class AsyncInvestigatorWithRawResponse: @@ -1384,6 +1454,7 @@ def __init__(self, resource: AsyncInvestigator) -> None: self.export_activity = async_to_raw_response_wrapper(resource.export_activity) self.retrieve_settings = async_to_raw_response_wrapper(resource.retrieve_settings) self.update_settings = async_to_raw_response_wrapper(resource.update_settings) + self.retrieve_offer = async_to_raw_response_wrapper(resource.retrieve_offer) class InvestigatorWithStreamingResponse: @@ -1403,6 +1474,7 @@ def __init__(self, resource: Investigator) -> None: self.export_activity = to_streamed_response_wrapper(resource.export_activity) self.retrieve_settings = to_streamed_response_wrapper(resource.retrieve_settings) self.update_settings = to_streamed_response_wrapper(resource.update_settings) + self.retrieve_offer = to_streamed_response_wrapper(resource.retrieve_offer) class AsyncInvestigatorWithStreamingResponse: @@ -1426,3 +1498,4 @@ def __init__(self, resource: AsyncInvestigator) -> None: self.export_activity = async_to_streamed_response_wrapper(resource.export_activity) self.retrieve_settings = async_to_streamed_response_wrapper(resource.retrieve_settings) self.update_settings = async_to_streamed_response_wrapper(resource.update_settings) + self.retrieve_offer = async_to_streamed_response_wrapper(resource.retrieve_offer) diff --git a/src/didit/types/__init__.py b/src/didit/types/__init__.py index ae1d4a6..e241013 100644 --- a/src/didit/types/__init__.py +++ b/src/didit/types/__init__.py @@ -83,6 +83,39 @@ from didit.types.aml_monitoring.retrieve_job_response import ( AmlMonitoringRetrieveJobResponseResults as AmlMonitoringRetrieveJobResponseResults, ) + from didit.types.authentication_setup.set_domain_params import ( + AuthenticationSetupSetDomainParams as AuthenticationSetupSetDomainParams, + ) + from didit.types.authentication_setup.set_method_params import ( + AuthenticationSetupSetMethodParams as AuthenticationSetupSetMethodParams, + ) + from didit.types.authentication_setup.update_branding_params import ( + AuthenticationSetupUpdateBrandingParams as AuthenticationSetupUpdateBrandingParams, + ) + from didit.types.authentication_setup.update_configuration_params import ( + AuthenticationSetupUpdateConfigurationParams as AuthenticationSetupUpdateConfigurationParams, + ) + from didit.types.authentication_setup.update_native_apps_params import ( + AuthenticationSetupUpdateNativeAppsParams as AuthenticationSetupUpdateNativeAppsParams, + ) + from didit.types.authentication_setup.update_onboarding_params import ( + AuthenticationSetupUpdateOnboardingParams as AuthenticationSetupUpdateOnboardingParams, + ) + from didit.types.authentication_setup.update_protection_params import ( + AuthenticationSetupUpdateProtectionParams as AuthenticationSetupUpdateProtectionParams, + ) + from didit.types.authentication_setup.update_settings_params import ( + AuthenticationSetupUpdateSettingsParams as AuthenticationSetupUpdateSettingsParams, + ) + from didit.types.authentication_setup.update_verified_params import ( + AuthenticationSetupUpdateVerifiedParams as AuthenticationSetupUpdateVerifiedParams, + ) + from didit.types.authentication_setup.update_verified_params import ( + AuthenticationSetupUpdateVerifiedParamsRules as AuthenticationSetupUpdateVerifiedParamsRules, + ) + from didit.types.authentication_setup.update_verified_params import ( + AuthenticationSetupUpdateVerifiedParamsWorkflows as AuthenticationSetupUpdateVerifiedParamsWorkflows, + ) from didit.types.bank.account_check_params import ( BankAccountCheckParams as BankAccountCheckParams, ) @@ -1921,6 +1954,85 @@ from didit.types.components.session_webhook_delivery import ( SessionWebhookDelivery as SessionWebhookDelivery, ) + from didit.types.components.setup_android_app import SetupAndroidApp as SetupAndroidApp + from didit.types.components.setup_android_app import ( + SetupAndroidAppParam as SetupAndroidAppParam, + ) + from didit.types.components.setup_brand import SetupBrand as SetupBrand + from didit.types.components.setup_branding import SetupBranding as SetupBranding + from didit.types.components.setup_branding import SetupBrandingBadge as SetupBrandingBadge + from didit.types.components.setup_branding import SetupBrandingDefaults as SetupBrandingDefaults + from didit.types.components.setup_branding_texts import SetupBrandingTexts as SetupBrandingTexts + from didit.types.components.setup_branding_texts import ( + SetupBrandingTextsParam as SetupBrandingTextsParam, + ) + from didit.types.components.setup_configuration import SetupConfiguration as SetupConfiguration + from didit.types.components.setup_custom_domain import SetupCustomDomain as SetupCustomDomain + from didit.types.components.setup_custom_domain import ( + SetupCustomDomainCertificate as SetupCustomDomainCertificate, + ) + from didit.types.components.setup_custom_domain import ( + SetupCustomDomainDnsRecord as SetupCustomDomainDnsRecord, + ) + from didit.types.components.setup_didit_test_credentials import ( + SetupDiditTestCredentials as SetupDiditTestCredentials, + ) + from didit.types.components.setup_domain import SetupDomain as SetupDomain + from didit.types.components.setup_email import SetupEmail as SetupEmail + from didit.types.components.setup_email_summary import SetupEmailSummary as SetupEmailSummary + from didit.types.components.setup_emails import SetupEmails as SetupEmails + from didit.types.components.setup_emails import SetupEmailsSenders as SetupEmailsSenders + from didit.types.components.setup_emails import ( + SetupEmailsSendersEmail as SetupEmailsSendersEmail, + ) + from didit.types.components.setup_emails import SetupEmailsSendersSms as SetupEmailsSendersSms + from didit.types.components.setup_method_result import SetupMethodResult as SetupMethodResult + from didit.types.components.setup_method_summary import SetupMethodSummary as SetupMethodSummary + from didit.types.components.setup_native_apps import SetupNativeApps as SetupNativeApps + from didit.types.components.setup_onboarding import SetupOnboarding as SetupOnboarding + from didit.types.components.setup_protection import SetupProtection as SetupProtection + from didit.types.components.setup_protection import ( + SetupProtectionAttackMode as SetupProtectionAttackMode, + ) + from didit.types.components.setup_protection import ( + SetupProtectionCalendarMonth as SetupProtectionCalendarMonth, + ) + from didit.types.components.setup_protection import ( + SetupProtectionCalendarMonthChallenges as SetupProtectionCalendarMonthChallenges, + ) + from didit.types.components.setup_protection import ( + SetupProtectionCalendarMonthProtections as SetupProtectionCalendarMonthProtections, + ) + from didit.types.components.setup_protection import ( + SetupProtectionCalendarMonthProtectionsCounts as SetupProtectionCalendarMonthProtectionsCounts, + ) + from didit.types.components.setup_protection import ( + SetupProtectionCalendarMonthProtectionsCountsDelta as SetupProtectionCalendarMonthProtectionsCountsDelta, + ) + from didit.types.components.setup_protection import ( + SetupProtectionCalendarMonthProtectionsPreviousCounts as SetupProtectionCalendarMonthProtectionsPreviousCounts, + ) + from didit.types.components.setup_protection import ( + SetupProtectionChallengesDaily as SetupProtectionChallengesDaily, + ) + from didit.types.components.setup_protection import SetupProtectionDaily as SetupProtectionDaily + from didit.types.components.setup_protection_policy import ( + SetupProtectionPolicy as SetupProtectionPolicy, + ) + from didit.types.components.setup_protection_policy import ( + SetupProtectionPolicyCounts as SetupProtectionPolicyCounts, + ) + from didit.types.components.setup_provider_credentials import ( + SetupProviderCredentials as SetupProviderCredentials, + ) + from didit.types.components.setup_settings import SetupSettings as SetupSettings + from didit.types.components.setup_verified import SetupVerified as SetupVerified + from didit.types.components.setup_verified import SetupVerifiedSignup as SetupVerifiedSignup + from didit.types.components.setup_verified import SetupVerifiedWallet as SetupVerifiedWallet + from didit.types.components.setup_verified import ( + SetupVerifiedWorkflows as SetupVerifiedWorkflows, + ) + from didit.types.components.setup_verified_rule import SetupVerifiedRule as SetupVerifiedRule from didit.types.components.signature_field import SignatureField as SignatureField from didit.types.components.signature_field_anchor import ( SignatureFieldAnchor as SignatureFieldAnchor, @@ -2793,12 +2905,18 @@ from didit.types.investigator.retrieve_dashboard_response import ( InvestigatorRetrieveDashboardResponse as InvestigatorRetrieveDashboardResponse, ) + from didit.types.investigator.retrieve_offer_response import ( + InvestigatorRetrieveOfferResponse as InvestigatorRetrieveOfferResponse, + ) from didit.types.investigator.retrieve_performance_response import ( InvestigatorRetrievePerformanceResponse as InvestigatorRetrievePerformanceResponse, ) from didit.types.investigator.retrieve_summary_response import ( InvestigatorRetrieveSummaryResponse as InvestigatorRetrieveSummaryResponse, ) + from didit.types.investigator.retrieve_summary_response import ( + InvestigatorRetrieveSummaryResponseFreeReports as InvestigatorRetrieveSummaryResponseFreeReports, + ) from didit.types.investigator.retrieve_transaction_response import ( InvestigatorRetrieveTransactionResponse as InvestigatorRetrieveTransactionResponse, ) @@ -3753,6 +3871,17 @@ "AsyncReportFile": "components.async_report_file", "AsyncReportList": "components.async_report_list", "AsyncReportListCounts": "components.async_report_list", + "AuthenticationSetupSetDomainParams": "authentication_setup.set_domain_params", + "AuthenticationSetupSetMethodParams": "authentication_setup.set_method_params", + "AuthenticationSetupUpdateBrandingParams": "authentication_setup.update_branding_params", + "AuthenticationSetupUpdateConfigurationParams": "authentication_setup.update_configuration_params", + "AuthenticationSetupUpdateNativeAppsParams": "authentication_setup.update_native_apps_params", + "AuthenticationSetupUpdateOnboardingParams": "authentication_setup.update_onboarding_params", + "AuthenticationSetupUpdateProtectionParams": "authentication_setup.update_protection_params", + "AuthenticationSetupUpdateSettingsParams": "authentication_setup.update_settings_params", + "AuthenticationSetupUpdateVerifiedParams": "authentication_setup.update_verified_params", + "AuthenticationSetupUpdateVerifiedParamsRules": "authentication_setup.update_verified_params", + "AuthenticationSetupUpdateVerifiedParamsWorkflows": "authentication_setup.update_verified_params", "BankAccountCheckBusinessHolder": "components.bank_account_check_business_holder", "BankAccountCheckHolder": "components.bank_account_check_holder", "BankAccountCheckParams": "bank.account_check_params", @@ -4144,8 +4273,10 @@ "InvestigatorOverrideRunParams": "investigator.override_run_params", "InvestigatorQueueRow": "components.investigator_queue_row", "InvestigatorRetrieveDashboardResponse": "investigator.retrieve_dashboard_response", + "InvestigatorRetrieveOfferResponse": "investigator.retrieve_offer_response", "InvestigatorRetrievePerformanceResponse": "investigator.retrieve_performance_response", "InvestigatorRetrieveSummaryResponse": "investigator.retrieve_summary_response", + "InvestigatorRetrieveSummaryResponseFreeReports": "investigator.retrieve_summary_response", "InvestigatorRetrieveTransactionResponse": "investigator.retrieve_transaction_response", "InvestigatorRunDetail": "components.investigator_run_detail", "InvestigatorSettings": "components.investigator_settings", @@ -4630,6 +4761,49 @@ "SessionsUpdateStatusResponse": "sessions.update_status_response", "SessionsUploadKybDocumentsParams": "sessions.upload_kyb_documents_params", "SessionsUploadKybDocumentsResponse": "sessions.upload_kyb_documents_response", + "SetupAndroidApp": "components.setup_android_app", + "SetupAndroidAppParam": "components.setup_android_app", + "SetupBrand": "components.setup_brand", + "SetupBranding": "components.setup_branding", + "SetupBrandingBadge": "components.setup_branding", + "SetupBrandingDefaults": "components.setup_branding", + "SetupBrandingTexts": "components.setup_branding_texts", + "SetupBrandingTextsParam": "components.setup_branding_texts", + "SetupConfiguration": "components.setup_configuration", + "SetupCustomDomain": "components.setup_custom_domain", + "SetupCustomDomainCertificate": "components.setup_custom_domain", + "SetupCustomDomainDnsRecord": "components.setup_custom_domain", + "SetupDiditTestCredentials": "components.setup_didit_test_credentials", + "SetupDomain": "components.setup_domain", + "SetupEmail": "components.setup_email", + "SetupEmailSummary": "components.setup_email_summary", + "SetupEmails": "components.setup_emails", + "SetupEmailsSenders": "components.setup_emails", + "SetupEmailsSendersEmail": "components.setup_emails", + "SetupEmailsSendersSms": "components.setup_emails", + "SetupMethodResult": "components.setup_method_result", + "SetupMethodSummary": "components.setup_method_summary", + "SetupNativeApps": "components.setup_native_apps", + "SetupOnboarding": "components.setup_onboarding", + "SetupProtection": "components.setup_protection", + "SetupProtectionAttackMode": "components.setup_protection", + "SetupProtectionCalendarMonth": "components.setup_protection", + "SetupProtectionCalendarMonthChallenges": "components.setup_protection", + "SetupProtectionCalendarMonthProtections": "components.setup_protection", + "SetupProtectionCalendarMonthProtectionsCounts": "components.setup_protection", + "SetupProtectionCalendarMonthProtectionsCountsDelta": "components.setup_protection", + "SetupProtectionCalendarMonthProtectionsPreviousCounts": "components.setup_protection", + "SetupProtectionChallengesDaily": "components.setup_protection", + "SetupProtectionDaily": "components.setup_protection", + "SetupProtectionPolicy": "components.setup_protection_policy", + "SetupProtectionPolicyCounts": "components.setup_protection_policy", + "SetupProviderCredentials": "components.setup_provider_credentials", + "SetupSettings": "components.setup_settings", + "SetupVerified": "components.setup_verified", + "SetupVerifiedRule": "components.setup_verified_rule", + "SetupVerifiedSignup": "components.setup_verified", + "SetupVerifiedWallet": "components.setup_verified", + "SetupVerifiedWorkflows": "components.setup_verified", "SignatureField": "components.signature_field", "SignatureFieldAnchor": "components.signature_field_anchor", "SignatureFieldResult": "components.signature_field_result", @@ -5086,6 +5260,17 @@ "AsyncReportFile", "AsyncReportList", "AsyncReportListCounts", + "AuthenticationSetupSetDomainParams", + "AuthenticationSetupSetMethodParams", + "AuthenticationSetupUpdateBrandingParams", + "AuthenticationSetupUpdateConfigurationParams", + "AuthenticationSetupUpdateNativeAppsParams", + "AuthenticationSetupUpdateOnboardingParams", + "AuthenticationSetupUpdateProtectionParams", + "AuthenticationSetupUpdateSettingsParams", + "AuthenticationSetupUpdateVerifiedParams", + "AuthenticationSetupUpdateVerifiedParamsRules", + "AuthenticationSetupUpdateVerifiedParamsWorkflows", "BankAccountCheckBusinessHolder", "BankAccountCheckHolder", "BankAccountCheckParams", @@ -5477,8 +5662,10 @@ "InvestigatorOverrideRunParams", "InvestigatorQueueRow", "InvestigatorRetrieveDashboardResponse", + "InvestigatorRetrieveOfferResponse", "InvestigatorRetrievePerformanceResponse", "InvestigatorRetrieveSummaryResponse", + "InvestigatorRetrieveSummaryResponseFreeReports", "InvestigatorRetrieveTransactionResponse", "InvestigatorRunDetail", "InvestigatorSettings", @@ -5963,6 +6150,49 @@ "SessionsUpdateStatusResponse", "SessionsUploadKybDocumentsParams", "SessionsUploadKybDocumentsResponse", + "SetupAndroidApp", + "SetupAndroidAppParam", + "SetupBrand", + "SetupBranding", + "SetupBrandingBadge", + "SetupBrandingDefaults", + "SetupBrandingTexts", + "SetupBrandingTextsParam", + "SetupConfiguration", + "SetupCustomDomain", + "SetupCustomDomainCertificate", + "SetupCustomDomainDnsRecord", + "SetupDiditTestCredentials", + "SetupDomain", + "SetupEmail", + "SetupEmailSummary", + "SetupEmails", + "SetupEmailsSenders", + "SetupEmailsSendersEmail", + "SetupEmailsSendersSms", + "SetupMethodResult", + "SetupMethodSummary", + "SetupNativeApps", + "SetupOnboarding", + "SetupProtection", + "SetupProtectionAttackMode", + "SetupProtectionCalendarMonth", + "SetupProtectionCalendarMonthChallenges", + "SetupProtectionCalendarMonthProtections", + "SetupProtectionCalendarMonthProtectionsCounts", + "SetupProtectionCalendarMonthProtectionsCountsDelta", + "SetupProtectionCalendarMonthProtectionsPreviousCounts", + "SetupProtectionChallengesDaily", + "SetupProtectionDaily", + "SetupProtectionPolicy", + "SetupProtectionPolicyCounts", + "SetupProviderCredentials", + "SetupSettings", + "SetupVerified", + "SetupVerifiedRule", + "SetupVerifiedSignup", + "SetupVerifiedWallet", + "SetupVerifiedWorkflows", "SignatureField", "SignatureFieldAnchor", "SignatureFieldResult", diff --git a/src/didit/types/authentication_setup/__init__.py b/src/didit/types/authentication_setup/__init__.py new file mode 100644 index 0000000..73f4330 --- /dev/null +++ b/src/didit/types/authentication_setup/__init__.py @@ -0,0 +1 @@ +# Code generated by codegen from openapi/*.json. DO NOT EDIT. diff --git a/src/didit/types/authentication_setup/set_domain_params.py b/src/didit/types/authentication_setup/set_domain_params.py new file mode 100644 index 0000000..8938e7b --- /dev/null +++ b/src/didit/types/authentication_setup/set_domain_params.py @@ -0,0 +1,11 @@ +# Code generated by codegen from openapi/*.json. DO NOT EDIT. +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["AuthenticationSetupSetDomainParams"] + + +class AuthenticationSetupSetDomainParams(TypedDict, total=False): + domain: Required[str] + """The domain to serve the hosted pages on. It must be a host under a zone: a CNAME cannot sit at an apex.""" diff --git a/src/didit/types/authentication_setup/set_method_params.py b/src/didit/types/authentication_setup/set_method_params.py new file mode 100644 index 0000000..6f931dc --- /dev/null +++ b/src/didit/types/authentication_setup/set_method_params.py @@ -0,0 +1,25 @@ +# Code generated by codegen from openapi/*.json. DO NOT EDIT. +from __future__ import annotations + +from typing import Literal + +from typing_extensions import Required, TypedDict + +from didit.types.components.setup_provider_credentials import SetupProviderCredentials + +__all__ = ["AuthenticationSetupSetMethodParams"] + + +class AuthenticationSetupSetMethodParams(TypedDict, total=False): + """`enabled` is required. `credentials` belongs to a social method, `workflow_id` to `phone`, and `credential_source` to a social method; anywhere else they answer `not_supported`. An unknown field answers `unknown_field`.""" + + enabled: Required[bool] + + credentials: SetupProviderCredentials + """Your own OAuth app's credentials. The secret is write-only: no response returns it.""" + + credential_source: Literal["own", "didit_test"] | str + """`didit_test` uses Didit's own sandbox app, and is refused on a live application with `sandbox_only`. Omitted: `own` when you send `credentials`, the stored source otherwise, and `didit_test` for a sandbox application's social method that was never configured.""" + + workflow_id: str + """`phone` only: the phone verification workflow whose codes it sends.""" diff --git a/src/didit/types/authentication_setup/update_branding_params.py b/src/didit/types/authentication_setup/update_branding_params.py new file mode 100644 index 0000000..35cc480 --- /dev/null +++ b/src/didit/types/authentication_setup/update_branding_params.py @@ -0,0 +1,20 @@ +# Code generated by codegen from openapi/*.json. DO NOT EDIT. +from __future__ import annotations + +from typing import Mapping + +from typing_extensions import TypedDict + +from didit.types.components.setup_branding_texts import SetupBrandingTextsParam + +__all__ = ["AuthenticationSetupUpdateBrandingParams"] + + +class AuthenticationSetupUpdateBrandingParams(TypedDict, total=False): + """Every field is optional. A language Didit does not publish answers `unsupported_language`, and a legal link that is not `https://` answers `https_required`.""" + + texts: Mapping[str, SetupBrandingTextsParam] + + terms_url: str + + privacy_url: str diff --git a/src/didit/types/authentication_setup/update_configuration_params.py b/src/didit/types/authentication_setup/update_configuration_params.py new file mode 100644 index 0000000..ae4e5db --- /dev/null +++ b/src/didit/types/authentication_setup/update_configuration_params.py @@ -0,0 +1,34 @@ +# Code generated by codegen from openapi/*.json. DO NOT EDIT. +from __future__ import annotations + +from typing import Literal, Sequence + +from typing_extensions import TypedDict + +__all__ = ["AuthenticationSetupUpdateConfigurationParams"] + + +class AuthenticationSetupUpdateConfigurationParams(TypedDict, total=False): + """Every field is optional; send only what changes. `enabled`, `publishable_key`, `methods` and `didit_test_credentials` are read-only and answer `follows_product` or `unknown_field`.""" + + redirect_uris: Sequence[str] + + allowed_origins: Sequence[str] + + post_logout_redirect_uri: str + + session_lifetime: int + + idle_timeout: int + + multiple_sessions: bool + + password_min_length: int + + revoke_on_password_change: bool + + allow_subaddresses: bool + + signup_policy: Literal["anyone", "invited", "allowed_domains"] | str + + allowed_email_domains: Sequence[str] diff --git a/src/didit/types/authentication_setup/update_native_apps_params.py b/src/didit/types/authentication_setup/update_native_apps_params.py new file mode 100644 index 0000000..3f7c714 --- /dev/null +++ b/src/didit/types/authentication_setup/update_native_apps_params.py @@ -0,0 +1,18 @@ +# Code generated by codegen from openapi/*.json. DO NOT EDIT. +from __future__ import annotations + +from typing import Sequence + +from typing_extensions import Required, TypedDict + +from didit.types.components.setup_android_app import SetupAndroidAppParam + +__all__ = ["AuthenticationSetupUpdateNativeAppsParams"] + + +class AuthenticationSetupUpdateNativeAppsParams(TypedDict, total=False): + """Both lists are replaced. Duplicates are dropped.""" + + ios_app_ids: Required[Sequence[str]] + + android_apps: Required[Sequence[SetupAndroidAppParam]] diff --git a/src/didit/types/authentication_setup/update_onboarding_params.py b/src/didit/types/authentication_setup/update_onboarding_params.py new file mode 100644 index 0000000..4cd6fe7 --- /dev/null +++ b/src/didit/types/authentication_setup/update_onboarding_params.py @@ -0,0 +1,18 @@ +# Code generated by codegen from openapi/*.json. DO NOT EDIT. +from __future__ import annotations + +from typing import Literal + +from typing_extensions import TypedDict + +__all__ = ["AuthenticationSetupUpdateOnboardingParams"] + + +class AuthenticationSetupUpdateOnboardingParams(TypedDict, total=False): + """At least one field is required; an empty body answers `{"non_field_errors": ["empty_update"]}`.""" + + test_skipped: bool + + import_skipped: bool + + sign_in_ui: Literal["hosted", "own"] | str diff --git a/src/didit/types/authentication_setup/update_protection_params.py b/src/didit/types/authentication_setup/update_protection_params.py new file mode 100644 index 0000000..ab0df86 --- /dev/null +++ b/src/didit/types/authentication_setup/update_protection_params.py @@ -0,0 +1,19 @@ +# Code generated by codegen from openapi/*.json. DO NOT EDIT. +from __future__ import annotations + +from typing import Literal, Mapping + +from typing_extensions import TypedDict + +__all__ = ["AuthenticationSetupUpdateProtectionParams"] + + +class AuthenticationSetupUpdateProtectionParams(TypedDict, total=False): + """Every field is optional. The policies you send are merged into the stored ones; an unknown policy answers `unknown_protection`.""" + + enabled: bool + + breached_password_check: bool + + policies: Mapping[str, Literal["off", "log", "challenge", "block"] | str] + """A mode per policy: `bots`, `stuffing`, `brute`, `disposable`, `vpn` and `travel`.""" diff --git a/src/didit/types/authentication_setup/update_settings_params.py b/src/didit/types/authentication_setup/update_settings_params.py new file mode 100644 index 0000000..e96b7af --- /dev/null +++ b/src/didit/types/authentication_setup/update_settings_params.py @@ -0,0 +1,34 @@ +# Code generated by codegen from openapi/*.json. DO NOT EDIT. +from __future__ import annotations + +from typing import Literal, Sequence + +from typing_extensions import TypedDict + +__all__ = ["AuthenticationSetupUpdateSettingsParams"] + + +class AuthenticationSetupUpdateSettingsParams(TypedDict, total=False): + """Every field is optional. Changing the application’s `agent_humans_only` setting requires an owner or admin. Enabling it also requires an enrolled passkey. A named key receives 403 `owner_or_admin_required`.""" + + sign_in_ui: Literal["hosted", "own"] | str + + agent_humans_only: bool + + agents_enabled: bool + + agent_scopes: Sequence[Literal["read", "act"] | str] + + agent_lifetime: int + + agent_idle_timeout: int + + agent_approval: Literal["passkey", "sign_in"] | str + + organizations_enabled: bool + + mfa_policy: Literal["optional", "everyone", "organization_admins"] | str + + default_member_role: Literal["admin", "member", "billing"] | str + + webhook_events_disabled: Sequence[str] diff --git a/src/didit/types/authentication_setup/update_verified_params.py b/src/didit/types/authentication_setup/update_verified_params.py new file mode 100644 index 0000000..eea43b9 --- /dev/null +++ b/src/didit/types/authentication_setup/update_verified_params.py @@ -0,0 +1,44 @@ +# Code generated by codegen from openapi/*.json. DO NOT EDIT. +from __future__ import annotations + +from typing import Literal, Sequence + +from typing_extensions import Required, TypedDict + +__all__ = [ + "AuthenticationSetupUpdateVerifiedParams", + "AuthenticationSetupUpdateVerifiedParamsRules", + "AuthenticationSetupUpdateVerifiedParamsWorkflows", +] + + +class AuthenticationSetupUpdateVerifiedParamsRules(TypedDict, total=False): + rule: Required[Literal["payout", "bank", "contact", "device", "sign_in"] | str] + + enabled: bool + + method: Literal["liveness", "selfie", "full_id"] | str + + threshold: str + + currency: str + + +class AuthenticationSetupUpdateVerifiedParamsWorkflows(TypedDict, total=False): + liveness: str | None + + selfie: str | None + + full_id: str | None + + +class AuthenticationSetupUpdateVerifiedParams(TypedDict, total=False): + """Every field is optional. Each supplied rule updates only the fields you send for its kind. Omitted rules keep their settings. Two rules of the same kind answer `duplicate_rule`, and `threshold` or `currency` on a rule other than `payout` answer `not_supported`.""" + + signup_level: Literal["none", "liveness", "full_id"] | str + + rules: Sequence[AuthenticationSetupUpdateVerifiedParamsRules] + + claims: Sequence[str] + + workflows: AuthenticationSetupUpdateVerifiedParamsWorkflows diff --git a/src/didit/types/components/investigator_queue_row.py b/src/didit/types/components/investigator_queue_row.py index 31413da..600c4eb 100644 --- a/src/didit/types/components/investigator_queue_row.py +++ b/src/didit/types/components/investigator_queue_row.py @@ -16,7 +16,7 @@ class InvestigatorQueueRow(BaseModel): queue: Literal["kyc", "kyb", "aml", "transactions", "cases"] | str | None = None - stage: Literal["shadow", "live"] | str | None = None + stage: Literal["none", "shadow", "live"] | str | None = None subject: dict[str, object] | None = None """The item under review: `id`, `number`, `status`, `name` and, depending on the kind, `country`, `workflow`, `vendor_data`, `txn_id`, `amount`, `currency`, `direction`, `title` or `priority`.""" @@ -41,3 +41,9 @@ class InvestigatorQueueRow(BaseModel): due_at: _dt.datetime | None = None prepared_at: _dt.datetime | None = None + + free_report: bool | None = None + """True for one of the organization's free reports: a review run at stage `none`, with no setup, never charged.""" + + example: bool | None = None + """True for an example report shown on a sandbox application. Example reports are read only and never cost anything.""" diff --git a/src/didit/types/components/setup_android_app.py b/src/didit/types/components/setup_android_app.py new file mode 100644 index 0000000..6d90115 --- /dev/null +++ b/src/didit/types/components/setup_android_app.py @@ -0,0 +1,22 @@ +# Code generated by codegen from openapi/*.json. DO NOT EDIT. +from __future__ import annotations + +from typing import Sequence + +from typing_extensions import Required, TypedDict + +from didit._models import BaseModel + +__all__ = ["SetupAndroidApp", "SetupAndroidAppParam"] + + +class SetupAndroidApp(BaseModel): + package_name: str + + sha256_cert_fingerprints: list[str] + + +class SetupAndroidAppParam(TypedDict, total=False): + package_name: Required[str] + + sha256_cert_fingerprints: Required[Sequence[str]] diff --git a/src/didit/types/components/setup_brand.py b/src/didit/types/components/setup_brand.py new file mode 100644 index 0000000..e540a4c --- /dev/null +++ b/src/didit/types/components/setup_brand.py @@ -0,0 +1,36 @@ +# Code generated by codegen from openapi/*.json. DO NOT EDIT. +from __future__ import annotations + +from typing import Literal + +from didit._models import BaseModel + +__all__ = ["SetupBrand"] + + +class SetupBrand(BaseModel): + """The brand as Customization sets it. Read-only here.""" + + source: str | None = None + + name: str | None = None + + logo: str | None = None + + logo_dark: str | None = None + + brand_colour: str | None = None + + brand_colour_dark: str | None = None + + button_text_colour: str | None = None + + background: str | None = None + + background_dark: str | None = None + + corner_radius: int | None = None + + font: str | None = None + + theme: Literal["device"] | str | None = None diff --git a/src/didit/types/components/setup_branding.py b/src/didit/types/components/setup_branding.py new file mode 100644 index 0000000..af73ff3 --- /dev/null +++ b/src/didit/types/components/setup_branding.py @@ -0,0 +1,48 @@ +# Code generated by codegen from openapi/*.json. DO NOT EDIT. +from __future__ import annotations + +from didit._models import BaseModel +from didit.types.components.setup_brand import SetupBrand +from didit.types.components.setup_branding_texts import SetupBrandingTexts + +__all__ = ["SetupBranding", "SetupBrandingBadge", "SetupBrandingDefaults"] + + +class SetupBrandingBadge(BaseModel): + visible: bool | None = None + + plan: str | None = None + + early_access: bool | None = None + + +class SetupBrandingDefaults(BaseModel): + """Didit's own copy for the language you asked for.""" + + sign_in_title: str | None = None + + subtitle: str | None = None + + sign_up_title: str | None = None + + +class SetupBranding(BaseModel): + brand: SetupBrand + """The brand as Customization sets it. Read-only here.""" + + texts: dict[str, SetupBrandingTexts] + """The texts this application set, by language code.""" + + defaults: SetupBrandingDefaults + """Didit's own copy for the language you asked for.""" + + terms_url: str | None = None + + privacy_url: str | None = None + + languages: list[str] + """The language codes the hosted pages can show.""" + + badge: SetupBrandingBadge + + hosted_url: str diff --git a/src/didit/types/components/setup_branding_texts.py b/src/didit/types/components/setup_branding_texts.py new file mode 100644 index 0000000..df3654f --- /dev/null +++ b/src/didit/types/components/setup_branding_texts.py @@ -0,0 +1,28 @@ +# Code generated by codegen from openapi/*.json. DO NOT EDIT. +from __future__ import annotations + +from typing_extensions import TypedDict + +from didit._models import BaseModel + +__all__ = ["SetupBrandingTexts", "SetupBrandingTextsParam"] + + +class SetupBrandingTexts(BaseModel): + """The texts of the hosted sign-in, sign-up and subtitle lines. A field left empty falls back to Didit's copy.""" + + sign_in_title: str | None = None + + subtitle: str | None = None + + sign_up_title: str | None = None + + +class SetupBrandingTextsParam(TypedDict, total=False): + """The texts of the hosted sign-in, sign-up and subtitle lines. A field left empty falls back to Didit's copy.""" + + sign_in_title: str + + subtitle: str + + sign_up_title: str diff --git a/src/didit/types/components/setup_configuration.py b/src/didit/types/components/setup_configuration.py new file mode 100644 index 0000000..8d853aa --- /dev/null +++ b/src/didit/types/components/setup_configuration.py @@ -0,0 +1,53 @@ +# Code generated by codegen from openapi/*.json. DO NOT EDIT. +from __future__ import annotations + +from typing import Literal + +from didit._models import BaseModel +from didit.types.components.setup_didit_test_credentials import SetupDiditTestCredentials +from didit.types.components.setup_method_summary import SetupMethodSummary + +__all__ = ["SetupConfiguration"] + + +class SetupConfiguration(BaseModel): + application_id: str + + publishable_key: str | None = None + """`pk_live_` or `pk_test_` followed by the base64url issuer. A public identifier, not a credential; `null` when the hosted origin is not usable yet.""" + + enabled: bool + """Whether Authentication is on for this application. Read-only: it follows the product.""" + + methods: list[SetupMethodSummary] + + didit_test_credentials: SetupDiditTestCredentials + """Which social providers Didit's own sandbox apps can serve for this application. Every value is `false` on a live application.""" + + redirect_uris: list[str] + """Where `POST authorize/` may send the browser after sign-in. Exact match, and `https://` only on a live application.""" + + allowed_origins: list[str] + """Origins allowed to embed or call the hosted pages and the browser SDK. Scheme, host and optional port only.""" + + post_logout_redirect_uri: str | None = None + """Where hosted sign-out sends the browser. Empty for none.""" + + session_lifetime: int + + idle_timeout: int + + multiple_sessions: bool | None = None + """`false` signs the person out of their other sessions at each new sign-in.""" + + password_min_length: int | None = None + + revoke_on_password_change: bool | None = None + + allow_subaddresses: bool | None = None + """Accept a `+` in the email's local part.""" + + signup_policy: Literal["anyone", "invited", "allowed_domains"] | str + + allowed_email_domains: list[str] | None = None + """The domains `signup_policy: "allowed_domains"` accepts.""" diff --git a/src/didit/types/components/setup_custom_domain.py b/src/didit/types/components/setup_custom_domain.py new file mode 100644 index 0000000..bb2733c --- /dev/null +++ b/src/didit/types/components/setup_custom_domain.py @@ -0,0 +1,42 @@ +# Code generated by codegen from openapi/*.json. DO NOT EDIT. +from __future__ import annotations + +import datetime as _dt +from typing import Literal + +from didit._models import BaseModel + +__all__ = ["SetupCustomDomain", "SetupCustomDomainCertificate", "SetupCustomDomainDnsRecord"] + + +class SetupCustomDomainCertificate(BaseModel): + status: str | None = None + + expires_at: _dt.datetime | None = None + + +class SetupCustomDomainDnsRecord(BaseModel): + type: Literal["CNAME"] | str + + name: str + + value: str + """The application's default host the domain points at.""" + + +class SetupCustomDomain(BaseModel): + domain: str + + status: Literal["pending", "issuing", "verified", "active", "failed"] | str + + failure_reason: str | None = None + + dns_record: SetupCustomDomainDnsRecord + + certificate: SetupCustomDomainCertificate + + dns_checked_at: _dt.datetime | None = None + + verified_at: _dt.datetime | None = None + + activated_at: _dt.datetime | None = None diff --git a/src/didit/types/components/setup_didit_test_credentials.py b/src/didit/types/components/setup_didit_test_credentials.py new file mode 100644 index 0000000..01ca945 --- /dev/null +++ b/src/didit/types/components/setup_didit_test_credentials.py @@ -0,0 +1,18 @@ +# Code generated by codegen from openapi/*.json. DO NOT EDIT. +from __future__ import annotations + +from didit._models import BaseModel + +__all__ = ["SetupDiditTestCredentials"] + + +class SetupDiditTestCredentials(BaseModel): + """Which social providers Didit's own sandbox apps can serve for this application. Every value is `false` on a live application.""" + + google: bool | None = None + + microsoft: bool | None = None + + apple: bool | None = None + + github: bool | None = None diff --git a/src/didit/types/components/setup_domain.py b/src/didit/types/components/setup_domain.py new file mode 100644 index 0000000..87620bc --- /dev/null +++ b/src/didit/types/components/setup_domain.py @@ -0,0 +1,32 @@ +# Code generated by codegen from openapi/*.json. DO NOT EDIT. +from __future__ import annotations + +from didit._models import BaseModel +from didit.types.components.setup_custom_domain import SetupCustomDomain + +__all__ = ["SetupDomain"] + + +class SetupDomain(BaseModel): + host: str + + default_origin: str + + origin: str + """The custom domain once it is active, the default origin until then.""" + + hosted_url: str + + issuer: str + + passkey_rp_id: str + + sandbox: bool + + sandbox_origin: str | None = None + """A live application's sandbox origin, shown beside its own.""" + + custom_domains_available: bool + """Whether this deployment can serve a custom domain.""" + + custom_domain: SetupCustomDomain | None = None diff --git a/src/didit/types/components/setup_email.py b/src/didit/types/components/setup_email.py new file mode 100644 index 0000000..b640a21 --- /dev/null +++ b/src/didit/types/components/setup_email.py @@ -0,0 +1,23 @@ +# Code generated by codegen from openapi/*.json. DO NOT EDIT. +from __future__ import annotations + +from pydantic import Field + +from didit._models import BaseModel + +__all__ = ["SetupEmail"] + + +class SetupEmail(BaseModel): + key: str + + from_: str = Field(alias="from") + + to: str + """The console member's address. Empty for a grant or a key.""" + + subject: str + + html: str + + enabled: bool diff --git a/src/didit/types/components/setup_email_summary.py b/src/didit/types/components/setup_email_summary.py new file mode 100644 index 0000000..e5477ce --- /dev/null +++ b/src/didit/types/components/setup_email_summary.py @@ -0,0 +1,22 @@ +# Code generated by codegen from openapi/*.json. DO NOT EDIT. +from __future__ import annotations + +from typing import Literal + +from didit._models import BaseModel + +__all__ = ["SetupEmailSummary"] + + +class SetupEmailSummary(BaseModel): + key: Literal["code", "magic", "reset", "device", "invite", "org", "agent", "agentoff"] | str + + icon: str | None = None + + sent: bool + """Whether Authentication sends this email at all. `false` for `device`, `agent` and `agentoff`, which are listing placeholders.""" + + enabled: bool + """Whether this application sends it.""" + + subject: str | None = None diff --git a/src/didit/types/components/setup_emails.py b/src/didit/types/components/setup_emails.py new file mode 100644 index 0000000..2ff4750 --- /dev/null +++ b/src/didit/types/components/setup_emails.py @@ -0,0 +1,39 @@ +# Code generated by codegen from openapi/*.json. DO NOT EDIT. +from __future__ import annotations + +from didit._models import BaseModel +from didit.types.components.setup_email_summary import SetupEmailSummary + +__all__ = ["SetupEmails", "SetupEmailsSenders", "SetupEmailsSendersEmail", "SetupEmailsSendersSms"] + + +class SetupEmailsSendersEmail(BaseModel): + name: str | None = None + + email: str | None = None + + header: str | None = None + + own: bool | None = None + """Whether the application sends from its own verified domain.""" + + +class SetupEmailsSendersSms(BaseModel): + name: str | None = None + + +class SetupEmailsSenders(BaseModel): + """Read-only: they come from Customization.""" + + email: SetupEmailsSendersEmail | None = None + + sms: SetupEmailsSendersSms | None = None + + +class SetupEmails(BaseModel): + senders: SetupEmailsSenders + """Read-only: they come from Customization.""" + + emails: list[SetupEmailSummary] + + language: str diff --git a/src/didit/types/components/setup_method_result.py b/src/didit/types/components/setup_method_result.py new file mode 100644 index 0000000..8ce8744 --- /dev/null +++ b/src/didit/types/components/setup_method_result.py @@ -0,0 +1,24 @@ +# Code generated by codegen from openapi/*.json. DO NOT EDIT. +from __future__ import annotations + +from typing import Literal + +from didit._models import BaseModel + +__all__ = ["SetupMethodResult"] + + +class SetupMethodResult(BaseModel): + name: str + + enabled: bool + + credential_source: Literal["own", "didit_test"] | str | None = None + """Returned only for social methods.""" + + configured: bool | None = None + """Whether the method can now sign anyone in.""" + + client_id: str | None = None + + callback_uri: str | None = None diff --git a/src/didit/types/components/setup_method_summary.py b/src/didit/types/components/setup_method_summary.py new file mode 100644 index 0000000..698c89b --- /dev/null +++ b/src/didit/types/components/setup_method_summary.py @@ -0,0 +1,49 @@ +# Code generated by codegen from openapi/*.json. DO NOT EDIT. +from __future__ import annotations + +from typing import Literal + +from didit._models import BaseModel + +__all__ = ["SetupMethodSummary"] + + +class SetupMethodSummary(BaseModel): + """One sign-in method. `credential_source` is `null` for a method that holds no social credentials, and `always_on` appears on the methods that are on for every application.""" + + name: ( + Literal[ + "password", + "code", + "magic", + "phone", + "passkey", + "google", + "microsoft", + "apple", + "github", + "sso", + "wallet", + ] + | str + ) + + enabled: bool + + credential_source: Literal["own", "didit_test"] | str | None + """`own` for the application's credentials, `didit_test` for Didit's sandbox app, `null` for a method that takes no social credentials.""" + + always_on: bool | None = None + """Present and `true` on a method no application can switch off.""" + + available: bool | None = None + """`wallet` only: whether Didit ID Wallet sign-in can be offered.""" + + configured: bool | None = None + """Whether the method has the credentials it needs to sign anyone in.""" + + client_id: str | None = None + """The social client ID in use, or an empty string.""" + + callback_uri: str | None = None + """The redirect URI to register with the provider; Didit's own broker for `didit_test`.""" diff --git a/src/didit/types/components/setup_native_apps.py b/src/didit/types/components/setup_native_apps.py new file mode 100644 index 0000000..0178c52 --- /dev/null +++ b/src/didit/types/components/setup_native_apps.py @@ -0,0 +1,14 @@ +# Code generated by codegen from openapi/*.json. DO NOT EDIT. +from __future__ import annotations + +from didit._models import BaseModel +from didit.types.components.setup_android_app import SetupAndroidApp + +__all__ = ["SetupNativeApps"] + + +class SetupNativeApps(BaseModel): + ios_app_ids: list[str] + """Apple team ID and bundle identifier, as `webcredentials` names an app.""" + + android_apps: list[SetupAndroidApp] diff --git a/src/didit/types/components/setup_onboarding.py b/src/didit/types/components/setup_onboarding.py new file mode 100644 index 0000000..106f779 --- /dev/null +++ b/src/didit/types/components/setup_onboarding.py @@ -0,0 +1,22 @@ +# Code generated by codegen from openapi/*.json. DO NOT EDIT. +from __future__ import annotations + +from typing import Literal + +from didit._models import BaseModel + +__all__ = ["SetupOnboarding"] + + +class SetupOnboarding(BaseModel): + completed: list[Literal["methods", "redirects", "import", "test"] | str] + + ready: bool + """Every setup step is done.""" + + sign_in_ui: Literal["hosted", "own"] | str + + test_sign_in: dict[str, object] | None = None + """Console session only: the sample sign-in the console shows, naming an end user. Left out for a grant or a key.""" + + test_status: Literal["verified", "skipped", "not_started"] | str diff --git a/src/didit/types/components/setup_protection.py b/src/didit/types/components/setup_protection.py new file mode 100644 index 0000000..acf8266 --- /dev/null +++ b/src/didit/types/components/setup_protection.py @@ -0,0 +1,135 @@ +# Code generated by codegen from openapi/*.json. DO NOT EDIT. +from __future__ import annotations + +import datetime as _dt + +from didit._models import BaseModel +from didit.types.components.setup_protection_policy import SetupProtectionPolicy + +__all__ = [ + "SetupProtection", + "SetupProtectionAttackMode", + "SetupProtectionCalendarMonth", + "SetupProtectionCalendarMonthChallenges", + "SetupProtectionCalendarMonthProtections", + "SetupProtectionCalendarMonthProtectionsCounts", + "SetupProtectionCalendarMonthProtectionsCountsDelta", + "SetupProtectionCalendarMonthProtectionsPreviousCounts", + "SetupProtectionChallengesDaily", + "SetupProtectionDaily", +] + + +class SetupProtectionAttackMode(BaseModel): + active: bool + + started_at: _dt.datetime | None = None + + expires_at: _dt.datetime | None = None + + +class SetupProtectionCalendarMonthChallenges(BaseModel): + passed: int | None = None + + failed: int | None = None + + previous_passed: int | None = None + + previous_failed: int | None = None + + +class SetupProtectionCalendarMonthProtectionsCounts(BaseModel): + log: int | None = None + + challenge: int | None = None + + block: int | None = None + + +class SetupProtectionCalendarMonthProtectionsCountsDelta(BaseModel): + log: int | None = None + + challenge: int | None = None + + block: int | None = None + + +class SetupProtectionCalendarMonthProtectionsPreviousCounts(BaseModel): + log: int | None = None + + challenge: int | None = None + + block: int | None = None + + +class SetupProtectionCalendarMonthProtections(BaseModel): + key: str | None = None + + counts: SetupProtectionCalendarMonthProtectionsCounts | None = None + + previous_counts: SetupProtectionCalendarMonthProtectionsPreviousCounts | None = None + + counts_delta: SetupProtectionCalendarMonthProtectionsCountsDelta | None = None + + accounts: int | None = None + + previous_accounts: int | None = None + + accounts_delta: int | None = None + + +class SetupProtectionCalendarMonth(BaseModel): + """This calendar month against the previous one.""" + + start: _dt.datetime | None = None + + as_of: _dt.datetime | None = None + + previous_start: _dt.datetime | None = None + + previous_end: _dt.datetime | None = None + + protections: list[SetupProtectionCalendarMonthProtections] | None = None + + challenges: SetupProtectionCalendarMonthChallenges | None = None + + +class SetupProtectionChallengesDaily(BaseModel): + date: _dt.date | None = None + + passed: int | None = None + + failed: int | None = None + + +class SetupProtectionDaily(BaseModel): + date: _dt.date | None = None + + protection: str | None = None + + action: str | None = None + + count: int | None = None + + +class SetupProtection(BaseModel): + enabled: bool + + breached_password_check: bool + + protections: list[SetupProtectionPolicy] + + daily: list[SetupProtectionDaily] | None = None + """Detections per day, policy and action.""" + + challenges_daily: list[SetupProtectionChallengesDaily] | None = None + """Extra proofs asked for and how they ended.""" + + period_days: int + + calendar_month: SetupProtectionCalendarMonth | None = None + """This calendar month against the previous one.""" + + attack_mode: SetupProtectionAttackMode | None = None + + selfie_available: bool | None = None diff --git a/src/didit/types/components/setup_protection_policy.py b/src/didit/types/components/setup_protection_policy.py new file mode 100644 index 0000000..50a0c95 --- /dev/null +++ b/src/didit/types/components/setup_protection_policy.py @@ -0,0 +1,30 @@ +# Code generated by codegen from openapi/*.json. DO NOT EDIT. +from __future__ import annotations + +from typing import Literal + +from didit._models import BaseModel + +__all__ = ["SetupProtectionPolicy", "SetupProtectionPolicyCounts"] + + +class SetupProtectionPolicyCounts(BaseModel): + log: int | None = None + + challenge: int | None = None + + block: int | None = None + + +class SetupProtectionPolicy(BaseModel): + key: Literal["bots", "stuffing", "brute", "disposable", "vpn", "travel"] | str + + mode: Literal["off", "log", "challenge", "block"] | str + + available: bool + """`vpn` and `travel` need the IP lookup; `false` when it cannot be attempted.""" + + counts: SetupProtectionPolicyCounts + + accounts: int + """How many people the policy matched in the last 14 days.""" diff --git a/src/didit/types/components/setup_provider_credentials.py b/src/didit/types/components/setup_provider_credentials.py new file mode 100644 index 0000000..6718953 --- /dev/null +++ b/src/didit/types/components/setup_provider_credentials.py @@ -0,0 +1,14 @@ +# Code generated by codegen from openapi/*.json. DO NOT EDIT. +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["SetupProviderCredentials"] + + +class SetupProviderCredentials(TypedDict, total=False): + """Your own OAuth app's credentials. The secret is write-only: no response returns it.""" + + client_id: Required[str] + + client_secret: Required[str] diff --git a/src/didit/types/components/setup_settings.py b/src/didit/types/components/setup_settings.py new file mode 100644 index 0000000..73ed860 --- /dev/null +++ b/src/didit/types/components/setup_settings.py @@ -0,0 +1,47 @@ +# Code generated by codegen from openapi/*.json. DO NOT EDIT. +from __future__ import annotations + +from typing import Literal + +from didit._models import BaseModel + +__all__ = ["SetupSettings"] + + +class SetupSettings(BaseModel): + sign_in_ui: Literal["hosted", "own"] | str | None = None + + agent_humans_only: bool | None = None + + agents_enabled: bool | None = None + + agent_scopes: list[Literal["read", "act"] | str] | None = None + + agent_lifetime: int | None = None + + agent_idle_timeout: int | None = None + + agent_approval: Literal["passkey", "sign_in"] | str | None = None + + organizations_enabled: bool | None = None + + mfa_policy: Literal["optional", "everyone", "organization_admins"] | str | None = None + + default_member_role: Literal["admin", "member", "billing"] | str | None = None + + webhook_events_disabled: ( + list[ + Literal[ + "auth.sign_in", + "auth.sign_in_failed", + "auth.new_device", + "auth.account_locked", + "auth.two_factor_changed", + "auth.session_revoked", + "auth.agent_access_approved", + "auth.agent_access_revoked", + ] + | str + ] + | None + ) = None diff --git a/src/didit/types/components/setup_verified.py b/src/didit/types/components/setup_verified.py new file mode 100644 index 0000000..52dd979 --- /dev/null +++ b/src/didit/types/components/setup_verified.py @@ -0,0 +1,69 @@ +# Code generated by codegen from openapi/*.json. DO NOT EDIT. +from __future__ import annotations + +import datetime as _dt +from typing import Literal + +from didit._models import BaseModel +from didit.types.components.setup_verified_rule import SetupVerifiedRule + +__all__ = ["SetupVerified", "SetupVerifiedSignup", "SetupVerifiedWallet", "SetupVerifiedWorkflows"] + + +class SetupVerifiedSignup(BaseModel): + checks: int | None = None + + passed: int | None = None + + failed: int | None = None + + +class SetupVerifiedWallet(BaseModel): + enabled: bool | None = None + + sign_ins: int | None = None + + people: int | None = None + + +class SetupVerifiedWorkflows(BaseModel): + """The verification workflow behind each method; `null` until one is created.""" + + liveness: str | None = None + + selfie: str | None = None + + full_id: str | None = None + + +class SetupVerified(BaseModel): + signup_level: Literal["none", "liveness", "full_id"] | str + + signup: SetupVerifiedSignup | None = None + + rules: list[SetupVerifiedRule] + + claims: list[ + Literal[ + "over_18", + "over_21", + "given_name", + "family_name", + "birthdate", + "nationality", + "country", + "document_verified", + "liveness", + ] + | str + ] + """The claims your tokens carry once the person is verified.""" + + available_claims: list[str] + + workflows: SetupVerifiedWorkflows + """The verification workflow behind each method; `null` until one is created.""" + + wallet: SetupVerifiedWallet + + since: _dt.datetime diff --git a/src/didit/types/components/setup_verified_rule.py b/src/didit/types/components/setup_verified_rule.py new file mode 100644 index 0000000..406b8dc --- /dev/null +++ b/src/didit/types/components/setup_verified_rule.py @@ -0,0 +1,29 @@ +# Code generated by codegen from openapi/*.json. DO NOT EDIT. +from __future__ import annotations + +from typing import Literal + +from didit._models import BaseModel + +__all__ = ["SetupVerifiedRule"] + + +class SetupVerifiedRule(BaseModel): + rule: Literal["payout", "bank", "contact", "device", "sign_in"] | str + + enabled: bool | None = None + + method: Literal["liveness", "selfie", "full_id"] | str | None = None + + threshold: str | None = None + """`payout` only: the amount above which the rule applies, as a decimal string.""" + + currency: str | None = None + """`payout` only: the ISO 4217 currency of `threshold`.""" + + checks: int | None = None + """Checks this month.""" + + passed: int | None = None + + failed: int | None = None diff --git a/src/didit/types/investigator/retrieve_offer_response.py b/src/didit/types/investigator/retrieve_offer_response.py new file mode 100644 index 0000000..b1b9392 --- /dev/null +++ b/src/didit/types/investigator/retrieve_offer_response.py @@ -0,0 +1,22 @@ +# Code generated by codegen from openapi/*.json. DO NOT EDIT. +from __future__ import annotations + +from typing import Literal + +from didit._models import BaseModel + +__all__ = ["InvestigatorRetrieveOfferResponse"] + + +class InvestigatorRetrieveOfferResponse(BaseModel): + show: bool | None = None + + manual_decisions_30d: int | None = None + + avg_handling_seconds: int | None = None + + stopped_halfway_30d: int | None = None + + stage: Literal["none", "shadow", "live"] | str | None = None + + followups_on: bool | None = None diff --git a/src/didit/types/investigator/retrieve_summary_response.py b/src/didit/types/investigator/retrieve_summary_response.py index fcf0ca1..0c401e1 100644 --- a/src/didit/types/investigator/retrieve_summary_response.py +++ b/src/didit/types/investigator/retrieve_summary_response.py @@ -5,11 +5,22 @@ from didit._models import BaseModel -__all__ = ["InvestigatorRetrieveSummaryResponse"] +__all__ = ["InvestigatorRetrieveSummaryResponse", "InvestigatorRetrieveSummaryResponseFreeReports"] + + +class InvestigatorRetrieveSummaryResponseFreeReports(BaseModel): + """The organization's free reports: the first reports run with no setup, on any plan, and are never charged.""" + + limit: int | None = None + + used: int | None = None + + remaining: int | None = None class InvestigatorRetrieveSummaryResponse(BaseModel): stage: str | None = None + """`none` (not set up; free reports still run while `free_reports.remaining` is above 0), `shadow` or `live`.""" last_report_at: _dt.datetime | None = None @@ -24,3 +35,6 @@ class InvestigatorRetrieveSummaryResponse(BaseModel): automation_rate_month: float | None = None preparing: int | None = None + + free_reports: InvestigatorRetrieveSummaryResponseFreeReports | None = None + """The organization's free reports: the first reports run with no setup, on any plan, and are never charged.""" diff --git a/tests/generated/test_authentication_setup.py b/tests/generated/test_authentication_setup.py new file mode 100644 index 0000000..907f443 --- /dev/null +++ b/tests/generated/test_authentication_setup.py @@ -0,0 +1,1085 @@ +# Code generated by codegen from openapi/*.json. DO NOT EDIT. +"""Generated tests of the ``authentication_setup`` resources: one per operation.""" + +from __future__ import annotations + +from didit.types.components.setup_branding import SetupBranding +from didit.types.components.setup_configuration import SetupConfiguration +from didit.types.components.setup_domain import SetupDomain +from didit.types.components.setup_email import SetupEmail +from didit.types.components.setup_emails import SetupEmails +from didit.types.components.setup_method_result import SetupMethodResult +from didit.types.components.setup_native_apps import SetupNativeApps +from didit.types.components.setup_onboarding import SetupOnboarding +from didit.types.components.setup_protection import SetupProtection +from didit.types.components.setup_settings import SetupSettings +from didit.types.components.setup_verified import SetupVerified +from tests.harness import Expect, check_operation + + +def test_authentication_setup_activate_domain() -> None: + """``POST /organizations/{organization_id}/applications/{application_id}/authentication/domain/activate/``""" + check_operation( + Expect( + method="POST", + path="/organizations/a1b2c3d4-5678-90ab-cdef-111111111111/applications/7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d/authentication/domain/activate/", + api="account", + auth="api_key", + status=200, + response_json={ + "host": "demo.auth.didit.me", + "default_origin": "https://demo.auth.didit.me", + "origin": "https://login.example.com", + "hosted_url": "https://login.example.com/sign-in", + "issuer": "https://login.example.com", + "passkey_rp_id": "login.example.com", + "sandbox": False, + "sandbox_origin": "https://demo.sandbox.auth.didit.me", + "custom_domains_available": True, + "custom_domain": { + "domain": "login.example.com", + "status": "verified", + "failure_reason": "", + "dns_record": { + "type": "CNAME", + "name": "login.example.com", + "value": "demo.auth.didit.me", + }, + "certificate": {"status": "issued", "expires_at": "2027-02-18T00:00:00Z"}, + "dns_checked_at": "2026-11-20T10:00:00Z", + "verified_at": "2026-11-20T10:05:00Z", + "activated_at": None, + }, + }, + ), + lambda c: c.authentication_setup.activate_domain( + "a1b2c3d4-5678-90ab-cdef-111111111111", "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" + ), + lambda c: c.authentication_setup.activate_domain( + "a1b2c3d4-5678-90ab-cdef-111111111111", "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" + ), + lambda r: isinstance(r, SetupDomain), + lambda r: isinstance(r, SetupDomain), + ) + + +def test_authentication_setup_get_branding() -> None: + """``GET /organizations/{organization_id}/applications/{application_id}/authentication/branding/``""" + check_operation( + Expect( + method="GET", + path="/organizations/a1b2c3d4-5678-90ab-cdef-111111111111/applications/7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d/authentication/branding/", + api="account", + auth="api_key", + query={"language": ["es"]}, + status=200, + response_json={ + "brand": { + "source": "customization", + "name": "Docs Demo", + "logo": None, + "logo_dark": None, + "brand_colour": "#2567FF", + "brand_colour_dark": "#6191FF", + "button_text_colour": "#FFFFFF", + "background": "#FFFFFF", + "background_dark": "#0E0F12", + "corner_radius": 12, + "font": "Inter", + "theme": "device", + }, + "texts": {}, + "defaults": { + "sign_in_title": "Sign in to Docs Demo (Sandbox)", + "subtitle": "Welcome back! Sign in to continue.", + "sign_up_title": "Create your Docs Demo (Sandbox) account", + }, + "terms_url": None, + "privacy_url": None, + "languages": ["en", "es", "fr", "de", "ja"], + "badge": {"visible": True, "plan": "free", "early_access": False}, + "hosted_url": "https://docs-demo.sandbox.auth.didit.me/sign-in", + }, + ), + lambda c: c.authentication_setup.get_branding( + "a1b2c3d4-5678-90ab-cdef-111111111111", + "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d", + language="es", + ), + lambda c: c.authentication_setup.get_branding( + "a1b2c3d4-5678-90ab-cdef-111111111111", + "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d", + language="es", + ), + lambda r: isinstance(r, SetupBranding), + lambda r: isinstance(r, SetupBranding), + ) + + +def test_authentication_setup_get_configuration() -> None: + """``GET /organizations/{organization_id}/applications/{application_id}/authentication/``""" + check_operation( + Expect( + method="GET", + path="/organizations/a1b2c3d4-5678-90ab-cdef-111111111111/applications/7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d/authentication/", + api="account", + auth="api_key", + status=200, + response_json={ + "enabled": True, + "publishable_key": "pk_test_ZG9jcy1kZW1vLnNhbmRib3guYXV0aC5kaWRpdC5tZQ", + "methods": [ + {"name": "code", "enabled": True, "credential_source": None}, + { + "name": "google", + "enabled": True, + "credential_source": "sample-secret", + "configured": True, + "client_id": "didit-test-google", + "callback_uri": "https://auth.didit.test/social/google/callback", + }, + {"name": "password", "enabled": False, "credential_source": None}, + ], + "didit_test_credentials": { + "google": True, + "microsoft": True, + "apple": True, + "github": True, + }, + "redirect_uris": ["https://app.example.com/auth/callback"], + "allowed_origins": [], + "post_logout_redirect_uri": "", + "session_lifetime": 2592000, + "idle_timeout": 86400, + "multiple_sessions": True, + "password_min_length": 10, + "revoke_on_password_change": True, + "allow_subaddresses": False, + "signup_policy": "anyone", + "allowed_email_domains": [], + }, + ), + lambda c: c.authentication_setup.get_configuration( + "a1b2c3d4-5678-90ab-cdef-111111111111", "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" + ), + lambda c: c.authentication_setup.get_configuration( + "a1b2c3d4-5678-90ab-cdef-111111111111", "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" + ), + lambda r: isinstance(r, SetupConfiguration), + lambda r: isinstance(r, SetupConfiguration), + ) + + +def test_authentication_setup_get_domain() -> None: + """``GET /organizations/{organization_id}/applications/{application_id}/authentication/domain/``""" + check_operation( + Expect( + method="GET", + path="/organizations/a1b2c3d4-5678-90ab-cdef-111111111111/applications/7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d/authentication/domain/", + api="account", + auth="api_key", + status=200, + response_json={ + "host": "demo.auth.didit.me", + "default_origin": "https://demo.auth.didit.me", + "origin": "https://login.example.com", + "hosted_url": "https://login.example.com/sign-in", + "issuer": "https://login.example.com", + "passkey_rp_id": "login.example.com", + "sandbox": False, + "sandbox_origin": "https://demo.sandbox.auth.didit.me", + "custom_domains_available": True, + "custom_domain": { + "domain": "login.example.com", + "status": "verified", + "failure_reason": "", + "dns_record": { + "type": "CNAME", + "name": "login.example.com", + "value": "demo.auth.didit.me", + }, + "certificate": {"status": "issued", "expires_at": "2027-02-18T00:00:00Z"}, + "dns_checked_at": "2026-11-20T10:00:00Z", + "verified_at": "2026-11-20T10:05:00Z", + "activated_at": None, + }, + }, + ), + lambda c: c.authentication_setup.get_domain( + "a1b2c3d4-5678-90ab-cdef-111111111111", "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" + ), + lambda c: c.authentication_setup.get_domain( + "a1b2c3d4-5678-90ab-cdef-111111111111", "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" + ), + lambda r: isinstance(r, SetupDomain), + lambda r: isinstance(r, SetupDomain), + ) + + +def test_authentication_setup_get_email() -> None: + """``GET /organizations/{organization_id}/applications/{application_id}/authentication/emails/{key}/``""" + check_operation( + Expect( + method="GET", + path="/organizations/a1b2c3d4-5678-90ab-cdef-111111111111/applications/7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d/authentication/emails/code/", + api="account", + auth="api_key", + status=200, + response_json={ + "key": "code", + "from": "Example ", + "to": "", + "subject": "Your Example code: 123456", + "html": "...", + "enabled": True, + }, + ), + lambda c: c.authentication_setup.get_email( + "a1b2c3d4-5678-90ab-cdef-111111111111", "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d", "code" + ), + lambda c: c.authentication_setup.get_email( + "a1b2c3d4-5678-90ab-cdef-111111111111", "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d", "code" + ), + lambda r: isinstance(r, SetupEmail), + lambda r: isinstance(r, SetupEmail), + ) + + +def test_authentication_setup_get_emails() -> None: + """``GET /organizations/{organization_id}/applications/{application_id}/authentication/emails/``""" + check_operation( + Expect( + method="GET", + path="/organizations/a1b2c3d4-5678-90ab-cdef-111111111111/applications/7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d/authentication/emails/", + api="account", + auth="api_key", + query={"language": ["en"]}, + status=200, + response_json={ + "senders": { + "email": { + "name": "Example", + "email": "no-reply@example.com", + "header": "Example ", + "own": False, + }, + "sms": {"name": None}, + }, + "emails": [ + { + "key": "code", + "icon": "mail", + "sent": True, + "enabled": True, + "subject": "Your Example code: 123456", + } + ], + "language": "en", + }, + ), + lambda c: c.authentication_setup.get_emails( + "a1b2c3d4-5678-90ab-cdef-111111111111", + "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d", + language="en", + ), + lambda c: c.authentication_setup.get_emails( + "a1b2c3d4-5678-90ab-cdef-111111111111", + "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d", + language="en", + ), + lambda r: isinstance(r, SetupEmails), + lambda r: isinstance(r, SetupEmails), + ) + + +def test_authentication_setup_get_native_apps() -> None: + """``GET /organizations/{organization_id}/applications/{application_id}/authentication/native-apps/``""" + check_operation( + Expect( + method="GET", + path="/organizations/a1b2c3d4-5678-90ab-cdef-111111111111/applications/7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d/authentication/native-apps/", + api="account", + auth="api_key", + status=200, + response_json={ + "ios_app_ids": ["A1B2C3D4E5.com.example.app"], + "android_apps": [ + { + "package_name": "com.example.app", + "sha256_cert_fingerprints": [ + "AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89" + ], + } + ], + }, + ), + lambda c: c.authentication_setup.get_native_apps( + "a1b2c3d4-5678-90ab-cdef-111111111111", "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" + ), + lambda c: c.authentication_setup.get_native_apps( + "a1b2c3d4-5678-90ab-cdef-111111111111", "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" + ), + lambda r: isinstance(r, SetupNativeApps), + lambda r: isinstance(r, SetupNativeApps), + ) + + +def test_authentication_setup_get_onboarding() -> None: + """``GET /organizations/{organization_id}/applications/{application_id}/authentication/onboarding/``""" + check_operation( + Expect( + method="GET", + path="/organizations/a1b2c3d4-5678-90ab-cdef-111111111111/applications/7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d/authentication/onboarding/", + api="account", + auth="api_key", + status=200, + response_json={ + "completed": ["methods", "redirects"], + "ready": False, + "sign_in_ui": "hosted", + "test_status": "not_started", + }, + ), + lambda c: c.authentication_setup.get_onboarding( + "a1b2c3d4-5678-90ab-cdef-111111111111", "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" + ), + lambda c: c.authentication_setup.get_onboarding( + "a1b2c3d4-5678-90ab-cdef-111111111111", "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" + ), + lambda r: isinstance(r, SetupOnboarding), + lambda r: isinstance(r, SetupOnboarding), + ) + + +def test_authentication_setup_get_protection() -> None: + """``GET /organizations/{organization_id}/applications/{application_id}/authentication/protection/``""" + check_operation( + Expect( + method="GET", + path="/organizations/a1b2c3d4-5678-90ab-cdef-111111111111/applications/7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d/authentication/protection/", + api="account", + auth="api_key", + status=200, + response_json={ + "enabled": True, + "breached_password_check": True, + "protections": [ + { + "key": "bots", + "mode": "block", + "available": True, + "counts": {"log": 0, "challenge": 12, "block": 3}, + "accounts": 9, + } + ], + "daily": [ + {"date": "2026-11-19", "protection": "bots", "action": "block", "count": 3} + ], + "challenges_daily": [{"date": "2026-11-19", "passed": 10, "failed": 2}], + "period_days": 14, + "calendar_month": { + "start": "2026-11-01T00:00:00Z", + "as_of": "2026-11-20T10:00:00Z", + "previous_start": "2026-10-01T00:00:00Z", + "previous_end": "2026-11-01T00:00:00Z", + "protections": [ + { + "key": "bots", + "counts": {"log": 0, "challenge": 4, "block": 1}, + "previous_counts": {"log": 0, "challenge": 2, "block": 0}, + "counts_delta": {"log": 0, "challenge": 2, "block": 1}, + "accounts": 4, + "previous_accounts": 2, + "accounts_delta": 2, + } + ], + "challenges": { + "passed": 4, + "failed": 1, + "previous_passed": 2, + "previous_failed": 0, + }, + }, + "attack_mode": {"active": False, "started_at": None, "expires_at": None}, + "selfie_available": False, + }, + ), + lambda c: c.authentication_setup.get_protection( + "a1b2c3d4-5678-90ab-cdef-111111111111", "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" + ), + lambda c: c.authentication_setup.get_protection( + "a1b2c3d4-5678-90ab-cdef-111111111111", "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" + ), + lambda r: isinstance(r, SetupProtection), + lambda r: isinstance(r, SetupProtection), + ) + + +def test_authentication_setup_get_settings() -> None: + """``GET /organizations/{organization_id}/applications/{application_id}/authentication/settings/``""" + check_operation( + Expect( + method="GET", + path="/organizations/a1b2c3d4-5678-90ab-cdef-111111111111/applications/7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d/authentication/settings/", + api="account", + auth="api_key", + status=200, + response_json={ + "sign_in_ui": "hosted", + "agent_humans_only": False, + "agents_enabled": False, + "agent_scopes": [], + "agent_lifetime": 604800, + "agent_idle_timeout": 7200, + "agent_approval": "passkey", + "organizations_enabled": False, + "mfa_policy": "organization_admins", + "default_member_role": "member", + "webhook_events_disabled": [], + }, + ), + lambda c: c.authentication_setup.get_settings( + "a1b2c3d4-5678-90ab-cdef-111111111111", "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" + ), + lambda c: c.authentication_setup.get_settings( + "a1b2c3d4-5678-90ab-cdef-111111111111", "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" + ), + lambda r: isinstance(r, SetupSettings), + lambda r: isinstance(r, SetupSettings), + ) + + +def test_authentication_setup_get_verified() -> None: + """``GET /organizations/{organization_id}/applications/{application_id}/authentication/verified/``""" + check_operation( + Expect( + method="GET", + path="/organizations/a1b2c3d4-5678-90ab-cdef-111111111111/applications/7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d/authentication/verified/", + api="account", + auth="api_key", + status=200, + response_json={ + "signup_level": "liveness", + "signup": {"checks": 41, "passed": 39, "failed": 2}, + "rules": [ + { + "rule": "payout", + "enabled": True, + "method": "selfie", + "threshold": "500.00", + "currency": "EUR", + "checks": 6, + "passed": 5, + "failed": 1, + } + ], + "claims": ["over_18", "given_name", "country"], + "available_claims": [ + "over_18", + "over_21", + "given_name", + "family_name", + "birthdate", + "nationality", + "country", + "document_verified", + "liveness", + ], + "workflows": {"liveness": None, "selfie": None, "full_id": None}, + "wallet": {"enabled": False, "sign_ins": 0, "people": 0}, + "since": "2026-11-01T00:00:00Z", + }, + ), + lambda c: c.authentication_setup.get_verified( + "a1b2c3d4-5678-90ab-cdef-111111111111", "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" + ), + lambda c: c.authentication_setup.get_verified( + "a1b2c3d4-5678-90ab-cdef-111111111111", "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" + ), + lambda r: isinstance(r, SetupVerified), + lambda r: isinstance(r, SetupVerified), + ) + + +def test_authentication_setup_remove_domain() -> None: + """``DELETE /organizations/{organization_id}/applications/{application_id}/authentication/domain/``""" + check_operation( + Expect( + method="DELETE", + path="/organizations/a1b2c3d4-5678-90ab-cdef-111111111111/applications/7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d/authentication/domain/", + api="account", + auth="api_key", + status=200, + response_json={ + "host": "demo.auth.didit.me", + "default_origin": "https://demo.auth.didit.me", + "origin": "https://demo.auth.didit.me", + "hosted_url": "https://demo.auth.didit.me/sign-in", + "issuer": "https://demo.auth.didit.me", + "passkey_rp_id": "demo.auth.didit.me", + "sandbox": False, + "sandbox_origin": "https://demo.sandbox.auth.didit.me", + "custom_domains_available": True, + "custom_domain": None, + }, + ), + lambda c: c.authentication_setup.remove_domain( + "a1b2c3d4-5678-90ab-cdef-111111111111", "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" + ), + lambda c: c.authentication_setup.remove_domain( + "a1b2c3d4-5678-90ab-cdef-111111111111", "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" + ), + lambda r: isinstance(r, SetupDomain), + lambda r: isinstance(r, SetupDomain), + ) + + +def test_authentication_setup_set_domain() -> None: + """``PUT /organizations/{organization_id}/applications/{application_id}/authentication/domain/``""" + check_operation( + Expect( + method="PUT", + path="/organizations/a1b2c3d4-5678-90ab-cdef-111111111111/applications/7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d/authentication/domain/", + api="account", + auth="api_key", + json_body={"domain": "login.example.com"}, + status=200, + response_json={ + "host": "demo.auth.didit.me", + "default_origin": "https://demo.auth.didit.me", + "origin": "https://login.example.com", + "hosted_url": "https://login.example.com/sign-in", + "issuer": "https://login.example.com", + "passkey_rp_id": "login.example.com", + "sandbox": False, + "sandbox_origin": "https://demo.sandbox.auth.didit.me", + "custom_domains_available": True, + "custom_domain": { + "domain": "login.example.com", + "status": "verified", + "failure_reason": "", + "dns_record": { + "type": "CNAME", + "name": "login.example.com", + "value": "demo.auth.didit.me", + }, + "certificate": {"status": "issued", "expires_at": "2027-02-18T00:00:00Z"}, + "dns_checked_at": "2026-11-20T10:00:00Z", + "verified_at": "2026-11-20T10:05:00Z", + "activated_at": None, + }, + }, + ), + lambda c: c.authentication_setup.set_domain( + "a1b2c3d4-5678-90ab-cdef-111111111111", + "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d", + domain="login.example.com", + ), + lambda c: c.authentication_setup.set_domain( + "a1b2c3d4-5678-90ab-cdef-111111111111", + "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d", + domain="login.example.com", + ), + lambda r: isinstance(r, SetupDomain), + lambda r: isinstance(r, SetupDomain), + ) + + +def test_authentication_setup_set_method() -> None: + """``PUT /organizations/{organization_id}/applications/{application_id}/authentication/methods/{name}/``""" + check_operation( + Expect( + method="PUT", + path="/organizations/a1b2c3d4-5678-90ab-cdef-111111111111/applications/7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d/authentication/methods/code/", + api="account", + auth="api_key", + json_body={"enabled": True}, + status=200, + response_json={ + "name": "google", + "enabled": True, + "credential_source": "sample-secret", + "configured": True, + "client_id": "didit-test-google", + "callback_uri": "https://auth.didit.test/social/google/callback", + }, + ), + lambda c: c.authentication_setup.set_method( + "a1b2c3d4-5678-90ab-cdef-111111111111", + "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d", + "code", + enabled=True, + ), + lambda c: c.authentication_setup.set_method( + "a1b2c3d4-5678-90ab-cdef-111111111111", + "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d", + "code", + enabled=True, + ), + lambda r: isinstance(r, SetupMethodResult), + lambda r: isinstance(r, SetupMethodResult), + ) + + +def test_authentication_setup_update_branding() -> None: + """``PATCH /organizations/{organization_id}/applications/{application_id}/authentication/branding/``""" + check_operation( + Expect( + method="PATCH", + path="/organizations/a1b2c3d4-5678-90ab-cdef-111111111111/applications/7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d/authentication/branding/", + api="account", + auth="api_key", + json_body={ + "terms_url": "https://example.com/terms", + "privacy_url": "https://example.com/privacy", + }, + status=200, + response_json={ + "brand": { + "source": "customization", + "name": "Docs Demo", + "logo": None, + "logo_dark": None, + "brand_colour": "#2567FF", + "brand_colour_dark": "#6191FF", + "button_text_colour": "#FFFFFF", + "background": "#FFFFFF", + "background_dark": "#0E0F12", + "corner_radius": 12, + "font": "Inter", + "theme": "device", + }, + "texts": {}, + "defaults": { + "sign_in_title": "Sign in to Docs Demo (Sandbox)", + "subtitle": "Welcome back! Sign in to continue.", + "sign_up_title": "Create your Docs Demo (Sandbox) account", + }, + "terms_url": "https://example.com/terms", + "privacy_url": "https://example.com/privacy", + "languages": ["en", "es", "fr", "de", "ja"], + "badge": {"visible": True, "plan": "free", "early_access": False}, + "hosted_url": "https://docs-demo.sandbox.auth.didit.me/sign-in", + }, + ), + lambda c: c.authentication_setup.update_branding( + "a1b2c3d4-5678-90ab-cdef-111111111111", + "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d", + terms_url="https://example.com/terms", + privacy_url="https://example.com/privacy", + ), + lambda c: c.authentication_setup.update_branding( + "a1b2c3d4-5678-90ab-cdef-111111111111", + "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d", + terms_url="https://example.com/terms", + privacy_url="https://example.com/privacy", + ), + lambda r: isinstance(r, SetupBranding), + lambda r: isinstance(r, SetupBranding), + ) + + +def test_authentication_setup_update_configuration() -> None: + """``PATCH /organizations/{organization_id}/applications/{application_id}/authentication/``""" + check_operation( + Expect( + method="PATCH", + path="/organizations/a1b2c3d4-5678-90ab-cdef-111111111111/applications/7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d/authentication/", + api="account", + auth="api_key", + json_body={"session_lifetime": 604800, "signup_policy": "invited"}, + status=200, + response_json={ + "enabled": True, + "publishable_key": "pk_test_ZG9jcy1kZW1vLnNhbmRib3guYXV0aC5kaWRpdC5tZQ", + "methods": [ + {"name": "code", "enabled": True, "credential_source": None}, + { + "name": "google", + "enabled": True, + "credential_source": "sample-secret", + "configured": True, + "client_id": "didit-test-google", + "callback_uri": "https://auth.didit.test/social/google/callback", + }, + {"name": "password", "enabled": False, "credential_source": None}, + ], + "didit_test_credentials": { + "google": True, + "microsoft": True, + "apple": True, + "github": True, + }, + "redirect_uris": ["https://app.example.com/auth/callback"], + "allowed_origins": [], + "post_logout_redirect_uri": "", + "session_lifetime": 604800, + "idle_timeout": 86400, + "multiple_sessions": True, + "password_min_length": 10, + "revoke_on_password_change": True, + "allow_subaddresses": False, + "signup_policy": "invited", + "allowed_email_domains": [], + }, + ), + lambda c: c.authentication_setup.update_configuration( + "a1b2c3d4-5678-90ab-cdef-111111111111", + "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d", + session_lifetime=604800, + signup_policy="invited", + ), + lambda c: c.authentication_setup.update_configuration( + "a1b2c3d4-5678-90ab-cdef-111111111111", + "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d", + session_lifetime=604800, + signup_policy="invited", + ), + lambda r: isinstance(r, SetupConfiguration), + lambda r: isinstance(r, SetupConfiguration), + ) + + +def test_authentication_setup_update_native_apps() -> None: + """``PUT /organizations/{organization_id}/applications/{application_id}/authentication/native-apps/``""" + check_operation( + Expect( + method="PUT", + path="/organizations/a1b2c3d4-5678-90ab-cdef-111111111111/applications/7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d/authentication/native-apps/", + api="account", + auth="api_key", + json_body={ + "ios_app_ids": ["A1B2C3D4E5.com.example.app"], + "android_apps": [ + { + "package_name": "com.example.app", + "sha256_cert_fingerprints": [ + "AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89" + ], + } + ], + }, + status=200, + response_json={ + "ios_app_ids": ["A1B2C3D4E5.com.example.app"], + "android_apps": [ + { + "package_name": "com.example.app", + "sha256_cert_fingerprints": [ + "AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89" + ], + } + ], + }, + ), + lambda c: c.authentication_setup.update_native_apps( + "a1b2c3d4-5678-90ab-cdef-111111111111", + "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d", + ios_app_ids=["A1B2C3D4E5.com.example.app"], + android_apps=[ + { + "package_name": "com.example.app", + "sha256_cert_fingerprints": [ + "AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89" + ], + } + ], + ), + lambda c: c.authentication_setup.update_native_apps( + "a1b2c3d4-5678-90ab-cdef-111111111111", + "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d", + ios_app_ids=["A1B2C3D4E5.com.example.app"], + android_apps=[ + { + "package_name": "com.example.app", + "sha256_cert_fingerprints": [ + "AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89" + ], + } + ], + ), + lambda r: isinstance(r, SetupNativeApps), + lambda r: isinstance(r, SetupNativeApps), + ) + + +def test_authentication_setup_update_onboarding() -> None: + """``PATCH /organizations/{organization_id}/applications/{application_id}/authentication/onboarding/``""" + check_operation( + Expect( + method="PATCH", + path="/organizations/a1b2c3d4-5678-90ab-cdef-111111111111/applications/7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d/authentication/onboarding/", + api="account", + auth="api_key", + json_body={"sign_in_ui": "own"}, + status=200, + response_json={ + "completed": ["methods", "redirects"], + "ready": False, + "sign_in_ui": "own", + "test_status": "not_started", + }, + ), + lambda c: c.authentication_setup.update_onboarding( + "a1b2c3d4-5678-90ab-cdef-111111111111", + "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d", + sign_in_ui="own", + ), + lambda c: c.authentication_setup.update_onboarding( + "a1b2c3d4-5678-90ab-cdef-111111111111", + "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d", + sign_in_ui="own", + ), + lambda r: isinstance(r, SetupOnboarding), + lambda r: isinstance(r, SetupOnboarding), + ) + + +def test_authentication_setup_update_protection() -> None: + """``PATCH /organizations/{organization_id}/applications/{application_id}/authentication/protection/``""" + check_operation( + Expect( + method="PATCH", + path="/organizations/a1b2c3d4-5678-90ab-cdef-111111111111/applications/7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d/authentication/protection/", + api="account", + auth="api_key", + json_body={ + "enabled": True, + "policies": {"bots": "block", "stuffing": "challenge", "brute": "challenge"}, + }, + status=200, + response_json={ + "enabled": True, + "breached_password_check": True, + "protections": [ + { + "key": "bots", + "mode": "block", + "available": True, + "counts": {"log": 0, "challenge": 12, "block": 3}, + "accounts": 9, + } + ], + "daily": [ + {"date": "2026-11-19", "protection": "bots", "action": "block", "count": 3} + ], + "challenges_daily": [{"date": "2026-11-19", "passed": 10, "failed": 2}], + "period_days": 14, + "calendar_month": { + "start": "2026-11-01T00:00:00Z", + "as_of": "2026-11-20T10:00:00Z", + "previous_start": "2026-10-01T00:00:00Z", + "previous_end": "2026-11-01T00:00:00Z", + "protections": [ + { + "key": "bots", + "counts": {"log": 0, "challenge": 4, "block": 1}, + "previous_counts": {"log": 0, "challenge": 2, "block": 0}, + "counts_delta": {"log": 0, "challenge": 2, "block": 1}, + "accounts": 4, + "previous_accounts": 2, + "accounts_delta": 2, + } + ], + "challenges": { + "passed": 4, + "failed": 1, + "previous_passed": 2, + "previous_failed": 0, + }, + }, + "attack_mode": {"active": False, "started_at": None, "expires_at": None}, + "selfie_available": False, + }, + ), + lambda c: c.authentication_setup.update_protection( + "a1b2c3d4-5678-90ab-cdef-111111111111", + "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d", + enabled=True, + policies={"bots": "block", "stuffing": "challenge", "brute": "challenge"}, + ), + lambda c: c.authentication_setup.update_protection( + "a1b2c3d4-5678-90ab-cdef-111111111111", + "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d", + enabled=True, + policies={"bots": "block", "stuffing": "challenge", "brute": "challenge"}, + ), + lambda r: isinstance(r, SetupProtection), + lambda r: isinstance(r, SetupProtection), + ) + + +def test_authentication_setup_update_settings() -> None: + """``PATCH /organizations/{organization_id}/applications/{application_id}/authentication/settings/``""" + check_operation( + Expect( + method="PATCH", + path="/organizations/a1b2c3d4-5678-90ab-cdef-111111111111/applications/7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d/authentication/settings/", + api="account", + auth="api_key", + json_body={"mfa_policy": "everyone", "default_member_role": "member"}, + status=200, + response_json={ + "sign_in_ui": "hosted", + "agent_humans_only": False, + "agents_enabled": False, + "agent_scopes": [], + "agent_lifetime": 604800, + "agent_idle_timeout": 7200, + "agent_approval": "passkey", + "organizations_enabled": False, + "mfa_policy": "everyone", + "default_member_role": "member", + "webhook_events_disabled": [], + }, + ), + lambda c: c.authentication_setup.update_settings( + "a1b2c3d4-5678-90ab-cdef-111111111111", + "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d", + mfa_policy="everyone", + default_member_role="member", + ), + lambda c: c.authentication_setup.update_settings( + "a1b2c3d4-5678-90ab-cdef-111111111111", + "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d", + mfa_policy="everyone", + default_member_role="member", + ), + lambda r: isinstance(r, SetupSettings), + lambda r: isinstance(r, SetupSettings), + ) + + +def test_authentication_setup_update_verified() -> None: + """``PATCH /organizations/{organization_id}/applications/{application_id}/authentication/verified/``""" + check_operation( + Expect( + method="PATCH", + path="/organizations/a1b2c3d4-5678-90ab-cdef-111111111111/applications/7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d/authentication/verified/", + api="account", + auth="api_key", + json_body={ + "signup_level": "liveness", + "rules": [ + { + "rule": "payout", + "enabled": True, + "method": "selfie", + "threshold": "500.00", + "currency": "EUR", + } + ], + "claims": ["over_18", "given_name", "country"], + }, + status=200, + response_json={ + "signup_level": "liveness", + "signup": {"checks": 41, "passed": 39, "failed": 2}, + "rules": [ + { + "rule": "payout", + "enabled": True, + "method": "selfie", + "threshold": "500.00", + "currency": "EUR", + "checks": 6, + "passed": 5, + "failed": 1, + } + ], + "claims": ["over_18", "given_name", "country"], + "available_claims": [ + "over_18", + "over_21", + "given_name", + "family_name", + "birthdate", + "nationality", + "country", + "document_verified", + "liveness", + ], + "workflows": {"liveness": None, "selfie": None, "full_id": None}, + "wallet": {"enabled": False, "sign_ins": 0, "people": 0}, + "since": "2026-11-01T00:00:00Z", + }, + ), + lambda c: c.authentication_setup.update_verified( + "a1b2c3d4-5678-90ab-cdef-111111111111", + "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d", + signup_level="liveness", + rules=[ + { + "rule": "payout", + "enabled": True, + "method": "selfie", + "threshold": "500.00", + "currency": "EUR", + } + ], + claims=["over_18", "given_name", "country"], + ), + lambda c: c.authentication_setup.update_verified( + "a1b2c3d4-5678-90ab-cdef-111111111111", + "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d", + signup_level="liveness", + rules=[ + { + "rule": "payout", + "enabled": True, + "method": "selfie", + "threshold": "500.00", + "currency": "EUR", + } + ], + claims=["over_18", "given_name", "country"], + ), + lambda r: isinstance(r, SetupVerified), + lambda r: isinstance(r, SetupVerified), + ) + + +def test_authentication_setup_verify_domain() -> None: + """``POST /organizations/{organization_id}/applications/{application_id}/authentication/domain/verify/``""" + check_operation( + Expect( + method="POST", + path="/organizations/a1b2c3d4-5678-90ab-cdef-111111111111/applications/7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d/authentication/domain/verify/", + api="account", + auth="api_key", + status=200, + response_json={ + "host": "demo.auth.didit.me", + "default_origin": "https://demo.auth.didit.me", + "origin": "https://login.example.com", + "hosted_url": "https://login.example.com/sign-in", + "issuer": "https://login.example.com", + "passkey_rp_id": "login.example.com", + "sandbox": False, + "sandbox_origin": "https://demo.sandbox.auth.didit.me", + "custom_domains_available": True, + "custom_domain": { + "domain": "login.example.com", + "status": "verified", + "failure_reason": "", + "dns_record": { + "type": "CNAME", + "name": "login.example.com", + "value": "demo.auth.didit.me", + }, + "certificate": {"status": "issued", "expires_at": "2027-02-18T00:00:00Z"}, + "dns_checked_at": "2026-11-20T10:00:00Z", + "verified_at": "2026-11-20T10:05:00Z", + "activated_at": None, + }, + }, + ), + lambda c: c.authentication_setup.verify_domain( + "a1b2c3d4-5678-90ab-cdef-111111111111", "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" + ), + lambda c: c.authentication_setup.verify_domain( + "a1b2c3d4-5678-90ab-cdef-111111111111", "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" + ), + lambda r: isinstance(r, SetupDomain), + lambda r: isinstance(r, SetupDomain), + ) diff --git a/tests/generated/test_investigator.py b/tests/generated/test_investigator.py index 692324d..821c538 100644 --- a/tests/generated/test_investigator.py +++ b/tests/generated/test_investigator.py @@ -15,6 +15,7 @@ from didit.types.investigator.retrieve_dashboard_response import ( InvestigatorRetrieveDashboardResponse, ) +from didit.types.investigator.retrieve_offer_response import InvestigatorRetrieveOfferResponse from didit.types.investigator.retrieve_performance_response import ( InvestigatorRetrievePerformanceResponse, ) @@ -262,7 +263,7 @@ def test_investigator_list_queue() -> None: "run_id": "00000000-0000-4000-8000-000000000005", "kind": "session", "queue": "kyc", - "stage": "shadow", + "stage": "none", "subject": {}, "recommendation": "approve", "recommendation_detail": "sample", @@ -274,6 +275,8 @@ def test_investigator_list_queue() -> None: "waiting_since": "2026-01-01T00:00:00Z", "due_at": "2026-01-01T00:00:00Z", "prepared_at": "2026-01-01T00:00:00Z", + "free_report": True, + "example": True, } ], }, @@ -403,6 +406,32 @@ def test_investigator_retrieve_dashboard() -> None: ) +def test_investigator_retrieve_offer() -> None: + """``GET /v3/investigator/offer/``""" + check_operation( + Expect( + method="GET", + path="/v3/investigator/offer/", + api="verification", + auth="api_key", + status=200, + response_json={ + "show": True, + "manual_decisions_30d": 1, + "avg_handling_seconds": 1, + "stopped_halfway_30d": 1, + "stage": "none", + "followups_on": True, + }, + strict_type=InvestigatorRetrieveOfferResponse, + ), + lambda c: c.investigator.retrieve_offer(), + lambda c: c.investigator.retrieve_offer(), + lambda r: isinstance(r, InvestigatorRetrieveOfferResponse), + lambda r: isinstance(r, InvestigatorRetrieveOfferResponse), + ) + + def test_investigator_retrieve_performance() -> None: """``GET /v3/investigator/performance/``""" check_operation( @@ -441,7 +470,7 @@ def test_investigator_retrieve_run() -> None: "run_id": "00000000-0000-4000-8000-000000000004", "kind": "session", "queue": "kyc", - "stage": "shadow", + "stage": "none", "subject": {}, "recommendation": "approve", "recommendation_detail": "sample", @@ -453,6 +482,8 @@ def test_investigator_retrieve_run() -> None: "waiting_since": "2026-01-01T00:00:00Z", "due_at": "2026-01-01T00:00:00Z", "prepared_at": "2026-01-01T00:00:00Z", + "free_report": True, + "example": True, "status": "sample", "is_open": True, "lookups": 1, @@ -555,6 +586,7 @@ def test_investigator_retrieve_summary() -> None: "decided_today": 1, "automation_rate_month": 1.5, "preparing": 1, + "free_reports": {"limit": 1, "used": 1, "remaining": 1}, }, strict_type=InvestigatorRetrieveSummaryResponse, ),