---
updatedAt: 2026-07-20T16:59:02.000Z
agentTools:
  projectIndex: https://developers.signwell.com/llms.txt
---

# Create a Document

Let's create a document to embed on our website. You can use any document as long as it has `embedded_signing` set to `true`.

<Callout icon="📘" theme="info">
  ###

  Any of these API endpoints will work with embedding:

  - [Create Document](https://developers.signwell.com/reference/createdocument)
  - [Create Document from Template](https://developers.signwell.com/reference/createdocumentfromtemplate)
  - [Update and Send Document](https://developers.signwell.com/reference/senddocument)
</Callout>

The example below is using *Create Document from Template*. (You can get the ID for any template from the URL when you view that template in the SignWell web app.)

```curl
curl --location --request POST 'https://www.signwell.com/api/v1/document_templates/documents/' \
--header 'X-Api-Key: [your api key]' \
--header 'Content-Type: application/json' \
--data-raw '{
	"test_mode" : true,
    "template_id": "[your template id]", 
    "embedded_signing": true,
    "recipients": [
        {
            "id": "1",
            "placeholder_name": "Contractor",
            "name": "Jeremy Neeson",
            "email": "person@email.com"
        }
        
    ]
}'
```
```ruby
document_response = HTTParty.post(
        "https://www.signwell.com/api/v1/document_templates/documents/",
        headers: {
            "Content-Type": "application/json",
            "X-Api-Key": "[your api key]"
        },
        body: { 
            "test_mode": true, #test mode is true for testing
            "template_id": "[your template id]",
            "embedded_signing": true,
            "recipients": [
            {
              "id": "1",
              "placeholder_name": "Contractor",
              "name": "Jeremy Neeson",
              "email": "person@email.com"
            }
            ]
        }.to_json
    )

@embedded_signing_url = document_response['recipients'].first['embedded_signing_url']
```

If you did everything right, you'll get a 200 response with your document details, including the `embedded_signing_url`.

```json 200 OK
{
  "id": "c4e4dbd4-4594-43b3-87b0-0b62b10b656b",
  "apply_signing_order": false,
  "archived": false,
  "recipients" : [
    {
      "id": "1",
      "email": "preston_olson@leannon.com",
      "name": "Preston Olson",
      "embedded_signing_url": "https://www.signwell.com/docs/e600d68a2b/"
    }
   ]
}
```

<br />