Atmosphere GroupsOpen specificationBeta
MenuClose

fyi.opensocial.defs

Shared definitions

Kind
Shared definitions
Record
at://did:plc:2gqnilpksz2e7faj3bwvo6qc/com.atproto.lexicon.schema/fyi.opensocial.defs
In the spec
org.atgrp.defs, the spec's lexicon of the same name. It may differ from this one.

#accessConfig object

Contents of an access record.

FieldTypeDescription
grants (required)array of #spaceGrant
  • array maxLength: 100
publicboolean
  • default: false
writableByarray of #audience
  • array maxLength: 50
Who may write into the space in their own name, when not every member whose roles grant read: role ids, or 'public' for anyone signed in. Absent or empty is every such member.

#accountRef object

An account, by its DID.

FieldTypeDescription
did (required)string (did)

#accountSubject object

An account, as a moderation subject.

FieldTypeDescription
did (required)string (did)

#action string

What a holder of a role may do, as the host's methods ask: each is answered by the scope that grants it in the role's grant.

string

  • knownValues: mod.read, mod.resolve, label, takedown, invite, admit, eject, role.assign, space.create, space.configure, space.delete, group.configure
  • maxLength: 64

#actorView object

A person, as a view names them: their DID, and the handle their DID document names, when it can be read.

FieldTypeDescription
canCreateGroupbooleanOnly on the caller's own view, from getActor: whether this host lets them start a group (createGroup).
did (required)string (did)
handlestring (handle)The handle their DID document names; missing when it names none or cannot be read.

#audience object

Who may read or write a space: a role, by its id, or everyone signed in.

FieldTypeDescription
role (required)string
  • knownValues: public
  • maxLength: 64
A role id, or public for anyone signed in.

#collectionRef object

A collection of records, by its NSID, or * for any.

FieldTypeDescription
collection (required)string
  • maxLength: 317

#ejectEvent object

The subject's membership was deleted.

No fields.

#groupGrant object

Scopes a role is granted across the group, and the roles its holders may assign.

FieldTypeDescription
assignable (required)array of fyi.opensocial.defs#roleId
  • array maxLength: 100
Roles holders may grant or revoke, and whose holders they may eject.
role (required)fyi.opensocial.defs#roleId
scopes (required)array of string
  • each item, minLength: 1
  • each item, maxLength: 2000
  • array maxLength: 100
OAuth scopes, one per item. May include permission sets. `repo:` scopes are the public-repo collections holders may write as the group.

#groupRule object

FieldTypeDescription
createdAtstring (datetime)
rkey (required)string (record-key)
textstring
  • maxLength: 20000
  • maxGraphemes: 2000
title (required)string
  • maxLength: 1000
  • maxGraphemes: 100

#groupView object

A group as a list shows it. To a caller not signed in, only its did and handle.

FieldTypeDescription
addressstringThe group's address here: one label under this host's handle domain, set when the group is made or arrives. Its handle, until the group takes one of its own.
avatarstringCID of the avatar blob; the host serves it at /img/{did}/{cid}, to whoever may see the profile.
bannerstringCID of the banner blob; the host serves it at /img/{did}/{cid}, to whoever may see the profile.
createdAtstring (datetime)When the group was started on this host.
deactivatedbooleanSet while a steward has the group switched off. Its spaces cannot be read until one of the stewards who could switch it off switches it back on.
descriptionstring
did (required)string (did)
displayNamestring
handle (required)string (handle)
joinPolicystringHow new members get in, as the profile states it.
languagesarray of #languageRef
  • array maxLength: 5
The languages it uses, as BCP 47 tags: en, pl, sl.
locationunion of community.lexicon.location.address, community.lexicon.location.geo, community.lexicon.location.fsq, community.lexicon.location.hthreeWhere it meets, if it meets somewhere: a town or city is enough.
membersstring (space-ref)
metastring (space-ref)
onlinebooleanIt meets online, as well as or instead of somewhere.
rulesarray of #groupRule
topicsarray of #topicRef
  • array maxLength: 10
What it's about, a few words each, as the group puts it: climbing, choir, renters' union.
urlstring (uri)The group's own site, if it keeps one.

#groupViewBasic object

FieldTypeDescription
addressstringThe group's address here: one label under this host's handle domain, set when the group is made or arrives. Its handle, until the group takes one of its own.
avatarstringCID of the group's picture.
did (required)string (did)
displayNamestring
handle (required)string (handle)
memberCountinteger
  • minimum: 0
How many people are in it. Only to its members.
sampleMembersarray of #actorView
  • array maxLength: 5
A few of its members, each as they are in the group, to show their faces. Only to its members.
urlstring (uri)The group's own site, if not at its handle.

#groupViewDetailed object

A group in full, as the viewer may see it. Profile fields and rules are present only when the viewer may read the meta space.

FieldTypeDescription
addressstringThe group's address here: one label under this host's handle domain, set when the group is made or arrives. Its handle, until the group takes one of its own.
avatarstringCID of the avatar blob; the host serves it at /img/{did}/{cid}, to whoever may see the profile.
bannerstringCID of the banner blob; the host serves it at /img/{did}/{cid}, to whoever may see the profile.
deactivatedbooleanSet while a steward has the group switched off. Its spaces cannot be read until one of the stewards who could switch it off switches it back on.
descriptionstring
did (required)string (did)
displayNamestring
handle (required)string (handle)
joinPolicystringHow new members get in, as the profile states it.
languagesarray of #languageRef
  • array maxLength: 5
The languages it uses, as BCP 47 tags: en, pl, sl.
linksarray of #link
  • array maxLength: 5
Where else the group is, as its profile lists them.
locationunion of community.lexicon.location.address, community.lexicon.location.geo, community.lexicon.location.fsq, community.lexicon.location.hthreeWhere it meets, if it meets somewhere: a town or city is enough.
memberCountinteger
  • minimum: 0
How many are in it. Present only when the viewer may read the members space, whose members listMembers gives a page at a time.
membersstring (space-ref)
metastring (space-ref)
onlinebooleanIt meets online, as well as or instead of somewhere.
rulesarray of #groupRuleIn the order they are presented. Absent when the meta space is closed to the viewer.
topicsarray of #topicRef
  • array maxLength: 10
What it's about, a few words each, as the group puts it: climbing, choir, renters' union.
urlstring (uri)The group's own site, if it keeps one.
viewer#viewerState

#inviteView object

FieldTypeDescription
actor#actorViewWhom it invites, with their handle where it can be read: on listInvites.
createdAt (required)string (datetime)
expiresAtstring (datetime)
invitee (required)string (did)
messagestring
uri (required)string (at-uri)

#joinPolicy string

open admits anyone; approval queues a join request; invite requires an invitation. An invitation admits its recipient under any policy.

string

  • knownValues: open, approval, invite

#joinRequest object

A request to join, waiting in the host.

FieldTypeDescription
actor#actorViewWho is asking, as a view names them.
createdAt (required)string (datetime)
member (required)string (did)
messagestring
  • maxLength: 20000
  • maxGraphemes: 2000

#labelerPolicies object

FieldTypeDescription
labelValueDefinitionsarray of com.atproto.label.defs#labelValueDefinitionIts own label values, defined.
labelValues (required)array of com.atproto.label.defs#labelValueThe label values it applies.

#labelEvent object

A label record was written or deleted.

FieldTypeDescription
deletedboolean
  • default: false
uri (required)string (at-uri)The label record.
val (required)string
  • minLength: 1
  • maxLength: 128

#languageRef object

A language the group uses.

FieldTypeDescription
language (required)string (language)

#memberView object

FieldTypeDescription
actor (required)#actorView
roles (required)array of #roleRef

#moderationEvent object

One event in the host's private moderation history.

FieldTypeDescription
createdAt (required)string (datetime)
createdBystring (did)Hosts may withhold this to protect reporters and moderators.
event (required)union of fyi.opensocial.defs#reportEvent, fyi.opensocial.defs#statusEvent, fyi.opensocial.defs#labelEvent, fyi.opensocial.defs#ejectEvent
id (required)string
  • minLength: 1
  • maxLength: 512

#recordSubject object

A record, as a moderation subject.

FieldTypeDescription
cidstring (cid)A specific version. Omit for the record as a whole.
uri (required)string (at-uri)A record in one of the group's spaces.

#reportEvent object

Someone reported the subject.

FieldTypeDescription
reasonstring
  • maxLength: 20000
  • maxGraphemes: 2000
