network.bsky.jetstream.subscribe_events

class atproto_client.models.network.bsky.jetstream.subscribe_events.Account

Bases: ModelBase

Definition 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: str [Required]

Did.

Constraints:
field py_type: Literal['network.bsky.jetstream.subscribeEvents#account'] = 'network.bsky.jetstream.subscribeEvents#account'
field seq: int [Required]

Seq.

field time: str [Required]

The time Jetstream witnessed this event, microsecond precision. Timestamp imports apply only to record (commit) events, so this is always the witnessed time.

Constraints:
class atproto_client.models.network.bsky.jetstream.subscribe_events.Commit

Bases: ModelBase

Definition model for network.bsky.jetstream.subscribeEvents. A single record mutation (create, update, or delete).

field cid: str | None = None

CID of the record. Absent for deletes.

field collection: str [Required]

Collection NSID of the record.

Constraints:
field did: str [Required]

Did.

Constraints:
field operation: Literal['create', 'update', 'delete'] | str [Required]

Operation.

field py_type: Literal['network.bsky.jetstream.subscribeEvents#commit'] = 'network.bsky.jetstream.subscribeEvents#commit'
field record: UnknownType | None = None

The record decoded to JSON. Absent for deletes.

field rev: str [Required]

The repo rev of the commit that produced this op.

Constraints:
field rkey: str [Required]

Record key.

Constraints:
field seq: int [Required]

Jetstream’s monotonic per-event sequence number; the stream cursor.

field time: str [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.

Constraints:
class atproto_client.models.network.bsky.jetstream.subscribe_events.Identity

Bases: ModelBase

Definition model for network.bsky.jetstream.subscribeEvents. An identity change (handle or DID document update), wrapping the upstream firehose event verbatim.

field did: str [Required]

Did.

Constraints:
field identity: models.ComAtprotoSyncSubscribeRepos.Identity [Required]

The upstream event; its seq and time are the upstream relay’s, not Jetstream’s.

field py_type: Literal['network.bsky.jetstream.subscribeEvents#identity'] = 'network.bsky.jetstream.subscribeEvents#identity'
field seq: int [Required]

Seq.

field time: str [Required]

The time Jetstream witnessed this event, microsecond precision. Timestamp imports apply only to record (commit) events, so this is always the witnessed time.

Constraints:
class atproto_client.models.network.bsky.jetstream.subscribe_events.Info

Bases: ModelBase

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

field message: str | None = None

Message.

field name: Literal['OutdatedCursor'] | str [Required]

Name.

field py_type: Literal['network.bsky.jetstream.subscribeEvents#info'] = 'network.bsky.jetstream.subscribeEvents#info'
class atproto_client.models.network.bsky.jetstream.subscribe_events.Params

Bases: ParamsModelBase

Parameters model for network.bsky.jetstream.subscribeEvents.

field collections: List[str] | None = None
Constraints:
  • max_length = 100

field cursor: int | None = None
field dids: List[str] | None = None
Constraints:
  • max_length = 10000

field kinds: List[Literal['commit', 'identity', 'account', 'sync']] | None = None
Constraints:
  • max_length = 4

field max_message_size_bytes: int | None = None
Constraints:
  • ge = 0

  • le = 4294967295

field zstd_dictionary: int | None = None
Constraints:
  • ge = 1

class atproto_client.models.network.bsky.jetstream.subscribe_events.ParamsDict

Bases: TypedDict

collections: NotRequired[List[str] | None]

all collections.

Type:

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

cursor: NotRequired[int | None]

start at the live tip.

Type:

Resume position, inclusive

Type:

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

dids: NotRequired[List[str] | None]

all repos.

Type:

Repo DIDs to receive events for; applies to every event kind. Omitted or empty

kinds: NotRequired[List[Literal['commit', 'identity', 'account', 'sync']] | None]

all kinds. A value outside the enum is rejected pre-upgrade with HTTP 400 (InvalidRequest) rather than silently never matching.

Type:

Event kinds to receive; values are the message $type fragment names. Omitted or empty

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]

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.

Type:

Jetstream extension

class atproto_client.models.network.bsky.jetstream.subscribe_events.Sync

Bases: ModelBase

Definition 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: str [Required]

Did.

Constraints:
field py_type: Literal['network.bsky.jetstream.subscribeEvents#sync'] = 'network.bsky.jetstream.subscribeEvents#sync'
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: str [Required]

The time Jetstream witnessed this event, microsecond precision. Timestamp imports apply only to record (commit) events, so this is always the witnessed time.

Constraints: