Reference · Platform methods
com.atproto.repo.applyWrites
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
| Name | Type | What it is |
|---|---|---|
reporequired | at-identifier | The handle or DID of the repo, your own account. |
writesrequired | array | The writes, each a #create, #update or #delete. |
validate | boolean | false skips the lexicon check of every record and true requires it. Left out, the PDS checks only the lexicons it knows. |
swapCommit | cid | The whole batch fails unless the repo's current commit is this CID. It guards against conflicting writes. |
Each write
#create | collection, rkey?, value | A new record. Without an rkey the PDS picks one. |
#update | collection, rkey, value | A record that exists, replaced. |
#delete | collection, rkey | A record removed. |
Output application/json
| Name | Type | What it is |
|---|---|---|
commit | commitMeta | The commit it made, its cid and rev. |
results | array | One 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