# dev.knotless.joinOrg

> Published by [lexicons.knotless.dev](https://lexicon.garden/identity/did:plc:yqsg7znbbhfmj3a2nrpnaerk)

✓ This is the authoritative definition for this NSID.

## Description

Takes the caller into an organization that invited them, once they keep a dev.knotless.orgAcceptance record naming it, through the gateway the organization delegated writes to: names them in its public record when their acceptance record is public, and only in its space when it is in their repo there; lets them read its space and its private repositories. Called again after moving the record, it changes how the membership shows. Refused when the invitation lapsed. Requires a service token from the caller's PDS, audience the gateway's DID, for this method.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:yqsg7znbbhfmj3a2nrpnaerk/dev.knotless.joinOrg)
- [Documentation](https://lexicon.garden/lexicon/did:plc:yqsg7znbbhfmj3a2nrpnaerk/dev.knotless.joinOrg/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:yqsg7znbbhfmj3a2nrpnaerk/dev.knotless.joinOrg/examples)

## Definitions

### `dev.knotless.joinOrg`

**Type**: `procedure`

Refused when the organization did not invite the caller, the caller keeps no acceptance record naming it, or the invitation lapsed.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `org` | `string` (did) | Yes | The organization. |
| `visibility` | `string` | No | Which of the caller's acceptance records counts, should they keep one in public and one in the organization's space, as they do moving it: a hidden one, if asked for; else a public one first. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `org` | `string` | Yes | The organization's handle, or its DID when none resolves back to it. |
| `role` | `string` | Yes | The caller's role in it. |
| `visibility` | `string` | Yes | Who sees the membership: anyone, or the organization's members. |

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Refused when the organization did not invite the caller, the caller keeps no acceptance record naming it, or the invitation lapsed.",
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "org": {
              "description": "The organization.",
              "format": "did",
              "type": "string"
            },
            "visibility": {
              "description": "Which of the caller's acceptance records counts, should they keep one in public and one in the organization's space, as they do moving it: a hidden one, if asked for; else a public one first.",
              "knownValues": [
                "public",
                "hidden"
              ],
              "maxLength": 64,
              "type": "string"
            }
          },
          "required": [
            "org"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "org": {
              "description": "The organization's handle, or its DID when none resolves back to it.",
              "maxLength": 300,
              "type": "string"
            },
            "role": {
              "description": "The caller's role in it.",
              "knownValues": [
                "admin",
                "member"
              ],
              "maxLength": 64,
              "type": "string"
            },
            "visibility": {
              "description": "Who sees the membership: anyone, or the organization's members.",
              "knownValues": [
                "public",
                "hidden"
              ],
              "maxLength": 64,
              "type": "string"
            }
          },
          "required": [
            "org",
            "role",
            "visibility"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "description": "Takes the caller into an organization that invited them, once they keep a dev.knotless.orgAcceptance record naming it, through the gateway the organization delegated writes to: names them in its public record when their acceptance record is public, and only in its space when it is in their repo there; lets them read its space and its private repositories. Called again after moving the record, it changes how the membership shows. Refused when the invitation lapsed. Requires a service token from the caller's PDS, audience the gateway's DID, for this method.",
  "id": "dev.knotless.joinOrg",
  "lexicon": 1
}
```