reasonType (required)com.atproto.moderation.defs#reasonType
rulestring (at-uri)A rule in the group's meta space.

#roleBinding object

What one role may do, as the host reads its grant.

FieldTypeDescription
actions (required)array of #action
assignable (required)array of #roleRef
repoCollectionsarray of #collectionRefThe public-repo collections holders may write as the group; `*` for any.
role (required)string
  • maxLength: 64
scopesarray of #scopeRefThe role's grant as the permissions record has it.

#roleId string

The rkey of a role record in the group's members space.

string (record-key)

  • maxLength: 512

#roleRef object

A role, by its id: the record key of a fyi.opensocial.role record.

FieldTypeDescription
role (required)string
  • maxLength: 64

#roleView object

FieldTypeDescription
botbooleanPeople with this role are bots.
defaultbooleanGranted to members who join through requestJoin.
descriptionstring
key (required)stringThe role id: its record key.
namestring

#scopeRef object

An OAuth scope, as a permission or permission set is written.

FieldTypeDescription
scope (required)string
  • maxLength: 400

#spaceGrant object

Scopes a role is granted in one space.

FieldTypeDescription
role (required)string (record-key)
  • maxLength: 512
A role id: the record key of a fyi.opensocial.role record.
scopes (required)array of string
  • each item, minLength: 1
  • each item, maxLength: 2000
  • array maxLength: 100
OAuth scopes, one per item: space scopes, read against this space. One granting read lets the role read the space; one naming collections lets it write those as the group here.

#spaceView object

FieldTypeDescription
grantsarray of #spaceGrantThe scopes each role is granted there, when the viewer may read the space.
namestring
peoplearray of #accountRefFor chosen people: who they are, when the viewer is one of them. Only they read it or write in it.
publicbooleanWhether anyone signed in may read it, when the viewer may read the space.
spaceType (required)string (nsid)
uri (required)string (space-ref)
writableByarray of #audienceWho may write there in their own name, when the viewer may read the space. Absent is every member whose roles grant read.

#statusEvent object

A moderator set the subject's status, optionally with a note.

FieldTypeDescription
notestring
  • maxLength: 20000
  • maxGraphemes: 2000
status (required)fyi.opensocial.defs#subjectStatus

#subjectStatus string

Where a subject stands in the moderation queue.

string

  • enum: open, escalated, resolved

#subjectView object

FieldTypeDescription
createdAt (required)string (datetime)
reportCount (required)integer
  • minimum: 0
status (required)fyi.opensocial.defs#subjectStatus
subject (required)union of fyi.opensocial.defs#accountSubject, fyi.opensocial.defs#recordSubject
updatedAt (required)string (datetime)

#topicRef object

A topic the group is about.

FieldTypeDescription
topic (required)string
  • maxLength: 640
  • maxGraphemes: 64

#viewerState object

The requesting account's standing in the group. Only present for authed requests.

