Streaks
Manage streak definitions — daily or weekly cadence, grace windows, and optional freezes.
Streak definitions describe the rules that user streaks follow. The actual user_streaks rows are written by the Temporal streak evaluation workflow and the POST /client/streaks/:streakId/qualify endpoint.
Source: apps/api/src/routes/admin/streaks.ts.
Endpoints
| Method | Path | Description |
|---|---|---|
| POST | /admin/projects/:projectId/streaks | Create a streak definition. |
| GET | /admin/projects/:projectId/streaks | List streak definitions. |
| PATCH | /admin/projects/:projectId/streaks/:streakId | Partial update. |
| DELETE | /admin/projects/:projectId/streaks/:streakId | Delete a streak definition. |
POST /admin/projects/:projectId/streaks
Request
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | yes | — | |
description | string | no | null | |
qualifying_event | string | yes | — | Engagement event that counts toward the streak. |
period | "daily" | "weekly" | no | "daily" | |
grace_period_hours | number | no | 0 | Extra hours after period end before the streak breaks. |
freeze_enabled | boolean | no | false | Allow freezes to save a broken streak. |
max_freezes | number | no | 1 | Per-user freeze cap. |
Response 201
Try it:
POST
developer auth/admin/projects/%7B%7BprojectId%7D%7D/streakscurl -X POST 'https://api.amba.dev/admin/projects/%7B%7BprojectId%7D%7D/streaks'Loading auth… Configure auth in the settings drawer (top-right) to run this request.
Curl:
GET /admin/projects/:projectId/streaks
Try it:
GET
developer auth/admin/projects/%7B%7BprojectId%7D%7D/streakscurl -X GET 'https://api.amba.dev/admin/projects/%7B%7BprojectId%7D%7D/streaks'Loading auth… Configure auth in the settings drawer (top-right) to run this request.
Curl:
PATCH /admin/projects/:projectId/streaks/:streakId
Updatable fields: name, description, qualifying_event, period, grace_period_hours, freeze_enabled, max_freezes.
Errors
404 NOT_FOUND.500 UPDATE_FAILED.
Try it:
PATCH
developer auth/admin/projects/%7B%7BprojectId%7D%7D/streaks/%7B%7BstreakId%7D%7Dcurl -X PATCH 'https://api.amba.dev/admin/projects/%7B%7BprojectId%7D%7D/streaks/%7B%7BstreakId%7D%7D'Loading auth… Configure auth in the settings drawer (top-right) to run this request.
Curl:
DELETE /admin/projects/:projectId/streaks/:streakId
Try it:
DELETE
developer auth/admin/projects/%7B%7BprojectId%7D%7D/streaks/%7B%7BstreakId%7D%7Dcurl -X DELETE 'https://api.amba.dev/admin/projects/%7B%7BprojectId%7D%7D/streaks/%7B%7BstreakId%7D%7D'Loading auth… Configure auth in the settings drawer (top-right) to run this request.
Curl: