---
title: "Update role for template"
url: "https://docs.signnow.com/docs/template/operations/put-v2-templates-template-id-roles-user-id"
type: "endpoint"
section: "template"
slug: "template/operations/put-v2-templates-template-id-roles-user-id"
method: "PUT"
path: "/v2/templates/{template_id}/roles/{user_id}"
operation_id: "put-v2-templates-template-id-roles-user-id"
authorization: "bearer"
---

# Update role for template

`PUT /v2/templates/{template_id}/roles/{user_id}`

This endpoint allows API users to change a user's role for a shared template. 

**Note**: Only the template owner can make role changes.


## Authorization

bearer

## Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `template_id` | string | Yes | ID of the template. |
| `user_id` | string | Yes | ID of the user. |

## Request Body

**Schema**

```json
{
  "type": "object",
  "required": [
    "role"
  ],
  "properties": {
    "role": {
      "type": "string",
      "example": "viewer",
      "description": "The role assigned to the user. Allowed values are `sender` and `viewer`.\n"
    }
  },
  "x-examples": {
    "Example 1": {
      "role": "viewer"
    }
  }
}
```

**Example** (`Example 1`)

```json
{
  "role": "viewer"
}
```

## Responses

### 200

Successful response.

**Example** (`Successful response`)

```json
{
  "id": "a0XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "role": "viewer",
  "email": "user@mail.com"
}
```

### 400

* Wrong, expired, or missing token.
* The template doesn't exist.
* You are not the template owner.
* The user with `user_id` doesn't have a role in the template.
* `role` must be one of: `viewer`, `sender`.

**Example** (`Incorrect role`)

```json
{
  "errors": [
    {
      "code": 12029006,
      "message": "Role must be one of the choices: `viewer`, `sender`."
    }
  ]
}
```

**Example** (`Template not found`)

```json
{
  "errors": [
    {
      "code": 12029014,
      "message": "Template not found."
    }
  ]
}
```

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

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

**Example** (`Not a template owner`)

```json
{
  "errors": [
    {
      "code": 65582,
      "message": "Accessor is not a document owner."
    }
  ]
}
```

## Code Examples

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

### cURL

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

---
*Full reference: https://docs.signnow.com/docs/template/operations/put-v2-templates-template-id-roles-user-id*
