post https://api.revenuehq.dev/session
This endpoint is public.
Revenue HQ does not use passwords to authenticate users. Instead, we use a combination of email and a one-time password (OTP) to authenticate users. The OTP is sent to the user's email address and is valid for five minutes. Creating a session is thus a two-part process (both steps are sent to the same API endpoint).
- Make a POST request and only including the email address in the payload.
- This will generate the OTP and send it to the user's email address.
- Make a second POST request and include both the email address and the OTP in the payload.
- This will create and return a session token (this session token will be valid for five mintues).
- This token can be used to authenticate future requests.
- This sesssion can be extended.
If a user record does not exist with the email address provided in Step 1, a new user record will be created and the OTP emailed. It is not possible to tell from our system response whether the email address provided was an existing user or not.