---
title: "Generate document from URL"
url: "https://docs.signnow.com/docs/document-generation/operations/post-v2-document-generations-url"
type: "endpoint"
section: "document-generation"
slug: "document-generation/operations/post-v2-document-generations-url"
method: "POST"
path: "/v2/document-generations/url"
operation_id: "post-v2-document-generations-url"
authorization: "bearer"
---

# Generate document from URL

`POST /v2/document-generations/url`

This endpoint allows API users to generate a PDF document by providing a publicly accessible URL to a `.docx` file with tags.

> In development mode, downloaded generated documents will include a watermark.

Learn more about [document generation](/docs/document-generations).

## Authorization

bearer

## Request Body

**Schema**

```json
{
  "type": "object",
  "required": [
    "docx_url",
    "data"
  ],
  "properties": {
    "data": {
      "type": "object",
      "example": {
        "Products": [
          {
            "ItemName": "T-shirt",
            "ItemPrice": "8",
            "ItemQuantity": "10"
          },
          {
            "ItemName": "Belt",
            "ItemPrice": "4",
            "ItemQuantity": "5"
          },
          {
            "ItemName": "Dress",
            "ItemPrice": "20",
            "ItemQuantity": "2"
          }
        ]
      },
      "description": "An object containing variable mappings. Keys correspond to tag names in the `.docx` template; values are the pre-filled text for each tag. Supports arrays of objects for repeating sections (e.g., tables, lists)."
    },
    "docx_url": {
      "type": "string",
      "example": "https://example.com/template.docx",
      "description": "Publicly accessible URL to the `.docx` file."
    },
    "single_document": {
      "type": "boolean",
      "default": false,
      "description": "If `true`, a single document is generated. If `false`, a document group is generated."
    }
  },
  "x-examples": {
    "Request example for generating a document with a Products table": {
      "data": {
        "Products": [
          {
            "ItemName": "T-shirt",
            "ItemPrice": "8",
            "ItemQuantity": "10"
          },
          {
            "ItemName": "Belt",
            "ItemPrice": "4",
            "ItemQuantity": "5"
          },
          {
            "ItemName": "Dress",
            "ItemPrice": "20",
            "ItemQuantity": "2"
          }
        ]
      },
      "docx_url": "https://example.com/template.docx",
      "single_document": true
    }
  }
}
```

**Example** (`Request example for generating a document with a Products table`)

```json
{
  "data": {
    "Products": [
      {
        "ItemName": "T-shirt",
        "ItemPrice": "8",
        "ItemQuantity": "10"
      },
      {
        "ItemName": "Belt",
        "ItemPrice": "4",
        "ItemQuantity": "5"
      },
      {
        "ItemName": "Dress",
        "ItemPrice": "20",
        "ItemQuantity": "2"
      }
    ]
  },
  "docx_url": "https://example.com/template.docx",
  "single_document": true
}
```

## Responses

### 200

Success

**Example** (`Success`)

```json
{
  "data": {
    "status": "in_progress",
    "process_id": "348bf62a-1c97-11f1-a071-5a78fa528452"
  }
}
```

### 400

* `docx_url` is not a valid URL.
* `docx_url` is an empty string.
* `data` is empty.
* `single_document` is not a boolean.

**Example** (`Empty data`)

```json
{
  "errors": [
    {
      "code": 21008003,
      "message": "The `data` field must not be empty."
    }
  ]
}
```

**Example** (`Empty docx_url`)

```json
{
  "errors": [
    {
      "code": 21008002,
      "message": "The `docx_url` field must not be empty."
    }
  ]
}
```

**Example** (`docx_url is not a valid URL`)

```json
{
  "errors": [
    {
      "code": 21008001,
      "message": "The `docx_url` must be a valid URL."
    }
  ]
}
```

**Example** (`single_document is not a boolean`)

```json
{
  "errors": [
    {
      "code": 21008008,
      "message": "The `single_document` field must be a boolean."
    }
  ]
}
```

## Code Examples

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

### cURL

```bash
curl -X POST \
  "https://api.signnow.com/v2/document-generations/url" \
  -H "Authorization: Bearer $SIGNNOW_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"data": {"Products": [{"ItemName": "T-shirt", "ItemPrice": "8", "ItemQuantity": "10"}, {"ItemName": "Belt", "ItemPrice": "4", "ItemQuantity": "5"}, {"ItemName": "Dress", "ItemPrice": "20", "ItemQuantity": "2"}]}, "docx_url": "https://example.com/template.docx", "single_document": true}'
```

---
*Full reference: https://docs.signnow.com/docs/document-generation/operations/post-v2-document-generations-url*
