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

> Verfolge den Verarbeitungsstatus eines Chats

Ruft den Verarbeitungsstatus eines Chats ab. Nützlich, um zu prüfen, ob ein Chat fertig verarbeitet wurde, ohne eine Streaming-Verbindung aufrechtzuerhalten.

## Anfrage

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

### Header

| Header | Erforderlich | Beschreibung |
| - | - | - |
| `Authorization` | Ja | `Bearer macaly_...` |

### Pfadparameter

| Parameter | Typ | Beschreibung |
| - | - | - |
| `chatId` | string | Die von `POST /api/chat` zurückgegebene Chat-ID |

### Beispielanfrage

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

## Antwort

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

### Antwortfelder

| Feld | Typ | Beschreibung |
| - | - | - |
| `chatId` | string | Die Chat-ID |
| `url` | string | URL zum Anzeigen des Chats im Browser |
| `status` | string | Aktueller Verarbeitungsstatus (siehe unten) |
| `result.content` | string | Letzte Assistant-Nachricht (nur bei `completed`) |
| `error.message` | string | Fehlerbeschreibung (nur bei `failed`) |

### Statuswerte

| Status | Beschreibung |
| - | - |
| `running` | Verarbeitung läuft gerade |
| `completed` | Erfolgreich abgeschlossen |
| `failed` | Fehler aufgetreten |
| `cancelled` | Verarbeitung wurde manuell abgebrochen |
| `no_active_workflow` | Keine aktive Verarbeitung für diesen Chat |

## Statuscodes

| Status | Beschreibung |
| - | - |
| 200 | Erfolgreich |
| 401 | Ungültiger oder fehlender API-Schlüssel |
| 403 | Chat gehört nicht zu deinem Team |
| 404 | Chat nicht gefunden |

## Polling-Muster

```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
```

## Nächste Schritte

Sobald der Status `completed` ist, kannst du:

1. **Die App deployen** über [`POST /api/chat/{chatId}/deploy`](/docs/de/api/deploy)


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