{
    "openapi": "3.1.2",
    "info": {
        "title": "Invoker Analytics API",
        "version": "1.0.0",
        "description": "Read your Invoker Analytics sites and stats programmatically. The API is read-only and versioned under `\/api\/v1`.\n\nGuide with examples: [invoker.app\/docs\/api](https:\/\/invoker.app\/docs\/api) \u00b7 OpenAPI document: [api.invoker.app\/docs\/api.json](https:\/\/api.invoker.app\/docs\/api.json)\n\n## Authentication\n\nCreate a personal API token in the dashboard under **Settings \u2192 API tokens** and send it in the `Authorization` header:\n\n```\nAuthorization: Bearer <token>\n```\n\nTokens are shown once, are stored hashed, can expire, and can be revoked at any time. Each token has abilities (`sites:read`, `stats:read`) and can optionally be restricted to specific sites. API tokens only work on `\/api\/v1` \u2014 they cannot manage your account.\n\n## Responses\n\nSuccessful responses are `{\"data\": ..., \"meta\": {...}}`. Dates are ISO 8601. Stats endpoints echo the resolved `period`, `date_from`, `date_to`, `timezone` and `filters` in `meta`; paginated endpoints include `meta.pagination`.\n\n## Errors\n\nErrors are `{\"error\": {\"status\": 422, \"code\": \"validation_failed\", \"message\": \"...\", \"errors\": {\"field\": [\"...\"]}}}`. Codes: `unauthenticated` (401), `missing_ability`, `site_not_allowed`, `plan_without_api_access`, `forbidden` (403), `not_found` (404), `validation_failed` (422), `rate_limited` (429), `server_error` (500).\n\n## Rate limits\n\nRequests are limited per token per minute (depends on your plan). Every response carries `X-RateLimit-Limit` and `X-RateLimit-Remaining`; a `429` response carries `Retry-After` (seconds)."
    },
    "servers": [
        {
            "url": "https:\/\/api.invoker.app\/api\/v1",
            "description": "Production"
        }
    ],
    "tags": [
        {
            "name": "Sites",
            "description": "Sites the token can read: sites you own or were invited to, narrowed to the token's site list when it has one."
        },
        {
            "name": "Stats",
            "description": "Aggregates, timeseries and breakdowns. All endpoints accept the same date range (`period`, `date_from`, `date_to`), `timezone` and `filters[...]` parameters. Filters apply to individual hits (e.g. `filters[page]=\/pricing` counts only hits on \/pricing)."
        },
        {
            "name": "Realtime"
        }
    ],
    "security": [
        {
            "apiToken": []
        }
    ],
    "paths": {
        "\/sites": {
            "get": {
                "operationId": "v1.sites.index",
                "description": "Sites the token can access, ordered by name. Requires the `sites:read` ability.",
                "summary": "List sites",
                "tags": [
                    "Sites"
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number.",
                        "schema": {
                            "type": [
                                "integer",
                                "null"
                            ],
                            "default": 1,
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Sites per page (max 100).",
                        "schema": {
                            "type": [
                                "integer",
                                "null"
                            ],
                            "default": 50,
                            "minimum": 1,
                            "maximum": 100
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "name": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "tracking_id": {
                                                        "type": "string"
                                                    },
                                                    "domains": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "role": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "timezone": {
                                                        "type": "string"
                                                    },
                                                    "tracking_enabled": {
                                                        "type": "boolean"
                                                    },
                                                    "created_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    }
                                                },
                                                "required": [
                                                    "id",
                                                    "name",
                                                    "tracking_id",
                                                    "domains",
                                                    "role",
                                                    "timezone",
                                                    "tracking_enabled",
                                                    "created_at"
                                                ]
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "pagination": {
                                                    "type": "object",
                                                    "properties": {
                                                        "page": {
                                                            "type": "integer"
                                                        },
                                                        "per_page": {
                                                            "type": "integer"
                                                        },
                                                        "total": {
                                                            "type": "integer"
                                                        },
                                                        "total_pages": {
                                                            "type": "integer"
                                                        },
                                                        "has_more": {
                                                            "type": "boolean"
                                                        }
                                                    },
                                                    "required": [
                                                        "page",
                                                        "per_page",
                                                        "total",
                                                        "total_pages",
                                                        "has_more"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "pagination"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "403": {
                        "$ref": "#\/components\/responses\/Forbidden"
                    },
                    "429": {
                        "$ref": "#\/components\/responses\/RateLimited"
                    }
                }
            }
        },
        "\/sites\/{site}": {
            "get": {
                "operationId": "v1.sites.show",
                "description": "Requires the `sites:read` ability.",
                "summary": "Get a site",
                "tags": [
                    "Sites"
                ],
                "parameters": [
                    {
                        "name": "site",
                        "in": "path",
                        "required": true,
                        "description": "The site ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "tracking_id": {
                                                    "type": "string"
                                                },
                                                "domains": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "role": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "timezone": {
                                                    "type": "string"
                                                },
                                                "tracking_enabled": {
                                                    "type": "boolean"
                                                },
                                                "created_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "name",
                                                "tracking_id",
                                                "domains",
                                                "role",
                                                "timezone",
                                                "tracking_enabled",
                                                "created_at"
                                            ]
                                        },
                                        "meta": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            },
                                            "minItems": 0,
                                            "maxItems": 0
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "403": {
                        "$ref": "#\/components\/responses\/Forbidden"
                    },
                    "429": {
                        "$ref": "#\/components\/responses\/RateLimited"
                    }
                }
            }
        },
        "\/sites\/{site}\/stats\/aggregate": {
            "get": {
                "operationId": "v1.stats.aggregate",
                "description": "Headline metrics for the date range: unique visitors, visits (sessions), pageviews, views per visit,\nbounce rate (% of visits with a single pageview) and average visit duration in seconds.\nPass `compare=previous` to also get the previous period of the same length and the % change per metric\n(`null` when the previous value is 0). Requires the `stats:read` ability.",
                "summary": "Aggregate",
                "tags": [
                    "Stats"
                ],
                "parameters": [
                    {
                        "name": "site",
                        "in": "path",
                        "required": true,
                        "description": "The site ID",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "period",
                        "in": "query",
                        "description": "Named date range, in `timezone`. Use `custom` with `date_from` and `date_to` for any other range (max 366 days).",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "enum": [
                                "today",
                                "yesterday",
                                "7d",
                                "14d",
                                "30d",
                                "90d",
                                "6mo",
                                "12mo",
                                "month",
                                "last_month",
                                "year",
                                "custom",
                                null
                            ],
                            "default": "30d"
                        }
                    },
                    {
                        "name": "date_from",
                        "in": "query",
                        "description": "First day of a custom range (YYYY-MM-DD, inclusive). Implies `period=custom`.",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "format": "date"
                        },
                        "example": "2026-10-01"
                    },
                    {
                        "name": "date_to",
                        "in": "query",
                        "description": "Last day of a custom range (YYYY-MM-DD, inclusive).",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "format": "date"
                        },
                        "example": "2026-10-31"
                    },
                    {
                        "name": "timezone",
                        "in": "query",
                        "description": "IANA timezone used for day boundaries and timeseries buckets. Defaults to the site's timezone (see the site's `timezone`), else UTC.",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "maxLength": 64
                        },
                        "example": "Europe\/Berlin"
                    },
                    {
                        "name": "filters",
                        "in": "query",
                        "style": "deepObject",
                        "schema": {
                            "type": "object",
                            "examples": [
                                {
                                    "page": "\/blog\/*",
                                    "country": "US|CA"
                                }
                            ],
                            "additionalProperties": {
                                "type": "string"
                            }
                        },
                        "explode": true
                    },
                    {
                        "name": "compare",
                        "in": "query",
                        "description": "Set to `previous` to compare with the previous period of the same length.",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "enum": [
                                "previous",
                                null
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "visitors": {
                                                    "type": "integer"
                                                },
                                                "visits": {
                                                    "type": "integer"
                                                },
                                                "pageviews": {
                                                    "type": "integer"
                                                },
                                                "views_per_visit": {
                                                    "type": "number"
                                                },
                                                "bounce_rate": {
                                                    "type": "number"
                                                },
                                                "visit_duration": {
                                                    "type": "number"
                                                },
                                                "comparison": {
                                                    "type": "object",
                                                    "properties": {
                                                        "date_from": {
                                                            "type": "string"
                                                        },
                                                        "date_to": {
                                                            "type": "string"
                                                        },
                                                        "previous": {
                                                            "type": "object",
                                                            "properties": {
                                                                "visitors": {
                                                                    "type": "integer"
                                                                },
                                                                "visits": {
                                                                    "type": "integer"
                                                                },
                                                                "pageviews": {
                                                                    "type": "integer"
                                                                },
                                                                "views_per_visit": {
                                                                    "type": "number"
                                                                },
                                                                "bounce_rate": {
                                                                    "type": "number"
                                                                },
                                                                "visit_duration": {
                                                                    "type": "number"
                                                                }
                                                            },
                                                            "required": [
                                                                "visitors",
                                                                "visits",
                                                                "pageviews",
                                                                "views_per_visit",
                                                                "bounce_rate",
                                                                "visit_duration"
                                                            ]
                                                        },
                                                        "change": {
                                                            "type": "object",
                                                            "properties": {
                                                                "visitors": {
                                                                    "type": [
                                                                        "number",
                                                                        "null"
                                                                    ]
                                                                },
                                                                "visits": {
                                                                    "type": [
                                                                        "number",
                                                                        "null"
                                                                    ]
                                                                },
                                                                "pageviews": {
                                                                    "type": [
                                                                        "number",
                                                                        "null"
                                                                    ]
                                                                },
                                                                "views_per_visit": {
                                                                    "type": [
                                                                        "number",
                                                                        "null"
                                                                    ]
                                                                },
                                                                "bounce_rate": {
                                                                    "type": [
                                                                        "number",
                                                                        "null"
                                                                    ]
                                                                },
                                                                "visit_duration": {
                                                                    "type": [
                                                                        "number",
                                                                        "null"
                                                                    ]
                                                                }
                                                            },
                                                            "required": [
                                                                "visitors",
                                                                "visits",
                                                                "pageviews",
                                                                "views_per_visit",
                                                                "bounce_rate",
                                                                "visit_duration"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "date_from",
                                                        "date_to",
                                                        "previous",
                                                        "change"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "visitors",
                                                "visits",
                                                "pageviews",
                                                "views_per_visit",
                                                "bounce_rate",
                                                "visit_duration"
                                            ]
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "site_id": {
                                                    "type": "integer"
                                                },
                                                "period": {
                                                    "type": "string"
                                                },
                                                "date_from": {
                                                    "type": "string"
                                                },
                                                "date_to": {
                                                    "type": "string"
                                                },
                                                "timezone": {
                                                    "type": "string"
                                                },
                                                "filters": {
                                                    "type": "object",
                                                    "additionalProperties": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "string"
                                                        }
                                                    }
                                                }
                                            },
                                            "required": [
                                                "site_id",
                                                "period",
                                                "date_from",
                                                "date_to",
                                                "timezone",
                                                "filters"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "403": {
                        "$ref": "#\/components\/responses\/Forbidden"
                    },
                    "429": {
                        "$ref": "#\/components\/responses\/RateLimited"
                    }
                }
            }
        },
        "\/sites\/{site}\/stats\/timeseries": {
            "get": {
                "operationId": "v1.stats.timeseries",
                "description": "Visitors, visits, pageviews and custom events per time bucket. Every bucket in the range is\nreturned (empty buckets are zeros). `date` is `YYYY-MM-DD` for day\/week\/month buckets (weeks start\non Monday) and an ISO 8601 datetime with offset for hourly buckets. Requires the `stats:read` ability.",
                "summary": "Timeseries",
                "tags": [
                    "Stats"
                ],
                "parameters": [
                    {
                        "name": "site",
                        "in": "path",
                        "required": true,
                        "description": "The site ID",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "period",
                        "in": "query",
                        "description": "Named date range, in `timezone`. Use `custom` with `date_from` and `date_to` for any other range (max 366 days).",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "enum": [
                                "today",
                                "yesterday",
                                "7d",
                                "14d",
                                "30d",
                                "90d",
                                "6mo",
                                "12mo",
                                "month",
                                "last_month",
                                "year",
                                "custom",
                                null
                            ],
                            "default": "30d"
                        }
                    },
                    {
                        "name": "date_from",
                        "in": "query",
                        "description": "First day of a custom range (YYYY-MM-DD, inclusive). Implies `period=custom`.",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "format": "date"
                        },
                        "example": "2026-10-01"
                    },
                    {
                        "name": "date_to",
                        "in": "query",
                        "description": "Last day of a custom range (YYYY-MM-DD, inclusive).",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "format": "date"
                        },
                        "example": "2026-10-31"
                    },
                    {
                        "name": "timezone",
                        "in": "query",
                        "description": "IANA timezone used for day boundaries and timeseries buckets. Defaults to the site's timezone (see the site's `timezone`), else UTC.",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "maxLength": 64
                        },
                        "example": "Europe\/Berlin"
                    },
                    {
                        "name": "filters",
                        "in": "query",
                        "style": "deepObject",
                        "schema": {
                            "type": "object",
                            "examples": [
                                {
                                    "page": "\/blog\/*",
                                    "country": "US|CA"
                                }
                            ],
                            "additionalProperties": {
                                "type": "string"
                            }
                        },
                        "explode": true
                    },
                    {
                        "name": "interval",
                        "in": "query",
                        "description": "Bucket size. Defaults to `hour` for ranges of up to 2 days and `day` otherwise. Hourly series are limited to 7 days.",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "enum": [
                                "hour",
                                "day",
                                "week",
                                "month",
                                null
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "date": {
                                                        "type": "string"
                                                    },
                                                    "visitors": {
                                                        "type": "integer"
                                                    },
                                                    "visits": {
                                                        "type": "integer"
                                                    },
                                                    "pageviews": {
                                                        "type": "integer"
                                                    },
                                                    "events": {
                                                        "type": "integer"
                                                    }
                                                },
                                                "required": [
                                                    "date",
                                                    "visitors",
                                                    "visits",
                                                    "pageviews",
                                                    "events"
                                                ]
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "site_id": {
                                                    "type": "integer"
                                                },
                                                "period": {
                                                    "type": "string"
                                                },
                                                "date_from": {
                                                    "type": "string"
                                                },
                                                "date_to": {
                                                    "type": "string"
                                                },
                                                "timezone": {
                                                    "type": "string"
                                                },
                                                "filters": {
                                                    "type": "object",
                                                    "additionalProperties": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "interval": {
                                                    "type": "string",
                                                    "enum": [
                                                        "hour",
                                                        "day",
                                                        "week",
                                                        "month"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "site_id",
                                                "period",
                                                "date_from",
                                                "date_to",
                                                "timezone",
                                                "filters",
                                                "interval"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "403": {
                        "$ref": "#\/components\/responses\/Forbidden"
                    },
                    "429": {
                        "$ref": "#\/components\/responses\/RateLimited"
                    }
                }
            }
        },
        "\/sites\/{site}\/stats\/breakdown\/{property}": {
            "get": {
                "operationId": "v1.stats.breakdown",
                "description": "Top values of a property, with visitors, visits and pageviews per value (entry\/exit pages: visitors\nand visits; events: events and visitors; goals: conversions, visitors and revenue). Sorted by\nvisitors (entry\/exit pages by visits, events by events, goals by conversions), descending.\nRequires the `stats:read` ability.\n\nCountries are ISO 3166-1 alpha-2 codes (with `country_name`); devices are Desktop, Mobile, Tablet\nor Bot; sources are referrer domains, with `Direct \/ None` for visits without a referrer.\n\nRow keys per property: `page` (pages, entry_pages, exit_pages), `hostname`, `source`, `referrer`,\n`utm_source`, `utm_medium`, `utm_campaign`, `utm_term`, `utm_content`, `country` + `country_name`,\n`region` + `country`, `city` + `region` + `country`, `device`, `browser`, `os`, `event`, `goal`.",
                "summary": "Breakdown",
                "tags": [
                    "Stats"
                ],
                "parameters": [
                    {
                        "name": "site",
                        "in": "path",
                        "required": true,
                        "description": "The site ID",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "period",
                        "in": "query",
                        "description": "Named date range, in `timezone`. Use `custom` with `date_from` and `date_to` for any other range (max 366 days).",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "enum": [
                                "today",
                                "yesterday",
                                "7d",
                                "14d",
                                "30d",
                                "90d",
                                "6mo",
                                "12mo",
                                "month",
                                "last_month",
                                "year",
                                "custom",
                                null
                            ],
                            "default": "30d"
                        }
                    },
                    {
                        "name": "date_from",
                        "in": "query",
                        "description": "First day of a custom range (YYYY-MM-DD, inclusive). Implies `period=custom`.",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "format": "date"
                        },
                        "example": "2026-10-01"
                    },
                    {
                        "name": "date_to",
                        "in": "query",
                        "description": "Last day of a custom range (YYYY-MM-DD, inclusive).",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "format": "date"
                        },
                        "example": "2026-10-31"
                    },
                    {
                        "name": "timezone",
                        "in": "query",
                        "description": "IANA timezone used for day boundaries and timeseries buckets. Defaults to the site's timezone (see the site's `timezone`), else UTC.",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "maxLength": 64
                        },
                        "example": "Europe\/Berlin"
                    },
                    {
                        "name": "filters",
                        "in": "query",
                        "style": "deepObject",
                        "schema": {
                            "type": "object",
                            "examples": [
                                {
                                    "page": "\/blog\/*",
                                    "country": "US|CA"
                                }
                            ],
                            "additionalProperties": {
                                "type": "string"
                            }
                        },
                        "explode": true
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Rows per page (max 1000).",
                        "schema": {
                            "type": [
                                "integer",
                                "null"
                            ],
                            "default": 100,
                            "minimum": 1,
                            "maximum": 1000
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number (1-based).",
                        "schema": {
                            "type": [
                                "integer",
                                "null"
                            ],
                            "default": 1,
                            "minimum": 1,
                            "maximum": 10000
                        }
                    },
                    {
                        "name": "property",
                        "in": "path",
                        "required": true,
                        "description": "What to break the stats down by: pages, entry_pages, exit_pages, hostnames, sources, referrers, utm_sources, utm_mediums, utm_campaigns, utm_terms, utm_contents, countries, regions, cities, devices, browsers, operating_systems, events or goals.",
                        "schema": {
                            "type": "string"
                        },
                        "example": "pages"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "page": {
                                                        "type": "string"
                                                    },
                                                    "source": {
                                                        "type": "string"
                                                    },
                                                    "country": {
                                                        "type": "string"
                                                    },
                                                    "country_name": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "visitors": {
                                                        "type": "integer"
                                                    },
                                                    "visits": {
                                                        "type": "integer"
                                                    },
                                                    "pageviews": {
                                                        "type": "integer"
                                                    },
                                                    "events": {
                                                        "type": "integer"
                                                    },
                                                    "conversions": {
                                                        "type": "integer"
                                                    },
                                                    "revenue": {
                                                        "type": "number"
                                                    }
                                                },
                                                "required": [
                                                    "visitors"
                                                ]
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "site_id": {
                                                    "type": "integer"
                                                },
                                                "property": {
                                                    "type": "string"
                                                },
                                                "period": {
                                                    "type": "string"
                                                },
                                                "date_from": {
                                                    "type": "string"
                                                },
                                                "date_to": {
                                                    "type": "string"
                                                },
                                                "timezone": {
                                                    "type": "string"
                                                },
                                                "filters": {
                                                    "type": "object",
                                                    "additionalProperties": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "pagination": {
                                                    "type": "object",
                                                    "properties": {
                                                        "page": {
                                                            "type": "integer"
                                                        },
                                                        "limit": {
                                                            "type": "integer"
                                                        },
                                                        "total": {
                                                            "type": "integer"
                                                        },
                                                        "has_more": {
                                                            "type": "boolean"
                                                        }
                                                    },
                                                    "required": [
                                                        "page",
                                                        "limit",
                                                        "total",
                                                        "has_more"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "site_id",
                                                "property",
                                                "period",
                                                "date_from",
                                                "date_to",
                                                "timezone",
                                                "filters",
                                                "pagination"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "403": {
                        "$ref": "#\/components\/responses\/Forbidden"
                    },
                    "429": {
                        "$ref": "#\/components\/responses\/RateLimited"
                    }
                }
            }
        },
        "\/sites\/{site}\/realtime\/visitors": {
            "get": {
                "operationId": "v1.realtime.visitors",
                "description": "Number of unique visitors seen on the site in the last 5 minutes. Cached for up to 15 seconds.\nRequires the `stats:read` ability.",
                "summary": "Current visitors",
                "tags": [
                    "Realtime"
                ],
                "parameters": [
                    {
                        "name": "site",
                        "in": "path",
                        "required": true,
                        "description": "The site ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "visitors": {
                                                    "type": "integer"
                                                }
                                            },
                                            "required": [
                                                "visitors"
                                            ]
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "site_id": {
                                                    "type": "integer"
                                                },
                                                "window_minutes": {
                                                    "type": "integer"
                                                },
                                                "as_of": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "site_id",
                                                "window_minutes",
                                                "as_of"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "403": {
                        "$ref": "#\/components\/responses\/Forbidden"
                    },
                    "429": {
                        "$ref": "#\/components\/responses\/RateLimited"
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "apiToken": {
                "type": "http",
                "description": "Personal API token from Settings \u2192 API tokens in the Invoker dashboard, sent as `Authorization: Bearer <token>`.",
                "scheme": "bearer"
            }
        },
        "responses": {
            "ValidationException": {
                "description": "Invalid parameters",
                "content": {
                    "application\/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "error": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "integer",
                                            "examples": [
                                                422
                                            ]
                                        },
                                        "code": {
                                            "type": "string",
                                            "description": "Machine-readable error code.",
                                            "examples": [
                                                "validation_failed"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "examples": [
                                                "The selected period is invalid."
                                            ]
                                        },
                                        "errors": {
                                            "type": "object",
                                            "description": "Messages per invalid parameter.",
                                            "examples": [
                                                {
                                                    "period": [
                                                        "The selected period is invalid."
                                                    ]
                                                }
                                            ],
                                            "additionalProperties": {
                                                "type": "array",
                                                "items": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "message"
                                    ]
                                }
                            },
                            "required": [
                                "error"
                            ]
                        }
                    }
                }
            },
            "AuthenticationException": {
                "description": "Missing, invalid, expired or revoked token",
                "content": {
                    "application\/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "error": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "integer",
                                            "examples": [
                                                401
                                            ]
                                        },
                                        "code": {
                                            "type": "string",
                                            "description": "Machine-readable error code.",
                                            "examples": [
                                                "unauthenticated"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "examples": [
                                                "Missing, invalid, expired or revoked API token. Send it as \"Authorization: Bearer <token>\"."
                                            ]
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "message"
                                    ]
                                }
                            },
                            "required": [
                                "error"
                            ]
                        }
                    }
                }
            },
            "ModelNotFoundException": {
                "description": "Not found (or not accessible to you)",
                "content": {
                    "application\/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "error": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "integer",
                                            "examples": [
                                                404
                                            ]
                                        },
                                        "code": {
                                            "type": "string",
                                            "description": "Machine-readable error code.",
                                            "examples": [
                                                "not_found"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "examples": [
                                                "Site not found."
                                            ]
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "message"
                                    ]
                                }
                            },
                            "required": [
                                "error"
                            ]
                        }
                    }
                }
            },
            "Forbidden": {
                "description": "The token lacks the required ability, is restricted to other sites, or the plan has no API access",
                "content": {
                    "application\/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "error": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "integer",
                                            "examples": [
                                                403
                                            ]
                                        },
                                        "code": {
                                            "type": "string",
                                            "description": "Machine-readable error code.",
                                            "examples": [
                                                "missing_ability"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "examples": [
                                                "This token does not have the \"stats:read\" ability."
                                            ]
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "message"
                                    ]
                                }
                            },
                            "required": [
                                "error"
                            ]
                        }
                    }
                }
            },
            "RateLimited": {
                "description": "Rate limit exceeded; retry after `Retry-After` seconds",
                "content": {
                    "application\/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "error": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "integer",
                                            "examples": [
                                                429
                                            ]
                                        },
                                        "code": {
                                            "type": "string",
                                            "description": "Machine-readable error code.",
                                            "examples": [
                                                "rate_limited"
                                            ]
                                        },
                                        "message": {
                                            "type": "string",
                                            "examples": [
                                                "Too many requests. Retry after 42 seconds."
                                            ]
                                        }
                                    },
                                    "required": [
                                        "status",
                                        "code",
                                        "message"
                                    ]
                                }
                            },
                            "required": [
                                "error"
                            ]
                        }
                    }
                },
                "headers": {
                    "Retry-After": {
                        "description": "Seconds until you can retry.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                }
            }
        }
    }
}