Issue a token
Rate limit 30 requests/min (public)
const url = 'https://app.ridebox.my/api/auth/login';const options = { method: 'POST', headers: {'X-API-Version': 'v1', 'Content-Type': 'application/json'}, body: '{"email":"[email protected]","password":"YOUR_PASSWORD","device_name":"YOUR_INTEGRATION_NAME"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://app.ridebox.my/api/auth/login \ --header 'Content-Type: application/json' \ --header 'X-API-Version: v1' \ --data '{ "email": "[email protected]", "password": "YOUR_PASSWORD", "device_name": "YOUR_INTEGRATION_NAME" }'Exchange account credentials for a bearer token. device_name labels the token, so name your integration.
Public tier: 30 requests/min per IP.
Parameters
Section titled “ Parameters ”Header Parameters
Section titled “ Header Parameters ”Selects the API version. With no version header the request is served as v1. An Accept: application/vnd.ridebox+v1+json header selects the version too; X-API-Version is read first when both are sent. An unsupported version answers 400 with supported_versions.
Example
v1Request Bodyrequired
Section titled “ Request Bodyrequired ”object
Account password.
Example
YOUR_PASSWORDA name for the issued token, such as the name of your integration.
Example
YOUR_INTEGRATION_NAMEResponses
Section titled “ Responses ”Token issued.
The response shape shared by POST /auth/login and POST /auth/refresh.
object
A bearer token. Store it securely: it is returned once and cannot be retrieved again.
object
The token value.
UTC instant at which the token expires, 30 days after issue.
The account the token belongs to.
object
IANA zone to render timestamps in. Timestamps themselves are always UTC.
Example
{ "data": { "token": "YOUR_API_TOKEN", "token_type": "Bearer", "expires_at": "2026-10-12T02:14:00Z", "user": { "id": "YOUR_USER_UUID", "name": "YOUR_NAME", "timezone": "Asia/Kuala_Lumpur" } }}Headers
Section titled “ Headers ”The API version that served this response. Always v1 on this surface.
Example
v1Requests permitted in the current window for the applicable tier.
Example
120Requests remaining in the current window.
Example
0Validation failed. errors is keyed by field name.
The single shape used by every non-2xx response. message is always present and safe to display. errors is present only on 422. code is present on a 401 that presented a token.
object
Human-readable, safe to display to the end user.
Present only on 422. Field name to array of messages.
object
Tells an expired token, which you can replace by signing in again, from a revoked one.
Example
{ "message": "The given data was invalid.", "errors": { "email": [ "The email field is required." ] }}Headers
Section titled “ Headers ”The API version that served this response. Always v1 on this surface.
Example
v1Rate limited. Back off and honour Retry-After.
The single shape used by every non-2xx response. message is always present and safe to display. errors is present only on 422. code is present on a 401 that presented a token.
object
Human-readable, safe to display to the end user.
Present only on 422. Field name to array of messages.
object
Tells an expired token, which you can replace by signing in again, from a revoked one.
Example
{ "message": "Too many requests. Please try again shortly."}Headers
Section titled “ Headers ”Seconds to wait before retrying.
Example
42Requests permitted in the current window for the applicable tier.
Example
120Requests remaining in the current window.
Example
0Unix timestamp at which the current window resets. Sent on 429.
Example
1789180500The API version that served this response. Always v1 on this surface.
Example
v1