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

# AI+API

> Generate agreements with human language.

<Note>This feature is currently in open beta.</Note>

### Concept

We provide our users with the ability to simplify the API request structure, sending unified requests
to Sendforsign's infrastructure and receiving unified responses.

Supported use cases:

* `Create a contract in free format`: Ask the system to generate a contract using your context and best practices. Optionally, specify the recipients' names and email addresses.
* `Create a contract from a template`: Ask the system to generate a contract using a template. Specify the name of the template.
* `Create and fill in a contract from a template`: Provide the template name, the recipients' names and email addresses, and the data to populate the placeholders.
* `See the list of templates`: Retrieve a list of templates created in your account.
* `See the list of template placeholders`: Retrieve a list of placeholders of a template. Specify the name of the template.

### Headers

<ParamField header="clientKey" type="string" required>
  Your clientKey.
</ParamField>

<ParamField header="secretKey" type="string" required>
  Your secretKey.
</ParamField>

### Body parameters

<ParamField body="message" type="string" required>
  Your message.
</ParamField>

### Response

<ResponseField name="output" type="string">
  The response message.
</ResponseField>

<ResponseField name="contractKey" type="string">
  If the system creates a contract, the contractKey will be returned.
</ResponseField>

<ResponseField name="previewURL" type="string">
  If the system creates a contract, a previewURL will be returned. This URL is valid for 30 minutes and is intended for preview purposes only.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST 'https://aiapi.sendforsign.com/webhook/aiapi' \
       -H 'X-Sendforsign-Key: YOUR_API_KEY' \
       -H 'clientKey: YOUR_CLIENT_KEY' \
       -H 'secretKey: YOUR_SECRET_KEY' \
       -H 'Content-Type: application/json' \
       -d '{
      "message": "hello world"
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
      "output": "Hey how are you?",
      "contract": {
        "contractKey": "CONTRACT_KEY",
        "previewURL": "URL",
      }
      "code": "201",
      "message": "Contract created"
  }
  ```
</ResponseExample>
