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

# App Install | Webhook Events

> Fires when your app is installed at the location or account level.

The `AppInstall` event fires whenever your app is installed by a user, either at the location level or at the account level. It includes trial information and the plan selected at installation time. Note that `userId` and `companyId` may not always be present — for example, when the app is installed via a future location provisioning flow. Use this event to initialize app state, begin onboarding flows, or activate the correct plan tier for the installing account.

## Payload

| Field                  | Type      | Description                                                                        |
| ---------------------- | --------- | ---------------------------------------------------------------------------------- |
| `type`                 | `string`  | Always `"INSTALL"`                                                                 |
| `appId`                | `string`  | ID of the app that was installed                                                   |
| `companyId`            | `string`  | Company ID of the installing account                                               |
| `locationId`           | `string`  | Location ID if installed at the location level; omitted for account-level installs |
| `userId`               | `string`  | ID of the user who initiated the install; may be absent in some flows              |
| `planId`               | `string`  | ID of the plan selected at install time                                            |
| `trial`                | `object`  | Trial information for the install                                                  |
| `trial.onTrial`        | `boolean` | Whether the account is starting on a trial                                         |
| `trial.trialDuration`  | `number`  | Duration of the trial period in days                                               |
| `trial.trialStartDate` | `string`  | ISO 8601 timestamp of when the trial started                                       |
| `companyName`          | `string`  | Display name of the installing company                                             |

## Example payload

#### Location level

```json theme={null}
{
  "type": "INSTALL",
  "appId": "ve9EPM428h8vShlRW1KT",
  "locationId": "otg8dTQqGLh3Q6iQI55w",
  "companyId": "otg8dTQqGLh3Q6iQI55w",
  "userId": "otg8dTQqGLh3Q6iQI55w",
  "planId": "66a0419a0dffa47fb5f8b22f",
  "trial": {
    "onTrial": true,
    "trialDuration": 10,
    "trialStartDate": "2024-07-23T23:54:51.264Z"
  },
  "companyName": "Example Company"
}
```

#### Account level

```json theme={null}
{
  "type": "INSTALL",
  "appId": "ve9EPM428h8vShlRW1KT",
  "companyId": "otg8dTQqGLh3Q6iQI55w",
  "planId": "66a0419a0dffa47fb5f8b22f",
  "trial": {
    "onTrial": true,
    "trialDuration": 10,
    "trialStartDate": "2024-07-23T23:54:51.264Z"
  }
}
```

## Related

* [App Uninstall](/api-reference/webhooks/app-uninstall) — fires when your app is removed
* [OAuth 2.0](/api-reference/oauth/overview) — authorization flow used during app installation
