Skip to main content
The RideShare API uses JWT-based authentication. To access protected endpoints, you must first create an account and log in to receive an access token.

Signup flow

Account creation requires email verification via a one-time passcode (OTP). Step 1 — Request an OTP Send your name and email to receive a passcode:
Step 2 — Create your account Submit your credentials along with the OTP:

Logging in

Call POST /auth/login with your email and password to receive tokens:

Authorizing requests

Include your access token in the Authorization header on every request to a protected endpoint:
The token type is always Bearer.
Access tokens expire after expiresIn seconds (3600 seconds by default). Once expired, requests will be rejected with a 401 response. Use your refresh token to get a new access token before it expires.

Refreshing tokens

Call POST /auth/refresh with your current refresh token to receive a new access token and a rotated refresh token. The old refresh token is immediately invalidated.
Store the new refreshToken returned in the response. Your previous refresh token will no longer work.

Logging out

Call POST /auth/logout with your refresh token to revoke it. After logout, the refresh token cannot be used to issue new access tokens.

Roles

Your account has a role that controls what actions you can perform. The supported roles are: By default, your account is assigned the role you specified at signup (or USER if none was provided). You can request a specific role at login time by including the role field in your login request body:
If you request a role that is not valid, the API falls back to the role stored on your account.

Public vs. protected endpoints

The following endpoints do not require an Authorization header. All other endpoints require a valid Bearer token.