---
title: "Update document group role"
url: "https://docs.signnow.com/docs/document-group/operations/update-document-group-role"
type: "endpoint"
section: "document-group"
slug: "document-group/operations/update-document-group-role"
method: "PUT"
path: "/v2/document-groups/{document_group_id}/roles/{user_id}"
operation_id: "update-document-group-role"
authorization: "bearer"
---

# Update document group role

`PUT /v2/document-groups/{document_group_id}/roles/{user_id}`

This endpoint allows API users to change the role of a user who already has sharing access to the document group.

**Notes**

* **Viewer** - can view, download, and make copies of documents in a document group; **sender** - can view, download, make copies, invite to sign, and manage document invites.
* Only the owner of the document group can change roles.
* The previous role is replaced with the new one.

## Authorization

bearer

## Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `document_group_id` | string | Yes | Document group ID. |
| `user_id` | string | Yes | ID of the user whose role is being changed. |

## Request Body

**Schema**

```json
{
  "type": "object",
  "required": [
    "role"
  ],
  "properties": {
    "role": {
      "type": "string",
      "example": "sender",
      "description": "New role to assign. Allowed values: `viewer`, `sender`."
    }
  }
}
```

**Example** (`application/json`)

```json
{
  "role": "sender"
}
```

## Responses

### 200

Role successfully updated.

**Example** (`Example 1`)

```json
{
  "id": "def456abc123def456abc123def456abc123defg",
  "role": "sender",
  "email": "user@example.com"
}
```

**Example** (`application/json`)

```json
{
  "id": "def456abc123def456abc123def456abc123defg",
  "role": "sender",
  "email": "user@example.com"
}
```

### 400

Bad request. Possible errors:

* Document group not found.
* User role not found.
* Role is required.
* Role must be string.
* Invalid role value.

**Example** (`Example 1`)

```json
{
  "errors": [
    {
      "code": 12029026,
      "message": "Document group not found."
    }
  ]
}
```

**Example** (`Role is required`)

```json
{
  "errors": [
    {
      "code": 12029004,
      "message": "Role is required."
    }
  ]
}
```

**Example** (`Role must be string`)

```json
{
  "errors": [
    {
      "code": 12029005,
      "message": "Role must be string."
    }
  ]
}
```

**Example** (`User role not found`)

```json
{
  "errors": [
    {
      "code": 12029011,
      "message": "User role not found."
    }
  ]
}
```

**Example** (`Incorrect role value`)

```json
{
  "errors": [
    {
      "code": 12030014,
      "message": "Field `role` value should be one of [\"viewer\", \"sender\"], value: [\"...\"] given."
    }
  ]
}
```

**Example** (`Document group not found`)

```json
{
  "errors": [
    {
      "code": 12029026,
      "message": "Document group not found."
    }
  ]
}
```

### 401

Incorrect or missing bearer token.

**Example** (`Unauthorized`)

```json
{
  "code": 1537,
  "error": "invalid_token"
}
```

### 403

Forbidden. Only the document group owner can change roles.

**Example** (`Example 1`)

```json
{
  "errors": [
    {
      "code": 12029012,
      "message": "You don't have access to the entity."
    }
  ]
}
```

**Example** (`Forbidden`)

```json
{
  "errors": [
    {
      "code": 12029012,
      "message": "You don't have access to the entity."
    }
  ]
}
```

## Code Examples

> Replace `$SIGNNOW_ACCESS_TOKEN` and any `{placeholder}` values before running.

### cURL

```bash
curl -X PUT \
  "https://api.signnow.com/v2/document-groups/{document_group_id}/roles/{user_id}" \
  -H "Authorization: Bearer $SIGNNOW_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"role": "sender"}'
```

---
*Full reference: https://docs.signnow.com/docs/document-group/operations/update-document-group-role*
