Skip to main content

Login

Authenticate a user and obtain a JWT token for accessing protected endpoints.

Authentication

Requires JWT authentication via Authorization: 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
Authenticated user information
string
User’s unique identifier
string
User’s wallet address
string
User’s display name

Example Usage

Error Responses

object
Bad Request - Invalid credentials or malformed request
object
Unauthorized - Authentication failed
Store the JWT token securely. Never expose it in client-side code or commit it to version control.

Logout

Invalidate the current user session and JWT token.

Authentication

Requires JWT authentication via Authorization: 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

  1. Request Message: Request a message to sign from the platform
  2. Sign Message: User signs the message with their wallet
  3. Login: Submit wallet address, signature, and message to /auth/login
  4. Receive Token: Store the JWT token securely
  5. Use Token: Include token in Authorization header for all API requests
  6. Logout: Call /auth/logout to invalidate the session