# AI Traffic Events by Channel

POST /api/v2/projects/{projectId}/analytics/ai-traffic/events-by-channel

People's events by the channel of the visit they happened in: AI assistants, search, social, direct and referral. A backend event takes the channel the person first arrived from. With `aiTool`, the AI channel holds only that assistant's visits.

## Request

- projectId: string, path, required — ID of the project to query.
- aiTool: chatgpt | claude | gemini | copilot | perplexity | grok | meta | deepseek | mistral — Limit the visits chart, landing pages, and the main reports to this AI assistant. The human comparison and the other channels of the events table stay unfiltered so search, social, and direct remain visible.
- dateFrom: string — Start of the window as a `YYYY-MM-DD` date, inclusive.
- dateTo: string — End of the window as a `YYYY-MM-DD` date, inclusive.
- timeZone: string — IANA timezone for calendar dates. The dashboard sends the signed-in user's local zone.

## Response

- 200: Successful response
  - elapsed: number, required
  - rows: object[], required
    - action: string, required
    - channel: ai | search | social | direct | referral, required
    - events: number, required
- 400: Invalid input data
- 401: Authorization not provided
- 403: Insufficient access
- 500: Internal server error
