Skip to content

AI Suggestions ​

AI-generated suggestions for improving productivity workflows.

Endpoints ​

MethodPathDescriptionAuthRate Limit
GET/ai/suggestionsList suggestions (filterable)JWT + Entitlement60/min
GET/ai/suggestions/:idGet a suggestionJWT + Entitlement60/min
POST/ai/suggestionsCreate a suggestionJWT + Entitlement10/min
PATCH/ai/suggestions/:id/acceptAccept a suggestionJWT + Entitlement30/min
PATCH/ai/suggestions/:id/dismissDismiss a suggestionJWT + Entitlement30/min

GET /ai/suggestions ​

List suggestions with optional filters.

Authentication: JWT Bearer token + active AI entitlement required. Rate limit: 60/min

Request ​

Query Parameters ​
ParameterTypeRequiredDescription
statusstringNoFilter: pending, accepted, dismissed
targetTypestringNoFilter: chain, chainy, bit, schedule
targetIdstringNoFilter by target entity ID
sourcestringNoFilter by source: chao, twin, manual
limitnumberNoItems per page
offsetnumberNoPagination offset

Response ​

Response Example ​
json
{
  "data": [
    {
      "id": "cm5sug01",
      "targetType": "chain",
      "targetId": "cm5chain01",
      "type": "schedule_change",
      "content": "Consider shifting your vocabulary practice to mornings. Your completion rate is 40% higher before noon.",
      "status": "pending",
      "payload": {
        "suggestedTime": "08:00",
        "reasoning": "completion_rate_analysis"
      },
      "createdAt": "2026-03-17T10:00:00.000Z"
    }
  ],
  "meta": {
    "total": 1,
    "limit": 10,
    "offset": 0
  }
}
Response Fields ​
FieldTypeDescription
idstringSuggestion ID
targetTypestringTarget entity type
targetIdstringTarget entity ID
typestringSuggestion type
contentstringHuman-readable text
statusstringpending, accepted, dismissed
payloadobject | nullStructured suggestion data
sourcestring | nullSuggestion source (chao, twin, manual)
analysisIdstring | nullOriginating analysis ID (for Chao-generated proposals)
createdAtstringISO 8601

Code Examples ​

bash
curl "https://api.chainabit.com/api/v1/ai/suggestions?status=pending&targetType=chain&limit=10" \
  -H "Authorization: Bearer $TOKEN"
javascript
const params = new URLSearchParams({
  status: "pending",
  targetType: "chain",
  limit: "10",
});
const res = await fetch(`${BASE_URL}/ai/suggestions?${params}`, {
  headers: { Authorization: `Bearer ${TOKEN}` },
});
const { data, meta } = await res.json();
python
import requests

res = requests.get(
    f"{BASE_URL}/ai/suggestions",
    headers={"Authorization": f"Bearer {TOKEN}"},
    params={"status": "pending", "targetType": "chain", "limit": 10},
)
body = res.json()

GET /ai/suggestions/:id ​

Get details of a specific suggestion.

Authentication: JWT Bearer token + active AI entitlement required. Rate limit: 60/min

Request ​

Response ​

Response Example ​
json
{
  "data": {
    "id": "cm5sug01",
    "targetType": "chain",
    "targetId": "cm5chain01",
    "type": "schedule_change",
    "content": "Consider shifting your vocabulary practice to mornings. Your completion rate is 40% higher before noon.",
    "status": "pending",
    "payload": {
      "suggestedTime": "08:00",
      "reasoning": "completion_rate_analysis"
    },
    "createdAt": "2026-03-17T10:00:00.000Z"
  }
}
Response Fields ​
FieldTypeDescription
idstringSuggestion ID
targetTypestringTarget entity type
targetIdstringTarget entity ID
typestringSuggestion type
contentstringHuman-readable text
statusstringpending, accepted, dismissed
payloadobject | nullStructured suggestion data
sourcestring | nullSuggestion source (chao, twin, manual)
analysisIdstring | nullOriginating analysis ID (for Chao-generated proposals)
createdAtstringISO 8601

