Reference · Platform methods

com.atproto.repo.applyWrites

Next release: this page describes techne-sdk/types, which is not in techne-sdk 0.3.4 yet. With techne-sdk 0.3 today shows the released API.

procedure · POSTIn the SDK, techne.puton your PDS

atproto's batch write. It applies creates, updates and deletes to one repo in one transaction.

Your PDS answers it, not techne.computer, and it needs the person's session. techne.put sends every public record in one call. A new record goes as a create, and one whose CID changed goes as an update. A record already at its CID is left out. Private records never go through it. They go to permissioned.putRecords.

Input application/json

NameTypeWhat it is
reporequiredat-identifierThe handle or DID of the repo, your own account.
writesrequiredarrayThe writes, each a #create, #update or #delete.
validatebooleanfalse skips the lexicon check of every record and true requires it. Left out, the PDS checks only the lexicons it knows.
swapCommitcidThe whole batch fails unless the repo's current commit is this CID. It guards against conflicting writes.

Each write

#createcollection, rkey?, valueA new record. Without an rkey the PDS picks one.
#updatecollection, rkey, valueA record that exists, replaced.
#deletecollection, rkeyA record removed.

Output application/json

NameTypeWhat it is
commitcommitMetaThe commit it made, its cid and rev.
resultsarrayOne per write. A create or update result has uri, cid and a validationStatus of valid or unknown. A delete result is empty.

Error InvalidSwap when swapCommit does not match the current commit. The lexicon is atproto's own.

A public place, written to your PDS

techne.put derives the key, sends this call, then hints the platform with sync.indexRecord.

The same write, by hand
What comes back

Then sync.indexRecord → for each public record