Mevcut bir aracı güncelleyin
/api/v1/tools/:toolIdMevcut bir aracın adını, açıklamasını veya konfigürasyonunu günceller.
toolIdstring (gerekli)Güncellenecek aracın ID'si
Tüm parametreler opsiyoneldir. Sadece güncellemek istediğiniz alanları gönderin.
namestringAracın yeni adı
descriptionstringAracın yeni açıklaması
configobjectGüncellenmiş konfigürasyon (mevcut config ile birleştirilir)
curl -X PUT https://api.wespoke.ai/api/v1/tools/tool_abc123 \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "CRM Sorgu (Güncel)"
}'curl -X PUT https://api.wespoke.ai/api/v1/tools/tool_abc123 \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"config": {
"query": {
"expand": "details,segments"
}
}
}'curl -X PUT https://api.wespoke.ai/api/v1/tools/tool_abc123 \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "CRM Müşteri Sorgu",
"description": "CRM API'sinden detaylı müşteri bilgisi çeker",
"config": {
"url": "https://api.crm.local/v2/customers/{id}",
"query": {
"expand": "details,segments,history"
}
}
}'{
"success": true,
"data": {
"id": "tool_abc123",
"name": "CRM Müşteri Sorgu",
"type": "API_REQUEST",
"description": "CRM API'sinden detaylı müşteri bilgisi çeker",
"config": {
"url": "https://api.crm.local/v2/customers/{id}",
"method": "GET",
"headers": {
"Authorization": "Bearer {{secrets.CRM_API_KEY}}"
},
"query": {
"expand": "details,segments,history"
}
},
"createdAt": "2024-01-14T09:00:00Z",
"updatedAt": "2024-01-16T14:30:00Z"
}
}• Araç tipi (type) güncellenemez. Farklı bir tip kullanmak için yeni araç oluşturun.
• Config objesi mevcut konfigürasyon ile birleştirilir (deep merge).
• Belirli bir config alanını silmek için null değeri gönderin.
• Güncellenmiş araç kullanan asistanlar otomatik olarak yeni konfigürasyonu kullanır.
{
"success": false,
"error": {
"code": "TOOL_NOT_FOUND",
"message": "Araç bulunamadı"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Geçersiz güncelleme",
"details": {
"config.url": "Geçersiz URL formatı"
}
}
}