# social.coves.aggregator.enable

> Published by [coves.social](https://lexicon.garden/identity/did:web:coves.social)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:web:coves.social/social.coves.aggregator.enable)
- [Documentation](https://lexicon.garden/lexicon/did:web:coves.social/social.coves.aggregator.enable/docs)
- [Examples](https://lexicon.garden/lexicon/did:web:coves.social/social.coves.aggregator.enable/examples)

## Definitions

### `social.coves.aggregator.enable`

**Type**: `procedure`

Enable an aggregator for a community. Creates an authorization record in the community's repository. Requires moderator permissions.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `config` | `unknown` | No | Aggregator-specific configuration. Must conform to the aggregator's configSchema. |
| `community` | `string` (at-identifier) | Yes | DID or handle of the community |
| `aggregatorDid` | `string` (did) | Yes | DID of the aggregator to enable |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `cid` | `string` (cid) | Yes | CID of the created authorization record |
| `uri` | `string` (at-uri) | Yes | AT-URI of the created authorization record |
| `authorization` | `ref` → `social.coves.aggregator.defs#authorizationView` | Yes | The created authorization details |

#### Errors

- **NotAuthorized**: Caller is not a moderator of this community
- **AggregatorNotFound**: Aggregator DID does not exist or has no service declaration
- **InvalidConfig**: Config does not match aggregator's configSchema
- **AlreadyEnabled**: Aggregator is already enabled for this community

## Raw Schema

```json
{
  "id": "social.coves.aggregator.enable",
  "defs": {
    "main": {
      "type": "procedure",
      "input": {
        "schema": {
          "type": "object",
          "required": [
            "community",
            "aggregatorDid"
          ],
          "properties": {
            "config": {
              "type": "unknown",
              "description": "Aggregator-specific configuration. Must conform to the aggregator's configSchema."
            },
            "community": {
              "type": "string",
              "format": "at-identifier",
              "description": "DID or handle of the community"
            },
            "aggregatorDid": {
              "type": "string",
              "format": "did",
              "description": "DID of the aggregator to enable"
            }
          }
        },
        "encoding": "application/json"
      },
      "errors": [
        {
          "name": "NotAuthorized",
          "description": "Caller is not a moderator of this community"
        },
        {
          "name": "AggregatorNotFound",
          "description": "Aggregator DID does not exist or has no service declaration"
        },
        {
          "name": "InvalidConfig",
          "description": "Config does not match aggregator's configSchema"
        },
        {
          "name": "AlreadyEnabled",
          "description": "Aggregator is already enabled for this community"
        }
      ],
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "uri",
            "cid",
            "authorization"
          ],
          "properties": {
            "cid": {
              "type": "string",
              "format": "cid",
              "description": "CID of the created authorization record"
            },
            "uri": {
              "type": "string",
              "format": "at-uri",
              "description": "AT-URI of the created authorization record"
            },
            "authorization": {
              "ref": "social.coves.aggregator.defs#authorizationView",
              "type": "ref",
              "description": "The created authorization details"
            }
          }
        },
        "encoding": "application/json"
      },
      "description": "Enable an aggregator for a community. Creates an authorization record in the community's repository. Requires moderator permissions."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
