# pub.chive.admin.assignRole

> 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.admin.assignRole)
- [Documentation](https://lexicon.garden/lexicon/did:plc:7natp5xae72bddaqlkef2t4e/pub.chive.admin.assignRole/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:7natp5xae72bddaqlkef2t4e/pub.chive.admin.assignRole/examples)

## Definitions

### `pub.chive.admin.assignRole`

**Type**: `procedure`

Assign a role to a user

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `did` | `string` (did) | Yes | Target user DID |
| `role` | `string` | Yes | Role to assign |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `success` | `boolean` | Yes | Whether the role was assigned |

#### Errors

- **AuthenticationRequired**
- **AdminRequired**
- **InvalidRequest**

## Raw Schema

```json
{
  "id": "pub.chive.admin.assignRole",
  "defs": {
    "main": {
      "type": "procedure",
      "input": {
        "schema": {
          "type": "object",
          "required": [
            "did",
            "role"
          ],
          "properties": {
            "did": {
              "type": "string",
              "format": "did",
              "description": "Target user DID"
            },
            "role": {
              "type": "string",
              "description": "Role to assign",
              "knownValues": [
                "admin",
                "moderator",
                "graph-editor",
                "author",
                "reader",
                "alpha-tester",
                "premium"
              ]
            }
          }
        },
        "encoding": "application/json"
      },
      "errors": [
        {
          "name": "AuthenticationRequired"
        },
        {
          "name": "AdminRequired"
        },
        {
          "name": "InvalidRequest"
        }
      ],
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "success"
          ],
          "properties": {
            "success": {
              "type": "boolean",
              "description": "Whether the role was assigned"
            }
          }
        },
        "encoding": "application/json"
      },
      "description": "Assign a role to a user"
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1,
  "revision": 1
}
```
