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

# Create webhook

> Create a webhook.

Webhooks are created for the specific client key you use when creating a webhook.

### Body parameters

<ParamField body="data" type="object" required>
  <Expandable title="child attribute">
    <ParamField body="action" type="string" required>
      Action type.
    </ParamField>

    <ParamField body="clientKey" type="string" required>
      Key of the client.
    </ParamField>

    <ParamField body="webhooks" type="array" required>
      Array of webhooks.

      <Expandable title="child attribute">
        <ParamField body="url" type="string" required>
          Webhook's endpoint.
        </ParamField>

        <ParamField body="created" type="boolean">
          Event to listen: `contract.created`.
        </ParamField>

        <ParamField body="seen" type="boolean">
          Event to listen: `contract.seen`.
        </ParamField>

        <ParamField body="sent" type="boolean">
          Event to listen: `contract.sent`.
        </ParamField>

        <ParamField body="approved" type="boolean">
          Event to listen: `contract.approved`.
        </ParamField>

        <ParamField body="signed" type="boolean">
          Event to listen: `contract.signed`.
        </ParamField>

        <ParamField body="fullySigned" type="boolean">
          Event to listen: `contract.fully_signed`.
        </ParamField>
      </Expandable>
    </ParamField>
  </Expandable>
</ParamField>

### Response

<ResponseField name="webhooks" type="string">
  Array of webhooks.

  <Expandable title="child attribute">
    <ResponseField name="createTime" type="string">
      Create time.
    </ResponseField>

    <ResponseField name="url" type="string">
      Webhook's endpoint.
    </ResponseField>

    <ResponseField name="secret" type="string">
      Webhook's secret.
    </ResponseField>

    <ResponseField name="webhookKey" type="string">
      Webhook's key.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="code" type="string">
  The code of the answer.
</ResponseField>

<ResponseField name="message" type="string">
  The message of the answer.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST 'https://api.sendforsign.com/api/webhook' \
       -H 'X-Sendforsign-Key: YOUR_API_KEY' \
       -H 'Content-Type: application/json' \
       -d '{
      "data": {
          "action": "create",
          "clientKey": "YOUR_CLIENT_KEY",
          "webhooks": [
              {
                  "url": "URL",
                  "created": true,
                  "seen": true,
                  "sent": false,
                  "approved": false,
                  "signed": false,
                  "fullySigned": true
              }
          ]
      }
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
      "webhooks": [
          {
              "createTime": "2024-04-08T08:58:54.000Z",
              "url": "testurl1",
              "secret": "whsec_123",
              "webhookKey": "WEBHOOK_KEY"
          }
      ],
      "code": "201",
      "message": "Webhooks created"
  }
  ```
</ResponseExample>
