> For the complete documentation index, see [llms.txt](https://docs.rewst.help/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rewst.help/rewst-documentation/documentation/integrations/integration-guides/kaseya-vsa-integration-setup.md).

# Kaseya VSA integration

{% hint style="info" %}
&#x20;If you’re new to integrations in Rewst, read through our introductory integration documentation [here](https://docs.rewst.help/documentation/integrations).
{% endhint %}

## What does the Kaseya VSA integration do?

Our Kaseya VSA integration enables the automation of remote monitoring and management. Use the Kaseya VSA API within Rewst workflows to obtain asset inventory, execute commands and run procedures on endpoints.

## Set up the Kaseya VSA integration

### Set up steps in Kaseya VSA

1. Log in to Kaseya VSA
2. Navigate to **System > Server Management > OAuth Clients**.
3. Select **Register Client** and supply the following:
   * **Client Name**: RewstAPI
   * **Redirect URL** (From Rewst Kaseya integration page)
   * **Email**: `email@address.com`
4. Click **Save**.
5. Copy the information from the dialogue and store it somewhere secure. You'll need this information for further steps in Rewst.

### Set up steps in Rewst

1. Navigate to **Integrations** in the left side menu of your Rewst platform.
2. In the Integrations page, search for the Kaseya VSA integration.
3. Under **Parameters**, enter the information copied from Kaseya into the relevant fields:
   1. **Hostname**: i.e. rmm.company.com
   2. **Client ID**: From Kaseya OAuth page
   3. **Client Secret**: From Kaseya OAuth page
4. Click **Save Configuration**.
5. Rewst will do a quick validation of your input. Once completed, you'll see a new section beneath the configuration form for[ organization mapping](https://docs.rewst.help/documentation/integrations#what-is-organization-mapping). Complete your mapping as desired.&#x20;

{% hint style="success" %}
If your VSA is behind a firewall, WAF has IIS Re-write rules, or has the Kaseya edge firewall configuration in place you will need to add `3.139.170.31` to the allowed list (tcp/443).
{% endhint %}

## Rewst agent procedure import

To perform actions on agent end points in Rewst, you'll need to import the file Procedure RewstPoshCommand.xml into the VSA.

{% hint style="warning" %}
It is important that you do not change or modify this file in any way. Please do not rename the procedure once imported.
{% endhint %}

1. Download the file Procedure Rewst (Powershell).xml.

{% file src="/files/Iu6cvgqrntZOU1BLHLmf" %}

2. Log in to your VSA.
3. Navigate to **System > Server Management > Import Center**.
4. Select **New Import**.
5. Name it `Rewst (Powershell)`, and point it to the *Procedure Rewst (Powershell).xml* file.
6. Click **Process**.
7. Click **Save**.

{% hint style="success" %}
Got an idea for a new Integration? Rewst is constantly adding new integrations to our integrations page. Submit your idea or upvote existing ideas here in our [Canny feedback collector](https://rewst.canny.io/integrations).
{% endhint %}

## Use custom PowerShell scripts with your RMM integration

If you're writing custom PowerShell scripts to use and be run with your RMM integration, you'll need to manually add webhook calls. Any custom script will time out if used without first adding the webhook calls. The use of standard built-in Rewst scripts with your RMM does not require you to add the calls.

The webhook calls everyone doing this custom scripting should use will always be as follows.

```

### Send all the data back to RewstyRewst ###


$postData = $PS_Results | ConvertTo-Json
Invoke-RestMethod -Method 'Post' -Uri $post_url -Body $postData -ContentType 'application/json; 
charset=utf-8'
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.rewst.help/rewst-documentation/documentation/integrations/integration-guides/kaseya-vsa-integration-setup.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
