# fyi.opensocial.putRole

> Published by [lexicons.opensocial.fyi](https://lexicon.garden/identity/did:plc:2gqnilpksz2e7faj3bwvo6qc)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:2gqnilpksz2e7faj3bwvo6qc/fyi.opensocial.putRole)
- [Documentation](https://lexicon.garden/lexicon/did:plc:2gqnilpksz2e7faj3bwvo6qc/fyi.opensocial.putRole/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:2gqnilpksz2e7faj3bwvo6qc/fyi.opensocial.putRole/examples)

## Definitions

### `fyi.opensocial.putRole`

**Type**: `procedure`

Create or update a role and its action bindings. Requires group.configure.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `actions` | `array` | Yes |  |
| `assignable` | `array` | No |  |
| `description` | `string` | No |  |
| `group` | `string` (did) | Yes | The group DID. Every method is served by the group's host and authorized against that group's roles. |
| `name` | `string` | Yes |  |
| `repoCollections` | `array` | No | See fyi.opensocial.permissions#binding. Omitted keeps the role's current value. |
| `role` | `string` | Yes |  |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `cid` | `string` (cid) | Yes |  |
| `uri` | `string` (at-uri) | Yes |  |

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Create or update a role and its action bindings. Requires group.configure.",
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "actions": {
              "items": {
                "ref": "fyi.opensocial.permissions#action",
                "type": "ref"
              },
              "type": "array"
            },
            "assignable": {
              "items": {
                "maxLength": 64,
                "type": "string"
              },
              "type": "array"
            },
            "description": {
              "type": "string"
            },
            "group": {
              "description": "The group DID. Every method is served by the group's host and authorized against that group's roles.",
              "format": "did",
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "repoCollections": {
              "description": "See fyi.opensocial.permissions#binding. Omitted keeps the role's current value.",
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "role": {
              "maxLength": 64,
              "type": "string"
            }
          },
          "required": [
            "group",
            "role",
            "name",
            "actions"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "cid": {
              "format": "cid",
              "type": "string"
            },
            "uri": {
              "format": "at-uri",
              "type": "string"
            }
          },
          "required": [
            "uri",
            "cid"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "fyi.opensocial.putRole",
  "lexicon": 1
}
```
