Gates API
Evaluate gate conditions to determine whether screens or content should be unlocked for a participant.
Authentication: Session-based. Pass
session_id and engagement_id in the request body. No API key required.Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /runtime/gates/check | Check gate status for one or more targets |
Check Gate Status
Evaluates gate conditions for the specified targets (screen IDs). Gates can require activity completion, point thresholds, badge ownership, or other conditions before content is unlocked.
curl -X POST https://YOUR_API_DOMAIN/api/v1/runtime/gates/check \
-H "Content-Type: application/json" \
-d '{
"session_id": "sess_abc123",
"engagement_id": "550e8400-e29b-41d4-a716-446655440000",
"targets": ["screen-rewards", "screen-bonus"]
}'Response
{
"gates": {
"screen-rewards": {
"locked": false,
"conditions_met": ["quiz_completed", "min_points_100"]
},
"screen-bonus": {
"locked": true,
"conditions_met": ["quiz_completed"],
"conditions_remaining": ["badge_earned:power_user"],
"unlock_hint": "Earn the Power User badge to unlock this screen"
}
}
}Gate Condition Types
Gates support several condition types that can be combined with AND logic:
| Condition | Description | Example |
|---|---|---|
| activity_completed | Participant completed a specific activity | quiz_completed |
| min_points | Participant has at least N points | min_points_500 |
| badge_earned | Participant earned a specific badge | badge_earned:power_user |
| screen_visited | Participant visited a specific screen | screen_visited:intro |