Code Examples ​

Replace $SUGGESTION_ID below with the id from a list or create response.

bash
curl https://api.chainabit.com/api/v1/ai/suggestions/$SUGGESTION_ID \
  -H "Authorization: Bearer $TOKEN"
javascript
const SUGGESTION_ID = process.env.SUGGESTION_ID; // id from a list or create response

const res = await fetch(`${BASE_URL}/ai/suggestions/${SUGGESTION_ID}`, {
  headers: { Authorization: `Bearer ${TOKEN}` },
});
const { data } = await res.json();
python
import os
import requests

suggestion_id = os.environ["SUGGESTION_ID"]  # id from a list or create response

res = requests.get(
    f"{BASE_URL}/ai/suggestions/{suggestion_id}",
    headers={"Authorization": f"Bearer {TOKEN}"},
)
data = res.json()["data"]

POST /ai/suggestions ​

Create a new AI suggestion for a target entity.

Authentication: JWT Bearer token + active AI entitlement required. Rate limit: 10/min

Request ​

Request Body ​
FieldTypeRequiredConstraintsDescription
targetTypestringYeschain, chainy, bit, scheduleTarget entity type
targetIdstringYesValid entity IDTarget entity ID
typestringYesschedule_change, bit_creation, chain_adjustmentSuggestion type
contentstringYesNon-emptyHuman-readable suggestion text
payloadobjectNo—Structured data for the suggestion
sourcestringNochao, twin, manualSuggestion source
analysisIdstringNoValid UUIDUUID linking to the originating analysis

targetId must be the id of an existing chain, chainy, bit, or schedule (matching targetType) — get it from that resource's own create/list response. $TARGET_ID below is a placeholder for that value.

Response ​

Response Example ​
json
{
  "data": {
    "id": "cm5sug01",
    "targetType": "chain",
    "targetId": "cm5chain01",
    "type": "schedule_change",
    "content": "Consider shifting your vocabulary practice to mornings. Your completion rate is 40% higher before noon.",
    "status": "pending",
    "payload": {
      "suggestedTime": "08:00",
      "reasoning": "completion_rate_analysis"
    },
    "createdAt": "2026-03-17T10:00:00.000Z"
  }
}
Response Fields ​
FieldTypeDescription
idstringSuggestion ID
targetTypestringTarget entity type
targetIdstringTarget entity ID
typestringSuggestion type
contentstringHuman-readable text
statusstringpending, accepted, dismissed
payloadobject | nullStructured suggestion data
sourcestring | nullSuggestion source (chao, twin, manual)
analysisIdstring | nullOriginating analysis ID (for Chao-generated proposals)
createdAtstringISO 8601

Code Examples ​

bash
curl -X POST https://api.chainabit.com/api/v1/ai/suggestions \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "targetType": "chain",
    "targetId": "'"$TARGET_ID"'",
    "type": "schedule_change",
    "content": "Consider shifting your vocabulary practice to mornings. Your completion rate is 40% higher before noon.",
    "payload": {
      "suggestedTime": "08:00",
      "reasoning": "completion_rate_analysis"
    }
  }'
javascript
const targetId = process.env.TARGET_ID; // id of the chain/chainy/bit/schedule this suggestion targets

const res = await fetch(`${BASE_URL}/ai/suggestions`, {
  method: "POST",
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    targetType: "chain",
    targetId,
    type: "schedule_change",
    content:
      "Consider shifting your vocabulary practice to mornings. Your completion rate is 40% higher before noon.",
    payload: {
      suggestedTime: "08:00",
      reasoning: "completion_rate_analysis",
    },
  }),
});
const { data } = await res.json();
python
import os
import requests

target_id = os.environ["TARGET_ID"]  # id of the chain/chainy/bit/schedule this suggestion targets

