majjha.developers
Open beta

Public beta: activity uses test Dots with no monetary value. There is no money in or out, and interfaces may change before launch.

Auth API

Session endpoints for local password compatibility and reading the current account. Public market data needs no session; private resources use a Bearer token.

Password login

Public
POST/api/auth/login

Authenticates a retained email/password account and returns a native Bearer JWT. The hosted first-party app prefers Dynamic; this flow remains for local development and compatible integrations.

Body parameters

  • emailstringbodyrequired

    Account email.

  • passwordstringbodyrequired

    Account password.

Request

cURL
curl -X POST "https://api.majjha.fun/api/auth/login" \
  -H "Content-Type: application/json" \
  -d '{ "email": "[email protected]", "password": "correct horse battery staple" }'
Request body
{ "email": "[email protected]", "password": "correct horse battery staple" }

Response

200 OK
{ "token": "eyJhbGciOiJIUzI1NiJ9…", "user": { "id": "usr_123", "email": "[email protected]", "name": "Ada", "username": "ada", "role": "USER" }, "isNewUser": false, "signupGrant": null }

Get current session

Requires auth
GET/api/auth/me

Validates the Bearer JWT and returns the current account plus its indexed available, reserved, and total test-token balance.

Request

cURL
curl "https://api.majjha.fun/api/auth/me" \
  -H "Authorization: Bearer $MAJJ_TOKEN"

Response

200 OK
{ "user": { "id": "usr_123", "email": "[email protected]", "name": "Ada", "username": "ada", "role": "USER", "createdAt": "2026-06-24T12:00:00Z" }, "balance": { "available": "1000.00000000", "reserved": "0.00000000", "total": "1000.00000000" } }