Challenges
Active challenges with per-user progress, join flow, user's own challenges.
Source: apps/api/src/routes/client/challenges.ts.
Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /client/challenges | Currently-active challenges with user progress + join status. |
| POST | /client/challenges/:challengeId/join | Join a challenge. Idempotent — returns existing row if already joined. |
| GET | /client/challenges/mine | User's challenges (active and completed) with challenge definition metadata. |
GET /client/challenges
Active = is_active = true AND start_at <= NOW() AND end_at >= NOW().
Response 200
Errors
500 FETCH_FAILED.
Try it:
GET
client auth/client/challengescurl -X GET 'https://api.amba.dev/client/challenges'Loading auth… Configure auth in the settings drawer (top-right) to run this request.
Curl:
POST /client/challenges/:challengeId/join
Insert into user_challenges with progress = 0, status = 'active'. Idempotent.
Response 201 (newly joined) / 200 (already joined)
Errors
404 NOT_FOUND— challenge doesn't exist or isn't active.500 CREATE_FAILED.
Try it:
POST
client auth/client/challenges/%7B%7BchallengeId%7D%7D/joincurl -X POST 'https://api.amba.dev/client/challenges/%7B%7BchallengeId%7D%7D/join'Loading auth… Configure auth in the settings drawer (top-right) to run this request.
Curl:
GET /client/challenges/mine
All of the caller's user_challenges, newest first, joined to the challenge definition.
Response 200
Try it:
GET
client auth/client/challenges/minecurl -X GET 'https://api.amba.dev/client/challenges/mine'Loading auth… Configure auth in the settings drawer (top-right) to run this request.
Curl: