BricqsBricqs
Documentation

Participants API

Register participants explicitly, fetch a rich profile with points, tier, badges, streaks, and rewards in one call, patch profile attributes, and query a unified state object scoped to the sections you need. Participants are also auto-created on first interaction with any other Gamify endpoint, so explicit registration is optional.

Auth
All endpoints require an X-API-Key header. Production keys are prefixed bq_live_; sandbox keys bq_test_.
Scopes
Participant key All participant endpoints work with any valid API key. No admin scope is required for this resource.
Base URLhttps://YOUR_API_DOMAIN/api/v1/gamify

Endpoint inventory

MethodEndpointPurpose
POST/gamify/participantsCreate or upsert a participant with profile data. Idempotent.
GET/gamify/participants/{participant_id}Rich profile with points, tier, badges, streaks, rewards counts.
PATCH/gamify/participants/{participant_id}Update display name, avatar, or custom attributes.
GET/gamify/participants/{participant_id}/stateUnified state with selectable sections via the include query.
POST/api/v1/gamify/participants
Participant keyIdempotent

Create a participant, or upsert profile fields when one already exists for the supplied participant_id. Returns the full profile (same shape as GET) with a 201 status code. Because it is an upsert, calling again with the same participant_id safely updates display_name, avatar_url, and attributes without creating duplicates.

Request body
FieldTypeDescription
participant_idrequiredstrYour app's user identifier. 1 to 255 characters. Used as the stable external key for every other endpoint.
display_nameOptional[str]Human-readable name shown in dashboards, leaderboards, and the SDK. Max 255 characters.
avatar_urlOptional[str]URL to a profile image. Max 500 characters.
attributesOptional[dict[str, Any]]Free-form JSON metadata stored verbatim on the participant. Useful for plan tier, signup source, segments.
POST /api/v1/gamify/participants
X-API-Key: bq_live_xxxxx
Content-Type: application/json

{
  "participant_id": "user_123",
  "display_name": "Jane Doe",
  "avatar_url": "https://example.com/avatar.png",
  "attributes": {
    "plan": "premium",
    "signup_source": "referral"
  }
}
Response fields
FieldTypeDescription
participant_idstrEcho of the supplied participant identifier.
display_nameOptional[str]Display name as stored after the upsert.
avatar_urlOptional[str]Avatar URL as stored after the upsert.
attributesOptional[dict[str, Any]]Free-form attributes as stored.
pointsOptional[PointsState]Points snapshot: balance, total_earned, total_spent. Zeroed for new participants.
tierOptional[TierState]Current tier placement: code, name, level, optional color, achieved_at, plus a next_tier delta. null when the participant has no tier yet.
badgeslist[BadgeSummary]Earned badges. Each entry: code, name, optional icon, rarity (default common), earned flag, optional earned_at. Empty list for new participants.
streaksOptional[StreakSummary]Streak summary: current, longest, optional last_activity_at.
rewards_claimedintLifetime count of rewards claimed. Default: 0
first_seen_atOptional[datetime]First time this participant was observed.
last_seen_atOptional[datetime]Most recent activity timestamp.
total_eventsintLifetime count of behavioural events observed for this participant. Default: 0
is_activeboolWhether the participant is currently active. Default: true
created_atOptional[datetime]Server-side creation timestamp.
{
  "participant_id": "user_123",
  "display_name": "Jane Doe",
  "avatar_url": "https://example.com/avatar.png",
  "attributes": { "plan": "premium", "signup_source": "referral" },
  "points": { "balance": 0, "total_earned": 0, "total_spent": 0 },
  "tier": null,
  "badges": [],
  "streaks": null,
  "rewards_claimed": 0,
  "first_seen_at": null,
  "last_seen_at": null,
  "total_events": 0,
  "is_active": true,
  "created_at": "2026-02-14T10:00:00Z"
}
Errors
StatusCodeWhen it fires
401unauthorizedX-API-Key header missing, invalid, expired, or revoked.
403forbiddenTenant is disabled.
GET/api/v1/gamify/participants/{participant_id}
Participant key

Returns the full participant profile: identity fields, points snapshot, current tier with next-tier delta, earned badges, streak summary, lifetime rewards and event counts, and seen-at timestamps.

