Challenges
Time-boxed challenges — goal type, goal value, reward XP, optional reward achievement.
Challenges are time-bounded goals (start_at → end_at) that users join and make progress against. Participant progress lives in user_challenges.
Source: apps/api/src/routes/admin/challenges.ts.
Endpoints
| Method | Path | Description |
|---|---|---|
| POST | /admin/projects/:projectId/challenges | Create a challenge. |
| GET | /admin/projects/:projectId/challenges | List challenges, optionally filtered by ?status=active|upcoming|ended. |
| GET | /admin/projects/:projectId/challenges/:challengeId | Fetch a challenge. |
| PATCH | /admin/projects/:projectId/challenges/:challengeId | Partial update. |
| DELETE | /admin/projects/:projectId/challenges/:challengeId | Delete. |
| GET | /admin/projects/:projectId/challenges/:challengeId/participants | Paginated participants, ordered by progress. |
POST /admin/projects/:projectId/challenges
Request
| Field | Type | Required |
|---|---|---|
name | string | yes |
description | string | no |
start_at | ISO-8601 | yes |
end_at | ISO-8601 | yes |
goal_type | string | yes |
goal_value | number | yes |
reward_xp | number | no (default 0) |
reward_achievement_id | uuid | no |
Response 201
Try it:
POST
developer auth/admin/projects/%7B%7BprojectId%7D%7D/challengescurl -X POST 'https://api.amba.dev/admin/projects/%7B%7BprojectId%7D%7D/challenges'Loading auth… Configure auth in the settings drawer (top-right) to run this request.
Curl:
GET /admin/projects/:projectId/challenges
Query
| Param | Values | Description |
|---|---|---|
status | active, upcoming, ended | Optional filter. Omit for all. |
Response 200
Try it:
GET
developer auth/admin/projects/%7B%7BprojectId%7D%7D/challengescurl -X GET 'https://api.amba.dev/admin/projects/%7B%7BprojectId%7D%7D/challenges'Loading auth… Configure auth in the settings drawer (top-right) to run this request.
Curl:
GET /admin/projects/:projectId/challenges/:challengeId
Errors
404 NOT_FOUND.
Try it:
GET
developer auth/admin/projects/%7B%7BprojectId%7D%7D/challenges/%7B%7BchallengeId%7D%7Dcurl -X GET 'https://api.amba.dev/admin/projects/%7B%7BprojectId%7D%7D/challenges/%7B%7BchallengeId%7D%7D'Loading auth… Configure auth in the settings drawer (top-right) to run this request.
Curl:
PATCH /admin/projects/:projectId/challenges/:challengeId
Allowed fields: name, description, start_at, end_at, goal_type, goal_value, reward_xp, reward_achievement_id, is_active.
Try it:
PATCH
developer auth/admin/projects/%7B%7BprojectId%7D%7D/challenges/%7B%7BchallengeId%7D%7Dcurl -X PATCH 'https://api.amba.dev/admin/projects/%7B%7BprojectId%7D%7D/challenges/%7B%7BchallengeId%7D%7D'Loading auth… Configure auth in the settings drawer (top-right) to run this request.
Curl:
DELETE /admin/projects/:projectId/challenges/:challengeId
Try it:
DELETE
developer auth/admin/projects/%7B%7BprojectId%7D%7D/challenges/%7B%7BchallengeId%7D%7Dcurl -X DELETE 'https://api.amba.dev/admin/projects/%7B%7BprojectId%7D%7D/challenges/%7B%7BchallengeId%7D%7D'Loading auth… Configure auth in the settings drawer (top-right) to run this request.
Curl:
GET /admin/projects/:projectId/challenges/:challengeId/participants
Paginated list of participants, ordered by progress DESC.
Query
| Param | Default |
|---|---|
limit | 50 |
offset | 0 |
Response 200
Try it:
GET
developer auth/admin/projects/%7B%7BprojectId%7D%7D/challenges/%7B%7BchallengeId%7D%7D/participantscurl -X GET 'https://api.amba.dev/admin/projects/%7B%7BprojectId%7D%7D/challenges/%7B%7BchallengeId%7D%7D/participants'Loading auth… Configure auth in the settings drawer (top-right) to run this request.
Curl: