# org.atgrp.requestJoin

Request to join a group, optionally redeeming an invite. Admits the caller right away when the join policy is open or with a valid invite, and otherwise queues a request. Returns the caller's existing request or membership if they have one. Requires service auth.

A method (procedure) in the spec for Atmosphere Groups. The page: https://www.atmospheregroups.org/spec/lexicons/org-atgrp-requestJoin/

- Named in the spec: 13.4 Methods (https://www.atmospheregroups.org/spec/#methods)
- In the spec's repository: https://tangled.org/atmospheregroups.org/spec/blob/0885261c9cd1af80e89908571f926c2d0c71771f/lexicons/org/atgrp/requestJoin.json
- Published under the same name: https://www.atmospheregroups.org/reference/lexicons/org-atgrp-requestJoin/, the same schema
- The reference host's version: fyi.opensocial.requestJoin, https://www.atmospheregroups.org/reference/lexicons/fyi-opensocial-requestJoin/

## The schema in the spec

```json
{
  "lexicon": 1,
  "id": "org.atgrp.requestJoin",
  "defs": {
    "main": {
      "type": "procedure",
      "description": "Request to join a group, optionally redeeming an invite. Admits the caller right away when the join policy is open or with a valid invite, and otherwise queues a request. Returns the caller's existing request or membership if they have one. Requires service auth.",
      "input": {
        "encoding": "application/json",
        "schema": {
          "type": "object",
          "required": [
            "group"
          ],
          "properties": {
            "group": {
              "type": "string",
              "format": "did"
            },
            "invite": {
              "type": "string",
              "format": "at-uri",
              "description": "An invite in the caller's inbox space."
            },
            "message": {
              "type": "string",
              "maxGraphemes": 2000,
              "maxLength": 20000,
              "description": "Shown to the group with the request."
            }
          }
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "type": "object",
          "required": [
            "status"
          ],
          "properties": {
            "status": {
              "type": "string",
              "knownValues": [
                "pending",
                "admitted"
              ]
            },
            "request": {
              "type": "ref",
              "ref": "org.atgrp.defs#joinRequest",
              "description": "Present when pending."
            },
            "membership": {
              "type": "ref",
              "ref": "com.atproto.repo.strongRef#main",
              "description": "Present when admitted."
            }
          }
        }
      },
      "errors": [
        {
          "name": "GroupNotFound"
        },
        {
          "name": "InvalidInvite"
        },
        {
          "name": "JoinClosed",
          "description": "The group is invite-only."
        }
      ]
    }
  }
}
```
