Vela Mobile API Documentation

MW API DOC

Endpoints for user authentication and session management.

Login (Get Access Token)

Exchange your credentials for a JWT access token.

Endpoint: POST /login/access-token

Request

This endpoint expects multipart/form-data or application/x-www-form-urlencoded.

Parameters:

Field Type Required Description
username string Yes User's email address or username
password string Yes User's password

Example (cURL):

curl -X 'POST' \
  'https://api.mw.velamobile.com/v1/login/access-token' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'username=yourname%40example.com&password=yourpassword'

Response

Success (200 OK):

{
  "access_token": "eyJhbGciOiJIUzI1NiIsInR...",
  "token_type": "bearer",
  "expires_in": 86400  # seconds (24 hours)
}

Session details:

  • Access Token Expiry: 24 Hours.
  • Refresh Token: Not currently implemented (re-login required upon expiry).

Errors:

  • 400 Bad Request: Incorrect email or password.
  • 429 Too Many Requests: Rate limit exceeded (limit: 5/min).

Token Expiry

If the access token expires or is invalid, the API returns 403 Forbidden.

Response:

{
  "detail": "Could not validate credentials"
}

Action: The client must re-authenticate by calling /login/access-token again.


Log Out

Invalidate the current session.

Endpoint: POST /login/logout

Headers:

  • Authorization: Bearer <token>

Example:

{
  "message": "Logged out successfully"
}