Developer API/Realtime gateway

Realtime gateway

Subscribe to organisation changes and resume after reconnecting.

The gateway is a WebSocket stream for changes in the API key's organisation:

wss://api.strave.gg/v1/gateway

Each dispatch identifies the resource that changed. Fetch that REST resource again to receive its current state.

Connection lifecycle

  1. The server sends hello with the heartbeat interval.
  2. Send identify with an API key and optional last sequence.
  3. The server sends ready.
  4. Send subscribe with topic patterns.
  5. Process dispatch messages in sequence order.
  6. Send heartbeat at the advertised interval.
{
	"op": "identify",
	"apiKey": "strave_api_key",
	"resumeAfter": 482
}
{
	"op": "subscribe",
	"topics": ["match.*", "event.*"]
}

Use ["*"] to receive every available organisation event.

Dispatch envelope

{
	"op": "dispatch",
	"sequence": 483,
	"id": "evt_01...",
	"type": "match.score.updated",
	"occurredAt": "2026-07-26T18:14:22.000Z",
	"resource": {
		"type": "match",
		"id": "match_01...",
		"eventId": "event_01..."
	}
}

sequence is monotonic per organisation. Persist the highest fully processed value and send it as resumeAfter after reconnecting.

Resume after reconnecting

Gateway records are retained for seven days and returned in batches. Delivery is at least once across reconnect boundaries, so processing should be idempotent.

WebSocket connections can close during network or service interruptions. The official SDK reconnects and resumes automatically; custom clients must do the same.

If a saved sequence is older than seven days, fetch the required REST collections again and continue from the newest received sequence.