> ## Documentation Index
> Fetch the complete documentation index at: https://stytch.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Authenticate

> Authenticates a one-time passcode entered by the user, establishing a session. Calls the `POST /sdk/v1/otps/authenticate` endpoint.

## Parameters

**token** `String` *required*

**methodId** `String` *required*

**sessionDurationMinutes** `Int` *required*

## Returns

**requestId** `String` *required*

**userId** `String` *required*

**methodId** `String` *required*

**sessionToken** `String` *required*

**session** `ApiSessionV1Session` *required*

**properties**

**sessionId** `String` *required*

**userId** `String` *required*

**authenticationFactors** `List\<ApiSessionV1AuthenticationFactor\>` *required*

**properties**

**type** `ApiSessionV1AuthenticationFactorType` *required*

**deliveryMethod** `ApiSessionV1AuthenticationFactorDeliveryMethod` *required*

**lastAuthenticatedAt** `Instant?`

**createdAt** `Instant?`

**updatedAt** `Instant?`

**emailFactor** `ApiSessionV1EmailFactor?`

**phoneNumberFactor** `ApiSessionV1PhoneNumberFactor?`

**googleOauthFactor** `ApiSessionV1GoogleOAuthFactor?`

**microsoftOauthFactor** `ApiSessionV1MicrosoftOAuthFactor?`

**appleOauthFactor** `ApiSessionV1AppleOAuthFactor?`

**webauthnFactor** `ApiSessionV1WebAuthnFactor?`

**authenticatorAppFactor** `ApiSessionV1AuthenticatorAppFactor?`

**githubOauthFactor** `ApiSessionV1GithubOAuthFactor?`

**recoveryCodeFactor** `ApiSessionV1RecoveryCodeFactor?`

**facebookOauthFactor** `ApiSessionV1FacebookOAuthFactor?`

**cryptoWalletFactor** `ApiSessionV1CryptoWalletFactor?`

**amazonOauthFactor** `ApiSessionV1AmazonOAuthFactor?`

**bitbucketOauthFactor** `ApiSessionV1BitbucketOAuthFactor?`

**coinbaseOauthFactor** `ApiSessionV1CoinbaseOAuthFactor?`

**discordOauthFactor** `ApiSessionV1DiscordOAuthFactor?`

**figmaOauthFactor** `ApiSessionV1FigmaOAuthFactor?`

**gitLabOauthFactor** `ApiSessionV1GitLabOAuthFactor?`

**instagramOauthFactor** `ApiSessionV1InstagramOAuthFactor?`

**linkedInOauthFactor** `ApiSessionV1LinkedInOAuthFactor?`

**shopifyOauthFactor** `ApiSessionV1ShopifyOAuthFactor?`

**slackOauthFactor** `ApiSessionV1SlackOAuthFactor?`

**snapchatOauthFactor** `ApiSessionV1SnapchatOAuthFactor?`

**spotifyOauthFactor** `ApiSessionV1SpotifyOAuthFactor?`

**steamOauthFactor** `ApiSessionV1SteamOAuthFactor?`

**tikTokOauthFactor** `ApiSessionV1TikTokOAuthFactor?`

**twitchOauthFactor** `ApiSessionV1TwitchOAuthFactor?`

**twitterOauthFactor** `ApiSessionV1TwitterOAuthFactor?`

**embeddableMagicLinkFactor** `ApiSessionV1EmbeddableMagicLinkFactor?`

**biometricFactor** `ApiSessionV1BiometricFactor?`

**samlSsoFactor** `ApiSessionV1SAMLSSOFactor?`

**oidcSsoFactor** `ApiSessionV1OIDCSSOFactor?`

**salesforceOauthFactor** `ApiSessionV1SalesforceOAuthFactor?`

**yahooOauthFactor** `ApiSessionV1YahooOAuthFactor?`

**hubspotOauthFactor** `ApiSessionV1HubspotOAuthFactor?`

**slackOauthExchangeFactor** `ApiSessionV1SlackOAuthExchangeFactor?`

**hubspotOauthExchangeFactor** `ApiSessionV1HubspotOAuthExchangeFactor?`

