Skip to content

Yapay Zeka Önerileri

Verimlilik iş akışlarını iyileştirmek için yapay zeka tarafından oluşturulan öneriler.

Uç noktalar

MethodPathDescriptionAuthRate Limit
GET/ai/suggestionsList suggestionsJWT + 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

İsteğe bağlı filtrelerle önerileri listeleyin.

Kimlik Doğrulama: JWT Taşıyıcı jetonu + aktif AI yetkisi gereklidir. Hız sınırı: 60/dak

Rica etmek

Sorgu Parametreleri
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

Cevap

Yanıt Örneği
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
  }
}
Yanıt Alanları
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
createdAtstringISO 8601

Kod Örnekleri

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

Belirli bir önerinin ayrıntılarını alın.

Kimlik Doğrulama: JWT Taşıyıcı jetonu + aktif AI yetkisi gereklidir. Hız sınırı: 60/dak

Rica etmek

Cevap

Yanıt Örneği
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"
  }
}
Yanıt Alanları
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
createdAtstringISO 8601

Kod Örnekleri

Aşağıdaki $SUGGESTION_IDyi bir liste veya create yanıtındaki `id' ile değiştirin.

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

Hedef varlık için yeni bir yapay zeka önerisi oluşturun.

Kimlik Doğrulama: JWT Taşıyıcı jetonu + aktif AI yetkisi gereklidir. Hız sınırı: 10/dak

Rica etmek

Talep Gövdesi
FieldTypeRequiredConstraintsDescription
targetTypestringYeschain, chainy, bit, scheduleTarget entity type
targetIdstringYesValid entity IDTarget entity ID
typestringYesschedule_change, bit_creation, chain_adjustmentSuggestion type
contentstringYesNon-emptyHuman-readable suggestion text
payloadobjectNoStructured data for the suggestion
sourcestringNochao, twin, manualSuggestion source
analysisIdstringNoValid UUIDUUID linking to the originating analysis

"targetId" mevcut bir zincirin, zincirleme, bitin veya zamanlamanın "kimliği" olmalıdır ("targetType"la eşleşen) - bunu kaynağın kendi oluşturma/liste yanıtından alın. Aşağıdaki "$TARGET_ID" bu değer için bir yer tutucudur.

Cevap

Yanıt Örneği
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"
  }
}
Yanıt Alanları
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
createdAtstringISO 8601

Kod Örnekleri

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

Bekleyen bir öneriyi kabul edin.

Kimlik Doğrulama: JWT Taşıyıcı jetonu + aktif AI yetkisi gereklidir. Hız sınırı: 30/dak

Rica etmek

Cevap

Yanıt Örneği
json
{
  "data": {
    "id": "cm5sug01",
    "status": "accepted",
    "acceptedAt": "2026-03-17T11:00:00.000Z"
  }
}
Yanıt Alanları
FieldTypeDescription
idstringSuggestion ID
statusstringAlways accepted
acceptedAtstringISO 8601 timestamp of acceptance

Kod Örnekleri

Aşağıdaki $SUGGESTION_IDyi bir liste veya create yanıtındaki `id' ile değiştirin.

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

Bekleyen bir öneriyi reddedin.

Kimlik Doğrulama: JWT Taşıyıcı jetonu + aktif AI yetkisi gereklidir. Hız sınırı: 30/dak

Rica etmek

Cevap

Yanıt Örneği
json
{
  "data": {
    "id": "cm5sug01",
    "status": "dismissed",
    "dismissedAt": "2026-03-17T11:00:00.000Z"
  }
}
Yanıt Alanları
FieldTypeDescription
idstringSuggestion ID
statusstringAlways dismissed
dismissedAtstringISO 8601 timestamp of dismissal

Kod Örnekleri

Aşağıdaki $SUGGESTION_IDyi bir liste veya create yanıtındaki `id' ile değiştirin.

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 Teklifleri

Analizler eyleme geçirilebilir bulguları tespit ettiğinde Chao otomatik olarak öneriler oluşturur. Bu öneriler, analiz sonuçlarından elde edilen sonraki somut adımları sağlar.

  • Tüm Chao tekliflerinde source: "chao" ve status: "pending" bulunur
  • Chao hiçbir zaman önerileri otomatik olarak uygulamaz; kullanıcının PATCH /ai/suggestions/:id/accept aracılığıyla açıkça kabul etmesi gerekir
  • Chao tarafından oluşturulan teklif türleri: create_bit, reschedule, prioritize, decompose, summarize
  • Analiz çalıştırması başına maksimum 3 teklif

Built with purpose.