> ## Documentation Index
> Fetch the complete documentation index at: https://msprecapp.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Automate webhook alerts and PSA ticket creation

> Create event-driven automation rules in MSP Recapp to fire webhooks or open PSA tickets when coverage gaps, sync failures, or security events occur.

Automations let you define rules that watch for specific events in Recapp and respond automatically — sending a webhook to a third-party platform or creating a ticket in your PSA. You set the trigger event, any conditions, and one or more actions. When Recapp detects the event, all enabled actions on that rule fire in sequence.

<Warning>
  Automations is a **Pro and Enterprise** feature. On the free plan you can view the Automations page but rules cannot be created or executed. Upgrade to enable automated webhooks, PSA ticket creation, and scheduled actions.
</Warning>

## Event categories

Each rule is triggered by a single event. Events are organized into six categories:

<Tabs>
  <Tab title="Device Health">
    | Event                       | Description                                                          |
    | --------------------------- | -------------------------------------------------------------------- |
    | `device.duplicate_detected` | New duplicate device found in an integration                         |
    | `device.gap_detected`       | Device missing from a required tool category (RMM/Endpoint)          |
    | `device.orphaned_agent`     | Device present in an endpoint tool but missing from both PSA and RMM |
    | `device.psa_sync_missing`   | Device present in RMM but not synced to PSA                          |
    | `device.stale_checkin`      | Check-in variance between tools exceeds the configured threshold     |
  </Tab>

  <Tab title="Sync Events">
    | Event            | Description                             |
    | ---------------- | --------------------------------------- |
    | `sync.completed` | Integration sync completed successfully |
    | `sync.failed`    | Integration sync failed                 |
    | `sync.partial`   | Sync completed but with some errors     |
  </Tab>

  <Tab title="Integration Events">
    | Event                             | Description                          |
    | --------------------------------- | ------------------------------------ |
    | `integration.added`               | A new integration was connected      |
    | `integration.removed`             | An integration was disconnected      |
    | `integration.credentials_updated` | Integration credentials were changed |
  </Tab>

  <Tab title="User & Security">
    | Event                   | Description                          |
    | ----------------------- | ------------------------------------ |
    | `user.invited`          | A new user was invited to the tenant |
    | `user.joined`           | A user accepted an invitation        |
    | `user.removed`          | A user was removed from the tenant   |
    | `user.role_changed`     | A user's role was modified           |
    | `security.mfa_enabled`  | MFA was enabled for a user           |
    | `security.mfa_disabled` | MFA was disabled for a user          |
  </Tab>

  <Tab title="Organization & Remediation">
    **Organization Events**

    | Event                  | Description                       |
    | ---------------------- | --------------------------------- |
    | `organization.created` | A new organization was added      |
    | `organization.updated` | Organization details were changed |
    | `organization.deleted` | An organization was removed       |

    **Remediation Events**

    | Event                          | Description                           |
    | ------------------------------ | ------------------------------------- |
    | `device.remediated`            | A device remediation action was taken |
    | `device.discrepancy_dismissed` | A discrepancy was marked as dismissed |
  </Tab>
</Tabs>

### Stale check-in threshold

When you select the `device.stale_checkin` event, an additional field appears where you set the variance threshold in hours. The rule fires when a device's check-in variance between tools exceeds this value. On Enterprise plans you can configure per-organization thresholds instead of a single global value.

### Organization filter

For any `device.*` event you can optionally restrict the rule to specific organizations. Leave the filter empty to receive alerts for all organizations.

## Action types

Each rule supports one or more actions. You can mix webhook and PSA ticket actions on the same rule.

<Tabs>
  <Tab title="Webhook">
    A webhook action sends an HTTP request to a URL you specify when the rule fires.

    | Field                | Details                                                                                                                                                        |
    | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | **URL**              | The endpoint that receives the request. Required.                                                                                                              |
    | **Method**           | `POST`, `PUT`, or `PATCH`.                                                                                                                                     |
    | **Custom Headers**   | Key-value pairs added to the request headers. Use this for `Authorization` tokens or `Content-Type` overrides.                                                 |
    | **Payload Template** | A JSON template for the request body. Supports the variables `{{event_type}}`, `{{device_name}}`, `{{organization_name}}`, `{{timestamp}}`, and `{{details}}`. |

    Click **View Example Webhook Payload** in the rule creation dialog to see what the payload looks like for the selected event type.
  </Tab>

  <Tab title="PSA Ticket">
    A PSA ticket action creates a ticket in HaloPSA or ConnectWise Manage when the rule fires.

    | Field                           | Details                                                                                                                           |
    | ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
    | **PSA Integration**             | Select the HaloPSA or ConnectWise Manage integration to create the ticket in. You must have at least one PSA integration enabled. |
    | **Ticket Summary Template**     | The ticket subject line. Supports the same template variables as the webhook payload.                                             |
    | **Ticket Description Template** | The ticket body. Supports the same template variables.                                                                            |
    | **Attach affected devices**     | Toggle on to include a list of affected device names in the ticket body.                                                          |

    <Note>
      PSA ticket actions are only available if you have at least one HaloPSA or ConnectWise Manage integration enabled. If no PSA is configured, the **Add PSA Ticket** button is disabled and a notice explains that you need to add a PSA integration first.
    </Note>
  </Tab>
</Tabs>

## Creating a rule

<Steps>
  <Step title="Open Create Rule dialog">
    Navigate to **Automations** and click the **Create Rule** button in the top-right corner of the Rules tab. The button is disabled if you are on the free plan.
  </Step>

  <Step title="Name and describe the rule">
    Enter a **Rule Name** (e.g., "Stale Agent Alert") and an optional description explaining what the rule does.
  </Step>

  <Step title="Select a trigger event">
    Open the **Trigger Event** dropdown and choose an event from one of the six categories. If you select `device.stale_checkin`, configure the variance threshold that appears below the dropdown.
  </Step>

  <Step title="Add an organization filter (optional)">
    For any `device.*` event, an organization filter appears. Select one or more organizations to limit the rule's scope, or leave it empty to apply to all organizations.
  </Step>

  <Step title="Add one or more actions">
    Click **Add Webhook** or **Add PSA Ticket** to create an action. Fill in the required fields for each action type. A rule must have at least one action before you can save it.
  </Step>

  <Step title="Save the rule">
    Click **Create Rule**. The new rule appears in the Rules list and is enabled by default. Use the toggle on the rule card to enable or disable it without deleting it.
  </Step>
</Steps>

## Execution Logs

The **Execution Logs** tab shows the history of every automation action that has been attempted. Each log entry shows the rule name, event type, action type, execution status (`success`, `failed`, or `pending`), and a timestamp. You can expand an entry to see the full request payload, response data, or error message.

## Run Now

The **Run Now** button on the Rules tab manually triggers all enabled rules against current data immediately, without waiting for the next scheduled evaluation. After the run completes, the Execution Logs tab refreshes automatically to show the new entries.

<Tip>
  Use **Run Now** after creating or editing rules to confirm they fire correctly and the payloads or ticket contents look as expected before relying on them in production.
</Tip>
