---
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 an owner of the template to change a user role for a specific 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

Success.

**Example** (`Example 1`)

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

**Example** (`Successful request`)

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

### 400

- You are not a template owner.
- `role` must be one of: `viewer`, `sender`.

**Example** (`Example 1`)

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

**Example** (`Incorrect role`)

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

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

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

### 404

- Incorrect `template_id`.
- Incorrect `user_id`.

**Example** (`Example 1`)

```json
{
  "404": "Unable to find a route to match the URI: v2/templates/inc/roles/39656a89512a42e6b156b4f5558f3c73c5dc15d5"
}
```

**Example** (`Incorrect user_id`)

```json
{
  "404": "Unable to find a route to match the URI: v2/templates/2274bf62786844e981584543275cdc0c88d67d45/roles/39656a8952a42e6b156b4f5558f3c73c5dc15d5"
}
```

**Example** (`Incorrect template_id`)

```json
{
  "404": "Unable to find a route to match the URI: v2/templates/2274bf62786844e981584543275cdcc88d67d45/roles/39656a89512a42e6b156b4f5558f3c73c5dc15d5"
}
```

## 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*
