pub.techne.draft.identity.writeAsCollective

Write as a collective: a batch of creates, updates and deletes applied atomically to the repo of a collective account whose credential this service holds, written with that credential. The same input and output as com.atproto.repo.applyWrites, with `repo` the collective's DID; each write is a com.atproto.repo.applyWrites#create, #update or #delete. The service checks the caller's role in the collective first: whoever manages the collective's own member space (`pub.techne.draft.space.collective.member/self`) writes as it; a member of a circle who only writes there deletes its own membership; a new collective's creator is its manager by the founding membership pub.techne.draft.identity.createCollective writes; a collective that lets every signed-in account post a type takes one such create. A collective that keeps its memberships and descriptor in its member space (a circle) has them created and updated there with pub.techne.draft.permissioned.putRecords, never here (a delete is applied here), and a `block` is never created or updated as a collective. An app reaches it through the caller's own PDS (`atproto-proxy: <service DID>#atproto_appview`), which forwards it with the caller's service-auth token; the app's OAuth scope needs `rpc:pub.techne.draft.identity.writeAsCollective?aud=<service DID>%23atproto_appview`. An agent's token from this service, or a session with it, calls it directly. Its writes are public records in the collective's repo, and the caller's authority is its role there, so the app's `space:` scopes need not reach them (the `rpc:` scope above is enough). It places nothing in a space: a write that names a `space` is refused, and pub.techne.draft.permissioned.putRecords writes into a collective's space. Your own repo is not written here: write it at your PDS with com.atproto.repo.applyWrites. One call spends one of the caller's writes.

Details · procedure
Kindprocedure
Authorityidentity.draft.techne.pub
Commit rev3n3iob5wnvg2u
Indexed

Procedure

procedure · POST

Input

application/json

repo

requiredstring · did

The collective's DID. Not the caller's own.

swapCommit

string · cid

As com.atproto.repo.applyWrites: the whole batch fails unless the collective's repo is at this commit.

validate

boolean

As com.atproto.repo.applyWrites: passed to the collective's PDS.

Errors

InvalidRequest

HTTP 400 (or the body extractor's 413, 415 or 422 for a body that is not JSON). Malformed input; `repo` is the caller's own DID (write your own repo at your PDS); a write names a `space` the app's `space:` scopes cover, or the token carries no scope claim at all (write it there with pub.techne.draft.permissioned.putRecords); or the collective's PDS refused the writes (its reason in the message, e.g. InvalidSwap when `swapCommit` did not match).

Forbidden

HTTP 403. The caller may not write as `repo`, or not this write: a record above its own role, a `block`, or a membership or descriptor the collective keeps in its member space.

NotAuthorized

HTTP 403. A write names a `space` the app's `space:` scopes do not cover writing to.

LastManager

HTTP 409. The writes would leave a circle's members with no manager.

PayloadTooLarge

HTTP 413, from the collective's PDS.

RateLimitExceeded

HTTP 429. Too many writes from this DID, or the collective's PDS is rate-limiting.

Similar lexicons

semantic match

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

  • Write up to 200 records into the caller's own repo in one call: each write is applied in order, exactly as putRecord applies it (the same admission, receipts, no-op re-put and swapCid), each in its own transaction. NOT atomic: a write that is refused does not undo the writes before it or stop the ones after it, and each write's result says what happened to it. That is why this is not called applyWrites: atproto's com.atproto.repo.applyWrites commits all of its writes or none, and this does not (

  • Make a collective account: a new DID whose credential the platform holds, with a random handle, and its founding membership, which the platform writes as the collective: the caller at role 40 (Steward), placed in the collective's own member space (`pub.techne.draft.space.collective.member/self`) with `addedBy` the caller (`founderMembershipVisibility: "members"`, the default), or public with no `addedBy` (`"public"`); a collective that will keep its roster private (a circle) keeps the default, s

  • Write a record into the caller's own repo, as a permissioned record (the generic private write). The caller authenticates with its own credential: a session from any sign-in lane (OAuth included), or an atproto service-auth JWT (iss = the caller, aud = the AppView's service DID, lxm = this method). repo must be the caller, or a collective or circle the platform holds the credential of whose own member space (`space.collective.member/self`) the caller manages (that space's manage leg alone hands

  • 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.

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