network.bsky.jetstream.subscribeEvents
Stream every archived and live Jetstream event in seq order, framed per the xrpc.v1.json subprotocol. The kinds, dids, and collections filters are independent predicates ANDed together; each is match-all when omitted. See the parameter and error descriptions for cursor, filtering, and compression semantics.
- class atproto_client.models.network.bsky.jetstream.subscribe_events.Params
Bases:
ParamsModelBaseParameters model for
network.bsky.jetstream.subscribeEvents.
- class atproto_client.models.network.bsky.jetstream.subscribe_events.ParamsDict
Bases:
TypedDict- collections: NotRequired[List[str] | None]
Collection NSIDs or ‘<prefix>.*’ patterns; constrains which commit events are delivered. Non-commit kinds are unaffected — combine with kinds=commit for a commits-only collection stream. Rejected pre-upgrade with HTTP 400 (InvalidRequest) when kinds is set and excludes commit, since the filter could never apply. Omitted or empty: all collections.
- cursor: NotRequired[int | None]
Resume position, inclusive: the server replays events with seq >= cursor and the client dedups the overlap. Values >= 1e15 are interpreted as a unix-microseconds timestamp instead of a seq and translated to the first seq witnessed at or after that instant; a timestamp below the retention floor clamps up to the floor and an #info OutdatedCursor frame is sent. Omitted: start at the live tip.
- dids: NotRequired[List[Did] | None]
Repo DIDs to receive events for; applies to every event kind. Omitted or empty: all repos.
- kinds: NotRequired[List[Literal['commit', 'identity', 'account', 'sync']] | None]
Event kinds to receive; values are the message $type fragment names. Omitted or empty: all kinds. A value outside the enum is rejected pre-upgrade with HTTP 400 (InvalidRequest) rather than silently never matching.
- max_message_size_bytes: NotRequired[int | None]
Skip events whose uncompressed frame (envelope included) exceeds this many bytes. 0 (default) means no limit.
- zstd_dictionary: NotRequired[int | None]
Jetstream extension: opt into dict-zstd frame compression with the given zstd dictionary ID (obtained via network.bsky.jetstream.getZstdDictionary). Frames then arrive as binary websocket messages, each one zstd frame whose decompressed bytes are exactly the xrpc.v1.json text frame. An unknown or retired ID is rejected pre-upgrade with HTTP 400 carrying the current ID.
- class atproto_client.models.network.bsky.jetstream.subscribe_events.Commit
Bases:
ModelBaseDefinition model for
network.bsky.jetstream.subscribeEvents. A single record mutation (create, update, or delete).- field collection: Nsid [Required]
Collection NSID of the record.
- field did: Did [Required]
Did.
- field record: UnknownType | None = None
The record decoded to JSON. Absent for deletes.
- field rev: Tid [Required]
The repo rev of the commit that produced this op.
- field rkey: RecordKey [Required]
Record key.
- field seq: int [Required]
Jetstream’s monotonic per-event sequence number; the stream cursor.
- field time: DateTime [Required]
The event’s display timestamp, microsecond precision: when Jetstream witnessed the event, unless an operator timestamp import overrode it. Timestamp cursors translate against the witnessed time, so after an import this value may not be a faithful resume position.
- class atproto_client.models.network.bsky.jetstream.subscribe_events.Identity
Bases:
ModelBaseDefinition model for
network.bsky.jetstream.subscribeEvents. An identity change (handle or DID document update), wrapping the upstream firehose event verbatim.- field did: Did [Required]
Did.
- field identity: models.ComAtprotoSyncSubscribeRepos.Identity [Required]
The upstream event; its seq and time are the upstream relay’s, not Jetstream’s.
- field seq: int [Required]
Seq.
- field time: DateTime [Required]
The time Jetstream witnessed this event, microsecond precision. Timestamp imports apply only to record (commit) events, so this is always the witnessed time.
- class atproto_client.models.network.bsky.jetstream.subscribe_events.Account
Bases:
ModelBaseDefinition model for
network.bsky.jetstream.subscribeEvents. An account status change (active/deactivated/deleted/…), wrapping the upstream firehose event verbatim.- field account: models.ComAtprotoSyncSubscribeRepos.Account [Required]
The upstream event; its seq and time are the upstream relay’s, not Jetstream’s.
- field did: Did [Required]
Did.
- field seq: int [Required]
Seq.
- field time: DateTime [Required]
The time Jetstream witnessed this event, microsecond precision. Timestamp imports apply only to record (commit) events, so this is always the witnessed time.
- class atproto_client.models.network.bsky.jetstream.subscribe_events.Sync
Bases:
ModelBaseDefinition model for
network.bsky.jetstream.subscribeEvents. An archived #sync event (broken commit chain; consumers should resync the repo), wrapping the upstream firehose event verbatim. Never emitted on the legacy v1 /subscribe wire.- field did: Did [Required]
Did.
- field seq: int [Required]
Seq.
- field sync: models.ComAtprotoSyncSubscribeRepos.Sync [Required]
The upstream event; its seq and time are the upstream relay’s, not Jetstream’s.
- field time: DateTime [Required]
The time Jetstream witnessed this event, microsecond precision. Timestamp imports apply only to record (commit) events, so this is always the witnessed time.
- class atproto_client.models.network.bsky.jetstream.subscribe_events.Info
Bases:
ModelBaseDefinition model for
network.bsky.jetstream.subscribeEvents. An advisory, non-fatal notice about the stream (mirrors com.atproto.sync.subscribeRepos#info). Carries no seq and does not advance the cursor. OutdatedCursor is sent as the first frame when a unix-microseconds timestamp cursor below the retention floor was clamped up to the floor; the message names the seq actually resumed from.