Verify a sign-in code
Exchange a valid email sign-in code for an API key.
POST
/v1/otp/verify
Request
Send JSON with otp as a four-character string and the same email used to request the code. You can supply the address with x-email instead of the JSON email field. The code is single-use. Successful verification may create a Tiiny Host account for the address.
Example
curl --fail-with-body https://ext.tiiny.host/v1/otp/verify \
-H 'Content-Type: application/json' \
-d '{"email":"you@example.com","otp":"1234"}'
Replace 1234 with the code from the email.
Success response
200 OK
{ "success": true, "apiKey": "YOUR_API_KEY", "existingAccount": true }
existingAccount is returned when an account already existed. Store the key securely and pass it in x-api-key for API-key requests.
Errors
A wrong or expired code returns 401. Check the email address and code or request a fresh code.