# New Analysis Complete — Insites

> Emit new event when a new analysis is completed. See the documentation

- Key: `insites-analysis-complete`
- Type: Trigger (Polling)
- Version: 0.0.2
- App: Insites (`insites`) — https://pipedream.com/apps/insites.md
- This page (HTML): https://pipedream.com/apps/insites/triggers/analysis-complete
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/insites/sources/analysis-complete/analysis-complete.mjs

## Description

Emit new event when a new analysis is completed. [See the documentation](https://help.insites.com/en/articles/7994946-report-api#h_e59622a8e7)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `timer` | `$.interface.timer` | Yes | Timer |
| `filter` | `string` | No | JSON encoded string - attributes by which the reports should be filtered by. See the documentation for more details. Example: [{"operator":"equal","property":"mobile.is_mobile","targetValue":false}] |
| `includeHistoric` | `boolean` | No | Whether the results should contain old versions of the business reports. |
| `listId` | `string` | No | Will filter the results and return only those in the given list. Note: list ID should be the 32-character hexadecimal ID provided by Insites (not the list name which is assigned by the user). |

## Returns

Events emitted by Insites.

## Run it

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const deployed = await pd.triggers.deploy({
  id: "insites-analysis-complete",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    insites: { authProvisionId: "apn_xxxxxxx" },
    timer: { "intervalSeconds": 900 },
    filter: "Filter",
  },
  webhookUrl: "https://example.com/webhooks/insites",
})

console.log(deployed.id)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/triggers/deploy \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "insites-analysis-complete",
    "webhook_url": "https://example.com/webhooks/insites",
    "configured_props": {
      "insites": { "authProvisionId": "apn_xxxxxxx" },
      "timer": { "intervalSeconds": 900 },
      "filter": "Filter"
    }
  }'
```

**MCP**

MCP servers expose Insites actions as on-demand tools.

New Analysis Complete is an event source, so your application deploys it with the Connect SDK or API and then either receives each event at a webhook URL or retrieves events on demand with the trigger events API.

## Event delivery

Every event is sent to the HTTP endpoint you choose when you deploy the source. Or: no webhook required — your app or agent can fetch recent events from the [trigger events API](https://pipedream.com/docs/connect/api-reference/list-trigger-events.md) instead.

---

- App: https://pipedream.com/apps/insites.md · All apps: https://pipedream.com/apps
