> ## Documentation Index > Fetch the complete documentation index at: https://developer.rocket.chat/llms.txt > Use this file to discover all available pages before exploring further. # Verify Two-Factor Challenge > Verifies the email or TOTP code for an OAuth two-factor authentication challenge and returns the `loginToken` and `userId`. This endpoint does not require authentication. Requests are limited to 5 per minute per caller. The challenge is removed when the maximum number of failed attempts is reached. ### Changelog | Version | Description | | ------- | ----------- | | 8.7.0 | Added | ## OpenAPI ````json POST /api/v1/twoFactorChallenges.verifyChallenge { "openapi": "3.0.0", "info": { "version": "1.0.0", "title": "Authentication" }, "servers": [ { "url": "https://apiexplorer.support.rocket.chat" } ], "tags": [ { "name": "Authentication" }, { "name": "Two-Factor Authentication" } ], "paths": { "/api/v1/twoFactorChallenges.verifyChallenge": { "post": { "tags": [ "Two-Factor Authentication" ], "summary": "Verify Two-Factor Challenge", "description": "Verifies the email or TOTP code for an OAuth two-factor authentication challenge and returns the `loginToken` and `userId`.\n\nThis endpoint does not require authentication. Requests are limited to 5 per minute per caller. The challenge is removed when the maximum number of failed attempts is reached.\n\n### Changelog\n| Version | Description |\n| ------- | ----------- |\n| 8.7.0 | Added |", "operationId": "post-api-v1-twoFactorChallenges.verifyChallenge", "requestBody": { "required": "true", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": "false", "properties": { "challengeId": { "type": "string", "description": "The ID of the pending two-factor challenge returned by the login flow.", "example": "8f4c2d1e9a7b6c5d3e2f1a0b" }, "code": { "type": "string", "description": "The two-factor code provided by the user for the challenge.", "example": "482913" } }, "required": [ "challengeId", "code" ] }, "examples": { "Verify challenge": { "value": { "challengeId": "8f4c2d1e9a7b6c5d3e2f1a0b", "code": "482913" } } } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "loginToken": { "type": "string" }, "userId": { "type": "string" }, "success": { "type": "boolean" } }, "required": [ "loginToken", "userId", "success" ] }, "examples": { "Verification successful": { "value": { "loginToken": "exampleLoginTokenString123", "userId": "aobEdbYhXfu5hkeqG", "success": "true" } } } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "error": { "type": "string" }, "errorType": { "type": "string" } } }, "examples": { "Missing parameters": { "value": { "success": "false", "error": "challengeId and code are required", "errorType": "error-parameter-required" } }, "Invalid code": { "value": { "success": "false", "error": "Invalid code", "errorType": "error-invalid-code" } }, "Challenge not found": { "value": { "success": "false", "error": "challenge not found", "errorType": "error-challenge-not-found" } }, "Challenge expired": { "value": { "success": "false", "error": "challenge expired", "errorType": "error-challenge-expired" } }, "User not found": { "value": { "success": "false", "error": "user not found", "errorType": "error-user-not-found" } }, "Max attempts reached": { "value": { "success": "false", "error": "TOTP Maximun Failed Attempts Reached", "errorType": "totp-max-attempts" } } } } } } } } } } } ````