# Website

## Webhook Integration Documentation

### Endpoint

**URL:**\
`https://api-v2.ledsak.ai/api/webhook/website/webhook`

**Request Method:**\
`POST`

### Description

This endpoint is used to send a webhook to a website. It requires a raw JSON request body containing client information, source details, branch location, and lead details.

***

### Request Format

#### **Headers**

Ensure the request contains the appropriate headers, such as:

```json
jsonCopy codeContent-Type: application/json
```

#### **Request Body**

The request body must be in JSON format and include the following fields:

| Field          | Type   | Description                                                                         |
| -------------- | ------ | ----------------------------------------------------------------------------------- |
| `client`       | string | The client associated with the webhook.  ([Find Client ID](#user-content-fn-1)[^1]) |
| `source`       | string | The source of the webhook.                                                          |
| `branch`       | string | Name of the branch location.                                                        |
| `lead_details` | array  | An array containing details about the lead. Each object in the array must include:  |

#### Client ID:

1. Go to Integrations
2. Click on Website View
3. See the Client Credentials: (Client id)

<figure><img src="https://3118056440-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fpwcj37nddkx6Z2kwcz8i%2Fuploads%2FO3AR1XLj6wnj451uA6qa%2FIntegrations%20(1).png?alt=media&#x26;token=957b5d95-6379-4da9-86d2-ff0523b97e56" alt=""><figcaption><p>Click on Website Leads view.</p></figcaption></figure>

#### Source:

<figure><img src="https://3118056440-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fpwcj37nddkx6Z2kwcz8i%2Fuploads%2Fzg1KLEJE6ze9dpk5wojr%2FLead%20Settings.png?alt=media&#x26;token=d046b13e-6fd3-4a2b-b034-47742275456e" alt=""><figcaption><p>Lead Source</p></figcaption></figure>

#### Branch:

<figure><img src="https://3118056440-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fpwcj37nddkx6Z2kwcz8i%2Fuploads%2FIHfmJ2aSXaKIj8qbtL7v%2FLead%20Settings%20(1).png?alt=media&#x26;token=c0c767b4-bdd6-48b9-b053-77c00ed7d1d0" alt=""><figcaption><p>Branch List</p></figcaption></figure>

#### Lead Details:

* `lead_field` (string): The name of the lead field.
* `lead_value` (string): The corresponding value for the lead field.

#### **Example Request Body**

{% code title="jsonCopy code" %}
```json
{
  "client": "example_client",
  "source": "website",
  "branch": "Main Branch",
  "lead_details": [
    {
      "lead_field": "name",
      "lead_value": "John Doe"
    },
    {
      "lead_field": "email",
      "lead_value": "johndoe@example.com"
    }
  ]
}
```
{% endcode %}

***

### Response

#### **Status Code**

`200 OK`

### Created Lead Succesfull

```json
{
  "message": "Successfully created",
  "lead_id": "6645f7c17aff889d10509de5"
}
```

[^1]: Go to Client ID
