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

com.atproto.repo.applyWrites

atproto-lexicons.bsky.social

Documentation

main procedure

Apply a batch transaction of repository creates, updates, and deletes. Requires auth, implemented by PDS.

Input

Encodingapplication/json
repo stringat-identifier Required

The handle or DID of the repo (aka, current account).

swapCommit stringcid Optional

If provided, the entire operation will fail if the current repo commit CID does not match this value. Used to prevent conflicting repo mutations.

validate boolean Optional

Can be set to 'false' to skip Lexicon schema validation of record data across all operations, 'true' to require it, or leave unset to validate only for known Lexicons.

writes array Required

No description provided.

Output

Encodingapplication/json
results array Optional

No description provided.

Errors

InvalidSwap Indicates that the 'swapCommit' parameter did not match current commit.
Try It

Direct PDS XRPC methods (com.atproto.*) are disabled in Try It for security reasons.

These methods interact directly with Personal Data Servers and require careful handling. Use a dedicated client or CLI tool instead.
View raw schema
{
  "type": "procedure",
  "input": {
    "schema": {
      "type": "object",
      "required": [
        "repo",
        "writes"
      ],
      "properties": {
        "repo": {
          "type": "string",
          "format": "at-identifier",
          "description": "The handle or DID of the repo (aka, current account)."
        },
        "writes": {
          "type": "array",
          "items": {
            "refs": [
              "#create",
              "#update",
              "#delete"
            ],
            "type": "union",
            "closed": true
          }
        },
        "validate": {
          "type": "boolean",
          "description": "Can be set to 'false' to skip Lexicon schema validation of record data across all operations, 'true' to require it, or leave unset to validate only for known Lexicons."
        },
        "swapCommit": {
          "type": "string",
          "format": "cid",
          "description": "If provided, the entire operation will fail if the current repo commit CID does not match this value. Used to prevent conflicting repo mutations."
        }
      }
    },
    "encoding": "application/json"
  },
  "errors": [
    {
      "name": "InvalidSwap",
      "description": "Indicates that the 'swapCommit' parameter did not match current commit."
    }
  ],
  "output": {
    "schema": {
      "type": "object",
      "required": [],
      "properties": {
        "commit": {
          "ref": "com.atproto.repo.defs#commitMeta",
          "type": "ref"
        },
        "results": {
          "type": "array",
          "items": {
            "refs": [
              "#createResult",
              "#updateResult",
              "#deleteResult"
            ],
            "type": "union",
            "closed": true
          }
        }
      }
    },
    "encoding": "application/json"
  },
  "description": "Apply a batch transaction of repository creates, updates, and deletes. Requires auth, implemented by PDS."
}
create object

Operation which creates a new record.

Properties

collection string nsid Required

A namespaced identifier (e.g., app.bsky.feed.post).

rkey string record-key Optional

NOTE: maxLength is redundant with record-key format. Keeping it temporarily to ensure backwards compatibility.

maxLength: 512 bytes
value unknown Required

No description provided.

View raw schema
{
  "type": "object",
  "required": [
    "collection",
    "value"
  ],
  "properties": {
    "rkey": {
      "type": "string",
      "format": "record-key",
      "maxLength": 512,
      "description": "NOTE: maxLength is redundant with record-key format. Keeping it temporarily to ensure backwards compatibility."
    },
    "value": {
      "type": "unknown"
    },
    "collection": {
      "type": "string",
      "format": "nsid"
    }
  },
  "description": "Operation which creates a new record."
}
createResult object

Properties

cid string cid Required

A content identifier (CID) referencing immutable data.

uri string at-uri Required

An AT Protocol URI (e.g., at://did:plc:xyz/app.bsky.feed.post/abc).

validationStatus string Optional

No description provided.

Known values: valid, unknown
View raw schema
{
  "type": "object",
  "required": [
    "uri",
    "cid"
  ],
  "properties": {
    "cid": {
      "type": "string",
      "format": "cid"
    },
    "uri": {
      "type": "string",
      "format": "at-uri"
    },
    "validationStatus": {
      "type": "string",
      "knownValues": [
        "valid",
        "unknown"
      ]
    }
  }
}
delete object

Operation which deletes an existing record.

Properties

collection string nsid Required

A namespaced identifier (e.g., app.bsky.feed.post).

rkey string record-key Required

A valid record key for AT Protocol repositories.

View raw schema
{
  "type": "object",
  "required": [
    "collection",
    "rkey"
  ],
  "properties": {
    "rkey": {
      "type": "string",
      "format": "record-key"
    },
    "collection": {
      "type": "string",
      "format": "nsid"
    }
  },
  "description": "Operation which deletes an existing record."
}
deleteResult object

This object has no properties defined.

View raw schema
{
  "type": "object",
  "required": [],
  "properties": {}
}
update object

Operation which updates an existing record.

Properties

collection string nsid Required

A namespaced identifier (e.g., app.bsky.feed.post).

rkey string record-key Required

A valid record key for AT Protocol repositories.

value unknown Required

No description provided.

View raw schema
{
  "type": "object",
  "required": [
    "collection",
    "rkey",
    "value"
  ],
  "properties": {
    "rkey": {
      "type": "string",
      "format": "record-key"
    },
    "value": {
      "type": "unknown"
    },
    "collection": {
      "type": "string",
      "format": "nsid"
    }
  },
  "description": "Operation which updates an existing record."
}
updateResult object

Properties

cid string cid Required

A content identifier (CID) referencing immutable data.

uri string at-uri Required

An AT Protocol URI (e.g., at://did:plc:xyz/app.bsky.feed.post/abc).

validationStatus string Optional

No description provided.

Known values: valid, unknown
View raw schema
{
  "type": "object",
  "required": [
    "uri",
    "cid"
  ],
  "properties": {
    "cid": {
      "type": "string",
      "format": "cid"
    },
    "uri": {
      "type": "string",
      "format": "at-uri"
    },
    "validationStatus": {
      "type": "string",
      "knownValues": [
        "valid",
        "unknown"
      ]
    }
  }
}

Lexicon Garden

@