Login
Authenticate a user and obtain a JWT token for accessing protected endpoints.Authentication
Requires JWT authentication viaAuthorization: Bearer <token> header.
Headers
string
required
Bearer token for authentication
string
required
Request content type
string
required
Response content type
string
required
Request origin
Request Body
string
required
User’s wallet address for authentication
string
required
Cryptographic signature proving wallet ownership
string
required
The message that was signed by the wallet
Response
object
Successfully authenticated
Response Schema
string
JWT authentication token for subsequent API requests
number
Token expiration time in seconds
object
Example Usage
Error Responses
object
Bad Request - Invalid credentials or malformed request
object
Unauthorized - Authentication failed
Logout
Invalidate the current user session and JWT token.Authentication
Requires JWT authentication viaAuthorization: Bearer <token> header.
Headers
string
required
Bearer token to invalidate
string
required
Response content type
string
required
Request origin
Response
object
Successfully logged out
Example Usage
Best Practices
- Always call the logout endpoint when the user explicitly logs out
- Clear the JWT token from local storage after logout
- Handle logout on token expiration
- Implement automatic logout after a period of inactivity
Authentication Flow
- Request Message: Request a message to sign from the platform
- Sign Message: User signs the message with their wallet
- Login: Submit wallet address, signature, and message to
/auth/login - Receive Token: Store the JWT token securely
- Use Token: Include token in
Authorizationheader for all API requests - Logout: Call
/auth/logoutto invalidate the session
Related Endpoints
- GET /auth/my-profile - Get current user profile
- POST /users/register - Register new user
- GET /auth/is-valid-jurisdiction - Check jurisdiction validity