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

# Get status

> Bir sohbet işleminin durumunu takip edin

Bir sohbet işleminin durumunu takip edin. Bir sohbetin işlemini tamamlayıp tamamlamadığını, açık bir stream bağlantısı sürdürmeye gerek kalmadan kontrol etmek için kullanışlıdır.

## İstek

```
GET /api/chat/{chatId}/status
```

### Başlıklar

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

### Yol parametreleri

| Parametre | Tür | Açıklama |
| - | - | - |
| `chatId` | string | `POST /api/chat` isteğinden dönen sohbet kimliği |

### Örnek istek

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

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

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

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

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

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

## Yanıt

```json theme={null}
{
  "chatId": "abc123",
  "url": "https://www.macaly.com/chat/abc123",
  "status": "completed",
  "result": {
    "content": "Here's what I built for you..."
  }
}
```

### Yanıt alanları

| Alan | Tür | Açıklama |
| - | - | - |
| `chatId` | string | Sohbet kimliği |
| `url` | string | Sohbeti tarayıcıda görüntülemek için URL |
| `status` | string | Geçerli işlem durumu (aşağıya bakın) |
| `result.content` | string | Nihai asistan mesajı (yalnızca `completed` olduğunda) |
| `error.message` | string | Hata açıklaması (yalnızca `failed` olduğunda) |

### Durum değerleri

| Durum | Açıklama |
| - | - |
| `running` | İşlem şu anda çalışıyor |
| `completed` | Başarıyla tamamlandı |
| `failed` | Bir hatayla karşılaşıldı |
| `cancelled` | İşlem manuel olarak iptal edildi |
| `no_active_workflow` | Bu sohbet için aktif bir işlem yok |

## Durum kodları

| Durum | Açıklama |
| - | - |
| 200 | Başarılı |
| 401 | Geçersiz veya eksik API anahtarı |
| 403 | Sohbet ekibinize ait değil |
| 404 | Sohbet bulunamadı |

## Durum takibi deseni

```bash theme={null}
while true; do
  STATUS=$(curl -s https://www.macaly.com/api/chat/$CHAT_ID/status \
    -H "Authorization: Bearer macaly_...")

  echo "Status: $(echo $STATUS | jq -r .status)"

  if echo "$STATUS" | grep -q '"status":"completed"'; then
    echo "Done!"
    break
  fi

  sleep 2
done
```

## Sonraki adımlar

Durum `completed` olduğunda şunları yapabilirsiniz:

1. **Uygulamayı dağıtın** - [`POST /api/chat/{chatId}/deploy`](/docs/tr/api/deploy)


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