Amba

Challenges

Time-limited goals with XP and achievement rewards to drive short-term engagement.

Challenges are time-limited goals that users can join and complete for rewards. They create short-term engagement bursts.

How it works

  1. Admin creates a challenge with start/end dates, goal type, and rewards
  2. Users discover active challenges and opt in (join)
  3. Progress is tracked automatically based on the goal type
  4. When a user meets the goal, they receive XP and/or an achievement

SDK usage

Get active challenges

const challenges = await client.challenges.getActive();
// Returns challenges with user's progress:
// [
//   {
//     name: "7-Day Fitness Sprint",
//     goal_type: "event_count",
//     goal_value: 7,
//     user_progress: 3,
//     user_status: "active",
//     is_joined: true
//   }
// ]

Join a challenge

await client.challenges.join('challenge_xxx');

Get my challenges

const mine = await client.challenges.getMine();
// Returns active + completed + failed challenges

Goal types

TypeDescriptionHow progress is tracked
event_countTrack an event N timesCounts matching events between start and end
xp_earnedEarn N XPSums XP earned between start and end
streak_maintainedKeep streak for N daysChecks streak continuity within the period

Admin API reference

MethodPathDescription
POST/admin/challengesCreate challenge
GET/admin/challengesList challenges (filter by status)

Client API reference

MethodPathDescription
GET/client/challengesGet active challenges with progress
POST/client/challenges/:id/joinJoin a challenge
GET/client/challenges/mineGet user's joined challenges

MCP tools

ToolDescription
amba_create_challengeCreate a challenge with goal, dates, and rewards
amba_list_challengesList challenges filtered by status

Example

Agent: "Create a weekend XP challenge"

amba_create_challenge({
  project_id: "proj_xxx",
  name: "Weekend XP Blitz",
  description: "Earn 500 XP this weekend for a bonus reward!",
  start_at: "2025-01-18T00:00:00Z",
  end_at: "2025-01-20T00:00:00Z",
  goal_type: "xp_earned",
  goal_value: 500,
  reward_xp: 200,
  reward_achievement_id: "achievement_weekend_warrior"
})

Database tables

TablePurpose
challenge_definitionsChallenge config with dates, goal, and rewards
user_challengesPer-user join records with progress and status

On this page