com.atproto.repo.applyWrites

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

Details · procedure
Kindprocedure
Authorityrepo.atproto.com
Indexed

Procedure

procedure · POST

Input

application/json

repo

requiredstring · at-identifier

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

swapCommit

string · cid

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

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

requiredarray
itemsunion
One of (closed)

Output

application/json

Errors

InvalidSwap

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

#create

object

Operation which creates a new record.

Properties

collection

requiredstring · nsid

rkey

string · record-key

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

  • maxLength: 512

value

requiredunknown

#createResult

object

Properties

cid

requiredstring · cid

uri

requiredstring · at-uri
  • knownValues: valid | unknown

#delete

object

Operation which deletes an existing record.

Properties

collection

requiredstring · nsid

rkey

requiredstring · record-key

#deleteResult

object

Properties

#update

object

Operation which updates an existing record.

Properties

collection

requiredstring · nsid

rkey

requiredstring · record-key

value

requiredunknown

#updateResult

object

Properties

cid

requiredstring · cid

uri

requiredstring · at-uri
  • knownValues: valid | unknown

Similar lexicons

semantic match

Lexicons whose schemas describe something close to this one. Check them before publishing a new one that overlaps.

  • Make several writes in the logged-in account's repo at once, as com.atproto.repo.applyWrites makes them at its PDS, and index them before answering. Called as social.grain.repo.createRecord is.

  • Writes records to the requesting user's repo in a space the AppView hosts for them. The write is authorized the way the space's authority would authorize it, stored, and indexed like a synced write. Records keep the URIs they will have on the user's PDS after a migration.

  • Write a repository record, creating or updating it as needed. Requires auth, implemented by PDS.

  • Create a single new repository record. Requires auth, implemented by PDS.

  • Delete a repository record, or ensure it doesn't exist. Requires auth, implemented by PDS.