API Reference

Complete documentation for Gami Protocol REST API

Authentication

All API requests require an API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Get your API key from the developer dashboard after creating an account.

Endpoints

POST/api/v1/quests

Create a new quest

curl -X POST https://api.gami.io/v1/quests \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"title": "Complete Tutorial", "reward": {"xp": 100}}'
GET/api/v1/users/:id/progress

Get user progress and XP

curl https://api.gami.io/v1/users/user123/progress \
  -H "Authorization: Bearer YOUR_API_KEY"
POST/api/v1/users/:id/rewards

Award reward to user

curl -X POST https://api.gami.io/v1/users/user123/rewards \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{"type": "xp", "amount": 50}'
GET/api/v1/leaderboard

Fetch global leaderboard

curl https://api.gami.io/v1/leaderboard?limit=100&offset=0 \
  -H "Authorization: Bearer YOUR_API_KEY"

Response Format

All responses are returned as JSON with standard HTTP status codes:

200 OK

Successful request

201 Created

Resource created

400 Bad Request

Invalid parameters

401 Unauthorized

Invalid API key

Rate Limiting

API requests are rate-limited to prevent abuse:

  • Free tier: 100 requests per minute
  • Pro tier: 1,000 requests per minute
  • Enterprise: Custom limits available

Need Help?

Join our community Discord or check out full examples on GitHub