Çalışma Alanı Yapay Zeka Kaynakları
Aracılar, ikizler, araçlar, beceriler ve ikiz ilkeler de dahil olmak üzere ekip işbirliği için belirli bir çalışma alanına yönelik yapay zeka kaynaklarını yönetin.
Çalışma Alanı Temsilcileri
Ekip işbirliği için belirli bir çalışma alanını kapsamına alan aracıları yönetin.
Uç noktalar
| Method | Path | Description | Auth | Rate Limit |
|---|---|---|---|---|
| GET | /workspaces/:workspaceId/ai/agents | List workspace agents | JWT + Entitlement | 60/min |
| POST | /workspaces/:workspaceId/ai/agents | Create a workspace agent | JWT + Entitlement | 10/min |
| GET | /workspaces/:workspaceId/ai/agents/:agentId/runs | List agent runs | JWT + Entitlement | 60/min |
| POST | /workspaces/:workspaceId/ai/agents/:agentId/runs | Create an agent run | JWT + Entitlement | 10/min |
Çalışma Alanı Aracısı Oluştur
Tanım
Verilen çalışma alanına uygun yeni bir aracı oluşturur. Model seçimi bu uç nokta aracılığıyla yapılandırılamaz; her çalışma alanı aracısı, platformun varsayılan modelini kullanır. Belirli bir "modelId" seçmeniz gerekiyorsa bunun yerine, çalışma alanına bağlı aracı örnekleri yerine yeniden kullanılabilir aracı şablonlarını temsil eden ayrı Aracı Tanımları kaynağını kullanın.
Rica etmek
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Agent display name |
description | string | No | Human-readable description of the agent's purpose |
systemPrompt | string | No | System prompt that shapes the agent's behavior |
toolIds | string[] | No | IDs of workspace tools the agent is allowed to call |
Bu uç noktada "definitionId", "config", "modelId" veya "instructions" alanı yok. Bu dönüşlerden herhangi birinin gönderilmesi "400 Hatalı İstek" döndürür (örneğin, "özellik talimatları olmamalıdır; özellik modelId olmamalıdır").
Cevap
{
"data": {
"id": "cm5wagent01",
"workspaceId": "$WORKSPACE_ID",
"name": "Team Productivity Coach",
"description": "Reviews team chain activity and suggests focus areas",
"systemPrompt": "You are a productivity coach for a team workspace...",
"toolIds": ["cm5wtool01"],
"status": "active",
"createdAt": "2026-03-17T10:00:00.000Z"
}
}Kod Örnekleri
curl -X POST https://api.chainabit.com/api/v1/workspaces/$WORKSPACE_ID/ai/agents \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Team Productivity Coach",
"description": "Reviews team chain activity and suggests focus areas",
"systemPrompt": "You are a productivity coach for a team workspace...",
"toolIds": ["cm5wtool01"]
}'const BASE_URL = process.env.BASE_URL;
const TOKEN = process.env.TOKEN;
const workspaceId = process.env.WORKSPACE_ID; // from a workspace lookup call
const response = await fetch(`${BASE_URL}/workspaces/${workspaceId}/ai/agents`, {
method: "POST",
headers: {
Authorization: `Bearer ${TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "Team Productivity Coach",
description: "Reviews team chain activity and suggests focus areas",
systemPrompt: "You are a productivity coach for a team workspace...",
toolIds: ["cm5wtool01"],
}),
});
const { data } = await response.json();import requests, os
workspace_id = os.environ["WORKSPACE_ID"] # from a workspace lookup call
response = requests.post(
f"{os.environ['BASE_URL']}/workspaces/{workspace_id}/ai/agents",
headers={"Authorization": f"Bearer {os.environ['TOKEN']}"},
json={
"name": "Team Productivity Coach",
"description": "Reviews team chain activity and suggests focus areas",
"systemPrompt": "You are a productivity coach for a team workspace...",
"toolIds": ["cm5wtool01"],
},
)
data = response.json()["data"]Workspace Agent'ı Çalıştır
Abonelik gereklidir.
POST /workspaces/:workspaceId/ai/agents/:agentId/runsaktif bir ücretli abonelik gerektirir. Geçerli bir aboneliği olmayan arayanlar,{ "code": "subscription_inactive" }ile403 Yasakmesajı alırlar. Kredi bakiyesi tek başına yeterli değildir; aktif bir planın da mevcut olması gerekir.
`agentId', Create Workspace Agent yanıtından gelmelidir. 'agentId' yol segmenti, yukarıdaki Create Workspace Agent öğesinden 'data.id'de döndürülen gerçek 'id' alanı olmalıdır; asla ayarlanmamış, boş veya sabit kodlanmış bir yer tutucu değişken değildir. Boş veya hatalı biçimlendirilmiş bir "agentId" daha önce opak bir "500 Dahili Sunucu Hatası" döndürüyordu; artık doğru bir şekilde '400 Hatalı İstek' döndürüyor.
Tanım
Mevcut bir çalışma alanı aracısı için bir çalıştırma başlatır.
Rica etmek
| Field | Type | Required | Description |
|---|---|---|---|
input | object | Yes | Freeform task input passed to the agent |
Yol parametreleri
| Param | Description |
|---|---|
workspaceId | From your workspace lookup or creation response's data.id |
agentId | From Create Workspace Agent's data.id |
Cevap
{
"data": {
"id": "cm5wrun01",
"agentId": "$AGENT_ID",
"workspaceId": "$WORKSPACE_ID",
"status": "running",
"input": {
"task": "Analyze team productivity patterns for the past week",
"scope": "all-members"
},
"startedAt": "2026-03-17T10:00:00.000Z",
"createdAt": "2026-03-17T10:00:00.000Z"
}
}Müdahale vakaları
| Status | Condition |
|---|---|
201 Created | Run started successfully |
400 Bad Request | Malformed or empty agentId path segment |
403 Forbidden | No active paid subscription (subscription_inactive) |
Kod Örnekleri
curl -X POST https://api.chainabit.com/api/v1/workspaces/$WORKSPACE_ID/ai/agents/$AGENT_ID/runs \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"input": {
"task": "Analyze team productivity patterns for the past week",
"scope": "all-members"
}
}'const BASE_URL = process.env.BASE_URL;
const TOKEN = process.env.TOKEN;
const workspaceId = process.env.WORKSPACE_ID; // from a workspace lookup call
const agentId = createdAgent.data.id; // from Create Workspace Agent's response
const response = await fetch(
`${BASE_URL}/workspaces/${workspaceId}/ai/agents/${agentId}/runs`,
{
method: "POST",
headers: {
Authorization: `Bearer ${TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
input: {
task: "Analyze team productivity patterns for the past week",
scope: "all-members",
},
}),
}
);
const { data } = await response.json();import requests, os
workspace_id = os.environ["WORKSPACE_ID"] # from a workspace lookup call
agent_id = created_agent["data"]["id"] # from Create Workspace Agent's response
response = requests.post(
f"{os.environ['BASE_URL']}/workspaces/{workspace_id}/ai/agents/{agent_id}/runs",
headers={"Authorization": f"Bearer {os.environ['TOKEN']}"},
json={"input": {"task": "Analyze team productivity patterns for the past week", "scope": "all-members"}},
)
data = response.json()["data"]Tek Çalıştırma Alın
Çalışma alanı aracısı çalıştırmaları, yuvalanmış bir GET /workspaces/:workspaceId/ai/agents/:agentId/runs/:runId uç noktası aracılığıyla okunamaz — yalnızca yukarıdaki liste formu (GET /workspaces/:workspaceId/ai/agents/:agentId/runs) çalışma alanları ve aracıların altında yuvalanmıştır. Kimliğe göre tek bir çalıştırmayı getirmek için AI Özellikleri bölümünde belgelenen üst düzey çalıştırma uç noktasını kullanın:
GET /ai/runs/{runId}Çalışma Alanı Aracısını Çalıştır yanıtındaki (data.id) id alanını $RUN_ID olarak kullanın:
curl https://api.chainabit.com/api/v1/ai/runs/$RUN_ID \
-H "Authorization: Bearer $TOKEN"Çalışma Alanı İkizleri
Ekip düzeyindeki yapay zeka kişilikleri için çalışma alanı kapsamlı dijital ikizler.
Uç noktalar
| Method | Path | Description | Auth | Rate Limit |
|---|---|---|---|---|
| GET | /workspaces/:workspaceId/ai/twins | List workspace twins | JWT + Entitlement | 60/min |
| POST | /workspaces/:workspaceId/ai/twins | Create a workspace twin | JWT + Entitlement | 10/min |
| PUT | /workspaces/:workspaceId/ai/twins/:twinId/persona | Update twin persona | JWT + Entitlement | 30/min |
| POST | /workspaces/:workspaceId/ai/twins/:twinId/test | Test twin interaction | JWT + Entitlement | 20/min |
Workspace Twin'i oluşturun
Rica etmek
Çalışma alanının "kimliğini" "$WORKSPACE_ID" olarak kullanın.
Cevap
{
"data": {
"id": "cm5wtwin01",
"workspaceId": "cm5ws01",
"name": "Team Standup Twin",
"persona": { "tone": "professional", "role": "scrum-master" },
"createdAt": "2026-03-17T10:00:00.000Z"
}
}Kod Örnekleri
curl -X POST https://api.chainabit.com/api/v1/workspaces/$WORKSPACE_ID/ai/twins \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Team Standup Twin",
"persona": {
"tone": "professional",
"role": "scrum-master"
}
}'const BASE_URL = process.env.BASE_URL;
const TOKEN = process.env.TOKEN;
const workspaceId = process.env.WORKSPACE_ID;
const response = await fetch(`${BASE_URL}/workspaces/${workspaceId}/ai/twins`, {
method: "POST",
headers: {
Authorization: `Bearer ${TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "Team Standup Twin",
persona: { tone: "professional", role: "scrum-master" },
}),
});
const { data } = await response.json();import requests, os
workspace_id = os.environ["WORKSPACE_ID"]
response = requests.post(
f"{os.environ['BASE_URL']}/workspaces/{workspace_id}/ai/twins",
headers={"Authorization": f"Bearer {os.environ['TOKEN']}"},
json={"name": "Team Standup Twin", "persona": {"tone": "professional", "role": "scrum-master"}},
)
data = response.json()["data"]İkiz Etkileşimini Test Edin
Rica etmek
Create Workspace Twin'in yanıtındaki ("data.id") "id"yi "$TWIN_ID" olarak kullanın.
Cevap
{
"data": {
"response": "Here is the team standup summary for yesterday...",
"tokensUsed": 320,
"latencyMs": 1200
}
}Kod Örnekleri
curl -X POST https://api.chainabit.com/api/v1/workspaces/$WORKSPACE_ID/ai/twins/$TWIN_ID/test \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"message": "Summarize yesterday progress for the team"
}'const BASE_URL = process.env.BASE_URL;
const TOKEN = process.env.TOKEN;
const workspaceId = process.env.WORKSPACE_ID;
const twinId = process.env.TWIN_ID; // from Create Workspace Twin's response
const response = await fetch(
`${BASE_URL}/workspaces/${workspaceId}/ai/twins/${twinId}/test`,
{
method: "POST",
headers: {
Authorization: `Bearer ${TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ message: "Summarize yesterday progress for the team" }),
}
);
const { data } = await response.json();import requests, os
workspace_id = os.environ["WORKSPACE_ID"]
twin_id = os.environ["TWIN_ID"] # from Create Workspace Twin's response
response = requests.post(
f"{os.environ['BASE_URL']}/workspaces/{workspace_id}/ai/twins/{twin_id}/test",
headers={"Authorization": f"Bearer {os.environ['TOKEN']}"},
json={"message": "Summarize yesterday progress for the team"},
)
data = response.json()["data"]Çalışma Alanı Araçları
Bir çalışma alanındaki tüm temsilcilerin kullanabileceği araçları kaydedin.
Uç noktalar
| Method | Path | Description | Auth | Rate Limit |
|---|---|---|---|---|
| GET | /workspaces/:workspaceId/ai/tools | List workspace tools | JWT + Entitlement | 60/min |
| POST | /workspaces/:workspaceId/ai/tools | Create a workspace tool | JWT + Entitlement | 10/min |
Webhook Aracı Güvenlik Politikası
executionType: "http_webhook" içeren araçlar, giden istek güvenliğinin uygulanmasına tabidir:
- Yalnızca HTTPS — "webhookUrl", "https:" şemasını kullanmalıdır. HTTP, dosya ve diğer şemalar yürütme sırasında reddedilir.
- Özel adres yok — Geri döngü istekleri ('127.x.x.x'), RFC 1918 aralıkları ('10.x', '172.16–31.x', '192.168.x'), yerel bağlantı/bulut meta verileri ('169.254.x.x') ve benzer ayrılmış aralıklar engellenir.
- Başlık kısıtlamaları — "tool_schema.headers"da sağlanan şu başlıklar giden istekten önce çıkarılır: "Yetkilendirme", "Çerez", "Host", "X-Forwarded-For", "X-Forwarded-Host", "X-Forwarded-Proto", "X-Real-IP" ve dahili hizmet başlıkları.
İhlaller, bir hata mesajıyla birlikte başarısız bir araç adımıyla sonuçlanır; arayan kişiye HTTP hataları olarak gösterilmez.
Çalışma Alanı Araçlarını Listeleme
Rica etmek
Çalışma alanının "kimliğini" "$WORKSPACE_ID" olarak kullanın.
Cevap
{
"data": [
{
"id": "cm5wtool01",
"name": "Slack Notifier",
"type": "webhook",
"createdAt": "2026-03-17T10:00:00.000Z"
}
],
"meta": { "total": 1 }
}Kod Örnekleri
curl https://api.chainabit.com/api/v1/workspaces/$WORKSPACE_ID/ai/tools \
-H "Authorization: Bearer $TOKEN"const BASE_URL = process.env.BASE_URL;
const TOKEN = process.env.TOKEN;
const workspaceId = process.env.WORKSPACE_ID;
const response = await fetch(`${BASE_URL}/workspaces/${workspaceId}/ai/tools`, {
headers: { Authorization: `Bearer ${TOKEN}` },
});
const { data } = await response.json();import requests, os
workspace_id = os.environ["WORKSPACE_ID"]
response = requests.get(
f"{os.environ['BASE_URL']}/workspaces/{workspace_id}/ai/tools",
headers={"Authorization": f"Bearer {os.environ['TOKEN']}"},
)
data = response.json()["data"]Çalışma Alanı Becerileri
Temsilcilerin çağırabileceği yeniden kullanılabilir beceri modüllerini yönetin. Becerilerin sürüm sürümleri var.
Uç noktalar
| Method | Path | Description | Auth | Rate Limit |
|---|---|---|---|---|
| GET | /workspaces/:workspaceId/ai/skills | List skills | JWT + Entitlement | 60/min |
| GET | /workspaces/:workspaceId/ai/skills/:id | Get a skill | JWT + Entitlement | 60/min |
| POST | /workspaces/:workspaceId/ai/skills | Create a skill | JWT + Entitlement | 10/min |
| PATCH | /workspaces/:workspaceId/ai/skills/:id | Update a skill | JWT + Entitlement | 30/min |
| DELETE | /workspaces/:workspaceId/ai/skills/:id | Delete a skill | JWT + Entitlement | 10/min |
Beceri Sürümleri
| Method | Path | Description | Auth | Rate Limit |
|---|---|---|---|---|
| GET | /workspaces/:workspaceId/ai/skills/:skillId/versions | List versions | JWT + Entitlement | 60/min |
| GET | /workspaces/:workspaceId/ai/skills/:skillId/versions/:versionId | Get a version | JWT + Entitlement | 60/min |
| POST | /workspaces/:workspaceId/ai/skills/:skillId/versions | Create a version | JWT + Entitlement | 10/min |
| POST | /workspaces/:workspaceId/ai/skills/:skillId/versions/:versionId/publish | Publish a version | JWT + Entitlement | 10/min |
Sahiplik uygulandı.
GET .../versions/:versionId, sürümü döndürmeden önce:skillIdnin hesabınıza ait olduğunu doğrular. Mevcut olan ancak farklı bir beceriye veya hesaba ait olan bir "versionId" girildiğinde "404 Bulunamadı" değeri döndürülür.
Beceri Oluştur
Rica etmek
Çalışma alanının "kimliğini" "$WORKSPACE_ID" olarak kullanın.
Cevap
{
"data": {
"id": "cm5skill01",
"workspaceId": "cm5ws01",
"name": "Streak Analysis",
"description": "Analyze chain streak patterns and provide insights",
"createdAt": "2026-03-17T10:00:00.000Z"
}
}Kod Örnekleri
curl -X POST https://api.chainabit.com/api/v1/workspaces/$WORKSPACE_ID/ai/skills \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Streak Analysis",
"description": "Analyze chain streak patterns and provide insights",
"inputSchema": {
"chainId": { "type": "string", "required": true }
}
}'const BASE_URL = process.env.BASE_URL;
const TOKEN = process.env.TOKEN;
const workspaceId = process.env.WORKSPACE_ID;
const response = await fetch(`${BASE_URL}/workspaces/${workspaceId}/ai/skills`, {
method: "POST",
headers: {
Authorization: `Bearer ${TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "Streak Analysis",
description: "Analyze chain streak patterns and provide insights",
inputSchema: { chainId: { type: "string", required: true } },
}),
});
const { data } = await response.json();import requests, os
workspace_id = os.environ["WORKSPACE_ID"]
response = requests.post(
f"{os.environ['BASE_URL']}/workspaces/{workspace_id}/ai/skills",
headers={"Authorization": f"Bearer {os.environ['TOKEN']}"},
json={
"name": "Streak Analysis",
"description": "Analyze chain streak patterns and provide insights",
"inputSchema": {"chainId": {"type": "string", "required": True}},
},
)
data = response.json()["data"]Workspace İkiz Politikaları
Bir çalışma alanındaki tüm ikizler için davranış ilkelerini yapılandırın.
Uç noktalar
| Method | Path | Description | Auth | Rate Limit |
|---|---|---|---|---|
| GET | /workspaces/:workspaceId/ai/twin-policies | Get twin policies | JWT + Entitlement | 60/min |
| PUT | /workspaces/:workspaceId/ai/twin-policies | Upsert twin policies | JWT + Entitlement | 10/min |
| DELETE | /workspaces/:workspaceId/ai/twin-policies | Remove twin policies | JWT + Entitlement | 10/min |
Upsert İkiz Politikalar
Rica etmek
Çalışma alanının "kimliğini" "$WORKSPACE_ID" olarak kullanın.
Cevap
{
"data": {
"workspaceId": "cm5ws01",
"maxMemoryEntries": 100,
"allowedActions": ["notification", "suggest", "analyze"],
"restrictedTopics": [],
"dataRetentionDays": 90,
"updatedAt": "2026-03-17T10:00:00.000Z"
}
}Kod Örnekleri
curl -X PUT https://api.chainabit.com/api/v1/workspaces/$WORKSPACE_ID/ai/twin-policies \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"maxMemoryEntries": 100,
"allowedActions": ["notification", "suggest", "analyze"],
"restrictedTopics": [],
"dataRetentionDays": 90
}'const BASE_URL = process.env.BASE_URL;
const TOKEN = process.env.TOKEN;
const workspaceId = process.env.WORKSPACE_ID;
const response = await fetch(`${BASE_URL}/workspaces/${workspaceId}/ai/twin-policies`, {
method: "PUT",
headers: {
Authorization: `Bearer ${TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
maxMemoryEntries: 100,
allowedActions: ["notification", "suggest", "analyze"],
restrictedTopics: [],
dataRetentionDays: 90,
}),
});
const { data } = await response.json();import requests, os
workspace_id = os.environ["WORKSPACE_ID"]
response = requests.put(
f"{os.environ['BASE_URL']}/workspaces/{workspace_id}/ai/twin-policies",
headers={"Authorization": f"Bearer {os.environ['TOKEN']}"},
json={
"maxMemoryEntries": 100,
"allowedActions": ["notification", "suggest", "analyze"],
"restrictedTopics": [],
"dataRetentionDays": 90,
},
)
data = response.json()["data"]