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

# OTP Verify

> Used to validate one-time passwords (OTPs) entered by users against previously generated and stored OTPs.

## OpenAPI

````json POST /otp/verify
{
  "openapi": "3.1.0",
  "info": {
    "title": "external-api",
    "version": "1"
  },
  "servers": [
    {
      "url": "https://api.eu.xtremepush.com/api/external"
    }
  ],
  "paths": {
    "/otp/verify": {
      "post": {
        "summary": "OTP Verify",
        "description": "Used to validate one-time passwords (OTPs) entered by users against previously generated and stored OTPs.",
        "operationId": "otp-verify",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "apptoken",
                  "service_id",
                  "otp_code"
                ],
                "properties": {
                  "apptoken": {
                    "type": "string",
                    "description": "Your App token"
                  },
                  "service_id": {
                    "type": "string",
                    "description": "Your OTP integration ID"
                  },
                  "otp_code": {
                    "type": "string",
                    "description": "The OTP code entered by the user"
                  },
                  "id": {
                    "type": "string",
                    "description": "User identifier. Required if send_by is set to id."
                  },
                  "id_type": {
                    "type": "string",
                    "description": "Type of identifier. Required if send_by is set to id."
                  },
                  "send_by": {
                    "type": "string",
                    "description": "Determines how the profile is identified. Options: id or contact."
                  },
                  "mobile_number": {
                    "type": "string",
                    "description": "Mobile number used to receive the OTP. Required if send_by is set to contact."
                  }
                }
              },
              "examples": {
                "Verify an OTP": {
                  "value": {
                    "apptoken": "YOUR_APPTOKEN",
                    "request_id": "<otp-request-id-from-generate-result>",
                    "otp": "<user-entered-otp>"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": "true",
                      "default": "true"
                    },
                    "code": {
                      "type": "integer",
                      "example": "200",
                      "default": "0"
                    },
                    "status": {
                      "type": "string",
                      "example": "success"
                    }
                  }
                },
                "examples": {
                  "Success": {
                    "value": {
                      "success": "true",
                      "code": "200",
                      "status": "success"
                    }
                  },
                  "Incorrect OTP": {
                    "value": {
                      "success": "false",
                      "code": "200",
                      "status": "failure",
                      "error": "Incorrect OTP"
                    }
                  },
                  "Expired OTP": {
                    "value": {
                      "success": "false",
                      "code": "200",
                      "status": "failure",
                      "error": "OTP expired"
                    }
                  },
                  "Verification Limit Exceeded": {
                    "value": {
                      "success": "false",
                      "code": "200",
                      "status": "failure",
                      "error": "Verification attempts exceeded"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {}
            }
          }
        },
        "tags": [
          "OTP Methods"
        ]
      }
    }
  }
}
````

