Verify a code for email or phone
POST
/verify-code
const url = 'http://localhost:8000/api/v1/verify-code';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"contact":"example","code":"example","type":"email","purpose":"registration"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:8000/api/v1/verify-code \ --header 'Content-Type: application/json' \ --data '{ "contact": "example", "code": "example", "type": "email", "purpose": "registration" }'Request Body required
Section titled “Request Body required ” Media type application/json
object
contact
required
Email address or phone number
string
code
required
Verification code
string
type
required
Type of contact
string
purpose
Purpose of verification (optional, defaults to “registration”)
string
Example
registrationResponses
Section titled “ Responses ”Code verified successfully
Invalid or expired code
Validation error