---
title: "Create link for doc group"
url: "https://docs.signnow.com/docs/embedded-editor/operations/post-v2-document-groups-document_group_id-embedded-editor"
type: "endpoint"
section: "embedded-editor"
slug: "embedded-editor/operations/post-v2-document-groups-document_group_id-embedded-editor"
method: "POST"
path: "/v2/document-groups/{document_group_id}/embedded-editor"
operation_id: "post-v2-document-groups-document_group_id-embedded-editor"
authorization: "bearer"
---

# Create link for doc group

`POST /v2/document-groups/{document_group_id}/embedded-editor`

This endpoint allows API users to generate a link to embed the SignNow editor into their app, allowing their customers to edit documents without sending them for signing.

To generate an embedded editor link, make sure that:

- the document group has not been sent for signing or signed.
- the document group is not deleted or archived.

## Authorization

bearer

## Path Parameters

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

## Header Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Content-Type` | string | No | application/json |

## Request Body

**Schema**

```json
{
  "type": "object",
  "properties": {
    "redirect_uri": {
      "type": "string",
      "description": "Optional: link that opens after the user has completed editing the document group."
    },
    "link_expiration": {
      "type": "integer",
      "description": "15 minutes by default. Can be set max to 43200 minutes by a user with Admin level of access."
    },
    "redirect_target": {
      "type": "string",
      "description": "Determines whether to open the redirect link in the new tab in the browser, or in the same tab after the signing session. Possible values: `blank` - opens the link in the new tab, `self` - opens the link in the same tab, default value.",
      "x-stoplight": {
        "id": "oc6q4mzzu5cun"
      }
    }
  },
  "x-examples": {
    "Example 1": {
      "redirect_uri": "{some_valid_url}",
      "link_expiration": 15,
      "redirect_target": "blank"
    }
  }
}
```

**Example** (`Example 1`)

```json
{
  "redirect_uri": "{some_valid_url}",
  "link_expiration": 15,
  "redirect_target": "blank"
}
```

## Responses

### 200

Success

**Example** (`Success`)

```json
{
  "data": {
    "url": "https://example.com/documentgroup/60XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/edit?access_token={{access_token}}&redirect_uri=https%3A%2F%2Fwww.redirect.com%2F&embedded=1&redirect_target=blank"
  }
}
```

### 400

* Incorrect or missing token.
* Document group was already sent.
* Document group not found.

**Validation errors:**

* `redirect_uri` is not a string.
* Empty `redirect_uri`.
* `redirect_uri` is longer than 2048 characters.
* `redirect_uri` is not a correct URL.
* `link_expiration` is not an integer.
* `link_expiration` must be between 15 and 45.
* Custom `link_expiration` is more than 43200 minutes.
* `redirect_target` is not a string.
* Incorrect `redirect_target`. Allowed values: `self`, `blank`.
* `redirect_uri` is required if `redirect_target` is added.


**Example** (`Empty redirect_uri`)

```json
{
  "errors": [
    {
      "code": 19046002,
      "message": "Parameter `redirect_uri` must not be an empty string."
    }
  ]
}
```

**Example** (`Missing redirect_uri`)

```json
{
  "errors": [
    {
      "code": 19046009,
      "message": "The `redirect_uri` field is required when `redirect_target` is added."
    }
  ]
}
```

**Example** (`redirect_uri too long`)

```json
{
  "errors": [
    {
      "code": 19046003,
      "message": "Parameter `redirect_uri` must not exceed 2048 characters."
    }
  ]
}
```

**Example** (`redirect_uri not a URL`)

```json
{
  "errors": [
    {
      "code": 19046004,
      "message": "Parameter `redirect_uri` must be a valid URL."
    }
  ]
}
```

**Example** (`link_expiration too big`)

```json
{
  "errors": [
    {
      "code": 19049001,
      "message": "The link expiration should be less than or equal to 45 minutes."
    }
  ]
}
```

**Example** (`redirect_uri not string`)

```json
{
  "errors": [
    {
      "code": 19046001,
      "message": "Parameter `redirect_uri` must be a string."
    }
  ]
}
```

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

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

**Example** (`Incorrect redirect_target`)

```json
{
  "errors": [
    {
      "code": 19046008,
      "message": "The `redirect_target` field is invalid, allowed values: self, blank."
    }
  ]
}
```

**Example** (`Incorrect or missing token`)

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

**Example** (`link_expiration too little`)

```json
{
  "errors": [
    {
      "code": 19046006,
      "message": "The link expiration should be greater than or equal to 15 minutes."
    }
  ]
}
```

**Example** (`redirect_target not string`)

```json
{
  "errors": [
    {
      "code": 19046007,
      "message": "The `redirect_target` field must be a string."
    }
  ]
}
```

**Example** (`link_expiration not integer`)

```json
{
  "errors": [
    {
      "code": 19046005,
      "message": "The link expiration value should be of type int."
    }
  ]
}
```

**Example** (`Custom link_expiration too big`)

```json
{
  "errors": [
    {
      "code": 19049001,
      "message": "The link expiration should be less than or equal to 43200 minutes."
    }
  ]
}
```

**Example** (`Document group was already sent`)

```json
{
  "errors": [
    {
      "code": 19001036,
      "message": "An invite already exists for this document group."
    }
  ]
}
```

### 403

User doesn't own the document group

**Example** (`User doesn't own the document group`)

```json
{
  "code": 19001010,
  "message": "Current user is not document group owner."
}
```

## Code Examples

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

### cURL

```bash
curl -X POST \
  "https://api.signnow.com/v2/document-groups/{document_group_id}/embedded-editor" \
  -H "Authorization: Bearer $SIGNNOW_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"redirect_uri": "{some_valid_url}", "link_expiration": 15, "redirect_target": "blank"}'
```

---
*Full reference: https://docs.signnow.com/docs/embedded-editor/operations/post-v2-document-groups-document_group_id-embedded-editor*
