# agency.portable.membership

> Published by [portable.agency](https://lexicon.garden/identity/did:plc:y564i3jkoqqb5of5bcnq4xee)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:y564i3jkoqqb5of5bcnq4xee/agency.portable.membership)
- [Documentation](https://lexicon.garden/lexicon/did:plc:y564i3jkoqqb5of5bcnq4xee/agency.portable.membership/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:y564i3jkoqqb5of5bcnq4xee/agency.portable.membership/examples)

## Definitions

### `agency.portable.membership`

**Type**: `record`

A self-attested claim by an atproto account that it is linked to an identity, community, or role in an external service. Paired with a matching agency.portable.attestation record on the attester's PDS.

**Key**: `any`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `role` | `string` | No | Optional role, rank, or status within the service or community (e.g. 'admin', 'maintainer', 'fascinator'). |
| `service` | `ref` → `#service` | Yes |  |
| `createdAt` | `string` (datetime) | Yes |  |
| `attestedBy` | `string` (did) | Yes | DID of the attester that verified this claim. |

### `agency.portable.membership#service`

**Type**: `object`

Identifies an external service and, optionally, a specific community and identity within it.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `type` | `string` | Yes | External service identifier (e.g. 'discord', 'github', 'slack'). |
| `community` | `string` | No | Optional identifier for a specific group, server, workspace, or organization within the service (e.g. a Discord guild ID, a GitHub org slug). |
| `identifier` | `string` | No | Optional external identity within the service (e.g. a user ID or handle). Include when proving platform identity; may be omitted when only proving community or role membership. |

## Raw Schema

```json
{
  "id": "agency.portable.membership",
  "defs": {
    "main": {
      "key": "any",
      "type": "record",
      "record": {
        "type": "object",
        "required": [
          "service",
          "attestedBy",
          "createdAt"
        ],
        "properties": {
          "role": {
            "type": "string",
            "description": "Optional role, rank, or status within the service or community (e.g. 'admin', 'maintainer', 'fascinator')."
          },
          "service": {
            "ref": "#service",
            "type": "ref"
          },
          "createdAt": {
            "type": "string",
            "format": "datetime"
          },
          "attestedBy": {
            "type": "string",
            "format": "did",
            "description": "DID of the attester that verified this claim."
          }
        }
      },
      "description": "A self-attested claim by an atproto account that it is linked to an identity, community, or role in an external service. Paired with a matching agency.portable.attestation record on the attester's PDS."
    },
    "service": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string",
          "description": "External service identifier (e.g. 'discord', 'github', 'slack')."
        },
        "community": {
          "type": "string",
          "description": "Optional identifier for a specific group, server, workspace, or organization within the service (e.g. a Discord guild ID, a GitHub org slug)."
        },
        "identifier": {
          "type": "string",
          "description": "Optional external identity within the service (e.g. a user ID or handle). Include when proving platform identity; may be omitted when only proving community or role membership."
        }
      },
      "description": "Identifies an external service and, optionally, a specific community and identity within it."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
