---
title: "Edit doc group template"
url: "https://docs.signnow.com/docs/document-group-template/operations/patch-v2-document-group-templates-doc_group_template_id"
type: "endpoint"
section: "document-group-template"
slug: "document-group-template/operations/patch-v2-document-group-templates-doc_group_template_id"
method: "PATCH"
path: "/v2/document-group-templates/{doc_group_template_id}"
operation_id: "patch-v2-document-group-templates-doc_group_template_id"
authorization: "bearer"
---

# Edit doc group template

`PATCH /v2/document-group-templates/{doc_group_template_id}`

This endpoint allows users to reorder documents, rename the document group template, and update the action performed upon completion of the document group template.

## Authorization

bearer

## Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `doc_group_template_id` | string | Yes | ID of the document group template. |

## Request Body

**Schema**

```json
{
  "type": "object",
  "properties": {
    "order": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "List of document IDs in the document group template."
    },
    "template_group_name": {
      "type": "string",
      "example": "HR documents",
      "description": "Name of the document group template."
    },
    "email_action_on_complete": {
      "type": "string",
      "example": "documents_and_attachments",
      "description": "Specifies the action to be taken upon invite completion. Allowed values: `documents_and_attachments`: Email documents and attachments to all parties. `documents_and_attachments_only_to_recipients`: Email documents and attachments only to recipients. `without_documents_and_attachments`: Do not email documents or any attachments."
    }
  },
  "x-examples": {
    "Example 1": {
      "order": [
        "ffa1e7109013c26d5a706d34a9d0ad598f95afa1",
        "06d34a9d0ad598f95afa1ffa1e7109013c26d5a7"
      ],
      "template_group_name": "Document group template name",
      "email_action_on_complete": "documents_and_attachments"
    }
  }
}
```

**Example** (`Example 1`)

```json
{
  "order": [
    "ffa1e7109013c26d5a706d34a9d0ad598f95afa1",
    "06d34a9d0ad598f95afa1ffa1e7109013c26d5a7"
  ],
  "template_group_name": "Document group template name",
  "email_action_on_complete": "documents_and_attachments"
}
```

## Responses

### 204

Success.

### 400

**Authorization errors**

**Validation errors:**
- `order` type is incorrect.
- Document IDs are not unique.
- Document ID type is incorrect.
- Document ID is incorrect.
- `template_group_name` type is incorrect.
- `template_group_name` has unsupported symbols.
- `template_group_name` is too long. Max length is 255 symbols.
- `email_action_on_complete` value type is incorrect.
-  `email_action_on_complete` is incorrect. 

**Example** (`Example 1`)

```json
{
  "errors": [
    {
      "code": 13022003,
      "message": "The order field must be an array"
    }
  ]
}
```

**Example** (`DGT name too long`)

```json
{
  "code": 13022009,
  "message": "Incorrect Length of document group template name"
}
```

**Example** (`Authorization error`)

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

**Example** (`Document ID incorrect`)

```json
{
  "errors": [
    {
      "code": 13022006,
      "message": "The order array must include valid unique document ids"
    }
  ]
}
```

**Example** (`Document IDs not unique`)

```json
{
  "errors": [
    {
      "code": 13022004,
      "message": "The order array must include unique document ids"
    }
  ]
}
```

**Example** (`Order type is incorrect`)

```json
{
  "errors": [
    {
      "code": 13022003,
      "message": "The order field must be an array"
    }
  ]
}
```

**Example** (`DGT name type is incorrect`)

```json
{
  "code": 13022007,
  "message": "Incorrect type of document group template name"
}
```

**Example** (`Document ID type incorrect`)

```json
{
  "errors": [
    {
      "code": 13022005,
      "message": "The order array must include string type of document ids"
    }
  ]
}
```

**Example** (`DGT name has unsupported symbols`)

```json
{
  "code": 13022008,
  "message": "Incorrect document group template name"
}
```

**Example** (`email_action_on_complete is incorrect`)

```json
{
  "code": 13022014,
  "message": "The email_action_on_complete value you selected is not a valid choice."
}
```

**Example** (`email_action_on_complete type is incorrect`)

```json
{
  "code": 13022013,
  "message": "Incorrect type of document group template email_action_on_complete"
}
```

### 403

Access to document group template denied.

**Example** (`Example 1`)

```json
{
  "errors": [
    {
      "code": 13022001,
      "message": "Access to DocumentGroupTemplate is denied"
    }
  ]
}
```

**Example** (`Access denied`)

```json
{
  "errors": [
    {
      "code": 13022001,
      "message": "Access to DocumentGroupTemplate is denied"
    }
  ]
}
```

### 404

`doc_group_template_id` is incorrect.

**Example** (`Example 1`)

```json
{
  "404": "Unable to find a route to match the URI: v2/document-group-templates/1d33671c3c8741ce9dbbd8e106f3a6bb2842b4f"
}
```

**Example** (`DGT id is incorrect`)

```json
{
  "404": "Unable to find a route to match the URI: v2/document-group-templates/1d33671c3c8741ce9dbbd8e106f3a6bb284XXXX"
}
```

### 422

Payload documents do not match the document group template.

**Example** (`Example 1`)

```json
{
  "errors": [
    {
      "code": 13022002,
      "message": "Documents in order are not equal to existing documents in DocumentGroupTemplate"
    }
  ]
}
```

**Example** (`Documents do not match DGT`)

```json
{
  "errors": [
    {
      "code": 13022002,
      "message": "Documents in order are not equal to existing documents in DocumentGroupTemplate"
    }
  ]
}
```

## Code Examples

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

### cURL

```bash
curl -X PATCH \
  "https://api.signnow.com/v2/document-group-templates/{doc_group_template_id}" \
  -H "Authorization: Bearer $SIGNNOW_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"order": ["ffa1e7109013c26d5a706d34a9d0ad598f95afa1", "06d34a9d0ad598f95afa1ffa1e7109013c26d5a7"], "template_group_name": "Document group template name", "email_action_on_complete": "documents_and_attachments"}'
```

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