# pub.chive.governance.listDelegations

> Published by [chive.pub](https://lexicon.garden/identity/did:plc:7natp5xae72bddaqlkef2t4e)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:7natp5xae72bddaqlkef2t4e/pub.chive.governance.listDelegations)
- [Documentation](https://lexicon.garden/lexicon/did:plc:7natp5xae72bddaqlkef2t4e/pub.chive.governance.listDelegations/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:7natp5xae72bddaqlkef2t4e/pub.chive.governance.listDelegations/examples)

## Definitions

### `pub.chive.governance.listDelegations`

**Type**: `query`

List active PDS delegations. Only accessible by administrators.

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `limit` | `integer` | No | Maximum number of results to return |
| `cursor` | `string` | No | Pagination cursor for next page |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `total` | `integer` | Yes | Total number of delegations |
| `cursor` | `string` | No | Cursor for next page |
| `delegations` | `array` | Yes | List of delegations |

#### Errors

- **AuthenticationRequired**
- **Unauthorized**

### `pub.chive.governance.listDelegations#delegation`

**Type**: `object`

PDS delegation record

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `id` | `string` | Yes | Delegation identifier |
| `active` | `boolean` | Yes | Whether the delegation is currently active |
| `handle` | `string` | No | Delegate handle |
| `expiresAt` | `integer` | Yes | Expiration timestamp |
| `grantedAt` | `integer` | Yes | Timestamp when delegation was granted |
| `grantedBy` | `string` (did) | Yes | DID of admin who granted the delegation |
| `collections` | `array` | Yes | NSID collections the delegation covers |
| `delegateDid` | `string` (did) | Yes | DID of the delegate |
| `displayName` | `string` | No | Delegate display name |
| `maxRecordsPerDay` | `integer` | Yes | Maximum records delegate can create per day |
| `recordsCreatedToday` | `integer` | Yes | Records created today under this delegation |

## Raw Schema

```json
{
  "id": "pub.chive.governance.listDelegations",
  "defs": {
    "main": {
      "type": "query",
      "errors": [
        {
          "name": "AuthenticationRequired"
        },
        {
          "name": "Unauthorized"
        }
      ],
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "delegations",
            "total"
          ],
          "properties": {
            "total": {
              "type": "integer",
              "description": "Total number of delegations"
            },
            "cursor": {
              "type": "string",
              "description": "Cursor for next page"
            },
            "delegations": {
              "type": "array",
              "items": {
                "ref": "#delegation",
                "type": "ref"
              },
              "description": "List of delegations"
            }
          }
        },
        "encoding": "application/json"
      },
      "parameters": {
        "type": "params",
        "properties": {
          "limit": {
            "type": "integer",
            "default": 20,
            "maximum": 100,
            "minimum": 1,
            "description": "Maximum number of results to return"
          },
          "cursor": {
            "type": "string",
            "description": "Pagination cursor for next page"
          }
        }
      },
      "description": "List active PDS delegations. Only accessible by administrators."
    },
    "delegation": {
      "type": "object",
      "required": [
        "id",
        "delegateDid",
        "collections",
        "expiresAt",
        "maxRecordsPerDay",
        "recordsCreatedToday",
        "grantedAt",
        "grantedBy",
        "active"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Delegation identifier"
        },
        "active": {
          "type": "boolean",
          "description": "Whether the delegation is currently active"
        },
        "handle": {
          "type": "string",
          "description": "Delegate handle"
        },
        "expiresAt": {
          "type": "integer",
          "description": "Expiration timestamp"
        },
        "grantedAt": {
          "type": "integer",
          "description": "Timestamp when delegation was granted"
        },
        "grantedBy": {
          "type": "string",
          "format": "did",
          "description": "DID of admin who granted the delegation"
        },
        "collections": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "NSID collections the delegation covers"
        },
        "delegateDid": {
          "type": "string",
          "format": "did",
          "description": "DID of the delegate"
        },
        "displayName": {
          "type": "string",
          "description": "Delegate display name"
        },
        "maxRecordsPerDay": {
          "type": "integer",
          "minimum": 0,
          "description": "Maximum records delegate can create per day"
        },
        "recordsCreatedToday": {
          "type": "integer",
          "minimum": 0,
          "description": "Records created today under this delegation"
        }
      },
      "description": "PDS delegation record"
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1,
  "revision": 1
}
```
