# social.colibri.beta.community.transferOwnership

> Published by [colibri.social](https://lexicon.garden/identity/did:plc:mprdjqjluoswa7awzggaggj3)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:mprdjqjluoswa7awzggaggj3/social.colibri.beta.community.transferOwnership)
- [Documentation](https://lexicon.garden/lexicon/did:plc:mprdjqjluoswa7awzggaggj3/social.colibri.beta.community.transferOwnership/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:mprdjqjluoswa7awzggaggj3/social.colibri.beta.community.transferOwnership/examples)

## Definitions

### `social.colibri.beta.community.transferOwnership`

**Type**: `procedure`

Hands the community's protected owner role from the caller to another member. The subject gains every protected role the caller holds, then the caller loses them. The caller keeps their other roles.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `community` | `string` (did) | Yes | The community whose ownership is transferred. |
| `subject` | `string` (did) | Yes | The member who becomes the owner. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `owner` | `ref` → `social.colibri.beta.community.defs#memberView` | Yes | The new owner, with their updated roles. |
| `previousOwner` | `ref` → `social.colibri.beta.community.defs#memberView` | Yes | The caller, with their updated roles. |

#### Errors

- **AuthRequired**: The request is missing, malformed, or unverifiable service auth.
- **Forbidden**: The caller does not hold a protected owner role in this community.
- **CommunityNotFound**: No community exists with that DID.
- **MemberNotFound**: The subject does not hold a member record in this community.
- **Banned**: The subject is banned from this community.
- **AlreadyOwner**: The subject already holds a protected owner role.
- **CredentialsUnavailable**: The AppView's stored credentials for this community are missing or unusable.

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Hands the community's protected owner role from the caller to another member. The subject gains every protected role the caller holds, then the caller loses them. The caller keeps their other roles.",
      "errors": [
        {
          "description": "The request is missing, malformed, or unverifiable service auth.",
          "name": "AuthRequired"
        },
        {
          "description": "The caller does not hold a protected owner role in this community.",
          "name": "Forbidden"
        },
        {
          "description": "No community exists with that DID.",
          "name": "CommunityNotFound"
        },
        {
          "description": "The subject does not hold a member record in this community.",
          "name": "MemberNotFound"
        },
        {
          "description": "The subject is banned from this community.",
          "name": "Banned"
        },
        {
          "description": "The subject already holds a protected owner role.",
          "name": "AlreadyOwner"
        },
        {
          "description": "The AppView's stored credentials for this community are missing or unusable.",
          "name": "CredentialsUnavailable"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "community": {
              "description": "The community whose ownership is transferred.",
              "format": "did",
              "type": "string"
            },
            "subject": {
              "description": "The member who becomes the owner.",
              "format": "did",
              "type": "string"
            }
          },
          "required": [
            "community",
            "subject"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "owner": {
              "description": "The new owner, with their updated roles.",
              "ref": "social.colibri.beta.community.defs#memberView",
              "type": "ref"
            },
            "previousOwner": {
              "description": "The caller, with their updated roles.",
              "ref": "social.colibri.beta.community.defs#memberView",
              "type": "ref"
            }
          },
          "required": [
            "owner",
            "previousOwner"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "social.colibri.beta.community.transferOwnership",
  "lexicon": 1
}
```
