Amba

Streaks

Read the current user's streak state and record a qualifying event.

POST /client/events automatically qualifies streaks whose qualifying_event matches. Use POST /client/streaks/:idOrKey/qualify for manual qualification (e.g. UI actions not mapped to an event).

The :idOrKey parameter accepts either a streak's UUID or its human-readable key (e.g. "daily_play"). If the value looks like a UUID it is treated as an id-lookup; otherwise it is treated as a key-lookup. The two paths are mutually exclusive.

Endpoints

MethodPathDescription
GET/client/streaksAll of the current user's streaks.
POST/client/streaks/:idOrKey/qualifyRecord a qualifying event against a streak definition.

GET /client/streaks

Response 200

{
  "data": [
    {
      "id": "…",
      "key": "daily_play",
      "name": "Daily Player",
      "current_count": 7,
      "longest_count": 42,
      "last_qualified_at": "…",
      "freezes_remaining": 1,
      "status": "active",
      "updated_at": "…"
    }
  ]
}

Errors

  • 500 FETCH_FAILED.

Try it:

GET/client/streaks
client auth
curl -X GET 'https://api.amba.dev/v1/client/streaks'
Loading auth… Configure auth in the settings drawer (top-right) to run this request.

Curl:

curl -X GET '${BASE_URL}/client/streaks' \
  -H 'X-Api-Key: ${CLIENT_API_KEY}' \
  -H 'Authorization: Bearer ${SESSION_TOKEN}'

POST /client/streaks/:idOrKey/qualify

Response 200 (existing row updated) / 201 (first-time qualifier)

{
  "data": {
    "id": "…",
    "key": "daily_play",
    "name": "Daily Player",
    "current_count": 8,
    "longest_count": 42,
    "last_qualified_at": "…",
    "status": "active",
    "freezes_remaining": 1,
    "updated_at": "…"
  }
}

Errors

  • 404 STREAK_NOT_FOUND — no streak definition with the given id or key. Includes a hint field pointing to amba_create_streak.
  • 500 QUALIFY_FAILED.

Try it:

POST/client/streaks/daily_play/qualify
client auth
curl -X POST 'https://api.amba.dev/v1/client/streaks/daily_play/qualify'
Loading auth… Configure auth in the settings drawer (top-right) to run this request.

Curl:

curl -X POST '${BASE_URL}/client/streaks/{idOrKey}/qualify' \
  -H 'X-Api-Key: ${CLIENT_API_KEY}' \
  -H 'Authorization: Bearer ${SESSION_TOKEN}' \
  -H 'Content-Type: application/json' \
  -d '{}'

On this page