Yapay Zeka Önerileri
Verimlilik iş akışlarını iyileştirmek için yapay zeka tarafından oluşturulan öneriler.
Uç noktalar
| Method | Path | Description | Auth | Rate Limit |
|---|---|---|---|---|
| GET | /ai/suggestions | List suggestions | JWT + Entitlement | 60/min |
| GET | /ai/suggestions/:id | Get a suggestion | JWT + Entitlement | 60/min |
| POST | /ai/suggestions | Create a suggestion | JWT + Entitlement | 10/min |
| PATCH | /ai/suggestions/:id/accept | Accept a suggestion | JWT + Entitlement | 30/min |
| PATCH | /ai/suggestions/:id/dismiss | Dismiss a suggestion | JWT + Entitlement | 30/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
| 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 |
source | string | No | Filter by source: chao, twin, manual |
limit | number | No | Items per page |
offset | number | No | Pagination offset |
Cevap
Yanıt Örneği
{
"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ı
| Field | Type | Description |
|---|---|---|
id | string | Suggestion ID |
targetType | string | Target entity type |
targetId | string | Target entity ID |
type | string | Suggestion type |
content | string | Human-readable text |
status | string | pending, accepted, dismissed |
payload | object | null | Structured suggestion data |
source | string | null | Suggestion source (chao, twin, manual) |
analysisId | string | null | Originating analysis ID |
createdAt | string | ISO 8601 |
Kod Örnekleri
curl "https://api.chainabit.com/api/v1/ai/suggestions?status=pending&targetType=chain&limit=10" \
-H "Authorization: Bearer $TOKEN"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();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
{
"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ı
| Field | Type | Description |
|---|---|---|
id | string | Suggestion ID |
targetType | string | Target entity type |
targetId | string | Target entity ID |
type | string | Suggestion type |
content | string | Human-readable text |
status | string | pending, accepted, dismissed |
payload | object | null | Structured suggestion data |
source | string | null | Suggestion source (chao, twin, manual) |
analysisId | string | null | Originating analysis ID |
createdAt | string | ISO 8601 |
Kod Örnekleri
Aşağıdaki
$SUGGESTION_IDyi bir liste veya create yanıtındaki `id' ile değiştirin.
curl https://api.chainabit.com/api/v1/ai/suggestions/$SUGGESTION_ID \
-H "Authorization: Bearer $TOKEN"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();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
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
targetType | string | Yes | chain, chainy, bit, schedule | Target entity type |
targetId | string | Yes | Valid entity ID | Target entity ID |
type | string | Yes | schedule_change, bit_creation, chain_adjustment | Suggestion type |
content | string | Yes | Non-empty | Human-readable suggestion text |
payload | object | No | — | Structured data for the suggestion |
source | string | No | chao, twin, manual | Suggestion source |
analysisId | string | No | Valid UUID | UUID 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
{
"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ı
| Field | Type | Description |
|---|---|---|
id | string | Suggestion ID |
targetType | string | Target entity type |
targetId | string | Target entity ID |
type | string | Suggestion type |
content | string | Human-readable text |
status | string | pending, accepted, dismissed |
payload | object | null | Structured suggestion data |
source | string | null | Suggestion source (chao, twin, manual) |
analysisId | string | null | Originating analysis ID |
createdAt | string | ISO 8601 |
Kod Örnekleri
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"
}
}'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();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
{
"data": {
"id": "cm5sug01",
"status": "accepted",
"acceptedAt": "2026-03-17T11:00:00.000Z"
}
}Yanıt Alanları
| Field | Type | Description |
|---|---|---|
id | string | Suggestion ID |
status | string | Always accepted |
acceptedAt | string | ISO 8601 timestamp of acceptance |
Kod Örnekleri
Aşağıdaki
$SUGGESTION_IDyi bir liste veya create yanıtındaki `id' ile değiştirin.
curl -X PATCH https://api.chainabit.com/api/v1/ai/suggestions/$SUGGESTION_ID/accept \
-H "Authorization: Bearer $TOKEN"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();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
{
"data": {
"id": "cm5sug01",
"status": "dismissed",
"dismissedAt": "2026-03-17T11:00:00.000Z"
}
}Yanıt Alanları
| Field | Type | Description |
|---|---|---|
id | string | Suggestion ID |
status | string | Always dismissed |
dismissedAt | string | ISO 8601 timestamp of dismissal |
Kod Örnekleri
Aşağıdaki
$SUGGESTION_IDyi bir liste veya create yanıtındaki `id' ile değiştirin.
curl -X PATCH https://api.chainabit.com/api/v1/ai/suggestions/$SUGGESTION_ID/dismiss \
-H "Authorization: Bearer $TOKEN"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();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"vestatus: "pending"bulunur - Chao hiçbir zaman önerileri otomatik olarak uygulamaz; kullanıcının
PATCH /ai/suggestions/:id/acceptaracı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