> ## 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 contract

> Create a new contract from HTML text with the Sendforsign API and get a contract key to share, sign or update it.

### 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 contract. If not specified, the default user credentials will be used.

**contract** `object` *required*

Contract structure.

**child attribute**

**name** `string`

Name of the contract.

**value** `string`

Content of the contract, use HTML.

### Response

**contract** `string`

Contract structure.

**child attribute**

**createTime** `string`

Create time.

**contractKey** `string`

ID of the contract.

**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/contract' \
     -H 'X-Sendforsign-Key: YOUR_API_KEY' \
     -H 'Content-Type: application/json' \
     -d '{ 
		  "data": {
				   "action": "create",
				   "clientKey": "YOUR_CLIENT_KEY",
                   "userKey": "USER_KEY", 
				   "contract": {
							  "name": "New contract",
							  "value": "<p>Contract text</p>"
						     }
				  }
       }'
```

```json Response theme={null}
     {
       "contract": {
                "createTime": "2023-12-01 12:18:55",
                "contractKey": "CONTRACT_KEY"
                 },
       "code": "201",
       "message": "Contract created"
    }
```


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