Ekip Oluştur

Yeni bir ekip oluşturun ve isteğe bağlı olarak üyeler ekleyin

Endpoint

POST/api/v1/squads

Yeni bir ekip oluşturur

İstek Gövdesi

namezorunlu

Ekip adı (1-100 karakter)

descriptionopsiyonel

Ekip açıklaması (max 500 karakter)

overridesopsiyonel

Ekip düzeyinde geçersiz kılmalar (llmModel, temperature vb.)

membersopsiyonel

Başlangıçta eklenecek üyeler dizisi

Üye Nesnesi

assistantIdzorunlu

Eklenecek asistan ID'si

descriptionopsiyonel

Üye açıklaması

isStartMemberopsiyonel

Başlangıç üyesi mi? (varsayılan: false)

overridesopsiyonel

Üye düzeyinde geçersiz kılmalar

Örnek İstek

cURL
curl -X POST https://api.wespoke.ai/api/v1/squads \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Müşteri Destek Ekibi",
    "description": "Çoklu asistan ile müşteri desteği",
    "members": [
      {
        "assistantId": "ast_aaa",
        "description": "Karşılama asistanı",
        "isStartMember": true
      },
      {
        "assistantId": "ast_bbb",
        "description": "Teknik destek asistanı"
      }
    ]
  }'

Yanıt

201 Created
{
  "success": true,
  "data": {
    "id": "sqd_1234567890",
    "name": "Müşteri Destek Ekibi",
    "description": "Çoklu asistan ile müşteri desteği",
    "userId": "user_123",
    "overrides": null,
    "canvasLayout": null,
    "createdAt": "2025-01-15T10:00:00Z",
    "updatedAt": "2025-01-15T10:00:00Z",
    "members": [
      {
        "id": "mbr_111",
        "assistantId": "ast_aaa",
        "position": 0,
        "description": "Karşılama asistanı",
        "isStartMember": true,
        "overrides": null,
        "assistant": {
          "id": "ast_aaa",
          "name": "Karşılama Botu"
        }
      },
      {
        "id": "mbr_222",
        "assistantId": "ast_bbb",
        "position": 1,
        "description": "Teknik destek asistanı",
        "isStartMember": false,
        "overrides": null,
        "assistant": {
          "id": "ast_bbb",
          "name": "Teknik Destek"
        }
      }
    ],
    "handoffs": []
  }
}

Hata Yanıtları

400 Bad Request
{
  "success": false,
  "error": {
    "message": "Invalid request data",
    "code": "VALIDATION_ERROR",
    "details": [
      {
        "path": ["name"],
        "message": "String must contain at least 1 character(s)"
      }
    ]
  }
}