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

# Share document group template

`POST /v2/document-group-templates/{document_group_template_id}/roles`

This endpoint allows API users to share a document group template with a user by email, assigning them a specified role. If the user does not have an account, one is created automatically.

**Notes**

* **Viewer** - can view, download, and make copies of documents in a document group template; **sender** - can view, download, make copies, invite to sign, and manage document invites.
* Only the owner of the document group template can share it.
* A document group template can be shared only once with the same user. Attempting to share again (even with a different role) returns an error.
* The user receives an email notification about the shared template.
* If the user does not exist in the system, a new account is created automatically.

## Authorization

bearer

## Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `document_group_template_id` | string | Yes | Document group template ID. |

## Request Body

**Schema**

```json
{
  "type": "object",
  "required": [
    "email",
    "role"
  ],
  "properties": {
    "role": {
      "type": "string",
      "example": "viewer",
      "description": "Role to assign. Allowed values: `viewer`, `sender`."
    },
    "email": {
      "type": "string",
      "example": "user@email.com",
      "description": "Email address of the user to share with."
    },
    "message": {
      "type": "string",
      "example": "Please review this template.",
      "description": "Custom message to include in the notification email."
    }
  }
}
```

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

```json
{
  "role": "viewer",
  "email": "user@example.com",
  "message": "Please review this template."
}
```

## Responses

### 200

Document group template successfully shared.

**Example** (`Example 1`)

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

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

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

### 400

Bad request. Possible errors:

* Document group template not found.
* You can't share document to yourself.
* Entity can only be shared once.
* Email validation errors.
* Role validation errors.
* Message validation errors.

**Example** (`Example 1`)

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

**Example** (`Already shared`)

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

**Example** (`Message too long`)

```json
{
  "errors": [
    {
      "code": 12029028,
      "message": "Field `message` should not exceed 10000 characters."
    }
  ]
}
```

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

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

**Example** (`Email is required`)

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

**Example** (`Message too short`)

```json
{
  "errors": [
    {
      "code": 12029028,
      "message": "Field `message` should be not less than 1 characters."
    }
  ]
}
```

**Example** (`Email is not valid`)

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

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

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

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

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

**Example** (`Email must be a string`)

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

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

```json
{
  "errors": [
    {
      "code": 12029027,
      "message": "Field `message` should be string, value: [...] given."
    }
  ]
}
```

**Example** (`Can't share to yourself`)

```json
{
  "errors": [
    {
      "code": 12029007,
      "message": "You can't share document to yourself."
    }
  ]
}
```

**Example** (`Message must not be empty`)

```json
{
  "errors": [
    {
      "code": 12029029,
      "message": "Field `message` must not be empty."
    }
  ]
}
```

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

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

### 403

Forbidden. You don't have access to the document group template.

**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."
    }
  ]
}
```

### 404

Incorrect document group template ID format (not a 40-character hex string).

**Example** (`Example 1`)

```json
{
  "404": "Unable to find a route to match the URI: v2/document-groups/{id}/roles"
}
```

**Example** (`Not found`)

```json
{
  "404": "Unable to find a route to match the URI: v2/document-groups/{id}/roles"
}
```

## Code Examples

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

### cURL

```bash
curl -X POST \
  "https://api.signnow.com/v2/document-group-templates/{document_group_template_id}/roles" \
  -H "Authorization: Bearer $SIGNNOW_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"role": "viewer", "email": "user@example.com", "message": "Please review this template."}'
```

---
*Full reference: https://docs.signnow.com/docs/document-group-template/operations/share-document-group-template*
