~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0
96 lines · 2.9 KB Raw History
{
  "lexicon": 1,
  "id": "org.atgrp.internal.createGroup",
  "defs": {
    "main": {
      "type": "procedure",
      "description": "Host-level: create a new group on this host. Authenticated as the founder (service auth from their PDS). The founder and any listed stewards become its first admins. Mints the group DID, creates the meta and members spaces, writes the bootstrap records and, for a discoverable group, a declaration. Modality spaces are left to the apps that use them (createSpace).",
      "input": {
        "encoding": "application/json",
        "schema": {
          "type": "object",
          "required": [
            "handle",
            "displayName"
          ],
          "properties": {
            "handle": {
              "type": "string",
              "format": "handle"
            },
            "stewards": {
              "type": "array",
              "items": {
                "type": "ref",
                "ref": "org.atgrp.internal.defs#accountRef"
              },
              "description": "Accounts that run the group alongside the founder, as admins from the start."
            },
            "displayName": {
              "type": "string",
              "maxGraphemes": 64,
              "maxLength": 640
            },
            "description": {
              "type": "string",
              "maxGraphemes": 2000,
              "maxLength": 20000
            },
            "joinPolicy": {
              "type": "ref",
              "ref": "org.atgrp.internal.defs#joinPolicy",
              "description": "Defaults to approval."
            },
            "metaPublicRead": {
              "type": "boolean",
              "default": true,
              "description": "Whether anyone may read its meta space (its policy's publicRead). Members read it either way."
            }
          }
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "type": "object",
          "required": [
            "did",
            "meta",
            "members"
          ],
          "properties": {
            "did": {
              "type": "string",
              "format": "did"
            },
            "meta": {
              "type": "string",
              "format": "space-ref"
            },
            "members": {
              "type": "string",
              "format": "space-ref"
            }
          }
        }
      },
      "errors": [
        {
          "name": "InvalidHandle",
          "description": "The handle is not one label under this host's handle domain."
        },
        {
          "name": "HandleTaken"
        },
        {
          "name": "AccountCreationFailed",
          "description": "The PLC directory did not take the group's new DID."
        },
        {
          "name": "NotAllowed",
          "description": "This host only lets the people it names start groups, and the caller isn't one."
        }
      ]
    }
  }
}