pub.techne.draft.registry.publishType
Publish a community record type, or a new version of one you published.
A new type gets the NSID pub.techne.draft.c.<id>.<name>: <id> is minted at random, so no one gets a good name and the type still reads as <name>. Only the creating account may change a type afterwards, and only additively (new optional fields, wider limits); anything else is refused and is published as a new type under a new name. Anyone may fork a type to a new id. To extend someone else's type, publish a sidecar of your own (sidecarOf): its records carry a subject naming the record they extend. The lexicon is validated, published as a com.atproto.lexicon.schema record in the registry's repo, and indexed from this moment. The answer carries the type's techne.pub page; share it.
Input application/json
| Name | Type | What it is |
|---|---|---|
nsid | nsid | The type to publish a new version of. Leave it out to create a type. |
name | string | For a new type, its name: the NSID's last segment, a letter then letters and digits (bookClubMeeting). With nsid, a new name under the same id (a second type, or a sidecar, of yours). |
lexiconrequired | object | The lexicon document. Its main def is a record. Its id may be left out of a new type (it is filled in); otherwise it must equal the type's NSID. |
query | object | The type's {nsid}.query document: which fields fill the shared query roles (start, end, location, text, references, category; pub.techne.draft.query#roles). Without it the type's records can only be got and listed. |
sidecarOf | nsid | For a new type: the type it extends. Its main record must then have a required subject (an at-uri). |
forkOf | nsid | For a new type: the community type it was forked from. |
Output application/json
| Name | Type | What it is |
|---|---|---|
nsidrequired | nsid | |
versionrequired | integer | A community or requested type's version. A community type's is 1 at its first publish and one more at each additive change; a requested type's is 1. Absent for a platform type. |
schemarequired | strongRef | The published com.atproto.lexicon.schema record. |
pagerequired | uri | The type's page on techne.pub. |
createdrequired | boolean | Whether this call created the type (false: a new version). |
unchanged | boolean | The lexicon and query document equal the current version; nothing was published. |
Errors: AuthenticationRequired (Publishing is a signed-in act: the creator is the caller); InvalidLexicon (The document is not a record lexicon the platform can check records against (the message lists every problem)); InvalidQuery (The query document names a role or a field the lexicon does not have, or a field of the wrong kind for its role); InvalidName (The name is not a letter followed by letters and digits, or is taken under this id); NotAdditive (The new version removes or tightens something (the message lists each change). Publish it as a new type under a new name); NotCreator (Only the account that created the type may change it. Fork it, or publish a sidecar); UnknownType (nsid or forkOf names no community type, or sidecarOf names no type the platform indexes); TooLarge (The lexicon or query document is larger than the platform takes (64 KiB as JSON)); NotConfigured (HTTP 503. This platform has no type registry account to publish in); RateLimitExceeded (Too many publishes from this account; try again later). The full lexicon is at publishType.registry.draft.techne.pub.
The SDK's generated client has every platform method on techne.platform, typed from its lexicon. The call goes through the user's PDS, which signs it for the platform.
The Bearer token is your session, or an atproto service-auth JWT with lxm set to this method. Every answer carries page, the type’s techne.pub page; share it.