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

# Create link for doc group

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

This endpoint allows users to create a link for embedded document group sending. 

Add the `type` attribute to the payload to specify the sending step at which the embedded link should open and to control what actions the sender can perform. 
- `manage`: The link opens on the **Add documents to document group page** (default).
- `edit`: The link opens in the editor, allowing the sender to add fields and send the invite.
- `send-invite`: The link opens on the **Send Invite** page.

Use the request body attributes to configure redirect options, specify link expiration, and customize the sender’s email and name appearance.

For more information, see [Embedded sending guide](/docs/guides-embedded-sending).


## Authorization

bearer

## Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `document_group_id` | string | Yes |  ID of the requested document group. |

## Request Body

**Schema**

```json
{
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "default": "manage",
      "description": "Specifies the sending step at which the embedded link should open: `manage` \u2014 opens the link on the Add documents to document group page (default); `edit`\u2014 opens the link in the editor; `send-invite` \u2014 opens the link on the Send Invite page.",
      "x-stoplight": {
        "id": "00nqby7r7jx1i"
      }
    },
    "from_name": {
      "type": "string",
      "example": "Anna Green",
      "maxLength": 300,
      "description": "Use this attribute to customize the name that appears: 1) on the Send Invite page (From, Invite Email Subject, and Invite Email Message); 2) in the invite and reassign emails: in email subject and email body; 3) in the signing session: as the name in From in the header and on the detailed From card."
    },
    "from_email": {
      "type": "string",
      "example": "sender@email.com",
      "maxLength": 255,
      "description": "Use this attribute to customize the email address that appears: 1) [part before @]on the Send Invite page (From, Invite Email Subject, and Invite Email Message) 2) in the invite and reassign emails: [part before @] in email subject and email body; when clicking Contact Sender and in Reply-to; 3) in the signing session: as the email in From in the header and on the detailed From card; when clicking Contact Sender in the More Actions menu and on the detailed From card."
    },
    "redirect_uri": {
      "type": "string",
      "example": "https://www.signnow.com/",
      "minLength": 1,
      "description": "The page that opens after embedded sending has been set up. Required if `redirect_target` is added."
    },
    "link_expiration": {
      "type": "integer",
      "default": 15,
      "maximum": 45,
      "minimum": 15,
      "description": "Specifies how many minutes the link remains active. The allowed range is 15 to 45 minutes."
    },
    "redirect_target": {
      "type": "string",
      "description": "Determines whether to open the redirect link in a new tab in the browser or in the same tab. Possible values: `blank` - opens the link in a new tab, `self` - opens the link in the same tab (default).",
      "x-stoplight": {
        "id": "d2unhtkuqshu0"
      }
    }
  },
  "x-examples": {
    "example-1": {
      "redirect_uri": "https://your.redirect.uri.com"
    }
  }
}
```

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

```json
{
  "type": "edit",
  "from_name": "Jane Doe",
  "from_email": "sender@email.com",
  "redirect_uri": "https://example.com",
  "link_expiration": 25,
  "redirect_target": "blank"
}
```

## Responses

### 200

Returns the link for embedded sending.


**Example** (`Success`)

```json
{
  "data": [
    {
      "url": "http://example.com/webapp/documentgroup/42XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/setup_invite?access_token={{access_token}}&redirect_uri=http%3A%2F%2Fyour.redirect.uri.com&redirect_target=blank"
    }
  ]
}
```

### 400

* Incorrect or missing token.
* Incorrect payload.

**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.
* UTF 4-byte characters in `redirect_uri` are not supported.
* `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.
* The `type` is not a string.
* The `type` value is incorrect.

**Example** (`Incorrect payload`)

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

**Example** (`type not a string`)

```json
{
  "code": 19043011,
  "message": "The type value must be of type string."
}
```

**Example** (`Empty redirect_uri`)

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

**Example** (`Missing redirect_uri`)

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

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

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

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

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

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

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

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

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

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

```json
{
  "code": 19043012,
  "message": "The `type` value is invalid, allowed values: \"manage\", \"edit\", \"send-invite\"."
}
```

**Example** (`Incorrect redirect_target`)

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

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

```json
{
  "errors": [
    {
      "code": 1537,
      "message": "Invalid token"
    }
  ]
}
```

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

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

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

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

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

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

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

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

**Example** (`4-byte characters in redirect_uri`)

```json
{
  "errors": [
    {
      "code": 19043002,
      "message": "4-byte characters in `redirect_uri` are not supported."
    }
  ]
}
```

### 403

The user does not own the document group.

**Example** (`Example 1`)

```json
{
  "errors": [
    {
      "code": 19001002,
      "message": "User is not document owner."
    }
  ]
}
```

**Example** (`User is not owner`)

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

### 404

Document group is not found.

**Example** (`Example 1`)

```json
{
  "errors": [
    {
      "code": 19002001,
      "message": "Document not found"
    }
  ]
}
```

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

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

## 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-sending" \
  -H "Authorization: Bearer $SIGNNOW_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"type": "edit", "from_name": "Jane Doe", "from_email": "sender@email.com", "redirect_uri": "https://example.com", "link_expiration": 25, "redirect_target": "blank"}'
```

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