> ## 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.

# Deploy

> Bir sohbeti üretime dağıtın

Bir sohbeti üretime dağıtın. Vercel'e bir dağıtım başlatır ve hemen yanıt döner.

## İstek

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

### Başlıklar

| Header | Zorunlu | Açıklama |
| - | - | - |
| `Authorization` | Evet | `Bearer macaly_...` |

### Yol parametreleri

| Parametre | Tür | Açıklama |
| - | - | - |
| `chatId` | string | Dağıtılacak sohbetin kimliği |

### Örnek istek

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://www.macaly.com/api/chat/abc123/deploy \
    -H "Authorization: Bearer macaly_abc123..."
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    `https://www.macaly.com/api/chat/${chatId}/deploy`,
    {
      method: 'POST',
      headers: {
        'Authorization': 'Bearer macaly_abc123...',
      },
    }
  );

  const data = await response.json();
  console.log(data.url);
  ```

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

  response = requests.post(
      f'https://www.macaly.com/api/chat/{chat_id}/deploy',
      headers={
          'Authorization': 'Bearer macaly_abc123...',
      },
  )

  data = response.json()
  print(data['url'])
  ```
</CodeGroup>

## Yanıt

```json theme={null}
{
  "id": "jzga0sttml37v6mbizb8tk1x",
  "url": "https://macaly-staging-abc123.macaly.app",
  "status": "QUEUED",
  "deploymentId": "dpl_HKLBd2QDTwq58AMUJiaMyUzk8WUw"
}
```

### Yanıt alanları

| Alan | Tür | Açıklama |
| - | - | - |
| `id` | string | Veritabanındaki dağıtım kimliği |
| `url` | string | Dağıtım URL'si |
| `status` | `"QUEUED"` \| `"BUILDING"` | Başlangıç durumu |
| `deploymentId` | string | Vercel dağıtım kimliği |

## Durum kodları

| Durum | Açıklama |
| - | - |
| 200 | Dağıtım başlatıldı |
| 400 | Geçersiz istek (örneğin sohbette hiç mesaj yok) |
| 401 | Geçersiz veya eksik API anahtarı |
| 403 | Dağıtım yetkisi yok VEYA sohbet ekibe ait değil |
| 404 | Sohbet bulunamadı |
| 500 | Sunucu taraflı hata |

## Notlar

<Info>
  Bu endpoint, dağıtımı başlattıktan hemen sonra yanıt döner. Dağıtım Vercel üzerinde eşzamansız olarak gerçekleşir.
</Info>

* Tamamlanmayı takip etmek için [`GET /api/chat/{chatId}/deployment`](/docs/tr/api/get-deployment) endpoint'ini, `deploymentId` olarak dönen `id` ile kullanın
* `hosting.publish_macaly` izni gereklidir

## Sonraki adımlar

Bir dağıtım başlattıktan sonra:

1. **İlerlemeyi takip edin** - [`GET /api/chat/{chatId}/deployment`](/docs/tr/api/get-deployment), `deploymentId` olarak dönen `id` ile
2. `status` değerinin `READY` olmasını bekleyin


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