**githubOauthExchangeFactor** `ApiSessionV1GithubOAuthExchangeFactor?`

**googleOauthExchangeFactor** `ApiSessionV1GoogleOAuthExchangeFactor?`

**impersonatedFactor** `ApiSessionV1ImpersonatedFactor?`

**oauthAccessTokenExchangeFactor** `ApiSessionV1OAuthAccessTokenExchangeFactor?`

**trustedAuthTokenFactor** `ApiSessionV1TrustedAuthTokenFactor?`

**roles** `List\<String\>` *required*

**startedAt** `Instant?`

**lastAccessedAt** `Instant?`

**expiresAt** `Instant?`

**attributes** `ApiAttributeV1Attributes?`

**properties**

**ipAddress** `String?`

**userAgent** `String?`

**customClaims** `Map\<String, JsonElement\>?`

**sessionJwt** `String` *required*

**user** `ApiUserV1User` *required*

**properties**

**userId** `String` *required*

**emails** `List\<ApiUserV1Email\>` *required*

**properties**

**emailId** `String` *required*

**email** `String` *required*

**verified** `Boolean` *required*

**status** `String` *required*

**phoneNumbers** `List\<ApiUserV1PhoneNumber\>` *required*

**properties**

**phoneId** `String` *required*

**phoneNumber** `String` *required*

**verified** `Boolean` *required*

**webauthnRegistrations** `List\<ApiUserV1WebAuthnRegistration\>` *required*

**properties**

**webauthnRegistrationId** `String` *required*

**domain** `String` *required*

**userAgent** `String` *required*

**verified** `Boolean` *required*

**authenticatorType** `String` *required*

**name** `String` *required*

**providers** `List\<ApiUserV1OAuthProvider\>` *required*

**properties**

**providerType** `String` *required*

**providerSubject** `String` *required*

**profilePictureUrl** `String` *required*

**locale** `String` *required*

**oauthUserRegistrationId** `String` *required*

**totps** `List\<ApiUserV1TOTP\>` *required*

**properties**

**totpId** `String` *required*

**verified** `Boolean` *required*

**cryptoWallets** `List\<ApiUserV1CryptoWallet\>` *required*

**properties**

**cryptoWalletId** `String` *required*

**cryptoWalletAddress** `String` *required*

**cryptoWalletType** `String` *required*

**verified** `Boolean` *required*

**biometricRegistrations** `List\<ApiUserV1BiometricRegistration\>` *required*

**properties**

**biometricRegistrationId** `String` *required*

**verified** `Boolean` *required*

**isLocked** `Boolean` *required*

**roles** `List\<String\>` *required*

**name** `ApiUserV1Name?`

**properties**

**firstName** `String?`

**middleName** `String?`

**lastName** `String?`

**createdAt** `Instant?`

**password** `ApiUserV1Password?`

**properties**

**passwordId** `String` *required*

**requiresReset** `Boolean` *required*

**trustedMetadata** `Map\<String, JsonElement\>?`

**untrustedMetadata** `Map\<String, JsonElement\>?`

**externalId** `String?`

**lockCreatedAt** `Instant?`

**lockExpiresAt** `Instant?`

**resetSessions** `Boolean` *required*

**statusCode** `Int` *required*

**userDevice** `SDKDeviceInfo?`

**properties**

**ipAddress** `String?`

**ipAddressDetails** `ApiDeviceHistoryV1DeviceAttributeDetails?`

**properties**

**isNew** `Boolean` *required*

**firstSeenAt** `Instant?`

**lastSeenAt** `Instant?`

**ipGeoCity** `String?`

**ipGeoRegion** `String?`

**ipGeoCountry** `String?`

**ipGeoCountryDetails** `ApiDeviceHistoryV1DeviceAttributeDetails?`

**properties**

**isNew** `Boolean` *required*

**firstSeenAt** `Instant?`

**lastSeenAt** `Instant?`

```kotlin theme={null}
StytchConsumer.otps.authenticate(
    OTPsAuthenticateParameters(
        token = "123456",
        methodId = "phone-number-test-d5a3b680-e8a3-40c0-b815-ab79986666d0",
        sessionDurationMinutes = 30,
    )
)
```
