> ## Documentation Index
> Fetch the complete documentation index at: https://www.macaly.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Publish message

> Konuşmayı sürdürmek için mevcut bir sohbete yeni bir mesaj gönderin

Mevcut bir sohbete yeni bir mesaj göndererek konuşmayı sürdürür.

## İstek

```
POST /api/chat/{chatId}/publish
```

### Başlıklar

| Header | Zorunlu | Açıklama |
| - | - | - |
| `Authorization` | Evet | `Bearer macaly_...` |
| `Content-Type` | Evet | `application/json` |

### Yol parametreleri

| Parametre | Tür | Açıklama |
| - | - | - |
| `chatId` | string | Sohbet kimliği |

### İstek gövdesi parametreleri

| Alan | Tür | Zorunlu | Varsayılan | Açıklama |
| - | - | - | - | - |
| `content` | string | Koşullu | - | Kullanıcının mesajı. `resume` `true` olmadıkça zorunludur |
| `stream` | boolean | Hayır | `true` | `false` ise stream yerine JSON döndürür |
| `agentMode` | `"auto"` \| `"fast"` \| `"smart"` | Hayır | `"auto"` | Agent'ın hız ve kalite dengesini belirler |
| `executionMode` | `"auto"` \| `"planning"` \| `"build"` | Hayır | `"auto"` | Yapay zekanın göreve nasıl yaklaşacağını belirler |
| `model` | `"gpt-5.6-terra"` \| `"gpt-6.1-sol"` \| `"gpt-6-luna"` \| `"grok-4-6"` \| `"kimi-k3"` \| `"sonnet-5-5"` \| `"opus-5-5"` \| `"blueai-glm-5-3"` \| `"blueai-glm-5-3-flash"` | Hayır | - | Kullanılacak yapay zeka modeli. Varsayılan olarak ekip için yapılandırılmış model kullanılır |
| `reasoningEffort` | `"medium"` \| `"high"` | Hayır | - | Yapay zekanın görev üzerinde ne kadar derin düşüneceğini belirler |
| `resume` | boolean | Hayır | `false` | `true` ise, yeni içerik eklemeden durdurulmuş bir konuşmayı sürdürür |
| `experimental_attachments` | array | Hayır | `[]` | Dosya ekleri (format için bkz. [Create Chat](/docs/tr/api/create-chat)) |

<Note>
  `resume` `true` olduğunda `content` veya `experimental_attachments` gönderemezsiniz. Bu, daha önce durdurulmuş bir konuşmaya devam etmek için kullanılır.
</Note>

### Örnek istek

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://www.macaly.com/api/chat/abc123def456/publish" \
    -H "Authorization: Bearer macaly_abc123..." \
    -H "Content-Type: application/json" \
    -d '{
      "content": "Add a dark mode toggle to the header",
      "stream": false
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    `https://www.macaly.com/api/chat/${chatId}/publish`,
    {
      method: 'POST',
      headers: {
        'Authorization': 'Bearer macaly_abc123...',
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        content: 'Add a dark mode toggle to the header',
        stream: false,
      }),
    }
  );

  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      f'https://www.macaly.com/api/chat/{chat_id}/publish',
      headers={
          'Authorization': 'Bearer macaly_abc123...',
          'Content-Type': 'application/json',
      },
      json={
          'content': 'Add a dark mode toggle to the header',
          'stream': False,
      },
  )

  data = response.json()
  ```
</CodeGroup>

## Yanıt

### JSON yanıtı (`stream: false` olduğunda)

```json theme={null}
{
  "chatId": "abc123def456",
  "streamId": "stream_xyz789",
  "assistantMessageId": "msg_123"
}
```

Ardından tamamlanmayı beklemek için [Get Status](/docs/tr/api/get-status) endpoint'i üzerinden durumu takip edebilirsiniz.

### Stream yanıtı (`stream: true`, varsayılan)

```
2:[{"chatId":"abc123def456"}]
0:"Analyzing your request..."
...
```

## Durum kodları

| Durum | Açıklama |
| - | - |
| 200 | Başarılı - Mesaj gönderildi |
| 400 | Geçersiz istek gövdesi |
| 401 | Geçersiz veya eksik API anahtarı |
| 402 | Yetersiz kredi |
| 403 | Sohbet bu ekibe ait değil |
| 404 | Sohbet bulunamadı |
| 429 | İstek limiti aşıldı |
| 500 | Sunucu hatası |
| 503 | Hizmet kullanılamıyor - Yapay zeka çalışma alanı meşgul, kısa süre sonra tekrar deneyin |

## Süreç

Stream kullanmadığınızda tipik süreç şöyledir:

1. **Mesaj gönderin** - `stream: false` ile
2. **Durumu takip edin** - `completed` olana kadar [`GET /api/chat/{chatId}/status`](/docs/tr/api/get-status) ile
3. **Tekrarlayın** - Sonraki mesajlar için


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.