at.happyproto.admin.createSpaces

Create HappyProto's admin and customers spaces, member-only, keeping either that already exists, and add each of staff to the admin space with write access, skipping existing members. Each space is looked up at the uri its script variable (HAPPYPROTO_ADMIN_SPACE, HAPPYPROTO_CUSTOMERS_SPACE) names, or, unset, under HAPPYPROTO_DID. A space created here has a DID of its own, and the uri answered is the one to set its variable to. Idempotent once the variables are set: a second call creates nothing and adds no one. Only HappyProto's own account may call it.

Repository @happyproto.at did:plc:mo7vq4jbioxwafy5zkcc3eux namespace authority
Details · procedure
Kindprocedure
Authorityadmin.happyproto.at
Indexed

Procedure

procedure · POST

Input

application/json

staff

array

DIDs to add to the admin space with write access. A DID listed twice is added once. A DID that is already a member is left at its current access (a read-only member is not upgraded) and is not listed in staffAdded.

  • maxLength: 50
itemsstring · did

Output

application/json

adminSpace

requiredref
Reference

customersSpace

requiredref
Reference

staffAdded

requiredarray

The DIDs this call added to the admin space; members already present are left out.

itemsstring · did

Errors

Conflict

A space of this type already exists at a uri of its own that no variable names. The message names the variable to set to it.

Forbidden

The caller is not HAPPYPROTO_DID, is signed out, or HAPPYPROTO_DID is unset or not a DID.

InvalidRequest

staff is not a list of at most 50 DIDs.

Upstream

A space could not be read, created or changed. A failure part-way through staff names, in its message, the DIDs already added. Retrying is safe.

#space

object

Properties

created

requiredboolean

Whether this call created the space; false when it already existed.

uri

requiredstring · uri

The space's at:// uri, at://<HAPPYPROTO_DID>/space/<type>/main. Not format at-uri: that format allows a collection NSID and a record key at most, and a space uri has four path segments and `space` where the NSID would be, so @atproto/lexicon refuses it.

Similar lexicons

semantic match

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