# Webhooks

## Step-by-Step Guide

Use this guide to integrate external systems with Squarebox by sending data via Webhooks. Ideal for adding customers, leads, or updates directly from your CRM or database.

1. **Navigate to Integrations**

From your Squarebox dashboard, go to **Integrations** in the left sidebar.

<figure><img src="/files/RHCmdZT6n1PZqHBQRZ6C" alt=""><figcaption></figcaption></figure>

#### 2. Add a New Integration

Scroll down and click on **Add Integration**.\
Give your integration a meaningful name like `Add Customers`.

<figure><img src="/files/GcAHBmWzyihKwEr8P11k" alt=""><figcaption></figcaption></figure>

#### 3. Create Event

Click on **Create Events** under the integration.\
You can create multiple events based on the type of data you plan to send.

**Example Event:**

* **Event Name:** Add Customer Record
* **Description:** Add new customer data (optional)

<figure><img src="/files/VlbAihWwtc544Dr15l5Z" alt=""><figcaption></figcaption></figure>

#### 4. Define Sample Payload

Add a dummy JSON payload that shows the data structure you’ll send.

For example

{\
"name": "Rohit Sharma",\
"mobile": "+919898989898",\
"email": "<rohit@example.com>",\
"address": {\
"place": "Hyderabad"\
}\
}

#### 5. Map Fields

Map the keys from the JSON payload to your Squarebox fields.

* Keys from your JSON (like `name`, `mobile`, `email`) will appear on the **right**.
* Custom fields in Squarebox will be on the **left**.
* For nested fields like `address.place`, use `address.place` in mapping.

<figure><img src="/files/O88r05bCcN6okCZOvAXO" alt=""><figcaption></figcaption></figure>

#### 6. Finalize the Event

Click on **Create Event** after mapping the fields.\
Your event is now saved and ready to receive data.

#### 7. Get Webhook Endpoint

After creating the event, a **Webhook URL** will be generated.\
Copy this URL – this is where you’ll send your data.

***

#### 8. Send Data Using Postman or Backend

Send a POST request to the Webhook URL with:

* **Header:** `api-key: YOUR_API_KEY_HERE`
* **Body:** Raw JSON payload as shown above

**Postman Example:**

* Method: `POST`
* URL: Your Webhook Endpoint
* Headers:
  * `api-key`: (Get from Squarebox dashboard)
* Body:
  * Type: `raw`
  * Format: `JSON`
  * Content: your payload

On success, you’ll receive a `200 OK` response.

***

#### 9. Verify Customer Entry

After successful request:

* Go to **Customers** tab in Squarebox
* The newly added customer (e.g., Rohit Sharma) will appear instantly
* Status will be shown as **Success.**

{% embed url="<https://youtu.be/3DJyniYOcH8>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://squarebox-ai.gitbook.io/squarebox/integrations/webhooks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
