> ## Documentation Index
> Fetch the complete documentation index at: https://sendforsign.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create and fill in template

> Create a contract template and add its placeholders in a single Sendforsign API request.

Using this way, you can create a template and define all placeholders
with their names and values in a single API call.

### Body parameters

**data** `object` *required*

**child attribute**

**action** `string` *required*

Action type.

**clientKey** `string` *required*

Key of the client.

**userKey** `string`

ID of the user who create the template. If not specified, the default user credentials will be used.

**template** `object` *required*

Template structure.

**child attribute**

**name** `string`

Name of the template.

**value** `string`

Content of the template, use HTML.

**placeholders** `array`

Array of placeholders, optional.

**child attribute**

**name** `string`

Name of the placeholder.

**value** `string`

Value of the placeholder.

### Response

**template** `string`

Template structure.

**child attribute**

**createTime** `string`

Create time.

**templateKey** `string`

ID of the template.

**code** `string`

The code of the answer.

**message** `string`

The message of the answer.

```bash cURL theme={null}
curl -X POST 'https://api.sendforsign.com/api/template' \
     -H 'X-Sendforsign-Key: YOUR_API_KEY' \
     -H 'Content-Type: application/json' \
     -d '{
    "data": {
        "action": "create",
        "clientKey": "YOUR_CLIENT_KEY",
        "userKey": "USER_KEY",
        "template": {
            "name": "New template",
            "value": "<p>Template text</p>"
        },
        "placeholders": [
            {
                "name": "Company Name",
                "value": "Acme Inc."
            },
            {
                "name": "Contract Date",
                "value": "2024-01-15"
            }
        ]
    }
}'
```

```json Response theme={null}
     {
       "template": {
                "createTime": "2023-12-01 12:18:55",
                "templateKey": "TEMPLATE_KEY"
                 },
       "code": "201",
       "message": "Template created"
    }
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.