Project Analysis
Analyse a Project's chain completion data to generate progress summaries, pattern insights, health scores, and recovery plans. Also exposes a task decomposition endpoint that breaks a free-text description into ordered sub-tasks.
Endpoints
| Method | Path | Description | Auth |
|---|---|---|---|
| POST | /ai/chainy-analysis | Trigger analysis for a Project | JWT + Entitlement |
| GET | /ai/chainy-analysis/:chainyId | List past analyses for a Project | JWT + Entitlement |
| POST | /ai/chainy-analysis/bit-decomposition | Decompose a task into sub-tasks | JWT + Entitlement |
POST /ai/chainy-analysis
Trigger an AI analysis of a Project. Results are stored and retrievable via the GET endpoint.
Request
- Auth: JWT Bearer token + active AI entitlement required
chainyIdmust be theidof an existing Project — e.g. from Create Project, shown below as$CHAINY_ID.
Request Body
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
chainyId | string | Yes | Valid UUID | Project to analyse |
analysisType | string | Yes | See table below | Type of analysis to run |
Analysis Types
analysisType | Description |
|---|---|
progress | Summary stats: total chains, active count, total completions, average completion history |
patterns | Temporal patterns: completion velocity, recent activity, chain distribution |
recommendations | Typed recommendation list (execution_recovery, get_started, maintain) |
decomposition | Chain listing with status for decomposition planning |
chainy_health | Composite health score (0–100) with the signals that shaped it |
continuity | At-risk chain detection: chains at risk of completion history break, broken, and strong performers |
blocker | Stall detection: chains with zero or declining progress |
execution_timing | Time-of-day and day-of-week completion pattern analysis |
focus | Attention distribution: neglected vs over-served chains |
recovery | Structured recovery plan for broken run history with prioritised next actions |
Response
Response Example
json
{
"data": {
"id": "cm9analysis01",
"chainyId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"analysisType": "chainy_health",
"result": {
"healthScore": 74,
"signals": ["reliable_execution", "low_fragmentation"]
},
"createdAt": "2026-05-22T10:00:00.000Z"
}
}Code Examples
curl -X POST "https://api.chainabit.com/api/v1/ai/chainy-analysis" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"chainyId": "'"$CHAINY_ID"'",
"analysisType": "chainy_health"
}'GET /ai/chainy-analysis/:chainyId
List past analyses for a specific Project. Scoped to the authenticated user.
Request
- Auth: JWT Bearer token + active AI entitlement required
- Path params:
chainyId— use the same Projectidyou analysed above (or any Project'sidfrom Create Project) as$CHAINY_ID
Response
Response Example
json
{
"data": [
{
"id": "cm9analysis01",
"chainyId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"analysisType": "chainy_health",
"result": { "healthScore": 74 },
"createdAt": "2026-05-22T10:00:00.000Z"
}
]
}Code Examples
curl "https://api.chainabit.com/api/v1/ai/chainy-analysis/$CHAINY_ID" \
-H "Authorization: Bearer $TOKEN"POST /ai/chainy-analysis/bit-decomposition
Break a free-text task description into an ordered list of smaller, actionable sub-tasks. Optionally scoped to an existing task for further decomposition.
Request
- Auth: JWT Bearer token + active AI entitlement required
chainIdmust be theidof an existing chain — e.g. from Create Chain, shown below as$CHAIN_ID.
Request Body
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
chainId | string | Yes | Valid UUID | Chain that provides context for decomposition |
description | string | Yes | max 2000 chars | Task description to decompose |
bitId | string | No | Valid UUID | Existing task to decompose further |
Response
Response Example
json
{
"data": {
"suggestedBits": [
{ "title": "Choose CI/CD provider", "order": 1, "estimatedMinutes": 30 },
{ "title": "Configure build pipeline", "order": 2, "estimatedMinutes": 60 },
{ "title": "Add deployment stage", "order": 3, "estimatedMinutes": 45 },
{ "title": "Set up environment secrets", "order": 4, "estimatedMinutes": 20 },
{ "title": "Run first end-to-end deploy", "order": 5, "estimatedMinutes": 30 }
]
}
}Response Fields
| Field | Type | Description |
|---|---|---|
suggestedBits | object[] | Ordered list of suggested sub-tasks |
suggestedBits[].title | string | Sub-task title |
suggestedBits[].description | string | undefined | Optional elaboration |
suggestedBits[].estimatedMinutes | number | undefined | Time estimate |
suggestedBits[].order | number | Position in the sequence |
Code Examples
curl -X POST "https://api.chainabit.com/api/v1/ai/chainy-analysis/bit-decomposition" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"chainId": "'"$CHAIN_ID"'",
"description": "Set up CI/CD pipeline for the mobile app"
}'Error Responses
| Status | Code | When |
|---|---|---|
| 400 | VALIDATION_FAILED | Missing required fields or invalid UUID |
| 403 | forbidden | Project or Chain does not belong to your account |
| 503 | SERVICE_UNAVAILABLE | No AI provider available |