---
title: "Create doc group from template"
url: "https://docs.signnow.com/docs/document-group-template/operations/post-v2-document-group-templates-unique_id-document-group"
type: "endpoint"
section: "document-group-template"
slug: "document-group-template/operations/post-v2-document-group-templates-unique_id-document-group"
method: "POST"
path: "/v2/document-group-templates/{unique_id}/document-group"
operation_id: "post-v2-document-group-templates-unique_id-document-group"
authorization: "bearer"
---

# Create doc group from template

`POST /v2/document-group-templates/{unique_id}/document-group`

This endpoint allows API users to create a document group from a document group template.

The new document group is a signable copy: the template stays untouched as the master version. The documents in the group have new IDs that differ from the ones in the template, so build any invite from the IDs returned by this request. For the full flow, from preparing the documents to sending the group for signature, see [Documents, doc groups, and templates](/docs/entities). To let recipients sign the group inside your own site or app, see [Embedded signing](/docs/guides-embedded-signing).

## Authorization

bearer

## Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `unique_id` | string | Yes | Document group template unique ID |

## Request Body

**Schema**

```json
{
  "type": "object",
  "required": [
    "group_name"
  ],
  "properties": {
    "folder_id": {
      "type": "string",
      "description": "ID of the folder"
    },
    "group_name": {
      "type": "string",
      "description": "Name of the Document Group"
    },
    "client_timestamp": {
      "type": "string",
      "description": "Timestamp of client"
    }
  },
  "x-examples": {
    "Example 1": {
      "folder_id": "ddXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "group_name": "Sample group",
      "client_timestamp": "4562325644"
    }
  }
}
```

**Example** (`Example of the request body`)

```json
{
  "folder_id": "ddXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "group_name": "Sample group",
  "client_timestamp": "4562325644"
}
```

## Responses

### 200

Successfully created document group

**Example** (`Example 1`)

```json
{
  "data": {
    "name": "Marvel group",
    "owner": {
      "id": "d611277a2fdb429baea8220cd945975342ff7ab7",
      "email": "mila.s.nikitenko@gmail.com",
      "organization": {
        "id": null
      }
    },
    "state": "created",
    "created": 1675344851,
    "documents": [
      {
        "id": "0ca8b738e9e94feca4d73cfe96aebd737e2867f0",
        "roles": [],
        "thumbnail": {
          "large": "https://api.signnow-dev.xyz/document/0ca8b738e9e94feca4d73cfe96aebd737e2867f0/thumbnail?size=large",
          "small": "https://api.signnow-dev.xyz/document/0ca8b738e9e94feca4d73cfe96aebd737e2867f0/thumbnail?size=small",
          "medium": "https://api.signnow-dev.xyz/document/0ca8b738e9e94feca4d73cfe96aebd737e2867f0/thumbnail?size=medium"
        },
        "document_name": "Doc without fields should_delete_document true",
        "origin_document_id": "996575737c6148b78e1576520c9a9395798e34b7",
        "has_unassigned_field": false,
        "has_credit_card_number": false
      },
      {
        "id": "2303d8a403aa4044800db4c7f793c1eb717d5f20",
        "roles": [],
        "thumbnail": {
          "large": "https://api.signnow-dev.xyz/document/2303d8a403aa4044800db4c7f793c1eb717d5f20/thumbnail?size=large",
          "small": "https://api.signnow-dev.xyz/document/2303d8a403aa4044800db4c7f793c1eb717d5f20/thumbnail?size=small",
          "medium": "https://api.signnow-dev.xyz/document/2303d8a403aa4044800db4c7f793c1eb717d5f20/thumbnail?size=medium"
        },
        "document_name": "Doc without fields should_delete_document true",
        "origin_document_id": "b9d692fe4c244090b9a568710ec856ba114c0b53",
        "has_unassigned_field": false,
        "has_credit_card_number": false
      },
      {
        "id": "b9510bc52b6844718f35dc68c44a99f9242c5cab",
        "roles": [],
        "thumbnail": {
          "large": "https://api.signnow-dev.xyz/document/b9510bc52b6844718f35dc68c44a99f9242c5cab/thumbnail?size=large",
          "small": "https://api.signnow-dev.xyz/document/b9510bc52b6844718f35dc68c44a99f9242c5cab/thumbnail?size=small",
          "medium": "https://api.signnow-dev.xyz/document/b9510bc52b6844718f35dc68c44a99f9242c5cab/thumbnail?size=medium"
        },
        "document_name": "RELEASE",
        "origin_document_id": "72598958d80d4bb0bbb2937b9b6ffe04da4dbea3",
        "has_unassigned_field": false,
        "has_credit_card_number": false
      },
      {
        "id": "b6575aacaef143959ff08d9b9145229f0bcf308f",
        "roles": [
          "Signer 1"
        ],
        "thumbnail": {
          "large": "https://api.signnow-dev.xyz/document/b6575aacaef143959ff08d9b9145229f0bcf308f/thumbnail?size=large",
          "small": "https://api.signnow-dev.xyz/document/b6575aacaef143959ff08d9b9145229f0bcf308f/thumbnail?size=small",
          "medium": "https://api.signnow-dev.xyz/document/b6575aacaef143959ff08d9b9145229f0bcf308f/thumbnail?size=medium"
        },
        "document_name": "without fields",
        "origin_document_id": "bcb6496ffbbb43c5ba55d8bab5710d3c00477d62",
        "has_unassigned_field": false,
        "has_credit_card_number": false
      }
    ],
    "invite_id": null,
    "unique_id": "92679f664b4b4c0a85521337d70f0a94c7898285",
    "owner_email": "mila.s.nikitenko@gmail.com",
    "last_invite_id": null
  }
}
```

