Skip to main content
This page covers Powerstream-specific disconnection handling. For comprehensive guidance on handling disconnections across all streaming endpoints, see the Handling disconnections fundamentals guide.

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

curl 'https://api.x.com/2/powerstream?backfillMinutes=5' \
  -H "Authorization: Bearer $ACCESS_TOKEN"

Powerstream recovery example

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