FieldTypeDescription
acceptedbooleanFor a member: whether their own acceptance is in the members space.
actions (required)array of fyi.opensocial.defs#actionThe union of actions across the viewer's roles: what the host would let them do.
member (required)boolean
request#joinRequestThe viewer's own pending request to join, when they are not a member and have one.
roles (required)array of #roleRef
The schema as published
{
  "defs": {
    "accessConfig": {
      "description": "Contents of an access record.",
      "properties": {
        "grants": {
          "items": {
            "ref": "#spaceGrant",
            "type": "ref"
          },
          "maxLength": 100,
          "type": "array"
        },
        "public": {
          "default": false,
          "type": "boolean"
        },
        "writableBy": {
          "description": "Who may write into the space in their own name, when not every member whose roles grant read: role ids, or 'public' for anyone signed in. Absent or empty is every such member.",
          "items": {
            "ref": "#audience",
            "type": "ref"
          },
          "maxLength": 50,
          "type": "array"
        }
      },
      "required": [
        "grants"
      ],
      "type": "object"
    },
    "accountRef": {
      "description": "An account, by its DID.",
      "properties": {
        "did": {
          "format": "did",
          "type": "string"
        }
      },
      "required": [
        "did"
      ],
      "type": "object"
    },
    "accountSubject": {
      "description": "An account, as a moderation subject.",
      "properties": {
        "did": {
          "format": "did",
          "type": "string"
        }
      },
      "required": [
        "did"
      ],
      "type": "object"
    },
    "action": {
      "description": "What a holder of a role may do, as the host's methods ask: each is answered by the scope that grants it in the role's grant.",
      "knownValues": [
        "mod.read",
        "mod.resolve",
        "label",
        "takedown",
        "invite",
        "admit",
        "eject",
        "role.assign",
        "space.create",
        "space.configure",
        "space.delete",
        "group.configure"
      ],
      "maxLength": 64,
      "type": "string"
    },
    "actorView": {
      "description": "A person, as a view names them: their DID, and the handle their DID document names, when it can be read.",
      "properties": {
        "canCreateGroup": {
          "description": "Only on the caller's own view, from getActor: whether this host lets them start a group (createGroup).",
          "type": "boolean"
        },
        "did": {
          "format": "did",
          "type": "string"
        },
        "handle": {
          "description": "The handle their DID document names; missing when it names none or cannot be read.",
          "format": "handle",
          "type": "string"
        }
      },
      "required": [
        "did"
      ],
      "type": "object"
    },
    "audience": {
      "description": "Who may read or write a space: a role, by its id, or everyone signed in.",
      "properties": {
        "role": {
          "description": "A role id, or public for anyone signed in.",
          "knownValues": [
            "public"
          ],
          "maxLength": 64,
          "type": "string"
        }
      },
      "required": [
        "role"
      ],
      "type": "object"
    },
    "collectionRef": {
      "description": "A collection of records, by its NSID, or * for any.",
      "properties": {
        "collection": {
          "maxLength": 317,
          "type": "string"
        }
      },
      "required": [
        "collection"
      ],
      "type": "object"
    },
    "ejectEvent": {
      "description": "The subject's membership was deleted.",
      "properties": {},
      "type": "object"
    },
    "groupGrant": {
      "description": "Scopes a role is granted across the group, and the roles its holders may assign.",
      "properties": {
        "assignable": {
          "description": "Roles holders may grant or revoke, and whose holders they may eject.",
          "items": {
            "ref": "fyi.opensocial.defs#roleId",
            "type": "ref"
          },
          "maxLength": 100,
          "type": "array"
        },
        "role": {
          "ref": "fyi.opensocial.defs#roleId",
          "type": "ref"
        },
        "scopes": {
          "description": "OAuth scopes, one per item. May include permission sets. `repo:` scopes are the public-repo collections holders may write as the group.",
          "items": {
            "maxLength": 2000,
            "minLength": 1,
            "type": "string"
          },
          "maxLength": 100,
          "type": "array"
        }
      },
      "required": [
        "role",
        "scopes",
        "assignable"
      ],
      "type": "object"
    },
    "groupRule": {
      "properties": {
        "createdAt": {
          "format": "datetime",
          "type": "string"
        },
        "rkey": {
          "format": "record-key",
          "type": "string"
        },
        "text": {
          "maxGraphemes": 2000,
          "maxLength": 20000,
          "type": "string"
        },
        "title": {
          "maxGraphemes": 100,
          "maxLength": 1000,
          "type": "string"
        }
      },
      "required": [
        "rkey",
        "title"
      ],
      "type": "object"
    },
    "groupView": {
      "description": "A group as a list shows it. To a caller not signed in, only its did and handle.",
      "properties": {
        "address": {
          "description": "The group's address here: one label under this host's handle domain, set when the group is made or arrives. Its handle, until the group takes one of its own.",
          "type": "string"
        },
        "avatar": {
          "description": "CID of the avatar blob; the host serves it at /img/{did}/{cid}, to whoever may see the profile.",
          "type": "string"
        },
        "banner": {
          "description": "CID of the banner blob; the host serves it at /img/{did}/{cid}, to whoever may see the profile.",
          "type": "string"
        },
        "createdAt": {
          "description": "When the group was started on this host.",
          "format": "datetime",
          "type": "string"
        },
        "deactivated": {
          "description": "Set while a steward has the group switched off. Its spaces cannot be read until one of the stewards who could switch it off switches it back on.",
          "type": "boolean"
        },
        "description": {
          "type": "string"
        },
        "did": {
          "format": "did",
          "type": "string"
        },
        "displayName": {
          "type": "string"
        },
        "handle": {
          "format": "handle",
          "type": "string"
        },
        "joinPolicy": {
          "description": "How new members get in, as the profile states it.",
          "type": "string"
        },
        "languages": {
          "description": "The languages it uses, as BCP 47 tags: en, pl, sl.",
          "items": {
            "ref": "#languageRef",
            "type": "ref"
          },
          "maxLength": 5,
          "type": "array"
        },
        "location": {
          "description": "Where it meets, if it meets somewhere: a town or city is enough.",
          "refs": [
            "community.lexicon.location.address",
            "community.lexicon.location.geo",
            "community.lexicon.location.fsq",
            "community.lexicon.location.hthree"
          ],
          "type": "union"
        },
        "members": {
          "format": "space-ref",
          "type": "string"
        },
        "meta": {
          "format": "space-ref",
          "type": "string"
        },
        "online": {
          "description": "It meets online, as well as or instead of somewhere.",
          "type": "boolean"
        },
        "rules": {
          "items": {
            "ref": "#groupRule",
            "type": "ref"
          },
          "type": "array"
        },
        "topics": {
          "description": "What it's about, a few words each, as the group puts it: climbing, choir, renters' union.",
          "items": {
            "ref": "#topicRef",
            "type": "ref"
          },
          "maxLength": 10,
          "type": "array"
        },
        "url": {
          "description": "The group's own site, if it keeps one.",
          "format": "uri",
          "type": "string"
        }
      },
      "required": [
        "did",
        "handle"
      ],
      "type": "object"
    },
    "groupViewBasic": {
      "properties": {
        "address": {
          "description": "The group's address here: one label under this host's handle domain, set when the group is made or arrives. Its handle, until the group takes one of its own.",
          "type": "string"
        },
        "avatar": {
          "description": "CID of the group's picture.",
          "type": "string"
        },
        "did": {
          "format": "did",
          "type": "string"
        },
        "displayName": {
          "type": "string"
        },
        "handle": {
          "format": "handle",
          "type": "string"
        },
        "memberCount": {
          "description": "How many people are in it. Only to its members.",
          "minimum": 0,
          "type": "integer"
        },
        "sampleMembers": {
          "description": "A few of its members, each as they are in the group, to show their faces. Only to its members.",
          "items": {
            "ref": "#actorView",
            "type": "ref"
          },
          "maxLength": 5,
          "type": "array"
        },
        "url": {
          "description": "The group's own site, if not at its handle.",
          "format": "uri",
          "type": "string"
        }
      },
      "required": [
        "did",
        "handle"
      ],
      "type": "object"
    },
    "groupViewDetailed": {
      "description": "A group in full, as the viewer may see it. Profile fields and rules are present only when the viewer may read the meta space.",
      "properties": {
        "address": {
          "description": "The group's address here: one label under this host's handle domain, set when the group is made or arrives. Its handle, until the group takes one of its own.",
          "type": "string"
        },
        "avatar": {
          "description": "CID of the avatar blob; the host serves it at /img/{did}/{cid}, to whoever may see the profile.",
          "type": "string"
        },
        "banner": {
          "description": "CID of the banner blob; the host serves it at /img/{did}/{cid}, to whoever may see the profile.",
          "type": "string"
        },
        "deactivated": {
          "description": "Set while a steward has the group switched off. Its spaces cannot be read until one of the stewards who could switch it off switches it back on.",
          "type": "boolean"
        },
        "description": {
          "type": "string"
        },
        "did": {
          "format": "did",
          "type": "string"
        },
        "displayName": {
          "type": "string"
        },
        "handle": {
          "format": "handle",
          "type": "string"
        },
        "joinPolicy": {
          "description": "How new members get in, as the profile states it.",
          "type": "string"
        },
        "languages": {
          "description": "The languages it uses, as BCP 47 tags: en, pl, sl.",
          "items": {
            "ref": "#languageRef",
            "type": "ref"
          },
          "maxLength": 5,
          "type": "array"
        },
        "links": {
          "description": "Where else the group is, as its profile lists them.",
          "items": {
            "ref": "#link",
            "type": "ref"
          },
          "maxLength": 5,
          "type": "array"
        },
        "location": {
          "description": "Where it meets, if it meets somewhere: a town or city is enough.",
          "refs": [
            "community.lexicon.location.address",
            "community.lexicon.location.geo",
            "community.lexicon.location.fsq",
            "community.lexicon.location.hthree"
          ],
          "type": "union"
        },
        "memberCount": {
          "description": "How many are in it. Present only when the viewer may read the members space, whose members listMembers gives a page at a time.",
          "minimum": 0,
          "type": "integer"
        },
        "members": {
          "format": "space-ref",
          "type": "string"
        },
        "meta": {
          "format": "space-ref",
          "type": "string"
        },
        "online": {
          "description": "It meets online, as well as or instead of somewhere.",
          "type": "boolean"
        },
        "rules": {
          "description": "In the order they are presented. Absent when the meta space is closed to the viewer.",
          "items": {
            "ref": "#groupRule",
            "type": "ref"
          },
          "type": "array"
        },
        "topics": {
          "description": "What it's about, a few words each, as the group puts it: climbing, choir, renters' union.",
          "items": {
            "ref": "#topicRef",
            "type": "ref"
          },
          "maxLength": 10,
          "type": "array"
        },
        "url": {
          "description": "The group's own site, if it keeps one.",
          "format": "uri",
          "type": "string"
        },
        "viewer": {
          "ref": "#viewerState",
          "type": "ref"
        }
      },
      "required": [
        "did",
        "handle"
      ],
      "type": "object"
    },
    "inviteView": {
      "properties": {
        "actor": {
          "description": "Whom it invites, with their handle where it can be read: on listInvites.",
          "ref": "#actorView",
          "type": "ref"
        },
        "createdAt": {
          "format": "datetime",
          "type": "string"
        },
        "expiresAt": {
          "format": "datetime",
          "type": "string"
        },
        "invitee": {
          "format": "did",
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "uri": {
          "format": "at-uri",
          "type": "string"
        }
      },
      "required": [
        "uri",
        "invitee",
        "createdAt"
      ],
      "type": "object"
    },
    "joinPolicy": {
      "description": "open admits anyone; approval queues a join request; invite requires an invitation. An invitation admits its recipient under any policy.",
      "knownValues": [
        "open",
        "approval",
        "invite"
      ],
      "type": "string"
    },
    "joinRequest": {
      "description": "A request to join, waiting in the host.",
      "properties": {
        "actor": {
          "description": "Who is asking, as a view names them.",
          "ref": "#actorView",
          "type": "ref"
        },
        "createdAt": {
          "format": "datetime",
          "type": "string"
        },
        "member": {
          "format": "did",
          "type": "string"
        },
        "message": {
          "maxGraphemes": 2000,
          "maxLength": 20000,
          "type": "string"
        }
      },
      "required": [
        "member",
        "createdAt"
      ],
      "type": "object"
    },
    "labelEvent": {
      "description": "A label record was written or deleted.",
      "properties": {
        "deleted": {
          "default": false,
          "type": "boolean"
        },
        "uri": {
          "description": "The label record.",
          "format": "at-uri",
          "type": "string"
        },
        "val": {
          "maxLength": 128,
          "minLength": 1,
          "type": "string"
        }
      },
      "required": [
        "uri",
        "val"
      ],
      "type": "object"
    },
    "labelerPolicies": {
      "properties": {
        "labelValueDefinitions": {
          "description": "Its own label values, defined.",
          "items": {
            "ref": "com.atproto.label.defs#labelValueDefinition",
            "type": "ref"
          },
          "type": "array"
        },
        "labelValues": {
          "description": "The label values it applies.",
          "items": {
            "ref": "com.atproto.label.defs#labelValue",
            "type": "ref"
          },
          "type": "array"
        }
      },
      "required": [
        "labelValues"
      ],
      "type": "object"
    },
    "languageRef": {
      "description": "A language the group uses.",
      "properties": {
        "language": {
          "format": "language",
          "type": "string"
        }
      },
      "required": [
        "language"
      ],
      "type": "object"
    },
    "link": {
      "description": "A place on the web where the group is: its site, a chat, a calendar.",
      "properties": {
        "title": {
          "description": "What it is, as the group puts it.",
          "maxGraphemes": 64,
          "maxLength": 640,
          "type": "string"
        },
        "url": {
          "description": "An http or https address.",
          "format": "uri",
          "maxLength": 2048,
          "type": "string"
        }
      },
      "required": [
        "url"
      ],
      "type": "object"
    },
    "memberView": {
      "properties": {
        "actor": {
          "ref": "#actorView",
          "type": "ref"
        },
        "roles": {
          "items": {
            "ref": "#roleRef",
            "type": "ref"
          },
          "type": "array"
        }
      },
      "required": [
        "actor",
        "roles"
      ],
      "type": "object"
    },
    "moderationEvent": {
      "description": "One event in the host's private moderation history.",
      "properties": {
        "createdAt": {
          "format": "datetime",
          "type": "string"
        },
        "createdBy": {
          "description": "Hosts may withhold this to protect reporters and moderators.",
          "format": "did",
          "type": "string"
        },
        "event": {
          "refs": [
            "fyi.opensocial.defs#reportEvent",
            "fyi.opensocial.defs#statusEvent",
            "fyi.opensocial.defs#labelEvent",
            "fyi.opensocial.defs#ejectEvent"
          ],
          "type": "union"
        },
        "id": {
          "maxLength": 512,
          "minLength": 1,
          "type": "string"
        }
      },
      "required": [
        "id",
        "createdAt",
        "event"
      ],
      "type": "object"
    },
    "recordSubject": {
      "description": "A record, as a moderation subject.",
      "properties": {
        "cid": {
          "description": "A specific version. Omit for the record as a whole.",
          "format": "cid",
          "type": "string"
        },
        "uri": {
          "description": "A record in one of the group's spaces.",
          "format": "at-uri",
          "type": "string"
        }
      },
      "required": [
        "uri"
      ],
      "type": "object"
    },
    "reportEvent": {
      "description": "Someone reported the subject.",
      "properties": {
        "reason": {
          "maxGraphemes": 2000,
          "maxLength": 20000,
          "type": "string"
        },
        "reasonType": {
          "ref": "com.atproto.moderation.defs#reasonType",
          "type": "ref"
        },
        "rule": {
          "description": "A rule in the group's meta space.",
          "format": "at-uri",
          "type": "string"
        }
      },
      "required": [
        "reasonType"
      ],
      "type": "object"
    },
    "roleBinding": {
      "description": "What one role may do, as the host reads its grant.",
      "properties": {
        "actions": {
          "items": {
            "ref": "#action",
            "type": "ref"
          },
          "type": "array"
        },
        "assignable": {
          "items": {
            "ref": "#roleRef",
            "type": "ref"
          },
          "type": "array"
        },
        "repoCollections": {
          "description": "The public-repo collections holders may write as the group; `*` for any.",
          "items": {
            "ref": "#collectionRef",
            "type": "ref"
          },
          "type": "array"
        },
        "role": {
          "maxLength": 64,
          "type": "string"
        },
        "scopes": {
          "description": "The role's grant as the permissions record has it.",
          "items": {
            "ref": "#scopeRef",
            "type": "ref"
          },
          "type": "array"
        }
      },
      "required": [
        "role",
        "actions",
        "assignable"
      ],
      "type": "object"
    },
    "roleId": {
      "description": "The rkey of a role record in the group's members space.",
      "format": "record-key",
      "maxLength": 512,
      "type": "string"
    },
    "roleRef": {
      "description": "A role, by its id: the record key of a fyi.opensocial.role record.",
      "properties": {
        "role": {
          "maxLength": 64,
          "type": "string"
        }
      },
      "required": [
        "role"
      ],
      "type": "object"
    },
    "roleView": {
      "properties": {
        "bot": {
          "description": "People with this role are bots.",
          "type": "boolean"
        },
        "default": {
          "description": "Granted to members who join through requestJoin.",
          "type": "boolean"
        },
        "description": {
          "type": "string"
        },
        "key": {
          "description": "The role id: its record key.",
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      },
      "required": [
        "key"
      ],
      "type": "object"
    },
    "scopeRef": {
      "description": "An OAuth scope, as a permission or permission set is written.",
      "properties": {
        "scope": {
          "maxLength": 400,
          "type": "string"
        }
      },
      "required": [
        "scope"
      ],
      "type": "object"
    },
    "spaceGrant": {
      "description": "Scopes a role is granted in one space.",
      "properties": {
        "role": {
          "description": "A role id: the record key of a fyi.opensocial.role record.",
          "format": "record-key",
          "maxLength": 512,
          "type": "string"
        },
        "scopes": {
          "description": "OAuth scopes, one per item: space scopes, read against this space. One granting read lets the role read the space; one naming collections lets it write those as the group here.",
          "items": {
            "maxLength": 2000,
            "minLength": 1,
            "type": "string"
          },
          "maxLength": 100,
          "type": "array"
        }
      },
      "required": [
        "role",
        "scopes"
      ],
      "type": "object"
    },
    "spaceView": {
      "properties": {
        "grants": {
          "description": "The scopes each role is granted there, when the viewer may read the space.",
          "items": {
            "ref": "#spaceGrant",
            "type": "ref"
          },
          "type": "array"
        },
        "name": {
          "type": "string"
        },
        "people": {
          "description": "For chosen people: who they are, when the viewer is one of them. Only they read it or write in it.",
          "items": {
            "ref": "#accountRef",
            "type": "ref"
          },
          "type": "array"
        },
        "public": {
          "description": "Whether anyone signed in may read it, when the viewer may read the space.",
          "type": "boolean"
        },
        "spaceType": {
          "format": "nsid",
          "type": "string"
        },
        "uri": {
          "format": "space-ref",
          "type": "string"
        },
        "writableBy": {
          "description": "Who may write there in their own name, when the viewer may read the space. Absent is every member whose roles grant read.",
          "items": {
            "ref": "#audience",
            "type": "ref"
          },
          "type": "array"
        }
      },
      "required": [
        "uri",
        "spaceType"
      ],
      "type": "object"
    },
    "statusEvent": {
      "description": "A moderator set the subject's status, optionally with a note.",
      "properties": {
        "note": {
          "maxGraphemes": 2000,
          "maxLength": 20000,
          "type": "string"
        },
        "status": {
          "ref": "fyi.opensocial.defs#subjectStatus",
          "type": "ref"
        }
      },
      "required": [
        "status"
      ],
      "type": "object"
    },
    "subjectStatus": {
      "description": "Where a subject stands in the moderation queue.",
      "enum": [
        "open",
        "escalated",
        "resolved"
      ],
      "type": "string"
    },
    "subjectView": {
      "properties": {
        "createdAt": {
          "format": "datetime",
          "type": "string"
        },
        "reportCount": {
          "minimum": 0,
          "type": "integer"
        },
        "status": {
          "ref": "fyi.opensocial.defs#subjectStatus",
          "type": "ref"
        },
        "subject": {
          "refs": [
            "fyi.opensocial.defs#accountSubject",
            "fyi.opensocial.defs#recordSubject"
          ],
          "type": "union"
        },
        "updatedAt": {
          "format": "datetime",
          "type": "string"
        }
      },
      "required": [
        "subject",
        "status",
        "createdAt",
        "updatedAt",
        "reportCount"
      ],
      "type": "object"
    },
    "topicRef": {
      "description": "A topic the group is about.",
      "properties": {
        "topic": {
          "maxGraphemes": 64,
          "maxLength": 640,
          "type": "string"
        }
      },
      "required": [
        "topic"
      ],
      "type": "object"
    },
    "viewerState": {
      "description": "The requesting account's standing in the group. Only present for authed requests.",
      "properties": {
        "accepted": {
          "description": "For a member: whether their own acceptance is in the members space.",
          "type": "boolean"
        },
        "actions": {
          "description": "The union of actions across the viewer's roles: what the host would let them do.",
          "items": {
            "ref": "fyi.opensocial.defs#action",
            "type": "ref"
          },
          "type": "array"
        },
        "member": {
          "type": "boolean"
        },
        "request": {
          "description": "The viewer's own pending request to join, when they are not a member and have one.",
          "ref": "#joinRequest",
          "type": "ref"
        },
        "roles": {
          "items": {
            "ref": "#roleRef",
            "type": "ref"
          },
          "type": "array"
        }
      },
      "required": [
        "member",
        "roles",
        "actions"
      ],
      "type": "object"
    }
  },
  "id": "fyi.opensocial.defs",
  "lexicon": 1
}

All lexicons