---
title: "Create document group"
url: "https://docs.signnow.com/docs/document-group/operations/create-document-group"
type: "endpoint"
section: "document-group"
slug: "document-group/operations/create-document-group"
method: "POST"
path: "/documentgroup"
operation_id: "create-document-group"
authorization: "bearer"
---

# Create document group

`POST /documentgroup`

Creates a document group from a list of document ids

All documents:
* Must be owned by the person creating the document group.
* Cannot be templates.
* Cannot already be a part of another document group (delete document group first to add them).
* Cannot have active or fulfilled invites.

For more information, check out our video tutorial.

<details open>

**<summary>Video tutorial</summary>**

<sub><sup>Note: The design shown in the video is outdated, but the flow is still accurate. You can go ahead and follow the steps as demonstrated.</sup></sub>

[Video tutorial](https://www.youtube.com/watch?v=5WJYRz6Szk0)

</details>


## Authorization

bearer

## Request Body

**Schema**

```json
{
  "type": "object",
  "required": [
    "document_ids",
    "group_name"
  ],
  "properties": {
    "group_name": {
      "type": "string"
    },
    "document_ids": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  }
}
```

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

```json
{
  "group_name": "Document Group 1",
  "document_ids": [
    "cdXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "ddXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
  ]
}
```

## Responses

### 200

Document group successfully created.

**Example** (`Example 1`)

```json
{
  "id": "68XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}
```

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

```json
{
  "id": "68XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}
```

### 400

	
Request with incorrect authorization:

* incorrect token
* expired token
* empty authorization header
* authorization = null
* authorization header without value

Other errors:
* Incorrect payload
* Incorrect `document_ids` property
* `document_ids` array not containing documents
* Document not found
* Document not found or belongs to another user
* Document is a template
* Document already part of another document group
* Missing `group_name` property
* Document has active or fulfilled invites

**Example** (`Example 1`)

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

**Example** (`Incorrect token`)

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

**Example** (`Incorrect payload`)

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

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

```json
{
  "errors": [
    {
      "code": 65582,
      "message": "Document \"{document_id}\" could not be found, make sure the id is correct and the user owns the document"
    }
  ]
}
```

**Example** (`document_ids empty`)

```json
{
  "errors": [
    {
      "code": 65582,
      "message": "No documents provided"
    }
  ]
}
```

**Example** (`Document has invites`)

```json
{
  "errors": [
    {
      "code": 65582,
      "message": "Document {document_id} already has active or fulfilled invites."
    }
  ]
}
```

**Example** (`Document is template`)

```json
{
  "errors": [
    {
      "code": 65582,
      "message": "Document {template_id} is a template"
    }
  ]
}
```

**Example** (`Incorrect document_ids`)

```json
{
  "errors": [
    {
      "code": 65582,
      "message": "document_ids property is missing, empty, or not an array"
    }
  ]
}
```

**Example** (`Missing group_name property`)

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

**Example** (`Document is part of another document group`)

```json
{
  "errors": [
    {
      "code": 65582,
      "message": "Document {document_id} is already part of a document group"
    }
  ]
}
```

**Example** (`Document not found or belongs to another user`)

```json
{
  "errors": [
    {
      "code": 65582,
      "message": "Document \"{document_id}\" could not be found, make sure the id is correct and the user owns the document"
    }
  ]
}
```

## Code Examples

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

### cURL

```bash
curl -X POST \
  "https://api.signnow.com/documentgroup" \
  -H "Authorization: Bearer $SIGNNOW_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"group_name": "Document Group 1", "document_ids": ["cdXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "ddXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"]}'
```

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