Backfill in-progress. Some lexicons and records may be missing or incomplete.

com.atproto.sync.subscribeRepos

atproto-lexicons.bsky.social

Documentation

main subscription

Repository event stream, aka Firehose endpoint. Outputs repo commits with diff data, and identity update events, for all repositories on the current server. See the atproto specifications for details around stream sequencing, repo versioning, CAR diff format, and more. Public and does not require auth; implemented by PDS and Relay.

Parameters

cursor integer Optional

The last known event seq number to backfill from.

Message Types

Errors

FutureCursor
ConsumerTooSlow If the consumer of the stream can not keep up with events, and a backlog gets too large, the server will drop the connection.
View raw schema
{
  "type": "subscription",
  "errors": [
    {
      "name": "FutureCursor"
    },
    {
      "name": "ConsumerTooSlow",
      "description": "If the consumer of the stream can not keep up with events, and a backlog gets too large, the server will drop the connection."
    }
  ],
  "message": {
    "schema": {
      "refs": [
        "#commit",
        "#sync",
        "#identity",
        "#account",
        "#info"
      ],
      "type": "union"
    }
  },
  "parameters": {
    "type": "params",
    "properties": {
      "cursor": {
        "type": "integer",
        "description": "The last known event seq number to backfill from."
      }
    }
  },
  "description": "Repository event stream, aka Firehose endpoint. Outputs repo commits with diff data, and identity update events, for all repositories on the current server. See the atproto specifications for details around stream sequencing, repo versioning, CAR diff format, and more. Public and does not require auth; implemented by PDS and Relay."
}
account object

Represents a change to an account's status on a host (eg, PDS or Relay). The semantics of this event are that the status is at the host which emitted the event, not necessarily that at the currently active PDS. Eg, a Relay takedown would emit a takedown with active=false, even if the PDS is still active.

Properties

active boolean Required

Indicates that the account has a repository which can be fetched from the host that emitted this event.

did string did Required

A decentralized identifier (DID).

seq integer Required

No description provided.

status string Optional

If active=false, this optional field indicates a reason for why the account is not active.

Known values: takendown, suspended, deleted, deactivated, desynchronized, throttled
time string datetime Required

An RFC 3339 formatted timestamp.

View raw schema
{
  "type": "object",
  "required": [
    "seq",
    "did",
    "time",
    "active"
  ],
  "properties": {
    "did": {
      "type": "string",
      "format": "did"
    },
    "seq": {
      "type": "integer"
    },
    "time": {
      "type": "string",
      "format": "datetime"
    },
    "active": {
      "type": "boolean",
      "description": "Indicates that the account has a repository which can be fetched from the host that emitted this event."
    },
    "status": {
      "type": "string",
      "description": "If active=false, this optional field indicates a reason for why the account is not active.",
      "knownValues": [
        "takendown",
        "suspended",
        "deleted",
        "deactivated",
        "desynchronized",
        "throttled"
      ]
    }
  },
  "description": "Represents a change to an account's status on a host (eg, PDS or Relay). The semantics of this event are that the status is at the host which emitted the event, not necessarily that at the currently active PDS. Eg, a Relay takedown would emit a takedown with active=false, even if the PDS is still active."
}
commit object

Represents an update of repository state. Note that empty commits are allowed, which include no repo data changes, but an update to rev and signature.

Properties

blobs array of cid-link Required

No description provided.

blocks bytes Required

CAR file containing relevant blocks, as a diff since the previous repo state. The commit must be included as a block, and the commit block CID must be the first entry in the CAR header 'roots' list.

maxLength: 2000000 bytes
commit cid-link Required

Repo commit object CID.

ops array of ref#repoOp Required

No description provided.

maxLength: 200 bytes
prevData cid-link Optional

The root CID of the MST tree for the previous commit from this repo (indicated by the 'since' revision field in this message). Corresponds to the 'data' field in the repo commit object. NOTE: this field is effectively required for the 'inductive' version of firehose.

rebase boolean Required

DEPRECATED -- unused

repo string did Required

The repo this event comes from. Note that all other message types name this field 'did'.

rev string tid Required

The rev of the emitted commit. Note that this information is also in the commit object included in blocks, unless this is a tooBig event.

seq integer Required

The stream sequence number of this message.

since string tid RequiredNullable

The rev of the last emitted commit from this repo (if any).

time string datetime Required

Timestamp of when this message was originally broadcast.

tooBig boolean Required

DEPRECATED -- replaced by #sync event and data limits. Indicates that this commit contained too many ops, or data size was too large. Consumers will need to make a separate request to get missing data.

