REST API V1

REST API

All Gami SDKs are thin clients over this API. Authenticate with a Bearer token, send events, read user state, manage quests, webhooks, and rewards.

https://api.gami.io/v1
Bearer token authentication
Webhook signature verification
Sandbox & production environments

Endpoints

POST/v1/events

Track a gamification event for a user.

terminal
curl -X POST https://api.gami.io/v1/events \
  -H "Authorization: Bearer $GAMI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "userId": "user_123",
    "action": "QUEST_COMPLETE",
    "metadata": { "questId": "q_001" }
  }'
GET/v1/users/:id

Return XP, level, badges, and points for a user.

terminal
curl https://api.gami.io/v1/users/user_123 \
  -H "Authorization: Bearer $GAMI_API_KEY"
POST/v1/users/:id/rewards

Grant a reward to a user.

terminal
curl -X POST https://api.gami.io/v1/users/user_123/rewards \
  -H "Authorization: Bearer $GAMI_API_KEY" \
  -d '{ "type": "xp", "amount": 250 }'
GET/v1/quests

List quests for the active project.

terminal
curl https://api.gami.io/v1/quests?status=active \
  -H "Authorization: Bearer $GAMI_API_KEY"
GET/v1/leaderboard

Fetch the project leaderboard.

terminal
curl https://api.gami.io/v1/leaderboard?limit=100 \
  -H "Authorization: Bearer $GAMI_API_KEY"
POST/v1/webhooks

Register a webhook endpoint.

terminal
curl -X POST https://api.gami.io/v1/webhooks \
  -H "Authorization: Bearer $GAMI_API_KEY" \
  -d '{ "url": "https://your-app.com/hook", "events": ["xp.earned"] }'