**Example** (`Successfully created Document Group`)

```json
{
  "data": {
    "name": "Sample group",
    "owner": {
      "id": "d6XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "email": "owner@email.com",
      "organization": {
        "id": null
      }
    },
    "state": "created",
    "created": 1675344851,
    "documents": [
      {
        "id": "0cXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        "roles": [],
        "thumbnail": {
          "large": "https://sample.com/thumbnail?size=large",
          "small": "https://sample.com/thumbnail?size=small",
          "medium": "https://sample.com/thumbnail?size=medium"
        },
        "document_name": "Sample document name 1",
        "origin_document_id": "99XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        "has_unassigned_field": false,
        "has_credit_card_number": false
      },
      {
        "id": "23XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        "roles": [],
        "thumbnail": {
          "large": "https://sample.com/thumbnail?size=large",
          "small": "https://sample.com/thumbnail?size=small",
          "medium": "https://sample.com/thumbnail?size=medium"
        },
        "document_name": "Sample document name 2",
        "origin_document_id": "b9XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        "has_unassigned_field": false,
        "has_credit_card_number": false
      },
      {
        "id": "b9XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        "roles": [],
        "thumbnail": {
          "large": "https://sample.com/thumbnail?size=large",
          "small": "https://sample.com/thumbnail?size=small",
          "medium": "https://sample.com/thumbnail?size=medium"
        },
        "document_name": "Sample document name 3",
        "origin_document_id": "72XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        "has_unassigned_field": false,
        "has_credit_card_number": false
      },
      {
        "id": "b6XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        "roles": [
          "Signer 1"
        ],
        "thumbnail": {
          "large": "https://sample.com/thumbnail?size=large",
          "small": "https://sample.com/thumbnail?size=small",
          "medium": "https://sample.com/thumbnail?size=medium"
        },
        "document_name": "Sample document name 4",
        "origin_document_id": "bcXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        "has_unassigned_field": false,
        "has_credit_card_number": false
      }
    ],
    "invite_id": null,
    "unique_id": "92XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "owner_email": "owner@email.com",
    "last_invite_id": null
  }
}
```

### 400

- Invalid token:
  - invalid token of user
  - expired token of user
  - empty header
  - authorization = null
  - authorization without value
- Invalid payload
- Incorrect folder_id property
- Incorrect client_timestamp property
- folder_id not found or deleted
- group_name property is empty
- Folder does not have enough permissions
- Folder does not exist
- Something happened during copying file
- User doesn't have rights to write into folder

**Example** (`Example 1`)

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

**Example** (`Invalid token`)

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

**Example** (`Invalid payload`)

```json
{
  "errors": [
    {
      "code": 65536,
      "message": "Invalid payload"
    }
  ]
}
```

**Example** (`Folder does not exist`)

```json
{
  "errors": [
    {
      "code": 13020002,
      "message": "Document folder is not found. Folder ID: `{folder_id}`."
    }
  ]
}
```

**Example** (`Error copying Template`)

```json
{
  "errors": [
    {
      "code": 13020007,
      "message": "Error Copying Template. ID: {document_id}. Error: {error}"
    }
  ]
}
```

**Example** (`Folder without permissions`)

```json
{
  "errors": [
    {
      "code": 13020003,
      "message": "Not enough permissions to add document group into the folder `{folder_id}`."
    }
  ]
}
```

**Example** (`Incorrect folder_id property`)

```json
{
  "errors": [
    {
      "code": 13020008,
      "message": "`folder_id` must be string"
    },
    {
      "code": 13020009,
      "message": "`folder_id` must match with pattern `[a-z0-9]{40}`"
    }
  ]
}
```

**Example** (`group_name property is empty`)

```json
{
  "errors": [
    {
      "code": 13020010,
      "message": "group_name property is empty"
    }
  ]
}
```

**Example** (`No rights to write into folder`)

```json
{
  "errors": [
    {
      "code": 13020003,
      "message": "Not enough permissions to add document group into the folder `{folder_id}`."
    }
  ]
}
```

**Example** (`folder_id not found or deleted`)

```json
{
  "errors": [
    {
      "code": 13020002,
      "message": "Document folder is not found. Folder ID: {folder_id}."
    }
  ]
}
```

**Example** (`Incorrect client_timestamp property`)

```json
{
  "errors": [
    {
      "code": 13020012,
      "message": "`client_timestamp` must be string"
    }
  ]
}
```

## 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/{unique_id}/document-group" \
  -H "Authorization: Bearer $SIGNNOW_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"folder_id": "ddXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "group_name": "Sample group", "client_timestamp": "4562325644"}'
```

---
*Full reference: https://docs.signnow.com/docs/document-group-template/operations/post-v2-document-group-templates-unique_id-document-group*
