20.1.14. REST API Reference
Every user-facing action in the Challenges module is backed by a REST endpoint. These are documented here for integrators who want to drive challenges from automation, external dashboards, or third-party reward platforms.
All endpoints are served under the configured {{SYSTEM.BASE.API.URL}} prefix and require the
X-API-Token header unless noted otherwise.
20.1.14.1. Challenges
Method |
Path |
Purpose |
|---|---|---|
GET |
|
List challenges. Query params: |
GET |
|
Fetch one challenge with full settings. |
POST |
|
Create. Body / query params: |
PUT |
|
Update. Same fields as create. |
DELETE |
|
Delete with full cascade (results + ledger + badge grants). |
POST |
|
Duplicate as a new inactive challenge. |
POST |
|
Rewrite the results snapshot. |
POST |
|
Dry-run close. Returns projected winners + points without mutating. |
POST |
|
Final close: award points, grant badges, evaluate auto-rules, queue notifications. |
POST |
|
Cron hook; closes all eligible challenges whose |
GET |
|
Leaderboard snapshot rows. |
GET |
|
CSV download of the leaderboard. |
20.1.14.2. Points ledger
Method |
Path |
Purpose |
|---|---|---|
GET |
|
Ledger list. Query params: |
POST |
|
Record a redeem / expire / adjust. Query params: |
GET |
|
Badge-grant list with the same filter shape as points. Paginated. |
20.1.14.3. Participant profile
Method |
Path |
Purpose |
|---|---|---|
GET |
|
Aggregate for one participant. Query params: |
20.1.14.4. Teams
Method |
Path |
Purpose |
|---|---|---|
GET |
|
List teams. Optional |
GET |
|
One team with its |
POST |
|
Create. Fields: |
PUT |
|
Update. |
DELETE |
|
Soft delete ( |
20.1.14.5. Badges
Method |
Path |
Purpose |
|---|---|---|
GET |
|
List badges. Query params: |
GET |
|
One badge. |
POST |
|
Create. Fields: |
PUT |
|
Update. |
DELETE |
|
Soft delete. |
GET |
|
List badge auto-rules. |
POST |
|
Create rule. Fields: |
DELETE |
|
Delete a rule (does not revoke granted badges). |
20.1.14.6. Error responses
All endpoints return application/json on error with an error string and, where
appropriate, a field hint. HTTP status codes follow the usual convention:
400– validation (bad enum, missing required field).403– role denied (admin required).404– record not found.409– conflict (e.g. spend would overdraw the ledger balance).500– unexpected server error – details in the server log.
20.1.14.7. Example: close a challenge from curl
curl -X POST \
-H 'X-API-Token: <token>' \
'https://your-server/challenges/close?id=42'
# {"success":true}
20.1.14.8. Example: paginated ledger for an auditor
curl -H 'X-API-Token: <token>' \
'https://your-server/challenges/points?participanttype=2&participantid=17&page=1&perPage=100'