Documentation Index
Fetch the complete documentation index at: https://mintlify.com/bluesky-social/atproto/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Thecom.atproto.repo namespace provides lexicons for managing repositories and records in the AT Protocol. These are the core operations for creating, reading, updating, and deleting data.
Key Concepts
- Repository: A versioned collection of records owned by a DID
- Record: A piece of data stored in a repository (e.g., post, profile, follow)
- Collection: A namespace for records (e.g.,
app.bsky.feed.post) - Record Key (rkey): Unique identifier for a record within a collection
- Commit: A snapshot of the repository state
- CID: Content Identifier for addressing data
Procedures
createRecord
Create a single new repository record. Endpoint:com.atproto.repo.createRecord
Authentication: Required
The handle or DID of the repo (current account)
The NSID of the record collection (e.g.,
app.bsky.feed.post)The Record Key (optional, will be auto-generated if omitted)
Whether to validate the record against its lexicon schema. Defaults to validating only known lexicons.
The record data. Must contain a
$type field matching the collection.Compare-and-swap: only create if the repo’s current commit matches this CID
AT-URI of the created record
Content Identifier of the record
Commit metadata (CID and revision)
Validation result:
valid or unknownInvalidSwap: TheswapCommitdidn’t match current repo commit
putRecord
Write or update a repository record. Endpoint:com.atproto.repo.putRecord
Authentication: Required
Similar to createRecord, but uses a specific rkey and will overwrite existing records.
The handle or DID of the repo
The NSID of the record collection
The Record Key (required for put)
Whether to validate the record
The record data
Compare-and-swap: only update if the current record CID matches
Compare-and-swap: only update if the repo’s current commit matches
deleteRecord
Delete a repository record. Endpoint:com.atproto.repo.deleteRecord
Authentication: Required
The handle or DID of the repo
The NSID of the record collection
The Record Key to delete
Compare-and-swap: only delete if the current record CID matches
Compare-and-swap: only delete if the repo’s current commit matches
applyWrites
Apply a batch of repository writes (creates, updates, deletes) in a single commit. Endpoint:com.atproto.repo.applyWrites
Authentication: Required
The handle or DID of the repo
Whether to validate records
Array of write operations (create, update, delete)
Compare-and-swap commit CID
uploadBlob
Upload a binary blob to the repository. Endpoint:com.atproto.repo.uploadBlob
Authentication: Required
Content-Type: Binary data (e.g., image/jpeg, video/mp4)
Response:
Blob reference with CID and metadata
Queries
getRecord
Get a single record from a repository. Endpoint:com.atproto.repo.getRecord
The handle or DID of the repo
The NSID of the record collection
The Record Key
Optional: specific version of record to retrieve
AT-URI of the record
Content Identifier of the record
The record data
listRecords
List records in a collection. Endpoint:com.atproto.repo.listRecords
The handle or DID of the repo
The NSID of the record collection
Maximum number of records to return (1-100, default 50)
Pagination cursor
Reverse chronological order
Pagination cursor for next page
Array of records with uri, cid, and value
describeRepo
Get metadata about a repository. Endpoint:com.atproto.repo.describeRepo
The handle or DID of the repo
The repository handle
The repository DID
The DID document
List of collection NSIDs in the repo
Whether the handle validates bi-directionally
importRepo
Import a CAR file repository. Endpoint:com.atproto.repo.importRepo
Authentication: Required
Used for account migration and backup restoration.
listMissingBlobs
List blobs that are referenced but missing from the repository. Endpoint:com.atproto.repo.listMissingBlobs
Authentication: Required
Type Definitions
strongRef
A strong reference to a specific record version.AT-URI of the record
Content Identifier of the specific version
commitMeta
Metadata about a repository commit.Content Identifier of the commit
Revision identifier (TID)
Common Use Cases
Creating a Post
Updating Profile
Following a User
Deleting a Post
Related Lexicons
- com.atproto.sync - Repository synchronization
- app.bsky.feed - Feed records
- app.bsky.actor - Profile records
- app.bsky.graph - Social graph records