Skip to content

AI Productivity Insights ​

Run AI-powered analysis on your productivity data. The insights engine analyzes task completion patterns across your chains and projects to detect trends, flag anomalies, suggest optimizations, and forecast progress.

Endpoints ​

MethodPathDescriptionAuth
POST/ai/productivity-insights/analyzeRun an analysisJWT + Entitlement
GET/ai/productivity-insightsList past insightsJWT + Entitlement

POST /ai/productivity-insights/analyze ​

Description ​

Run AI analysis on productivity patterns within a date range.

Authentication: JWT Bearer token + active AI entitlement required.

Request ​

  • Headers: Authorization: Bearer <token>, Content-Type: application/json
Request Body ​
FieldTypeRequiredDescription
scopestringYesAnalysis scope: account, chainy, or chain
scopeIdstring (uuid)NoTarget ID when scope is chainy or chain
insightTypestringYesOne of: trend, anomaly, optimization, forecast
fromstring (ISO 8601)NoStart date (defaults to 30 days ago)
tostring (ISO 8601)NoEnd date (defaults to now)
Insight Types ​
TypeWhat It Does
trendShows whether your completion pace is improving, declining, or stable over the date range
anomalyFlags days with unusually high activity or unexpected gaps
optimizationGenerates actionable suggestions from your completion history
forecastProjects completion counts for the next 7 and 30 days

Response ​

Response Example (Trend) ​
json
{
  "data": {
    "id": "cm5insight01",
    "scope": "account",
    "scopeId": null,
    "insightType": "trend",
    "content": {
      "direction": "improving",
      "avgDailyCompletions": 3.2,
      "firstHalfAvg": 2.1,
      "secondHalfAvg": 4.3,
      "activeChains": 4,
      "totalCompletions": 96
    },
    "runId": null,
    "createdAt": "2026-03-17T14:00:00.000Z"
  }
}
Response Example (Anomaly) ​
json
{
  "data": {
    "id": "cm5insight02",
    "scope": "account",
    "scopeId": null,
    "insightType": "anomaly",
    "content": {
      "avgDailyCompletions": 3.2,
      "anomalyCount": 3,
      "anomalies": [
        { "date": "2026-03-01", "count": 12, "type": "spike" },
        { "date": "2026-03-05", "count": 0, "type": "gap" },
        { "date": "2026-03-10", "count": 11, "type": "spike" }
      ]
    },
    "runId": null,
    "createdAt": "2026-03-17T14:00:00.000Z"
  }
}
Response Example (Optimization) ​
json
{
  "data": {
    "id": "cm5insight03",
    "scope": "chainy",
    "scopeId": "cm5abc123",
    "insightType": "optimization",
    "content": {
      "averageSuccessfulRuns": 2.5,
      "activeChains": 7,
      "suggestions": [
        "Focus on building consistent run history before adding new chains.",
        "Consider consolidating chains -- too many parallel goals can reduce focus."
      ]
    },
    "runId": null,
    "createdAt": "2026-03-17T14:00:00.000Z"
  }
}
Response Example (Forecast) ​
json
{
  "data": {
    "id": "cm5insight04",
    "scope": "account",
    "scopeId": null,
    "insightType": "forecast",
    "content": {
      "projectedCompletions7d": 22,
      "projectedCompletions30d": 96,
      "currentPace": 3.2,
      "requiredPaceForTarget": null
    },
    "runId": null,
    "createdAt": "2026-03-17T14:00:00.000Z"
  }
}
Response Fields ​
FieldTypeDescription
idstringInsight UUID
scopestringAnalysis scope (account, chainy, chain)
scopeIdstring | nullTarget ID (null for account scope)
insightTypestringThe insight type
contentobjectAnalysis results (structure varies by insight type)
runIdstring | nullAssociated AI run ID (if generated by LLM)
createdAtstringISO 8601 timestamp

Code Examples ​

curl -X POST https://api.chainabit.com/api/v1/ai/productivity-insights/analyze \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "scope": "account",
    "insightType": "trend",
    "from": "2026-02-15T00:00:00.000Z",
    "to": "2026-03-17T00:00:00.000Z"
  }'

GET /ai/productivity-insights ​

Description ​

List your past productivity insights, ordered by most recent first. Returns up to 20 results.

Authentication: JWT Bearer token + active AI entitlement required.

Request ​

  • Headers: Authorization: Bearer <token>

Response ​

Response Example ​
json
{
  "data": [
    {
      "id": "cm5insight01",
      "scope": "account",
      "scopeId": null,
      "insightType": "trend",
      "content": {
        "direction": "improving",
        "avgDailyCompletions": 3.2,
        "firstHalfAvg": 2.1,
        "secondHalfAvg": 4.3,
        "activeChains": 4,
        "totalCompletions": 96
      },
      "runId": null,
      "createdAt": "2026-03-17T14:00:00.000Z"
    },
    {
      "id": "cm5insight02",
      "scope": "chainy",
      "scopeId": "cm5abc123",
      "insightType": "optimization",
      "content": {
        "averageSuccessfulRuns": 2.5,
        "activeChains": 7,
        "suggestions": [
          "Focus on building consistent run history before adding new chains."
        ]
      },
      "runId": null,
      "createdAt": "2026-03-16T10:00:00.000Z"
    }
  ]
}

Code Examples ​

curl https://api.chainabit.com/api/v1/ai/productivity-insights \
  -H "Authorization: Bearer $TOKEN"

Built with purpose. chainabit.com