Reference · Platform methods

pub.techne.draft.permissioned.putRecords

procedure · POSTIn the SDK, put

Write up to 200 records into your own repo in one call, each for the space it names.

Each write is applied in order, exactly as putRecord would apply it, each in its own transaction. It is not atomic. A refused write does not undo the ones before it or stop the ones after it. Writing the current version again is a no-op, so send a failed batch again whole.

Input application/json

NameTypeWhat it is
reporequireddidYour DID. Or a collective or circle whose space you manage, if the platform holds its credential.
writesrequiredwrite[], 1–200The writes, applied in this order.

Each write

collectionrequirednsidThe record's type.
rkeyrequiredrecord-keyIts key, up to 512 characters.
recordrequiredunknownThe body. Its $type must equal collection, and it must satisfy the published lexicon if there is one.
swapCidcidWrite only if the current version has this CID. A missing record never matches.
spacerequiredat-uriThe space the record is for. A write with none is refused (400 InvalidRequest); a record only you read goes in your own at://{did}/pub.techne.draft.space.personal/self.

Output application/json

NameTypeWhat it is
resultsrequiredunion[]One per write, in the order of writes. Each is a writeResult or a writeError.

Each writeResult, a write that applied

urirequiredat-uriThe record's address.
cidrequiredcidThe DAG-CBOR CID, the same a PDS would compute.
revrequiredtidThe repo revision of the version now current.
readrequireddid[]The DIDs the space's shares name, when you may read that space. Empty otherwise.
spaceat-uriThe space the record counts in now.

Each writeError, a write refused with nothing of it written

errorrequiredstringInvalidRequest, InvalidSwap, Conflict, IdentityConflict or DuplicatePhone.
messagerequiredstringWhy.

These errors stop the whole call. They are InvalidRequest (400; also 413 over 8 MiB, 415 not JSON, 422 not this input), AuthenticationRequired (401), Forbidden (403, repo is not yours; nothing is written), AccountDeleting (403) and RateLimitExceeded (429). One call spends one of your writes, however many it carries. The full lexicon is at putRecords.permissioned.draft.techne.pub.

An event's detail, for its detail space
What comes back

put sends every record with a space (or a type with no public home) here, in one call, before any public record. If one is refused it throws PutError and writes nothing public.

An event's detail, for its detail space
What comes back

The detail is keyed {event rkey}-det, and its space is keyed by the event's own key. The Bearer token is a session from any sign-in, or an atproto service-auth JWT with lxm set to this method.