View raw schema
{
  "type": "object",
  "nullable": [
    "since"
  ],
  "required": [
    "seq",
    "rebase",
    "tooBig",
    "repo",
    "commit",
    "rev",
    "since",
    "blocks",
    "ops",
    "blobs",
    "time"
  ],
  "properties": {
    "ops": {
      "type": "array",
      "items": {
        "ref": "#repoOp",
        "type": "ref",
        "description": "List of repo mutation operations in this commit (eg, records created, updated, or deleted)."
      },
      "maxLength": 200
    },
    "rev": {
      "type": "string",
      "format": "tid",
      "description": "The rev of the emitted commit. Note that this information is also in the commit object included in blocks, unless this is a tooBig event."
    },
    "seq": {
      "type": "integer",
      "description": "The stream sequence number of this message."
    },
    "repo": {
      "type": "string",
      "format": "did",
      "description": "The repo this event comes from. Note that all other message types name this field 'did'."
    },
    "time": {
      "type": "string",
      "format": "datetime",
      "description": "Timestamp of when this message was originally broadcast."
    },
    "blobs": {
      "type": "array",
      "items": {
        "type": "cid-link",
        "description": "DEPRECATED -- will soon always be empty. List of new blobs (by CID) referenced by records in this commit."
      }
    },
    "since": {
      "type": "string",
      "format": "tid",
      "description": "The rev of the last emitted commit from this repo (if any)."
    },
    "blocks": {
      "type": "bytes",
      "maxLength": 2000000,
      "description": "CAR file containing relevant blocks, as a diff since the previous repo state. The commit must be included as a block, and the commit block CID must be the first entry in the CAR header 'roots' list."
    },
    "commit": {
      "type": "cid-link",
      "description": "Repo commit object CID."
    },
    "rebase": {
      "type": "boolean",
      "description": "DEPRECATED -- unused"
    },
    "tooBig": {
      "type": "boolean",
      "description": "DEPRECATED -- replaced by #sync event and data limits. Indicates that this commit contained too many ops, or data size was too large. Consumers will need to make a separate request to get missing data."
    },
    "prevData": {
      "type": "cid-link",
      "description": "The root CID of the MST tree for the previous commit from this repo (indicated by the 'since' revision field in this message). Corresponds to the 'data' field in the repo commit object. NOTE: this field is effectively required for the 'inductive' version of firehose."
    }
  },
  "description": "Represents an update of repository state. Note that empty commits are allowed, which include no repo data changes, but an update to rev and signature."
}
identity object

Represents a change to an account's identity. Could be an updated handle, signing key, or pds hosting endpoint. Serves as a prod to all downstream services to refresh their identity cache.

Properties

did string did Required

A decentralized identifier (DID).

handle string handle Optional

The current handle for the account, or 'handle.invalid' if validation fails. This field is optional, might have been validated or passed-through from an upstream source. Semantics and behaviors for PDS vs Relay may evolve in the future; see atproto specs for more details.

seq integer Required

No description provided.

time string datetime Required

An RFC 3339 formatted timestamp.

View raw schema
{
  "type": "object",
  "required": [
    "seq",
    "did",
    "time"
  ],
  "properties": {
    "did": {
      "type": "string",
      "format": "did"
    },
    "seq": {
      "type": "integer"
    },
    "time": {
      "type": "string",
      "format": "datetime"
    },
    "handle": {
      "type": "string",
      "format": "handle",
      "description": "The current handle for the account, or 'handle.invalid' if validation fails. This field is optional, might have been validated or passed-through from an upstream source. Semantics and behaviors for PDS vs Relay may evolve in the future; see atproto specs for more details."
    }
  },
  "description": "Represents a change to an account's identity. Could be an updated handle, signing key, or pds hosting endpoint. Serves as a prod to all downstream services to refresh their identity cache."
}
info object

Properties

message string Optional

No description provided.

name string Required

No description provided.

Known values: OutdatedCursor
View raw schema
{
  "type": "object",
  "required": [
    "name"
  ],
  "properties": {
    "name": {
      "type": "string",
      "knownValues": [
        "OutdatedCursor"
      ]
    },
    "message": {
      "type": "string"
    }
  }
}
repoOp object

A repo operation, ie a mutation of a single record.

Properties

action string Required

No description provided.

Known values: create, update, delete
cid cid-link RequiredNullable

For creates and updates, the new record CID. For deletions, null.

path string Required

No description provided.

prev cid-link Optional

For updates and deletes, the previous record CID (required for inductive firehose). For creations, field should not be defined.

View raw schema
{
  "type": "object",
  "nullable": [
    "cid"
  ],
  "required": [
    "action",
    "path",
    "cid"
  ],
  "properties": {
    "cid": {
      "type": "cid-link",
      "description": "For creates and updates, the new record CID. For deletions, null."
    },
    "path": {
      "type": "string"
    },
    "prev": {
      "type": "cid-link",
      "description": "For updates and deletes, the previous record CID (required for inductive firehose). For creations, field should not be defined."
    },
    "action": {
      "type": "string",
      "knownValues": [
        "create",
        "update",
        "delete"
      ]
    }
  },
  "description": "A repo operation, ie a mutation of a single record."
}
sync object

Updates the repo to a new state, without necessarily including that state on the firehose. Used to recover from broken commit streams, data loss incidents, or in situations where upstream host does not know recent state of the repository.

Properties

blocks bytes Required

CAR file containing the commit, as a block. The CAR header must include the commit block CID as the first 'root'.

maxLength: 10000 bytes
did string did Required

The account this repo event corresponds to. Must match that in the commit object.

rev string Required

The rev of the commit. This value must match that in the commit object.

seq integer Required

The stream sequence number of this message.

time string datetime Required

Timestamp of when this message was originally broadcast.

View raw schema
{
  "type": "object",
  "required": [
    "seq",
    "did",
    "blocks",
    "rev",
    "time"
  ],
  "properties": {
    "did": {
      "type": "string",
      "format": "did",
      "description": "The account this repo event corresponds to. Must match that in the commit object."
    },
    "rev": {
      "type": "string",
      "description": "The rev of the commit. This value must match that in the commit object."
    },
    "seq": {
      "type": "integer",
      "description": "The stream sequence number of this message."
    },
    "time": {
      "type": "string",
      "format": "datetime",
      "description": "Timestamp of when this message was originally broadcast."
    },
    "blocks": {
      "type": "bytes",
      "maxLength": 10000,
      "description": "CAR file containing the commit, as a block. The CAR header must include the commit block CID as the first 'root'."
    }
  },
  "description": "Updates the repo to a new state, without necessarily including that state on the firehose. Used to recover from broken commit streams, data loss incidents, or in situations where upstream host does not know recent state of the repository."
}

Lexicon Garden

@