{
  "openapi": "3.0.1",
  "info": {
    "title": "services/auth_proxy/v1/proxy_api.proto",
    "version": "version not set"
  },
  "servers": [
    {
      "url": "https://authproxy.turnkey.com"
    }
  ],
  "paths": {
    "/v1/account": {
      "post": {
        "tags": [
          "Accounts"
        ],
        "summary": "Get Account",
        "description": "Return organization id associated with a given phone number, email, public key, credential ID or OIDC token.",
        "operationId": "GetAccount",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GetAccountRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetAccountResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/oauth2_authenticate": {
      "post": {
        "tags": [
          "Auth"
        ],
        "summary": "OAuth 2.0 Authenticate",
        "description": "Authenticate with an OAuth 2.0 provider and receive an OIDC token issued by Turnkey in response.",
        "operationId": "OAuth2Authenticate",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OAuth2AuthenticateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuth2AuthenticateResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/oauth_login": {
      "post": {
        "tags": [
          "Sessions"
        ],
        "summary": "OAuth Login",
        "description": "Login using an OIDC token and public key.",
        "operationId": "OAuthLogin",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OAuthLoginRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthLoginResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/otp_init": {
      "post": {
        "tags": [
          "Auth"
        ],
        "summary": "Init OTP",
        "description": "Initialize an OTP (email or SMS) for a user.",
        "operationId": "InitOtp",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InitOtpRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InitOtpResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/otp_init_v2": {
      "post": {
        "tags": [
          "Auth"
        ],
        "summary": "Init OTP",
        "description": "Start a new OTP flow and return a new OTP flow ID.",
        "operationId": "InitOtpV2",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InitOtpV2Request"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InitOtpV2Response"
                }
              }
            }
          }
        }
      }
    },
    "/v1/otp_login": {
      "post": {
        "tags": [
          "Sessions"
        ],
        "summary": "OTP Login",
        "description": "Login using a verification token and public key.",
        "operationId": "OtpLogin",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OtpLoginRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OtpLoginResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/otp_login_v2": {
      "post": {
        "tags": [
          "Sessions"
        ],
        "summary": "OTP Login",
        "description": "Login using an existing OTP Verification Token and a client-side signature. The signature's public key must match the public key contained within the OTP Verification Token.",
        "operationId": "OtpLoginV2",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OtpLoginV2Request"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OtpLoginV2Response"
                }
              }
            }
          }
        }
      }
    },
    "/v1/otp_verify": {
      "post": {
        "tags": [
          "Auth"
        ],
        "summary": "Verify OTP",
        "description": "Verify the OTP code previously sent to the user's contact and return a verification token.",
        "operationId": "VerifyOtp",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VerifyOtpRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerifyOtpResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/otp_verify_v2": {
      "post": {
        "tags": [
          "Auth"
        ],
        "summary": "Verify OTP",
        "description": "Verify the OTP code previously sent to the user's contact and return a verification token.",
        "operationId": "VerifyOtpV2",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VerifyOtpV2Request"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerifyOtpV2Response"
                }
              }
            }
          }
        }
      }
    },
    "/v1/signup": {
      "post": {
        "tags": [
          "Auth"
        ],
        "summary": "Signup",
        "description": "Onboard a new user.",
        "operationId": "Signup",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignupRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignupResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/signup_v2": {
      "post": {
        "tags": [
          "Auth"
        ],
        "summary": "Signup",
        "description": "Onboard a new user.",
        "operationId": "SignupV2",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignupV2Request"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignupV2Response"
                }
              }
            }
          }
        }
      }
    },
    "/v1/wallet_kit_config": {
      "post": {
        "tags": [
          "Wallet Kit"
        ],
        "summary": "Get WalletKit Config",
        "description": "Get wallet kit settings and feature toggles for the calling organization.",
        "operationId": "GetWalletKitConfig",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GetWalletKitConfigRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetWalletKitConfigResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AddressFormat": {
        "type": "string",
        "enum": [
          "ADDRESS_FORMAT_UNCOMPRESSED",
          "ADDRESS_FORMAT_COMPRESSED",
          "ADDRESS_FORMAT_ETHEREUM",
          "ADDRESS_FORMAT_SOLANA",
          "ADDRESS_FORMAT_COSMOS",
          "ADDRESS_FORMAT_TRON",
          "ADDRESS_FORMAT_SUI",
          "ADDRESS_FORMAT_APTOS",
          "ADDRESS_FORMAT_BITCOIN_MAINNET_P2PKH",
          "ADDRESS_FORMAT_BITCOIN_MAINNET_P2SH",
          "ADDRESS_FORMAT_BITCOIN_MAINNET_P2WPKH",
          "ADDRESS_FORMAT_BITCOIN_MAINNET_P2WSH",
          "ADDRESS_FORMAT_BITCOIN_MAINNET_P2TR",
          "ADDRESS_FORMAT_BITCOIN_TESTNET_P2PKH",
          "ADDRESS_FORMAT_BITCOIN_TESTNET_P2SH",
          "ADDRESS_FORMAT_BITCOIN_TESTNET_P2WPKH",
          "ADDRESS_FORMAT_BITCOIN_TESTNET_P2WSH",
          "ADDRESS_FORMAT_BITCOIN_TESTNET_P2TR",
          "ADDRESS_FORMAT_BITCOIN_SIGNET_P2PKH",
          "ADDRESS_FORMAT_BITCOIN_SIGNET_P2SH",
          "ADDRESS_FORMAT_BITCOIN_SIGNET_P2WPKH",
          "ADDRESS_FORMAT_BITCOIN_SIGNET_P2WSH",
          "ADDRESS_FORMAT_BITCOIN_SIGNET_P2TR",
          "ADDRESS_FORMAT_BITCOIN_REGTEST_P2PKH",
          "ADDRESS_FORMAT_BITCOIN_REGTEST_P2SH",
          "ADDRESS_FORMAT_BITCOIN_REGTEST_P2WPKH",
          "ADDRESS_FORMAT_BITCOIN_REGTEST_P2WSH",
          "ADDRESS_FORMAT_BITCOIN_REGTEST_P2TR",
          "ADDRESS_FORMAT_SEI",
          "ADDRESS_FORMAT_XLM",
          "ADDRESS_FORMAT_DOGE_MAINNET",
          "ADDRESS_FORMAT_DOGE_TESTNET",
          "ADDRESS_FORMAT_TON_V3R2",
          "ADDRESS_FORMAT_TON_V4R2",
          "ADDRESS_FORMAT_TON_V5R1",
          "ADDRESS_FORMAT_XRP",
          "ADDRESS_FORMAT_SPARK_MAINNET",
          "ADDRESS_FORMAT_SPARK_REGTEST"
        ]
      },
      "ApiKeyCurve": {
        "type": "string",
        "enum": [
          "API_KEY_CURVE_P256",
          "API_KEY_CURVE_SECP256K1",
          "API_KEY_CURVE_ED25519"
        ]
      },
      "ApiKeyParamsV2": {
        "type": "object",
        "properties": {
          "apiKeyName": {
            "type": "string",
            "description": "Human-readable name for an API Key."
          },
          "publicKey": {
            "type": "string",
            "description": "The public component of a cryptographic key pair used to sign messages and transactions."
          },
          "curveType": {
            "$ref": "#/components/schemas/ApiKeyCurve"
          },
          "expirationSeconds": {
            "type": "string",
            "description": "Optional window (in seconds) indicating how long the API Key should last.",
            "nullable": true
          }
        },
        "required": [
          "apiKeyName",
          "publicKey",
          "curveType"
        ]
      },
      "AppProof": {
        "type": "object",
        "properties": {
          "scheme": {
            "$ref": "#/components/schemas/data.v1.SignatureScheme"
          },
          "publicKey": {
            "type": "string",
            "description": "Ephemeral public key."
          },
          "proofPayload": {
            "type": "string",
            "description": "JSON serialized AppProofPayload."
          },
          "signature": {
            "type": "string",
            "description": "Signature over hashed proof_payload."
          }
        },
        "required": [
          "scheme",
          "publicKey",
          "proofPayload",
          "signature"
        ]
      },
      "Attestation": {
        "type": "object",
        "properties": {
          "credentialId": {
            "type": "string",
            "description": "The cbor encoded then base64 url encoded id of the credential."
          },
          "clientDataJson": {
            "type": "string",
            "description": "A base64 url encoded payload containing metadata about the signing context and the challenge."
          },
          "attestationObject": {
            "type": "string",
            "description": "A base64 url encoded payload containing authenticator data and any attestation the webauthn provider chooses."
          },
          "transports": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AuthenticatorTransport"
            },
            "description": "The type of authenticator transports."
          }
        },
        "required": [
          "credentialId",
          "clientDataJson",
          "attestationObject",
          "transports"
        ]
      },
      "AuthenticatorParamsV2": {
        "type": "object",
        "properties": {
          "authenticatorName": {
            "type": "string",
            "description": "Human-readable name for an Authenticator."
          },
          "challenge": {
            "type": "string",
            "description": "Challenge presented for authentication purposes."
          },
          "attestation": {
            "$ref": "#/components/schemas/Attestation"
          }
        },
        "required": [
          "authenticatorName",
          "challenge",
          "attestation"
        ]
      },
      "AuthenticatorTransport": {
        "type": "string",
        "enum": [
          "AUTHENTICATOR_TRANSPORT_BLE",
          "AUTHENTICATOR_TRANSPORT_INTERNAL",
          "AUTHENTICATOR_TRANSPORT_NFC",
          "AUTHENTICATOR_TRANSPORT_USB",
          "AUTHENTICATOR_TRANSPORT_HYBRID"
        ]
      },
      "ClientSignature": {
        "type": "object",
        "properties": {
          "publicKey": {
            "type": "string",
            "description": "The public component of a cryptographic key pair used to create the signature."
          },
          "scheme": {
            "$ref": "#/components/schemas/ClientSignatureScheme"
          },
          "message": {
            "type": "string",
            "description": "The message that was signed."
          },
          "signature": {
            "type": "string",
            "description": "The cryptographic signature over the message."
          }
        },
        "required": [
          "publicKey",
          "scheme",
          "message",
          "signature"
        ]
      },
      "ClientSignatureScheme": {
        "type": "string",
        "enum": [
          "CLIENT_SIGNATURE_SCHEME_API_P256"
        ]
      },
      "Curve": {
        "type": "string",
        "enum": [
          "CURVE_SECP256K1",
          "CURVE_ED25519",
          "CURVE_P256"
        ]
      },
      "GetAccountRequest": {
        "type": "object",
        "properties": {
          "filterType": {
            "type": "string",
            "description": "Specifies the type of filter to apply, i.e 'CREDENTIAL_ID', 'NAME', 'USERNAME', 'EMAIL', 'PHONE_NUMBER', 'OIDC_TOKEN' or 'PUBLIC_KEY'"
          },
          "filterValue": {
            "type": "string",
            "description": "The value of the filter to apply for the specified type. For example, a specific email or name string."
          },
          "verificationToken": {
            "type": "string",
            "description": "Signed JWT containing a unique id, expiry, verification type, contact. Used to verify access to PII (email/phone number) when filter_type is 'EMAIL' or 'PHONE_NUMBER'.",
            "nullable": true
          },
          "oidcToken": {
            "type": "string",
            "description": "OIDC token to verify access to PII (email/phone number) when filter_type is 'EMAIL' or 'PHONE_NUMBER'. Needed for social linking when verification_token is not available.",
            "nullable": true
          }
        },
        "required": [
          "filterType",
          "filterValue"
        ]
      },
      "GetAccountResponse": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "GetWalletKitConfigRequest": {
        "type": "object"
      },
      "GetWalletKitConfigResponse": {
        "type": "object",
        "properties": {
          "enabledProviders": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "List of enabled authentication providers (e.g., 'facebook', 'google', 'apple', 'email', 'sms', 'passkey', 'wallet')",
            "title": "Enabled Providers"
          },
          "sessionExpirationSeconds": {
            "type": "string",
            "description": "Session expiration duration in seconds",
            "title": "Session Expiration"
          },
          "organizationId": {
            "type": "string",
            "description": "The organization ID this configuration applies to",
            "title": "Organization ID"
          },
          "oauthClientIds": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Mapping of social login providers to their OAuth client IDs.",
            "title": "OAuth Client IDs"
          },
          "oauthRedirectUrl": {
            "type": "string",
            "description": "OAuth redirect URL to be used for social login flows.",
            "title": "OAuth Redirect URL"
          },
          "otpAlphanumeric": {
            "type": "boolean",
            "nullable": true
          },
          "otpLength": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "enabledProviders",
          "sessionExpirationSeconds",
          "organizationId"
        ]
      },
      "InitOtpRequest": {
        "type": "object",
        "properties": {
          "otpType": {
            "type": "string",
            "description": "Enum to specify whether to send OTP via SMS or email"
          },
          "contact": {
            "type": "string",
            "description": "Email or phone number to send the OTP code to"
          },
          "emailCustomization": {
            "$ref": "#/components/schemas/ProxyEmailCustomizationParams"
          }
        },
        "required": [
          "otpType",
          "contact"
        ]
      },
      "InitOtpResponse": {
        "type": "object",
        "properties": {
          "otpId": {
            "type": "string",
            "description": "Unique identifier for an OTP authentication"
          }
        },
        "required": [
          "otpId"
        ]
      },
      "InitOtpV2Request": {
        "type": "object",
        "properties": {
          "otpType": {
            "type": "string",
            "description": "Enum to specify whether to send OTP code via SMS or email"
          },
          "contact": {
            "type": "string",
            "description": "Email or phone number to send the OTP code to"
          },
          "emailCustomization": {
            "$ref": "#/components/schemas/ProxyEmailCustomizationParams"
          }
        },
        "required": [
          "otpType",
          "contact"
        ]
      },
      "InitOtpV2Response": {
        "type": "object",
        "properties": {
          "otpId": {
            "type": "string",
            "description": "Unique identifier for an OTP flow."
          },
          "otpEncryptionTargetBundle": {
            "type": "string",
            "description": "Signed bundle containing a target encryption key to use when submitting OTP codes."
          }
        },
        "required": [
          "otpId",
          "otpEncryptionTargetBundle"
        ]
      },
      "OAuth2AuthenticateRequest": {
        "type": "object",
        "properties": {
          "provider": {
            "$ref": "#/components/schemas/Oauth2Provider"
          },
          "authCode": {
            "type": "string",
            "description": "The auth_code provided by the OAuth 2.0 to the end user to be exchanged for a Bearer token in the OAuth 2.0 flow"
          },
          "redirectUri": {
            "type": "string",
            "description": "The URI the user is redirected to after they have authenticated with the OAuth 2.0 provider"
          },
          "codeVerifier": {
            "type": "string",
            "description": "The code verifier used by OAuth 2.0 PKCE providers"
          },
          "nonce": {
            "type": "string",
            "description": "A nonce value set to sha256(publicKey), used to bind the OIDC token to a specific public key"
          },
          "clientId": {
            "type": "string",
            "description": "The client ID registered with the OAuth 2.0 provider"
          }
        },
        "required": [
          "provider",
          "authCode",
          "redirectUri",
          "codeVerifier",
          "nonce",
          "clientId"
        ]
      },
      "OAuth2AuthenticateResponse": {
        "type": "object",
        "properties": {
          "oidcToken": {
            "type": "string",
            "description": "A Turnkey issued OIDC token to be used with the LoginWithOAuth activity"
          }
        },
        "required": [
          "oidcToken"
        ]
      },
      "OAuthLoginRequest": {
        "type": "object",
        "properties": {
          "oidcToken": {
            "type": "string",
            "description": "Base64 encoded OIDC token"
          },
          "publicKey": {
            "type": "string",
            "description": "Client-side public key generated by the user, which will be conditionally added to org data based on the validity of the oidc token associated with this request"
          },
          "invalidateExisting": {
            "type": "boolean",
            "description": "Invalidate all other previously generated Login API keys",
            "nullable": true
          },
          "organizationId": {
            "type": "string",
            "description": "Unique identifier for a given Organization. If provided, this organization id will be used directly. If omitted, uses the OIDC token to look up the associated organization id.",
            "nullable": true
          }
        },
        "required": [
          "oidcToken",
          "publicKey"
        ]
      },
      "OAuthLoginResponse": {
        "type": "object",
        "properties": {
          "session": {
            "type": "string",
            "description": "Signed JWT containing an expiry, public key, session type, user id, and organization id"
          }
        },
        "required": [
          "session"
        ]
      },
      "Oauth2Provider": {
        "type": "string",
        "enum": [
          "OAUTH2_PROVIDER_X",
          "OAUTH2_PROVIDER_DISCORD"
        ]
      },
      "OauthProviderParams": {
        "type": "object",
        "properties": {
          "providerName": {
            "type": "string",
            "description": "Human-readable name to identify a Provider."
          },
          "oidcToken": {
            "type": "string",
            "description": "Base64 encoded OIDC token"
          }
        },
        "required": [
          "providerName",
          "oidcToken"
        ]
      },
      "OauthProviderParamsV2": {
        "type": "object",
        "properties": {
          "providerName": {
            "type": "string",
            "description": "Human-readable name to identify a Provider."
          },
          "oidcToken": {
            "type": "string",
            "description": "Base64 encoded OIDC token"
          },
          "oidcClaims": {
            "$ref": "#/components/schemas/OidcClaims"
          }
        },
        "required": [
          "providerName"
        ]
      },
      "OidcClaims": {
        "type": "object",
        "properties": {
          "iss": {
            "type": "string",
            "description": "The issuer identifier from the OIDC token (iss claim)"
          },
          "sub": {
            "type": "string",
            "description": "The subject identifier from the OIDC token (sub claim)"
          },
          "aud": {
            "type": "string",
            "description": "The audience from the OIDC token (aud claim)"
          }
        },
        "required": [
          "iss",
          "sub",
          "aud"
        ]
      },
      "OtpLoginRequest": {
        "type": "object",
        "properties": {
          "verificationToken": {
            "type": "string",
            "description": "Signed JWT containing a unique id, expiry, verification type, contact. Verification status of a user is updated when the token is consumed (in OTP_LOGIN requests)"
          },
          "publicKey": {
            "type": "string",
            "description": "Client-side public key generated by the user, which will be conditionally added to org data based on the validity of the verification token"
          },
          "invalidateExisting": {
            "type": "boolean",
            "description": "Invalidate all other previously generated Login API keys",
            "nullable": true
          },
          "organizationId": {
            "type": "string",
            "description": "Unique identifier for a given Organization. If provided, this organization id will be used directly. If omitted, uses the verification token to look up the verified sub-organization based on the contact and verification type.",
            "nullable": true
          },
          "clientSignature": {
            "$ref": "#/components/schemas/ClientSignature"
          }
        },
        "required": [
          "verificationToken",
          "publicKey"
        ]
      },
      "OtpLoginResponse": {
        "type": "object",
        "properties": {
          "session": {
            "type": "string",
            "description": "Signed JWT containing an expiry, public key, session type, user id, and organization id"
          }
        },
        "required": [
          "session"
        ]
      },
      "OtpLoginV2Request": {
        "type": "object",
        "properties": {
          "verificationToken": {
            "type": "string",
            "description": "Session containing a unique id, expiry, verification type, contact. Verification status of a user is updated when the token is consumed (in OTP_LOGIN requests)"
          },
          "publicKey": {
            "type": "string",
            "description": "Client-side public key generated by the user, used as the session public key upon successful login."
          },
          "clientSignature": {
            "$ref": "#/components/schemas/ClientSignature"
          },
          "invalidateExisting": {
            "type": "boolean",
            "description": "Invalidate all other previously generated Login sessions",
            "nullable": true
          },
          "organizationId": {
            "type": "string",
            "description": "Unique identifier for a given Organization. If provided, this organization id will be used directly. If omitted, uses the verification token to look up the verified sub-organization based on the contact and verification type.",
            "nullable": true
          }
        },
        "required": [
          "verificationToken",
          "publicKey",
          "clientSignature"
        ]
      },
      "OtpLoginV2Response": {
        "type": "object",
        "properties": {
          "session": {
            "type": "string",
            "description": "Session containing an expiry, public key, session type, user id, and organization id"
          }
        },
        "required": [
          "session"
        ]
      },
      "PathFormat": {
        "type": "string",
        "enum": [
          "PATH_FORMAT_BIP32"
        ]
      },
      "ProxyEmailCustomizationParams": {
        "type": "object",
        "properties": {
          "templateId": {
            "type": "string",
            "description": "Unique identifier for a given Email Template. If not specified, the default is the most recent Email Template.",
            "nullable": true
          }
        }
      },
      "SignupRequest": {
        "type": "object",
        "properties": {
          "userEmail": {
            "type": "string",
            "nullable": true
          },
          "userPhoneNumber": {
            "type": "string",
            "nullable": true
          },
          "userTag": {
            "type": "string",
            "nullable": true
          },
          "userName": {
            "type": "string"
          },
          "organizationName": {
            "type": "string"
          },
          "verificationToken": {
            "type": "string",
            "nullable": true
          },
          "apiKeys": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiKeyParamsV2"
            },
            "description": "A list of API Key parameters. This field, if not needed, should be an empty array in your request body."
          },
          "authenticators": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AuthenticatorParamsV2"
            },
            "description": "A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body."
          },
          "oauthProviders": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OauthProviderParams"
            },
            "description": "A list of Oauth providers. This field, if not needed, should be an empty array in your request body."
          },
          "wallet": {
            "$ref": "#/components/schemas/WalletParams"
          },
          "clientSignature": {
            "$ref": "#/components/schemas/ClientSignature"
          }
        },
        "required": [
          "apiKeys",
          "authenticators",
          "oauthProviders"
        ]
      },
      "SignupResponse": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": "string"
          },
          "wallet": {
            "$ref": "#/components/schemas/WalletResult"
          },
          "userId": {
            "type": "string",
            "description": "Root user ID created for this sub-organization",
            "title": "User ID"
          },
          "appProofs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AppProof"
            },
            "description": "A list of App Proofs generated by enclaves during activity execution, providing verifiable attestations of performed operations."
          }
        },
        "required": [
          "organizationId",
          "userId"
        ]
      },
      "SignupV2Request": {
        "type": "object",
        "properties": {
          "userEmail": {
            "type": "string",
            "nullable": true
          },
          "userPhoneNumber": {
            "type": "string",
            "nullable": true
          },
          "userTag": {
            "type": "string",
            "nullable": true
          },
          "userName": {
            "type": "string"
          },
          "organizationName": {
            "type": "string"
          },
          "verificationToken": {
            "type": "string",
            "nullable": true
          },
          "apiKeys": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiKeyParamsV2"
            },
            "description": "A list of API Key parameters. This field, if not needed, should be an empty array in your request body."
          },
          "authenticators": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AuthenticatorParamsV2"
            },
            "description": "A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body."
          },
          "oauthProviders": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OauthProviderParamsV2"
            },
            "description": "A list of Oauth providers. This field, if not needed, should be an empty array in your request body."
          },
          "wallet": {
            "$ref": "#/components/schemas/WalletParams"
          },
          "clientSignature": {
            "$ref": "#/components/schemas/ClientSignature"
          }
        },
        "required": [
          "apiKeys",
          "authenticators",
          "oauthProviders"
        ]
      },
      "SignupV2Response": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": "string"
          },
          "wallet": {
            "$ref": "#/components/schemas/WalletResult"
          },
          "userId": {
            "type": "string",
            "description": "Root user ID created for this sub-organization",
            "title": "User ID"
          },
          "appProofs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AppProof"
            },
            "description": "A list of App Proofs generated by enclaves during activity execution, providing verifiable attestations of performed operations."
          }
        },
        "required": [
          "organizationId",
          "userId"
        ]
      },
      "VerifyOtpRequest": {
        "type": "object",
        "properties": {
          "otpId": {
            "type": "string",
            "description": "ID representing the result of an init OTP activity."
          },
          "otpCode": {
            "type": "string",
            "description": "OTP sent out to a user's contact (email or SMS)"
          },
          "publicKey": {
            "type": "string",
            "description": "Client-side public key generated by the user, which will be added to the JWT response and verified in subsequent requests via a client proof signature",
            "nullable": true
          }
        },
        "required": [
          "otpId",
          "otpCode"
        ]
      },
      "VerifyOtpResponse": {
        "type": "object",
        "properties": {
          "verificationToken": {
            "type": "string",
            "description": "Signed JWT containing a unique id, expiry, verification type, contact. Verification status of a user is updated when the token is consumed (in OTP_LOGIN requests)"
          }
        },
        "required": [
          "verificationToken"
        ]
      },
      "VerifyOtpV2Request": {
        "type": "object",
        "properties": {
          "otpId": {
            "type": "string",
            "description": "ID representing the result of an init OTP activity."
          },
          "encryptedOtpBundle": {
            "type": "string",
            "description": "Encrypted bundle containing the OTP code and a client-generated public key. Turnkey's secure enclaves will decrypt this bundle, verify the OTP code, and issue a new Verification Token. Encrypted using the target encryption key provided in the INIT_OTP activity result."
          }
        },
        "required": [
          "otpId",
          "encryptedOtpBundle"
        ]
      },
      "VerifyOtpV2Response": {
        "type": "object",
        "properties": {
          "verificationToken": {
            "type": "string",
            "description": "Verification Token containing a unique id, expiry, verification type, contact signed by Turnkey's enclaves. Verification status of a user is updated when the token is consumed (in OTP_LOGIN requests)"
          }
        },
        "required": [
          "verificationToken"
        ]
      },
      "WalletAccountParams": {
        "type": "object",
        "properties": {
          "curve": {
            "$ref": "#/components/schemas/Curve"
          },
          "pathFormat": {
            "$ref": "#/components/schemas/PathFormat"
          },
          "path": {
            "type": "string",
            "description": "Path used to generate a wallet Account."
          },
          "addressFormat": {
            "$ref": "#/components/schemas/AddressFormat"
          },
          "name": {
            "type": "string",
            "description": "Optional human-readable name for the account.",
            "nullable": true
          }
        },
        "required": [
          "curve",
          "pathFormat",
          "path",
          "addressFormat"
        ]
      },
      "WalletParams": {
        "type": "object",
        "properties": {
          "walletName": {
            "type": "string",
            "description": "Human-readable name for a Wallet."
          },
          "accounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WalletAccountParams"
            },
            "description": "A list of wallet Accounts. This field, if not needed, should be an empty array in your request body."
          },
          "mnemonicLength": {
            "type": "integer",
            "format": "int32",
            "description": "Length of mnemonic to generate the Wallet seed. Defaults to 12. Accepted values: 12, 15, 18, 21, 24.",
            "nullable": true
          }
        },
        "required": [
          "walletName",
          "accounts"
        ]
      },
      "WalletResult": {
        "type": "object",
        "properties": {
          "walletId": {
            "type": "string"
          },
          "addresses": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "A list of account addresses."
          }
        },
        "required": [
          "walletId",
          "addresses"
        ]
      },
      "data.v1.SignatureScheme": {
        "type": "string",
        "enum": [
          "SIGNATURE_SCHEME_EPHEMERAL_KEY_P256"
        ]
      }
    }
  },
  "x-original-swagger-version": "2.0"
}