# How to use/create Webhook

The "Webhook" feature in Agency Handy allows users to set up automatic notifications and data transfers to other systems when specific events occur within the platform.&#x20;

This integration is particularly useful for automating workflows, keeping systems synchronized, and triggering actions in external applications.

### **Pre-conditions**

* **User Permissions:** Ensure you have the necessary permissions to configure webhooks.
* **Endpoint URL:** Obtain the URL of the external system where you want to send the webhook data. Endpoint URL should be a POST URL.
* **Content-Type:** Determine the content type the external system requires (usually JSON).



### **Steps to Use**

1. **Log in to Your Account**
   * Access your Agency Handy account using your credentials.\

2.  **Navigate to Webhook Settings**

    *   From the Dashboard, Select “Integrations” => " Webhooks Management "\


        <figure><img src="https://842362573-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiedbxyF6rrnGBuHuFME1%2Fuploads%2F4oujYjLHNSd0v8ePkpN8%2FScreenshot_138.png?alt=media&#x26;token=75b7acc3-fb9c-4229-b1f2-fc804d00ea1d" alt=""><figcaption></figcaption></figure>


3.  **Authenticate**

    * Click the “Management” button to authenticate the token..

    <figure><img src="https://842362573-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiedbxyF6rrnGBuHuFME1%2Fuploads%2FXMazEObsKkojqL1xHtUf%2FScreenshot_139.png?alt=media&#x26;token=1dfc4278-f51c-43a4-9a44-9e68282489f9" alt=""><figcaption></figcaption></figure>
4.  **Create a New Webhook**

    * Click the “Create New Webhook” button to set up a new webhook.

    <figure><img src="https://842362573-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiedbxyF6rrnGBuHuFME1%2Fuploads%2FIS1sFlUS37vsN91NgxfZ%2FScreenshot_130.png?alt=media&#x26;token=6ab6c6d4-ed83-41d8-952f-3cda28da7282" alt=""><figcaption></figcaption></figure>
5. **Enter Endpoint URL**
   * In the “Endpoint URL” field, enter the URL of the external system where you want to send the webhook data.\

6. **Select Content Type**
   * Choose “JSON” as the content type for the webhook payload.\

7. **Select Webhook Events**
   * Choose the specific events in Agency Handy that will trigger the webhook. These can include:
     * **Service:** Creation, Update, Deletion
     * **Order:** Creation, Update, Deletion
     * **Task:** Creation, Assigned, Completion, Update
     * **Invoice:** Status change
     * **Client/User:** New client added/created, Deletion
     * **Proposal:** Sent, Received, Accepted, Rejected
     * **Ticket:** Created, Assigned to, Status change
     * **Payment:** Received, Failed
     * **Service Package:** Creation, Update, Deletion\

8. **Configure Event Triggers**
   * Identify and select key events within Agency Handy that will trigger the webhook. For example:
     * **Service Events:** When a service is created, updated, or deleted.
     * **Order Events:** When an order is created, updated, or deleted.
     * **Task Events:** When a task is created, assigned, completed, or updated.
     * **Invoice Events:** When the status of an invoice changes.
     * **Client/User Events:** When a new client is added, or a client/user is deleted.
     * **Proposal Events:** When a proposal is sent, received, accepted, or rejected.
     * **Ticket Events:** When a ticket is created, assigned, or its status changes.
     * **Payment Events:** When a payment is received or fails.
     * **Service Package Events:** When a service package is created, updated, or deleted.\

9. **Activate the Webhook**
   * When Webhook is active, data will be sent for the selected events.
   * Activate the radio button.\

10. **Save the Webhook Configuration**

    * Review the webhook configuration to ensure all details are correct.
    * Click “Save” to finalize and activate the webhook.
    * Review the webhook configuration to ensure all details are correct.
    * Click “Save” to finalize and activate the webhook.

    <figure><img src="https://842362573-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiedbxyF6rrnGBuHuFME1%2Fuploads%2FtO0MBNVDFO6ss7EqoPcH%2FScreenshot_132.png?alt=media&#x26;token=de4a522b-e4c5-43d3-b009-e4b0f87733ef" alt=""><figcaption></figcaption></figure>
11. **Preview the Webhook**&#x20;

    * Click the just-created webhook to check the data.

    <figure><img src="https://842362573-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiedbxyF6rrnGBuHuFME1%2Fuploads%2FJrMxZDIhLgSZpt3OKbQ9%2FScreenshot_133.png?alt=media&#x26;token=c6a4175c-850c-4b57-8355-ad0ed22a207b" alt=""><figcaption></figcaption></figure>

    * You will see all the data of your selected events, including history, requests, and responses. You can also redeliver the information to your endpoint URL.

    <figure><img src="https://842362573-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiedbxyF6rrnGBuHuFME1%2Fuploads%2FsHZrvblOksm0Exakwq0F%2FScreenshot_146.png?alt=media&#x26;token=ac0c6190-cf80-4546-8b5a-50f287077959" alt=""><figcaption></figcaption></figure>

### **Important Notes**

* **Testing:** Before going live, test the webhook configuration to ensure data is being sent correctly to the endpoint.
* **Security:** Ensure the endpoint URL is secure to protect the transmitted data.
* **Monitoring:** Regularly monitor the webhook activity to ensure it functions as expected.
* **Updates:** Periodically review and update webhook configurations to accommodate changes in your workflows or external systems.
