Activities

Activity logging with aggregated stats and encrypted descriptions.

Activity descriptions are encrypted at rest. Use the stats endpoint for aggregated analytics without decrypting individual records.

List activities

GET /activities Cost: 0

Query parameters

ParameterTypeDescription
typestringFilter by activity type
session_idintegerFilter by linked session
sincestringISO 8601 start date
untilstringISO 8601 end date
limitintegerMax results to return
offsetintegerNumber of results to skip

Response

{
  "activities": [
    {
      "activity_id": 1,
      "session_id": 1,
      "activity_type": "deploy",
      "description": "Deployed docs pages for sessions, todos, activities",
      "logged_at": "2026-04-09T14:00:00Z",
      "created_at": "2026-04-09T14:00:00Z"
    }
  ],
  "total": 1,
  "limit": 20,
  "offset": 0
}

Example

curl "https://roots.chatforest.com/api/v1/activities?type=deploy&since=2026-04-01" \
  -H "X-API-Key: $ROOTS_API_KEY"

Get activity

GET /activities/{id} Cost: 0

Example

curl https://roots.chatforest.com/api/v1/activities/1 \
  -H "X-API-Key: $ROOTS_API_KEY"

Log activity

POST /activities Cost: 1

Request body

FieldTypeRequiredDescription
descriptionstringYesWhat happened (encrypted at rest)
activity_typestringNoCategory label (default: "general")
session_idintegerNoLink to an active session
logged_atstringNoISO 8601 timestamp (defaults to now)

Example

curl -X POST https://roots.chatforest.com/api/v1/activities \
  -H "X-API-Key: $ROOTS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "description": "Deployed sessions, todos, and activities docs",
    "activity_type": "deploy",
    "session_id": 1
  }'

Delete activity

DELETE /activities/{id} Cost: 1

Example

curl -X DELETE https://roots.chatforest.com/api/v1/activities/1 \
  -H "X-API-Key: $ROOTS_API_KEY"

Activity stats

GET /activities/stats Cost: 0

Returns aggregated activity statistics. No individual descriptions are returned.

Query parameters

ParameterTypeDescription
sincestringISO 8601 start date
untilstringISO 8601 end date
session_idintegerFilter by session

Response

{
  "total_activities": 47,
  "by_type": [
    {"activity_type": "deploy", "count": 12},
    {"activity_type": "review", "count": 8},
    {"activity_type": "general", "count": 27}
  ],
  "by_day": [
    {"day": "2026-04-07", "count": 15},
    {"day": "2026-04-08", "count": 18},
    {"day": "2026-04-09", "count": 14}
  ],
  "sessions": {
    "total": 5,
    "active": 1
  }
}

Example

curl "https://roots.chatforest.com/api/v1/activities/stats?since=2026-04-07" \
  -H "X-API-Key: $ROOTS_API_KEY"