res = requests.post(
    f"{BASE_URL}/ai/suggestions",
    headers={
        "Authorization": f"Bearer {TOKEN}",
        "Content-Type": "application/json",
    },
    json={
        "targetType": "chain",
        "targetId": target_id,
        "type": "schedule_change",
        "content": "Consider shifting your vocabulary practice to mornings. Your completion rate is 40% higher before noon.",
        "payload": {
            "suggestedTime": "08:00",
            "reasoning": "completion_rate_analysis",
        },
    },
)
data = res.json()["data"]

PATCH /ai/suggestions/:id/accept ​

Accept a pending suggestion.

Authentication: JWT Bearer token + active AI entitlement required. Rate limit: 30/min

Request ​

Response ​

Response Example ​
json
{
  "data": {
    "id": "cm5sug01",
    "status": "accepted",
    "acceptedAt": "2026-03-17T11:00:00.000Z"
  }
}
Response Fields ​
FieldTypeDescription
idstringSuggestion ID
statusstringAlways accepted
acceptedAtstringISO 8601 timestamp of acceptance

Code Examples ​

Replace $SUGGESTION_ID below with the id from a list or create response.

bash
curl -X PATCH https://api.chainabit.com/api/v1/ai/suggestions/$SUGGESTION_ID/accept \
  -H "Authorization: Bearer $TOKEN"
javascript
const SUGGESTION_ID = process.env.SUGGESTION_ID; // id from a list or create response

const res = await fetch(`${BASE_URL}/ai/suggestions/${SUGGESTION_ID}/accept`, {
  method: "PATCH",
  headers: { Authorization: `Bearer ${TOKEN}` },
});
const { data } = await res.json();
python
import os
import requests

suggestion_id = os.environ["SUGGESTION_ID"]  # id from a list or create response

res = requests.patch(
    f"{BASE_URL}/ai/suggestions/{suggestion_id}/accept",
    headers={"Authorization": f"Bearer {TOKEN}"},
)
data = res.json()["data"]

PATCH /ai/suggestions/:id/dismiss ​

Dismiss a pending suggestion.

Authentication: JWT Bearer token + active AI entitlement required. Rate limit: 30/min

Request ​

Response ​

Response Example ​
json
{
  "data": {
    "id": "cm5sug01",
    "status": "dismissed",
    "dismissedAt": "2026-03-17T11:00:00.000Z"
  }
}
Response Fields ​
FieldTypeDescription
idstringSuggestion ID
statusstringAlways dismissed
dismissedAtstringISO 8601 timestamp of dismissal

Code Examples ​

Replace $SUGGESTION_ID below with the id from a list or create response.

bash
curl -X PATCH https://api.chainabit.com/api/v1/ai/suggestions/$SUGGESTION_ID/dismiss \
  -H "Authorization: Bearer $TOKEN"
javascript
const SUGGESTION_ID = process.env.SUGGESTION_ID; // id from a list or create response

const res = await fetch(`${BASE_URL}/ai/suggestions/${SUGGESTION_ID}/dismiss`, {
  method: "PATCH",
  headers: { Authorization: `Bearer ${TOKEN}` },
});
const { data } = await res.json();
python
import os
import requests

suggestion_id = os.environ["SUGGESTION_ID"]  # id from a list or create response

res = requests.patch(
    f"{BASE_URL}/ai/suggestions/{suggestion_id}/dismiss",
    headers={"Authorization": f"Bearer {TOKEN}"},
)
data = res.json()["data"]

Chao Proposals ​

Chao automatically generates suggestions (proposals) when analyses detect actionable findings. These proposals provide concrete next steps derived from analysis results.

  • All Chao proposals have source: "chao" and status: "pending"
  • Chao never auto-applies suggestions — the user must explicitly accept via PATCH /ai/suggestions/:id/accept
  • Proposal types generated by Chao: create_bit, reschedule, prioritize, decompose, summarize
  • Maximum 3 proposals per analysis run

Built with purpose.