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

# Handling disconnections

> Handle disconnections, reconnects, and backfill on the X API v2 Powerstream endpoint with guidance on retries, error codes, and stream stability.

This page covers Powerstream-specific disconnection handling. For comprehensive guidance on handling disconnections across all streaming endpoints, see the [Handling disconnections fundamentals guide](/x-api/fundamentals/handling-disconnections).

## Powerstream disconnection handling

The core concepts for handling disconnections apply to all streaming endpoints. See the fundamentals guide for:

* Why connections disconnect
* Common disconnection errors
* Detecting disconnections
* Reconnection strategies and backoff
* Best practices

## Recovering lost data

If you experience a disconnect, see [Recovery and redundancy](/x-api/fundamentals/recovery-and-redundancy) for strategies to recover missed data, including:

* **Backfill** — Use the `backfillMinutes` parameter for disconnections of 5 minutes or less
* **Recovery** — Use `startTime` and `endTime` parameters for longer disconnections (up to 24 hours)

### Powerstream backfill example

```bash theme={null}
curl 'https://api.x.com/2/powerstream?backfillMinutes=5' \
  -H "Authorization: Bearer $ACCESS_TOKEN"
```

### Powerstream recovery example

```bash theme={null}
curl 'https://api.x.com/2/powerstream?startTime=2022-07-12T15:10:00Z&endTime=2022-07-12T15:20:00Z' \
  -H "Authorization: Bearer $ACCESS_TOKEN"
```

***

## Next steps

<CardGroup cols={2}>
  <Card title="Handling disconnections" icon="plug" href="/x-api/fundamentals/handling-disconnections">
    Complete disconnection handling guide
  </Card>

  <Card title="Recovery and redundancy" icon="shield" href="/x-api/fundamentals/recovery-and-redundancy">
    Recover missed data
  </Card>

  <Card title="Consuming streaming data" icon="stream" href="/x-api/fundamentals/consuming-streaming-data">
    Build robust streaming clients
  </Card>
</CardGroup>
