Skip to main content

Documentation Index

Fetch the complete documentation index at: https://developer.mogl.online/llms.txt

Use this file to discover all available pages before exploring further.

This guide walks you through the three steps needed to make your first authenticated request to the MOGL Core API: create an account, obtain a JWT token, and call a protected endpoint. By the end you will have a working token and a real API response in your terminal.
All examples use the MOGL production base URL: https://api.mogl.online/api.

Prerequisites

  • An HTTP client — curl works for all examples below, but any HTTP library will work.
  • Your intended account type: athlete, agent, or partner (brand).

1

Register your account

Choose the registration endpoint that matches your role and create an account.
curl -X POST https://api.mogl.online/api/athlete/register \
  -F "email=you@example.com" \
  -F "password=SecurePass1!"
A 200 response confirms that the account was created. If you receive 409 Conflict, an account with that email already exists — proceed to step 2 and log in.
Registration endpoints are rate-limited. Do not retry in a tight loop — wait a moment before re-attempting if you receive a 429 response.
2

Log in and get your token

Call POST /api/login with your email and password to receive a JWT Bearer token.
curl -X POST https://api.mogl.online/api/login \
  -H "Content-Type: application/json" \
  -d '{
    "email": "you@example.com",
    "password": "SecurePass1!"
  }'
The response body looks like this:
{
  "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
  "token_type": "Bearer",
  "user": { ... }
}
Copy the value of access_token. You will pass it in the Authorization header of every subsequent request.
Save the token to an environment variable so you can reuse it across requests without re-typing it:
export MOGL_TOKEN="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9..."
3

Make your first authenticated API call

Use your token to call a protected endpoint. The example below fetches your agent profile from GET /api/agent/me. If you registered as an athlete or partner, use POST /api/me instead (shown in the second tab).
curl https://api.mogl.online/api/agent/me \
  -H "Authorization: Bearer $MOGL_TOKEN"
A 200 response returns your profile data. If you receive a 401, your token may be missing or expired — return to step 2 to get a fresh token.

What’s next

You are now authenticated and ready to explore the full API surface.
  • Authentication — Understand token expiry, how to log out, and how to handle 401 and 403 errors in production.
  • API Reference — Complete reference for all Core API endpoints, including deals, payments, messaging, and more.