# Get Session Intelligence — Dappier

> Retrieve session-intelligence analytics for Ask AI widgets (GET /v1/analytics/session-intelligence). Returns a single top-level session_intelligence object wrapping all breakdowns - session_intelligence.summary, .engagement_time stats…

- Key: `dappier-get-session-intelligence`
- Type: Action (Read-only)
- Version: 0.0.2
- App: Dappier (`dappier`) — https://pipedream.com/apps/dappier.md
- This page (HTML): https://pipedream.com/apps/dappier/actions/get-session-intelligence
- Hints: read-only · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/dappier/actions/get-session-intelligence/get-session-intelligence.mjs

## Description

Retrieve session-intelligence analytics for Ask AI widgets (GET `/v1/analytics/session-intelligence`). Returns a single top-level `session_intelligence` object wrapping all breakdowns - `session_intelligence.summary`, `.engagement_time` stats, `.intent_breakdown`, `.top_queried_topics`, `.category_distribution` (IAB categories), and a fixed 7-bucket `.session_engagement_distribution` (query-depth). All filters are optional; with no dates it defaults to the last 7 days (UTC). Example: call with no arguments for last-7-days intent and topic breakdowns, or pass `widgetId=wd_92831` to scope to a single widget. [See the documentation](https://docs.dappier.com/api-reference/endpoint/session-intelligence).

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `startDate` | `string` | No | Inclusive start of the reporting window in YYYY-MM-DD format, interpreted as UTC (e.g. 2026-08-01). Optional - when omitted, defaults to 6 days before the End Date (a trailing 7-day window). The window between Start Date and End Date must not exceed 365 days. |
| `endDate` | `string` | No | Inclusive end of the reporting window in YYYY-MM-DD format, interpreted as UTC (e.g. 2026-08-28). Optional - defaults to today if omitted. Must be on or after Start Date, and the window between them must not exceed 365 days. |
| `widgetId` | `string` | No | Filter results to a single widget by its external ID (e.g. wd_92831). Optional - omit to include all widgets. The Dappier API exposes no listing endpoint; find widget IDs in the Dappier platform at https://platform.dappier.com. |
| `placementId` | `string` | No | Filter results to a single placement by its external ID. Optional - omit to include all placements. The Dappier API exposes no listing endpoint; find placement IDs in the Dappier platform at https://platform.dappier.com. |
| `deploymentType` | `string` | No | Filter by deployment type, exact match (e.g. brand_agent, sponsored_conversation, embed, widget). Optional - omit to include all deployment types. |
| `creativeId` | `string` | No | Filter by DSP/ad-tracking creative ID. Optional - omit to include all creatives. |
| `lineItemId` | `string` | No | Filter by DSP/ad-tracking line item ID. Optional - omit to include all line items. |
| `publisherId` | `string` | No | Filter by publisher ID (Dianomi traffic only). Optional - omit to include all publishers. |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
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 accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "dappier",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "dappier-get-session-intelligence",
  arguments: {
    startDate: "Start Date",
    endDate: "End Date",
  },
})
```

**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 result = await pd.actions.run({
  id: "dappier-get-session-intelligence",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    dappier: { authProvisionId: "apn_xxxxxxx" },
    startDate: "Start Date",
    endDate: "End Date",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "dappier-get-session-intelligence",
    "configured_props": {
      "dappier": { "authProvisionId": "apn_xxxxxxx" },
      "startDate": "Start Date",
      "endDate": "End Date"
    }
  }'
```

---

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