pub.techne.draft.permissioned.putRecord
Write one record into your own repo (or a collective's or circle's whose own member space you manage; a circle member holding only its write leg writes membership adds and their own claim) as a permissioned record, for the `space` it names (required: no space is InvalidRequest; public records go through com.atproto.repo.putRecord, and a record only you read goes in your space.personal). Any collection; a body of a collection with a published lexicon must satisfy it. It counts in that space only when the space's write policy admits you (and, for one of our own types, the space type declares the collection); otherwise it is stored and only you read it. A first write is never refused by its space's policy (only by your token's `space:` scopes). A pub.techne.draft.space.private record counts there when written under `space:` scopes covering it or with no scope claim; which app is calling is not asked. Replacing a record already written there needs `space:` scopes covering it, or no scope claim; anyone else is 403 Forbidden. The output's `space` says where it counts. Writing the current version again is a no-op (in an app's space, only under covering scopes or with no scope claim; else Forbidden). One write of your rate (RateLimitExceeded). A token with space scopes from Techne's ePDS: a write to a space they do not cover is 403 Forbidden. Draft tier.
Details · procedure
| Kind | procedure |
|---|---|
| Authority | permissioned.draft.techne.pub |
| Commit rev | 3n3iob6xcsw2u |
| Indexed |
Checks
Valid Lint pass{
"$type": "com.atproto.lexicon.schema",
"defs": {
"main": {
"description": "Write one record into your own repo (or a collective's or circle's whose own member space you manage; a circle member holding only its write leg writes membership adds and their own claim) as a permissioned record, for the `space` it names (required: no space is InvalidRequest; public records go through com.atproto.repo.putRecord, and a record only you read goes in your space.personal). Any collection; a body of a collection with a published lexicon must satisfy it. It counts in that space only when the space's write policy admits you (and, for one of our own types, the space type declares the collection); otherwise it is stored and only you read it. A first write is never refused by its space's policy (only by your token's `space:` scopes). A pub.techne.draft.space.private record counts there when written under `space:` scopes covering it or with no scope claim; which app is calling is not asked. Replacing a record already written there needs `space:` scopes covering it, or no scope claim; anyone else is 403 Forbidden. The output's `space` says where it counts. Writing the current version again is a no-op (in an app's space, only under covering scopes or with no scope claim; else Forbidden). One write of your rate (RateLimitExceeded). A token with space scopes from Techne's ePDS: a write to a space they do not cover is 403 Forbidden. Draft tier.",
"errors": [
{
"description": "HTTP 400. Malformed input (no `space`: name one, since public records go through com.atproto.repo.putRecord; a bad DID, NSID, record key or space address, a record whose $type is not collection, or one with no DAG-CBOR form), or a body that fails its collection's published lexicon. Also HTTP 413, 415, 400 or 422 for a request body that is not the method's input (see the description).",
"name": "InvalidRequest"
},
{
"description": "HTTP 403. repo is not the caller's own (or a collective's or circle's the caller may write as, see the description); or the call's `space:` scopes do not cover the write; or the write replaces a record already written for an app's space (pub.techne.draft.space.private) under `space:` scopes that do not cover a put there. A first write is never refused by its space's policy (only by the token's `space:` scopes). Nothing is written.",
"name": "Forbidden"
},
{
"description": "HTTP 409. The write, as a circle, would leave it with members and nobody at role >= 30. Make someone else manager first. Nothing is written.",
"name": "LastManager"
},
{
"description": "HTTP 403. The caller's account is being deleted, or is deleted. Nothing is written.",
"name": "AccountDeleting"
},
{
"description": "HTTP 409. swapCid did not match the current version.",
"name": "InvalidSwap"
},
{
"description": "HTTP 401. No credential, or one that fails verification (for a service-auth JWT: wrong aud or lxm, expired, replayed, or an issuer whose key does not resolve right now; retry later in that case).",
"name": "AuthenticationRequired"
},
{
"description": "HTTP 409. The same key holds a public record in the caller's repo, or a claim (a share, membership, connection and the like keep one space per key) written for another space, or a concurrent write replaced this version before it was recorded (read the record back).",
"name": "Conflict"
},
{
"description": "HTTP 409. The write would change a contact's identity (pub.techne.draft.contact: a held number or did changed or dropped, an archived contact un-archived or archived at another instant, a number and a did that are not one account, or a deleted contact's key written again). Writing it again never succeeds: archive the contact and write a new one.",
"name": "IdentityConflict"
},
{
"description": "HTTP 409. A pub.techne.draft.contact write introduces a number (a new contact's, or a first one) that another of the caller's active contacts already carries (an archived contact, or one bound to an account that is gone, does not count). Not refused for a write that archives the contact.",
"name": "DuplicatePhone"
},
{
"description": "HTTP 429. The caller has written faster than its per-DID write limit allows (by default 20 writes a second, a burst of 200; putRecord and deleteRecord each spend one, and putRecords one per call whatever the number of writes it carries; counted per AppView instance). Retry later. Also HTTP 429, with nothing written, for a pub.techne.draft.contact write that binds a number to an account (`phone` and `did` both set, where the stored contact does not already carry both): such a write refused because that account does not hold the number (IdentityConflict) spends one of the caller's phone lookups, the budget pub.techne.draft.identity.accountsForPhones spends (10 a minute per caller, counted per AppView instance), and a matching one spends none; and with none left every such write is refused. Retry in a minute.",
"name": "RateLimitExceeded"
}
],
"input": {
"encoding": "application/json",
"schema": {
"properties": {
"collection": {
"format": "nsid",
"type": "string"
},
"record": {
"description": "The record body. Its `$type` must equal `collection`; a collection with a published lexicon must satisfy it.",
"type": "unknown"
},
"repo": {
"description": "The owner's DID. Must equal the JWT's iss.",
"format": "did",
"type": "string"
},
"rkey": {
"description": "The record key. By convention a pub.techne.draft.description's rkey is sidecar_rkey(subject.uri) (one description per subject) and a pub.techne.draft.share's is a TID.",
"format": "record-key",
"maxLength": 512,
"type": "string"
},
"space": {
"description": "The space this record is for. Public records are written with com.atproto.repo.putRecord, not here. Required: at://{authority}/{spaceType}/{skey} (a record only you read goes in your own pub.techne.draft.space.personal, at://{you}/pub.techne.draft.space.personal/self; a source's own records in at://{repo}/pub.techne.draft.space.source/self). A write naming no space is refused as InvalidRequest. The key holds one record per space (the 0016 record address): writing it for another space writes another record and leaves this one; to move a record, delete it and write it again.",
"format": "at-uri",
"type": "string"
},
"swapCid": {
"description": "Write only if the record's current CID is this one. A missing record never matches.",
"format": "cid",
"type": "string"
}
},
"required": [
"repo",
"collection",
"rkey",
"record",
"space"
],
"type": "object"
}
},
"output": {
"encoding": "application/json",
"schema": {
"properties": {
"cid": {
"description": "The DAG-CBOR CID of the record, the same CID a PDS would compute.",
"format": "cid",
"type": "string"
},
"read": {
"description": "The DIDs the `share`s placed in the space the record counts in name (its authority left out), when the caller may read that space; empty otherwise. For a source space this is its whole audience beside the owner (as getGrants).",
"items": {
"format": "did",
"type": "string"
},
"type": "array"
},
"rev": {
"description": "The repo revision of the version now current.",
"format": "tid",
"type": "string"
},
"space": {
"description": "The space the record counts in now. Absent when it counts in none (the space's write policy does not admit the writer).",
"format": "at-uri",
"type": "string"
},
"uri": {
"format": "at-uri",
"type": "string"
}
},
"required": [
"uri",
"cid",
"rev",
"read"
],
"type": "object"
}
},
"type": "procedure"
}
},
"description": "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 over the authority's pen; managing another of its spaces does not); in a circle (a collective whose descriptor names a circle type) a caller holding only that space's write leg (role 20-29) holds the pen for pub.techne.draft.membership writes alone: an add (a new claim at a key that holds none now, not ending, whose addedBy is the caller or absent) or the caller's own claim (its leave, or a re-put keeping its subject and addedBy); anything else as the circle is Forbidden; any other repo is Forbidden: a record is only ever written into its writer's repo. There is no write gate on a first write and no collection check: any collection may be written, for any space, and a first write is never refused by its space's policy (only by the token's `space:` scopes). Replacing a record already written for an app's space (a pub.techne.draft.space.private space): only a caller whose `space:` scopes cover a put there, or whose token carries no scope claim at all (an ePDS grant naming no `space:` scope carries an empty claim and reaches none), may replace it; any other caller is refused 403 Forbidden and nothing is written. One collection is refused there: one of the platform's own record types named for an app's space (pub.techne.draft.space.private) is refused as InvalidRequest, since our own types keep their declared homes (the adopted community.lexicon.calendar.event and .rsvp are not refused there: they are the app's own data, and an RSVP there projects no claim). Otherwise what it counts for is the managing app's admission of the version as it is written: the record counts in the `space` it names only when that space's write policy admits the writer and, for a collection with a published lexicon, the space type declares the collection; it is then read by whoever the space's read policy admits. A record for a pub.techne.draft.space.private space is a space like any other: a write there counts when its owner writes it under `space:` scopes covering it or with no scope claim at all (which app is calling is not asked); a write under scopes that do not cover it is refused like any write out of scope. Otherwise it is stored in the writer's repo, counts in no space, and only its writer reads it (a record written for an app's space and not admitted there is read by no one); write it again to ask again (for an app's space only the callers that may replace a record there can). A write into a space whose authority's account is being deleted, or is deleted, is stored the same way and counts in no space (the space goes with that account). A caller whose own account is being deleted, or is deleted, is refused (AccountDeleting). The output's `space` says where it counts. A source keeps what it does not publish in its own pub.techne.draft.space.source (at://{source}/pub.techne.draft.space.source/self): its permissioned descriptions, the `share`s naming its readers (writing one admits its subject, who gets a 'granted' receipt; deleting the last one naming a reader gives a 'revoke-read'. A share keeps one space per key, so it is never moved out of the space: writing it for another space is refused as Conflict), and a scraper's raw payloads and crawl state. A body in a collection with a published lexicon must satisfy it (InvalidRequest otherwise); any other collection is stored as written. Writing the current version again for the same space records no new version: if it counts there it is a no-op; if it was not admitted, admission is asked again, and a version admitted now is placed in the space with a receipt. In an app's space this holds only for the callers that may replace a record there; anyone else's write of the same version is refused Forbidden. A request body that is not this method's input is refused as InvalidRequest, with an XRPC error body ({\"error\":\"InvalidRequest\",\"message\":...}): HTTP 413 for a body over 2 MiB (2,097,152 bytes; it is not read past that); 415 for one not sent as application/json; 400 for one that is not JSON; 422 for JSON that is not the input (a field missing or of the wrong type). Such a refused write still spends one of the caller's writes (RateLimitExceeded). When the call's token carries space scopes from Techne's ePDS, a write to a space they do not cover is refused 403 Forbidden. `space` is required: a write that names no space is refused as InvalidRequest (HTTP 400; for putRecords the whole call, and nothing is written), since public records are written with com.atproto.repo.putRecord and a record only the caller reads goes in its own pub.techne.draft.space.personal. Records written before this rule with no space stay stored and readable by their writer. Draft tier.",
"id": "pub.techne.draft.permissioned.putRecord",
"lexicon": 1
}