AI Suggestions
Store and review structured suggestions for productivity workflows. Creating a suggestion stores the content you supply; it does not ask an AI model to generate a recommendation.
Endpoints
| Method | Path | Description | Auth |
|---|---|---|---|
| GET | /ai/suggestions | List suggestions (filterable) | JWT + Entitlement |
| GET | /ai/suggestions/:id | Get a suggestion | JWT + Entitlement |
| POST | /ai/suggestions | Create a suggestion | JWT + Entitlement |
| PATCH | /ai/suggestions/:id/accept | Accept a suggestion | JWT + Entitlement |
| PATCH | /ai/suggestions/:id/dismiss | Dismiss a suggestion | JWT + Entitlement |
GET /ai/suggestions
List suggestions with optional filters.
Authentication: JWT Bearer token + active AI entitlement required.
Request
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
status | string | No | Filter: pending, accepted, dismissed |
targetType | string | No | Filter: chain, chainy, bit, schedule |
targetId | string | No | Filter by target entity ID |
limit | number | No | Items per page |
offset | number | No | Pagination offset |
Response
Response Example
{
"data": {
"items": [
{
"id": "cm5sug01",
"target_type": "chain",
"target_id": "cm5chain01",
"suggestion_type": "reschedule",
"content": {
"summary": "Review the planned schedule before changing it.",
"suggestedTime": "08:00"
},
"status": "pending",
"created_at": "2026-03-17T10:00:00.000Z"
}
],
"meta": {
"total": 1,
"limit": 10,
"offset": 0
}
}
}Response Fields
The response record uses snake_case names such as target_type, target_id, suggestion_type, and created_at; request fields use the camelCase DTO above.
| Field | Type | Description |
|---|---|---|
id | string | Suggestion ID |
target_type | string | Target entity type |
target_id | string | Target entity ID |
suggestion_type | string | Suggestion type |
content | object | Structured suggestion content |
status | string | pending, accepted, dismissed |
created_at | string | ISO 8601 |
Code Examples
curl "https://api.chainabit.com/api/v1/ai/suggestions?status=pending&targetType=chain&limit=10" \
-H "Authorization: Bearer $TOKEN"GET /ai/suggestions/:id
Get details of a specific suggestion.
Authentication: JWT Bearer token + active AI entitlement required.
Request
Response
Response Example
{
"data": {
"id": "cm5sug01",
"target_type": "chain",
"target_id": "cm5chain01",
"suggestion_type": "reschedule",
"content": {
"summary": "Review the planned schedule before changing it.",
"suggestedTime": "08:00"
},
"status": "pending",
"created_at": "2026-03-17T10:00:00.000Z"
}
}Response Fields
| Field | Type | Description |
|---|---|---|
id | string | Suggestion ID |
target_type | string | Target entity type |
target_id | string | Target entity ID |
suggestion_type | string | Suggestion type |
content | object | Structured suggestion content |
status | string | pending, accepted, dismissed |
created_at | string | ISO 8601 |
Code Examples
Replace
$SUGGESTION_IDbelow with theidfrom a list or create response.
curl https://api.chainabit.com/api/v1/ai/suggestions/$SUGGESTION_ID \
-H "Authorization: Bearer $TOKEN"POST /ai/suggestions
Create a new AI suggestion for a target entity.
Authentication: JWT Bearer token + active AI entitlement required.
Request
Request Body
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
targetType | string | Yes | Non-empty | Target entity type, such as bit or chainy |
targetId | string | Yes | UUID | Target entity ID |
sourceRunId | string | No | -- | Optional source run reference |
suggestionType | string | Yes | create_chain, create_bit, reschedule, prioritize, decompose, summarize | Suggestion type |
content | object | Yes | JSON object | Structured suggestion content |
Use a target ID from that resource’s create or list response. For a task, set
targetTypeto the compatibility valuebit; for a project, usechainy.$TARGET_IDbelow is a placeholder for the selected resource’s UUID.
Response
Response Example
{
"data": {
"id": "cm5sug01",
"target_type": "chain",
"target_id": "cm5chain01",
"suggestion_type": "reschedule",
"content": {
"summary": "Review the planned schedule before changing it.",
"suggestedTime": "08:00"
},
"status": "pending",
"created_at": "2026-03-17T10:00:00.000Z"
}
}Response Fields
| Field | Type | Description |
|---|---|---|
id | string | Suggestion ID |
target_type | string | Target entity type |
target_id | string | Target entity ID |
suggestion_type | string | Suggestion type |
content | object | Structured suggestion content |
status | string | pending, accepted, dismissed |
created_at | string | ISO 8601 |
Code Examples
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"'",
"suggestionType": "reschedule",
"content": { "summary": "Review the planned schedule before changing it.", "suggestedTime": "08:00" }
}'PATCH /ai/suggestions/:id/accept
Accept a pending suggestion.
Authentication: JWT Bearer token + active AI entitlement required.
Request
Response
Response Example
{
"data": {
"accepted": true
}
}Response Fields
| Field | Type | Description |
|---|---|---|
data.accepted | boolean | true after acceptance |
Code Examples
Replace
$SUGGESTION_IDbelow with theidfrom a list or create response.
curl -X PATCH https://api.chainabit.com/api/v1/ai/suggestions/$SUGGESTION_ID/accept \
-H "Authorization: Bearer $TOKEN"PATCH /ai/suggestions/:id/dismiss
Dismiss a pending suggestion.
Authentication: JWT Bearer token + active AI entitlement required.
Request
Response
Response Example
{
"data": {
"dismissed": true
}
}Response Fields
| Field | Type | Description |
|---|---|---|
data.dismissed | boolean | true after dismissal |
Code Examples
Replace
$SUGGESTION_IDbelow with theidfrom a list or create response.
curl -X PATCH https://api.chainabit.com/api/v1/ai/suggestions/$SUGGESTION_ID/dismiss \
-H "Authorization: Bearer $TOKEN"Chao Proposals
Suggestions can also be produced by AI workflows. Do not assume every record has the same source, status, or generation policy.
The accept and dismiss endpoints record your decision on a pending suggestion. Accepting changes its status; these endpoints do not themselves execute the action described in content. Repeating a decision, or resolving a suggestion that is no longer pending, returns 409 Conflict. Refresh the suggestion before deciding what to do next.