---
title: "Share template"
url: "https://docs.signnow.com/docs/template/operations/post-v2-templates-template_id-roles"
type: "endpoint"
section: "template"
slug: "template/operations/post-v2-templates-template_id-roles"
method: "POST"
path: "/v2/templates/{template_id}/roles"
operation_id: "post-v2-templates-template_id-roles"
authorization: "bearer"
---

# Share template

`POST /v2/templates/{template_id}/roles`

This endpoint allows an owner of a template to share it with other users (as a viewer or sender).

**Note**: A template can be shared only once with the same user. The user will receive an email notification about the shared template.

## Authorization

bearer

## Path Parameters

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

## Request Body

**Schema**

```json
{
  "type": "object",
  "required": [
    "email",
    "role"
  ],
  "properties": {
    "role": {
      "type": "string",
      "example": "sender",
      "description": "The role assigned to the user. Allowed values are `sender` and `viewer`."
    },
    "email": {
      "type": "string",
      "example": "user@mail.com",
      "description": "The email address of the user you want to share the template with."
    }
  },
  "x-examples": {
    "Example 1": {
      "role": "sender",
      "email": "user@email.com"
    }
  }
}
```

**Example** (`Example 1`)

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

## Responses

### 200

Success.

**Example** (`Example 1`)

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

**Example** (`Successful request`)

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

### 400

- The template has already been shared with this user.
- You are not a template owner.
- Trial users can share up to 10 entities.
- The user email is not valid.
- `email` is not a string.
- `email` is required.
- `role` must be one of: `viewer`, `sender`.
- `role` is not a string.

**Example** (`Example 1`)

```json
{
  "errors": [
    {
      "code": 12029008,
      "message": "Template can only be shared once."
    }
  ]
}
```

**Example** (`Invalid role`)

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

**Example** (`Invalid email`)

```json
{
  "errors": [
    {
      "code": 12029003,
      "message": "Email is not valid."
    }
  ]
}
```

**Example** (`Limit exceeded`)

```json
{
  "errors": [
    {
      "code": 12029018,
      "message": "Shared entities limit exceeded."
    }
  ]
}
```

**Example** (`Multiple sharing`)

```json
{
  "errors": [
    {
      "code": 12029008,
      "message": "Entity can only be shared once."
    }
  ]
}
```

**Example** (`email is required`)

```json
{
  "errors": [
    {
      "code": 12029002,
      "message": "Email is required"
    }
  ]
}
```

**Example** (`role not a string`)

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

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

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

**Example** (`email not a string`)

```json
{
  "errors": [
    {
      "code": 12029001,
      "message": "Email must be a string"
    }
  ]
}
```

### 404

Incorrect `template_id`.

**Example** (`Example 1`)

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

**Example** (`Incorrect template_id`)

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

## Code Examples

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

### cURL

```bash
curl -X POST \
  "https://api.signnow.com/v2/templates/{template_id}/roles" \
  -H "Authorization: Bearer $SIGNNOW_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"role": "sender", "email": "user@email.com"}'
```

---
*Full reference: https://docs.signnow.com/docs/template/operations/post-v2-templates-template_id-roles*
