{
    "variable": [
        {
            "id": "baseUrl",
            "key": "baseUrl",
            "type": "string",
            "name": "string",
            "value": "http:\/\/nagrajto.local"
        }
    ],
    "info": {
        "name": "NagrajTo API Documentation",
        "_postman_id": "2474ba1d-c316-4196-9aa2-31cd0f9fcd37",
        "description": "REST API for accessing analytics data, session recordings, and visitor insights.",
        "schema": "https:\/\/schema.getpostman.com\/json\/collection\/v2.1.0\/collection.json"
    },
    "item": [
        {
            "name": "Analytics",
            "description": "\nAPIs for accessing analytics data including sessions, pageviews, technology, geography, marketing, and performance metrics.\n\nAll endpoints require authentication via Bearer token and accept common filter parameters.",
            "item": [
                {
                    "name": "List Domains",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/analytics\/domains",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/analytics\/domains"
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Get a list of all domains associated with the authenticated user's account."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\"success\": true, \"data\": [{\"id\": 1, \"name\": \"My Website\", \"domain\": \"example.com\", \"is_active\": true, \"created_at\": \"2024-01-15T10:30:00Z\"}]}",
                            "name": ""
                        }
                    ]
                },
                {
                    "name": "Overview Statistics",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/analytics\/overview",
                            "query": [
                                {
                                    "key": "domain_id",
                                    "value": "1",
                                    "description": "The domain ID. If not specified, returns data for the first domain.",
                                    "disabled": false
                                },
                                {
                                    "key": "period",
                                    "value": "30d",
                                    "description": "Time period preset: 24h, 7d, 30d, 90d, year. Default: 7d.",
                                    "disabled": false
                                },
                                {
                                    "key": "date_from",
                                    "value": "2024-01-01",
                                    "description": "Custom start date (YYYY-MM-DD). Overrides period.",
                                    "disabled": false
                                },
                                {
                                    "key": "date_to",
                                    "value": "2024-01-31",
                                    "description": "Custom end date (YYYY-MM-DD). Overrides period.",
                                    "disabled": false
                                },
                                {
                                    "key": "device_type",
                                    "value": "mobile",
                                    "description": "Filter by device: desktop, mobile, tablet.",
                                    "disabled": false
                                },
                                {
                                    "key": "browser",
                                    "value": "Chrome",
                                    "description": "Filter by browser name.",
                                    "disabled": false
                                },
                                {
                                    "key": "os",
                                    "value": "Windows",
                                    "description": "Filter by operating system.",
                                    "disabled": false
                                },
                                {
                                    "key": "country",
                                    "value": "PL",
                                    "description": "Filter by country code (ISO 3166-1 alpha-2).",
                                    "disabled": false
                                }
                            ],
                            "raw": "{{baseUrl}}\/api\/analytics\/overview?domain_id=1&period=30d&date_from=2024-01-01&date_to=2024-01-31&device_type=mobile&browser=Chrome&os=Windows&country=PL"
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Get high-level analytics overview including sessions, visitors, pageviews, bounce rate, and trends."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\"success\": true, \"data\": {\"sessions\": 1234, \"visitors\": 567, \"pageviews\": 3456, \"bounce_rate\": 45.2, \"avg_duration\": 180, \"pages_per_session\": 2.8, \"changes\": {\"sessions\": 12.5, \"visitors\": 8.3}, \"daily_data\": [], \"top_pages\": [], \"top_referrers\": [], \"devices\": {\"desktop\": 800, \"mobile\": 400}}, \"meta\": {\"domain\": {\"id\": 1, \"name\": \"My Site\"}, \"period\": {\"start\": \"2024-01-01T00:00:00Z\", \"end\": \"2024-01-31T23:59:59Z\"}}}",
                            "name": "Success"
                        },
                        {
                            "header": [],
                            "code": 404,
                            "body": "{\"success\": false, \"error\": \"Domain not found or access denied\"}",
                            "name": "Domain not found"
                        }
                    ]
                },
                {
                    "name": "Page Statistics",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/analytics\/pages",
                            "query": [
                                {
                                    "key": "domain_id",
                                    "value": "1",
                                    "description": "The domain ID.",
                                    "disabled": false
                                },
                                {
                                    "key": "period",
                                    "value": "30d",
                                    "description": "Time period preset. Default: 7d.",
                                    "disabled": false
                                },
                                {
                                    "key": "limit",
                                    "value": "20",
                                    "description": "Maximum number of pages to return (1-100). Default: 50.",
                                    "disabled": false
                                }
                            ],
                            "raw": "{{baseUrl}}\/api\/analytics\/pages?domain_id=1&period=30d&limit=20"
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Get page-level analytics including views, unique views, time on page, and scroll depth."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\"success\": true, \"data\": [{\"path\": \"\/\", \"views\": 500, \"unique_views\": 350, \"avg_time_on_page\": 45000, \"avg_scroll_depth\": 75, \"total_clicks\": 120}]}",
                            "name": ""
                        }
                    ]
                },
                {
                    "name": "Technology Statistics",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/analytics\/technology",
                            "query": [
                                {
                                    "key": "domain_id",
                                    "value": "1",
                                    "description": "The domain ID.",
                                    "disabled": false
                                },
                                {
                                    "key": "period",
                                    "value": "30d",
                                    "description": "Time period preset. Default: 7d.",
                                    "disabled": false
                                }
                            ],
                            "raw": "{{baseUrl}}\/api\/analytics\/technology?domain_id=1&period=30d"
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Get visitor technology breakdown: browsers, operating systems, device types, and screen resolutions."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\"success\": true, \"data\": {\"browsers\": [{\"browser\": \"Chrome\", \"count\": 500}], \"os\": [{\"os\": \"Windows\", \"count\": 400}], \"devices\": [{\"device_type\": \"desktop\", \"count\": 600}], \"resolutions\": [{\"resolution\": \"1920x1080\", \"count\": 300}]}}",
                            "name": ""
                        }
                    ]
                },
                {
                    "name": "Geography Statistics",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/analytics\/geography",
                            "query": [
                                {
                                    "key": "domain_id",
                                    "value": "1",
                                    "description": "The domain ID.",
                                    "disabled": false
                                },
                                {
                                    "key": "period",
                                    "value": "30d",
                                    "description": "Time period preset. Default: 7d.",
                                    "disabled": false
                                }
                            ],
                            "raw": "{{baseUrl}}\/api\/analytics\/geography?domain_id=1&period=30d"
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Get visitor geographic distribution: countries, cities, languages, and timezones."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\"success\": true, \"data\": {\"countries\": [{\"country_code\": \"PL\", \"count\": 500}], \"cities\": [{\"city\": \"Warsaw\", \"country_code\": \"PL\", \"count\": 200}], \"languages\": [{\"language\": \"pl-PL\", \"count\": 400}], \"timezones\": [{\"timezone\": \"Europe\/Warsaw\", \"count\": 450}]}}",
                            "name": ""
                        }
                    ]
                },
                {
                    "name": "Marketing Statistics",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/analytics\/marketing",
                            "query": [
                                {
                                    "key": "domain_id",
                                    "value": "1",
                                    "description": "The domain ID.",
                                    "disabled": false
                                },
                                {
                                    "key": "period",
                                    "value": "30d",
                                    "description": "Time period preset: 24h, 7d, 30d, 90d, year. Default: 7d.",
                                    "disabled": false
                                },
                                {
                                    "key": "date_from",
                                    "value": "2024-01-01",
                                    "description": "Custom start date (YYYY-MM-DD).",
                                    "disabled": false
                                },
                                {
                                    "key": "date_to",
                                    "value": "2024-01-31",
                                    "description": "Custom end date (YYYY-MM-DD).",
                                    "disabled": false
                                }
                            ],
                            "raw": "{{baseUrl}}\/api\/analytics\/marketing?domain_id=1&period=30d&date_from=2024-01-01&date_to=2024-01-31"
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Get marketing and traffic source data including referrers, UTM campaigns, sources, mediums, and content tags."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\"success\": true, \"data\": {\"referrers\": [{\"referrer\": \"google.com\", \"count\": 500}], \"utm_sources\": [{\"utm_source\": \"newsletter\", \"count\": 200}], \"utm_mediums\": [{\"utm_medium\": \"email\", \"count\": 150}], \"utm_campaigns\": [{\"utm_campaign\": \"spring_sale\", \"count\": 100}], \"utm_contents\": [{\"utm_content\": \"header_cta\", \"count\": 50}]}}",
                            "name": ""
                        }
                    ]
                },
                {
                    "name": "Performance Statistics",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/analytics\/performance",
                            "query": [
                                {
                                    "key": "domain_id",
                                    "value": "1",
                                    "description": "The domain ID.",
                                    "disabled": false
                                },
                                {
                                    "key": "period",
                                    "value": "30d",
                                    "description": "Time period preset: 24h, 7d, 30d, 90d, year. Default: 7d.",
                                    "disabled": false
                                },
                                {
                                    "key": "date_from",
                                    "value": "2024-01-01",
                                    "description": "Custom start date (YYYY-MM-DD).",
                                    "disabled": false
                                },
                                {
                                    "key": "date_to",
                                    "value": "2024-01-31",
                                    "description": "Custom end date (YYYY-MM-DD).",
                                    "disabled": false
                                }
                            ],
                            "raw": "{{baseUrl}}\/api\/analytics\/performance?domain_id=1&period=30d&date_from=2024-01-01&date_to=2024-01-31"
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Get page performance metrics including load times, Core Web Vitals (LCP, FID, CLS), and time to interactive."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\"success\": true, \"data\": {\"avg_page_load\": 1250, \"avg_dom_ready\": 800, \"avg_first_paint\": 450, \"avg_first_contentful_paint\": 650, \"avg_lcp\": 1100, \"avg_fid\": 25, \"avg_cls\": 0.05, \"by_page\": [{\"path\": \"\/\", \"avg_load\": 1000, \"count\": 500}]}}",
                            "name": ""
                        }
                    ]
                },
                {
                    "name": "Interactions Statistics",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/analytics\/interactions",
                            "query": [
                                {
                                    "key": "domain_id",
                                    "value": "1",
                                    "description": "The domain ID.",
                                    "disabled": false
                                },
                                {
                                    "key": "period",
                                    "value": "30d",
                                    "description": "Time period preset: 24h, 7d, 30d, 90d, year. Default: 7d.",
                                    "disabled": false
                                },
                                {
                                    "key": "date_from",
                                    "value": "2024-01-01",
                                    "description": "Custom start date (YYYY-MM-DD).",
                                    "disabled": false
                                },
                                {
                                    "key": "date_to",
                                    "value": "2024-01-31",
                                    "description": "Custom end date (YYYY-MM-DD).",
                                    "disabled": false
                                }
                            ],
                            "raw": "{{baseUrl}}\/api\/analytics\/interactions?domain_id=1&period=30d&date_from=2024-01-01&date_to=2024-01-31"
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Get user interaction data including total clicks, rage clicks (frustration indicator), scroll depth, and click patterns."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\"success\": true, \"data\": {\"total_clicks\": 15000, \"rage_clicks\": 120, \"avg_scroll_depth\": 68.5, \"clicks_by_element\": [{\"selector\": \"button.cta\", \"count\": 500}], \"top_clicked_pages\": [{\"path\": \"\/pricing\", \"clicks\": 2000}]}}",
                            "name": ""
                        }
                    ]
                },
                {
                    "name": "Heatmap Data",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/analytics\/heatmap",
                            "query": [
                                {
                                    "key": "domain_id",
                                    "value": "1",
                                    "description": "The domain ID.",
                                    "disabled": false
                                },
                                {
                                    "key": "page",
                                    "value": "%2Fcontact",
                                    "description": "The page path to get heatmap for.",
                                    "disabled": false
                                },
                                {
                                    "key": "period",
                                    "value": "30d",
                                    "description": "Time period preset: 24h, 7d, 30d, 90d, year. Default: 7d.",
                                    "disabled": false
                                }
                            ],
                            "raw": "{{baseUrl}}\/api\/analytics\/heatmap?domain_id=1&page=%2Fcontact&period=30d"
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Get click heatmap data for a specific page, including click coordinates and element selectors."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\"success\": true, \"data\": {\"clicks\": [{\"x\": 150, \"y\": 300, \"selector\": \"button#submit\", \"count\": 45}], \"total_clicks\": 500, \"page_snapshot_url\": \"\/snapshots\/abc123.html\"}}",
                            "name": ""
                        },
                        {
                            "header": [],
                            "code": 400,
                            "body": "{\"success\": false, \"error\": \"Page parameter is required\"}",
                            "name": "Missing page"
                        }
                    ]
                },
                {
                    "name": "Dead Clicks Analysis",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/analytics\/dead-clicks",
                            "query": [
                                {
                                    "key": "domain_id",
                                    "value": "1",
                                    "description": "The domain ID.",
                                    "disabled": false
                                },
                                {
                                    "key": "period",
                                    "value": "30d",
                                    "description": "Time period preset: 24h, 7d, 30d, 90d, year. Default: 7d.",
                                    "disabled": false
                                },
                                {
                                    "key": "limit",
                                    "value": "20",
                                    "description": "Maximum results to return (1-100). Default: 50.",
                                    "disabled": false
                                }
                            ],
                            "raw": "{{baseUrl}}\/api\/analytics\/dead-clicks?domain_id=1&period=30d&limit=20"
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Get analysis of dead clicks - clicks on non-interactive elements that may indicate UX issues or user confusion."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\"success\": true, \"data\": [{\"selector\": \"div.pricing-card\", \"page\": \"\/pricing\", \"count\": 85, \"is_interactive\": false, \"suggestion\": \"Consider making this element clickable or adding a CTA\"}]}",
                            "name": ""
                        }
                    ]
                }
            ]
        },
        {
            "name": "Endpoints",
            "description": "",
            "item": [
                {
                    "name": "POST api\/broadcasting\/auth",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/broadcasting\/auth",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/broadcasting\/auth"
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": ""
                    },
                    "response": []
                },
                {
                    "name": "Store rrweb events via HTTP (for large payloads like FullSnapshot).",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/rrweb-events",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/rrweb-events"
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "This bypasses WebSocket message size limits."
                    },
                    "response": []
                },
                {
                    "name": "List sessions for a domain.",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/sessions",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/sessions"
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": ""
                    },
                    "response": [
                        {
                            "header": [
                                {
                                    "key": "cache-control",
                                    "value": "no-cache, private"
                                },
                                {
                                    "key": "content-type",
                                    "value": "application\/json"
                                },
                                {
                                    "key": "vary",
                                    "value": "Origin"
                                }
                            ],
                            "code": 401,
                            "body": "{\"message\":\"Unauthenticated.\"}",
                            "name": ""
                        }
                    ]
                },
                {
                    "name": "Get session details with events for playback.",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/sessions\/:session",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/sessions\/:session",
                            "variable": [
                                {
                                    "id": "session",
                                    "key": "session",
                                    "value": "architecto",
                                    "description": "The session."
                                }
                            ]
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": ""
                    },
                    "response": [
                        {
                            "header": [
                                {
                                    "key": "cache-control",
                                    "value": "no-cache, private"
                                },
                                {
                                    "key": "content-type",
                                    "value": "application\/json"
                                },
                                {
                                    "key": "vary",
                                    "value": "Origin"
                                }
                            ],
                            "code": 401,
                            "body": "{\"message\":\"Unauthenticated.\"}",
                            "name": ""
                        }
                    ]
                }
            ]
        }
    ],
    "auth": {
        "type": "bearer",
        "bearer": [
            {
                "key": "Authorization",
                "type": "string"
            }
        ]
    }
}