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
| Kind | procedure |
|---|---|
| Authority | identity.draft.techne.pub |
| Commit rev | 3n3iob5wnvg2u |
| Indexed |
Checks
Valid Lint pass{
"$type": "com.atproto.lexicon.schema",
"defs": {
"main": {
"description": "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.",
"errors": [
{
"description": "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).",
"name": "InvalidRequest"
},
{
"description": "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.",
"name": "Forbidden"
},
{
"description": "HTTP 403. A write names a `space` the app's `space:` scopes do not cover writing to.",
"name": "NotAuthorized"
},
{
"description": "HTTP 409. The writes would leave a circle's members with no manager.",
"name": "LastManager"
},
{
"description": "HTTP 413, from the collective's PDS.",
"name": "PayloadTooLarge"
},
{
"description": "HTTP 429. Too many writes from this DID, or the collective's PDS is rate-limiting.",
"name": "RateLimitExceeded"
}
],
"input": {
"encoding": "application/json",
"schema": {
"properties": {
"repo": {
"description": "The collective's DID. Not the caller's own.",
"format": "did",
"type": "string"
},
"swapCommit": {
"description": "As com.atproto.repo.applyWrites: the whole batch fails unless the collective's repo is at this commit.",
"format": "cid",
"type": "string"
},
"validate": {
"description": "As com.atproto.repo.applyWrites: passed to the collective's PDS.",
"type": "boolean"
},
"writes": {
"items": {
"closed": true,
"refs": [
"com.atproto.repo.applyWrites#create",
"com.atproto.repo.applyWrites#update",
"com.atproto.repo.applyWrites#delete"
],
"type": "union"
},
"type": "array"
}
},
"required": [
"repo",
"writes"
],
"type": "object"
}
},
"output": {
"encoding": "application/json",
"schema": {
"properties": {
"commit": {
"ref": "com.atproto.repo.defs#commitMeta",
"type": "ref"
},
"results": {
"items": {
"closed": true,
"refs": [
"com.atproto.repo.applyWrites#createResult",
"com.atproto.repo.applyWrites#updateResult",
"com.atproto.repo.applyWrites#deleteResult"
],
"type": "union"
},
"type": "array"
}
},
"required": [],
"type": "object"
}
},
"type": "procedure"
}
},
"id": "pub.techne.draft.identity.writeAsCollective",
"lexicon": 1
}