Skip to content

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 ​

MethodPathDescriptionAuth
GET/ai/suggestionsList suggestions (filterable)JWT + Entitlement
GET/ai/suggestions/:idGet a suggestionJWT + Entitlement
POST/ai/suggestionsCreate a suggestionJWT + Entitlement
PATCH/ai/suggestions/:id/acceptAccept a suggestionJWT + Entitlement
PATCH/ai/suggestions/:id/dismissDismiss a suggestionJWT + Entitlement

GET /ai/suggestions ​

List suggestions with optional filters.

Authentication: JWT Bearer token + active AI entitlement required.

Request ​

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

Response ​

Response Example ​
json
{
  "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.

FieldTypeDescription
idstringSuggestion ID
target_typestringTarget entity type
target_idstringTarget entity ID
suggestion_typestringSuggestion type
contentobjectStructured suggestion content
statusstringpending, accepted, dismissed
created_atstringISO 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 ​
json
{
  "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 ​
FieldTypeDescription
idstringSuggestion ID
target_typestringTarget entity type
target_idstringTarget entity ID
suggestion_typestringSuggestion type
contentobjectStructured suggestion content
statusstringpending, accepted, dismissed
created_atstringISO 8601

Code Examples ​

Replace $SUGGESTION_ID below with the id from 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 ​
FieldTypeRequiredConstraintsDescription
targetTypestringYesNon-emptyTarget entity type, such as bit or chainy
targetIdstringYesUUIDTarget entity ID
sourceRunIdstringNo--Optional source run reference
suggestionTypestringYescreate_chain, create_bit, reschedule, prioritize, decompose, summarizeSuggestion type
contentobjectYesJSON objectStructured suggestion content

Use a target ID from that resource’s create or list response. For a task, set targetType to the compatibility value bit; for a project, use chainy. $TARGET_ID below is a placeholder for the selected resource’s UUID.

Response ​

Response Example ​
json
{
  "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 ​
FieldTypeDescription
idstringSuggestion ID
target_typestringTarget entity type
target_idstringTarget entity ID
suggestion_typestringSuggestion type
contentobjectStructured suggestion content
statusstringpending, accepted, dismissed
created_atstringISO 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 ​
json
{
  "data": {
    "accepted": true
  }
}
Response Fields ​
FieldTypeDescription
data.acceptedbooleantrue after acceptance

Code Examples ​

Replace $SUGGESTION_ID below with the id from 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 ​
json
{
  "data": {
    "dismissed": true
  }
}
Response Fields ​
FieldTypeDescription
data.dismissedbooleantrue after dismissal

Code Examples ​

Replace $SUGGESTION_ID below with the id from 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.

Built with purpose. chainabit.com