Path parameters
FieldTypeDescription
participant_idrequiredstrYour participant identifier as supplied at creation. 1 to 255 characters.
GET /api/v1/gamify/participants/user_123
X-API-Key: bq_live_xxxxx
Response fields
FieldTypeDescription
participant_idstrEcho of the requested participant id.
display_nameOptional[str]Display name. null when never set.
avatar_urlOptional[str]Avatar URL. null when never set.
attributesOptional[dict[str, Any]]Free-form attributes JSON.
pointsOptional[PointsState]balance, total_earned, total_spent integers (all default 0).
tierOptional[TierState]code, name, level, optional color, optional achieved_at, optional next_tier { code, name, points_required, points_remaining }.
badgeslist[BadgeSummary]Each entry: code, name, optional icon, rarity (default common), earned (default false), optional earned_at.
streaksOptional[StreakSummary]current (default 0), longest (default 0), optional last_activity_at.
rewards_claimedintLifetime rewards claimed count. Default: 0
first_seen_atOptional[datetime]First observation timestamp.
last_seen_atOptional[datetime]Latest observation timestamp.
total_eventsintLifetime event count. Default: 0
is_activeboolActive flag. Default: true
created_atOptional[datetime]Creation timestamp.
{
  "participant_id": "user_123",
  "display_name": "Jane Doe",
  "avatar_url": "https://example.com/avatar.png",
  "attributes": { "plan": "premium" },
  "points": { "balance": 1500, "total_earned": 5000, "total_spent": 3500 },
  "tier": {
    "code": "gold",
    "name": "Gold",
    "level": 3,
    "color": "#FFD700",
    "achieved_at": "2026-02-01T10:00:00Z",
    "next_tier": {
      "code": "platinum",
      "name": "Platinum",
      "points_required": 10000,
      "points_remaining": 8500
    }
  },
  "badges": [
    {
      "code": "first_steps",
      "name": "First Steps",
      "icon": "https://cdn.example.com/badges/first_steps.png",
      "rarity": "common",
      "earned": true,
      "earned_at": "2026-01-15T12:30:00Z"
    }
  ],
  "streaks": { "current": 7, "longest": 21, "last_activity_at": "2026-02-14T08:15:00Z" },
  "rewards_claimed": 3,
  "first_seen_at": "2026-01-01T10:00:00Z",
  "last_seen_at": "2026-02-14T08:15:00Z",
  "total_events": 156,
  "is_active": true,
  "created_at": "2026-01-01T10:00:00Z"
}
Errors
StatusCodeWhen it fires
404participant_not_foundNo participant exists for the supplied participant_id under this tenant.
PATCH/api/v1/gamify/participants/{participant_id}
Participant key

Partial update of a participant's profile fields. All body fields are optional; only supplied fields are changed. Returns the full profile with the same shape as GET. At least one field must be supplied.

Path parameters
FieldTypeDescription
participant_idrequiredstrYour participant identifier. 1 to 255 characters.
Request body (all optional, at least one required)
FieldTypeDescription
display_nameOptional[str]New display name. Max 255 characters.
avatar_urlOptional[str]New avatar URL. Max 500 characters.
attributesOptional[dict[str, Any]]Replaces the attributes JSON entirely.
PATCH /api/v1/gamify/participants/user_123
X-API-Key: bq_live_xxxxx
Content-Type: application/json

{
  "display_name": "Jane Smith",
  "attributes": { "plan": "enterprise", "team_id": "team_42" }
}
{
  "participant_id": "user_123",
  "display_name": "Jane Smith",
  "avatar_url": "https://example.com/avatar.png",
  "attributes": { "plan": "enterprise", "team_id": "team_42" },
  "points": { "balance": 1500, "total_earned": 5000, "total_spent": 3500 },
  "tier": { "code": "gold", "name": "Gold", "level": 3 },
  "badges": [],
  "streaks": { "current": 7, "longest": 21 },
  "rewards_claimed": 3,
  "first_seen_at": "2026-01-01T10:00:00Z",
  "last_seen_at": "2026-02-14T08:15:00Z",
  "total_events": 156,
  "is_active": true,
  "created_at": "2026-01-01T10:00:00Z"
}
Errors
StatusCodeWhen it fires
400no_fields_to_updateRequest body was empty or contained no recognised fields.
404participant_not_foundNo participant exists for the supplied participant_id under this tenant.
GET/api/v1/gamify/participants/{participant_id}/state
Participant key

Lightweight unified state endpoint that returns one or more gamification sections. Use the include query to scope the payload to the sections you need; omit it to return every section.

Path parameters
FieldTypeDescription
participant_idrequiredstrYour participant identifier. 1 to 255 characters.
Query parameters
FieldTypeDescription
includeOptional[str]Comma-separated subset of points, tier, badges, streaks, challenges, rewards. Omit to return every section.
GET /api/v1/gamify/participants/user_123/state?include=points,tier,badges
X-API-Key: bq_live_xxxxx
Response fields
FieldTypeDescription
participant_idstrEcho of the requested participant id.
pointsOptional[PointsState]Present when points was included (or include was omitted). balance, total_earned, total_spent.
tierOptional[TierState]Present when tier was included. code, name, level, optional color, optional achieved_at, optional next_tier.
badgesOptional[list[BadgeSummary]]Present when badges was included. Each entry: code, name, optional icon, rarity, earned, optional earned_at.
streaksOptional[StreakSummary]Present when streaks was included. current, longest, optional last_activity_at.
challengesOptional[dict]Present when challenges was included. Shape: { active: int, completed: int }.
rewardsOptional[dict]Present when rewards was included. Shape: { total_claimed: int }.
{
  "participant_id": "user_123",
  "points": { "balance": 1500, "total_earned": 5000, "total_spent": 3500 },
  "tier": { "code": "gold", "name": "Gold", "level": 3 },
  "badges": [
    { "code": "first_steps", "name": "First Steps", "rarity": "common",
      "earned": true, "earned_at": "2026-01-15T12:30:00Z" },
    { "code": "power_user",  "name": "Power User",  "rarity": "rare",
      "earned": false, "earned_at": null }
  ]
}
Errors
StatusCodeWhen it fires
401unauthorizedX-API-Key header missing, invalid, expired, or revoked.
403forbiddenTenant is disabled.
Related
← Back to Gamification API