Dokumentacja
Przeglądaj dokumentację

Analytics REST API

The Privatus Analytics REST API: add .json to any app URL and send a token. Conventions and a reference of every operation, generated from the code.

Zobacz jako Markdown

Every page and action in Privatus Analytics is also an API endpoint. There's no separate /api/v1: add .json to a URL and send an API token.

sh
curl https://privatusanalytics.com/sites/pa_7Q2K9XH3AB/stats/aggregate.json?period=7d \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
json
{
  "data": {
    "period": { "from": "2026-09-23T00:00:00Z", "to": "2026-09-30T00:00:00Z" },
    "metrics": {
      "visitors": 1840, "visits": 2310, "pageviews": 5122,
      "views_per_visit": 2.22, "bounce_rate": 41.3,
      "visit_duration": 48000, "revenue": 129900
    }
  }
}

The reference below lists every operation with its method, path, permission, input schema and response schema. It's generated from the running code, as is the OpenAPI 3.1 document, so neither can drift from what the server does. The same operations are MCP tools.

Conventions#

Base URL https://privatusanalytics.com
Format JSON. Add .json to the path (or send Accept: application/json)
Auth Authorization: Bearer pat_… (Authentication)
Ids Public ids with a prefix: ws_… workspaces, pa_… sites, seg_… segments, wh_… webhooks
Reads GET with query parameters
Writes POST, PATCH, DELETE with a JSON body of flat fields
Success { "data": … }, plus "meta" for lists
Errors { "error": { "code", "message", "details" } } (Errors)
Lists page and per_page (max 100) (Pagination)
Times ISO 8601 in UTC. Date parameters (from, to) are days in the site's timezone
Money Minor units (cents) in the site currency, e.g. revenue: 129900 = 1,299.00
Durations Milliseconds

Common tasks#

Task Operation
List workspaces GET /workspaces.json
List sites GET /workspaces/{workspace_id}/sites.json
Headline metrics GET /sites/{site_id}/stats/aggregate.json
Chart data GET /sites/{site_id}/stats/timeseries.json
Top pages, sources, countries… GET /sites/{site_id}/breakdown/{dimension}.json
Everything on the Overview GET /sites/{site_id}/overview.json
Live visitors GET /sites/{site_id}/live.json
Add a note (e.g. a deploy) POST /sites/{site_id}/notes.json

See Stats endpoints and Examples.

In this section#

Authentication · Errors · Pagination · Rate limits · Filters · Stats endpoints · Examples · Webhooks · Changelog and deprecation

Sending data in is a different API: see Server-side ingest.

Wszystkie operacje

Uwierzytelnianie

Wyślij Authorization: Bearer pat_…. Tokeny utworzysz w ustawieniach przestrzeni roboczej, w sekcji Tokeny API. Przewodnik po uwierzytelnianiu.

JSON wszędzie

Dodaj .json do dowolnej ścieżki. Odpowiedzi mają postać { "data": … }, a błędy { "error": { "code", "message" } }. Błędy.

MCP

Wyślij POST z JSON-RPC na https://privatusanalytics.com/mcp z tym samym tokenem. Każda operacja poniżej jest narzędziem. Przewodnik po MCP.

Pobierz openapi.json · 285 operacji

Alerty

POST /alerts/:id/acknowledge.json Potwierdź ostatni incydent alerts_acknowledge

Uprawnienie: analytics.read

Przykład
curl -X POST https://privatusanalytics.com/alerts/:id/acknowledge.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator alertu, np. alr_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Identyfikator witryny (null dla alertów zużycia)"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "threshold, anomaly, goal, no_data, usage, uptime, ssl lub vitals"
    },
    "metric": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "operator": {
      "anyOf": [
        {
          "type": "string",
          "description": "gt, gte, lt lub lte"
        },
        {
          "type": "null"
        }
      ]
    },
    "threshold": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "window_minutes": {
      "type": "integer"
    },
    "sensitivity": {
      "type": "string",
      "description": "Czułość anomalii"
    },
    "goal_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "channel_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Identyfikatory kanałów powiadomień"
    },
    "state": {
      "type": "string",
      "description": "ok lub triggered"
    },
    "enabled": {
      "type": "boolean"
    },
    "muted_until": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_triggered_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_evaluated_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /workspaces/:workspace_id/alerts.json Utwórz alert alerts_create

Uprawnienie: content.write

Przykład
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/alerts.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny (pa_…). Wymagany, z wyjątkiem alertów zużycia"
    },
    "metric": {
      "type": "string",
      "description": "threshold/anomaly: visitors, visits, pageviews, bounce_rate lub conversion. vitals: lcp, inp, cls, fcp lub ttfb"
    },
    "operator": {
      "type": "string",
      "description": "Porównanie (gt, gte, lt, lte). anomaly: lt tylko spadki, gt tylko skoki, puste oba",
      "enum": [
        "gt",
        "gte",
        "lt",
        "lte"
      ]
    },
    "threshold": {
      "type": "number",
      "description": "threshold: wartość metryki, goal: ukończenia, no_data: godziny, usage: procent, ssl: dni, vitals: ms (CLS: wynik)"
    },
    "window_minutes": {
      "type": "integer",
      "description": "Okno oceny w minutach (od 5 do 10080)"
    },
    "sensitivity": {
      "type": "string",
      "description": "anomaly: low, medium lub high",
      "enum": [
        "low",
        "medium",
        "high"
      ]
    },
    "goal_id": {
      "type": "string",
      "description": "alerty goal i conversion: identyfikator celu (goal_…)"
    },
    "uptime_check_id": {
      "type": "string",
      "description": "uptime/ssl: identyfikator kontroli (domyślnie: wszystkie kontrole witryny)"
    },
    "channel_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Identyfikatory kanałów powiadomień (nch_…)"
    },
    "enabled": {
      "type": "boolean",
      "description": "Oceniaj ten alert"
    },
    "name": {
      "type": "string",
      "description": "Nazwa alertu",
      "examples": [
        "Traffic dropped"
      ]
    },
    "kind": {
      "type": "string",
      "description": "threshold, anomaly, goal, no_data, usage, uptime, ssl lub vitals",
      "enum": [
        "threshold",
        "anomaly",
        "goal",
        "no_data",
        "usage",
        "uptime",
        "ssl",
        "vitals"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "kind",
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator alertu, np. alr_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Identyfikator witryny (null dla alertów zużycia)"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "threshold, anomaly, goal, no_data, usage, uptime, ssl lub vitals"
    },
    "metric": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "operator": {
      "anyOf": [
        {
          "type": "string",
          "description": "gt, gte, lt lub lte"
        },
        {
          "type": "null"
        }
      ]
    },
    "threshold": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "window_minutes": {
      "type": "integer"
    },
    "sensitivity": {
      "type": "string",
      "description": "Czułość anomalii"
    },
    "goal_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "channel_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Identyfikatory kanałów powiadomień"
    },
    "state": {
      "type": "string",
      "description": "ok lub triggered"
    },
    "enabled": {
      "type": "boolean"
    },
    "muted_until": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_triggered_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_evaluated_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /alerts/:id.json Usuń alert alerts_delete

Uprawnienie: content.write

Przykład
curl -X DELETE https://privatusanalytics.com/alerts/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator alertu, np. alr_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Identyfikator witryny (null dla alertów zużycia)"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "threshold, anomaly, goal, no_data, usage, uptime, ssl lub vitals"
    },
    "metric": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "operator": {
      "anyOf": [
        {
          "type": "string",
          "description": "gt, gte, lt lub lte"
        },
        {
          "type": "null"
        }
      ]
    },
    "threshold": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "window_minutes": {
      "type": "integer"
    },
    "sensitivity": {
      "type": "string",
      "description": "Czułość anomalii"
    },
    "goal_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "channel_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Identyfikatory kanałów powiadomień"
    },
    "state": {
      "type": "string",
      "description": "ok lub triggered"
    },
    "enabled": {
      "type": "boolean"
    },
    "muted_until": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_triggered_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_evaluated_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /alerts/:id/history.json Historia incydentów alertu alerts_history

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/alerts/:id/history.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "open": {
      "type": "boolean",
      "description": "Tylko nierozwiązane incydenty",
      "default": false
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    },
    "page": {
      "type": "integer",
      "description": "Strona (od 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Wyników na stronę (maks. 100)"
    }
  },
  "required": [
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "triggered_at": {
        "type": "string",
        "format": "date-time"
      },
      "resolved_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "value": {
        "anyOf": [
          {
            "type": "number",
            "description": "Zmierzona wartość w chwili wyzwolenia"
          },
          {
            "type": "null"
          }
        ]
      },
      "message": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "acknowledged_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "acknowledged_by": {
        "anyOf": [
          {
            "type": "string",
            "description": "Imię i nazwisko członka, który potwierdził"
          },
          {
            "type": "null"
          }
        ]
      }
    }
  }
}
GET /workspaces/:workspace_id/alerts.json Wyświetl alerty alerts_list

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/workspaces/:workspace_id/alerts.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Tylko alerty tej witryny (pa_…)"
    },
    "state": {
      "type": "string",
      "description": "Tylko alerty ok lub triggered",
      "enum": [
        "ok",
        "triggered"
      ]
    },
    "kind": {
      "type": "string",
      "description": "Tylko ten rodzaj",
      "enum": [
        "threshold",
        "anomaly",
        "goal",
        "no_data",
        "usage",
        "uptime",
        "ssl",
        "vitals"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Strona (od 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Wyników na stronę (maks. 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Identyfikator alertu, np. alr_7Q2K9XH3AB"
      },
      "site_id": {
        "anyOf": [
          {
            "type": "string",
            "description": "Identyfikator witryny (null dla alertów zużycia)"
          },
          {
            "type": "null"
          }
        ]
      },
      "name": {
        "type": "string"
      },
      "kind": {
        "type": "string",
        "description": "threshold, anomaly, goal, no_data, usage, uptime, ssl lub vitals"
      },
      "metric": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "operator": {
        "anyOf": [
          {
            "type": "string",
            "description": "gt, gte, lt lub lte"
          },
          {
            "type": "null"
          }
        ]
      },
      "threshold": {
        "anyOf": [
          {
            "type": "number"
          },
          {
            "type": "null"
          }
        ]
      },
      "window_minutes": {
        "type": "integer"
      },
      "sensitivity": {
        "type": "string",
        "description": "Czułość anomalii"
      },
      "goal_id": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "channel_ids": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Identyfikatory kanałów powiadomień"
      },
      "state": {
        "type": "string",
        "description": "ok lub triggered"
      },
      "enabled": {
        "type": "boolean"
      },
      "muted_until": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "last_triggered_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "last_evaluated_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
POST /alerts/:id/mute.json Wycisz (lub włącz ponownie) powiadomienia alertu alerts_mute

Uprawnienie: content.write

Przykład
curl -X POST https://privatusanalytics.com/alerts/:id/mute.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "minutes": {
      "type": "integer",
      "description": "Wycisz na tyle minut (0 wyłącza wyciszenie, maks. 30 dni)",
      "default": 60
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator alertu, np. alr_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Identyfikator witryny (null dla alertów zużycia)"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "threshold, anomaly, goal, no_data, usage, uptime, ssl lub vitals"
    },
    "metric": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "operator": {
      "anyOf": [
        {
          "type": "string",
          "description": "gt, gte, lt lub lte"
        },
        {
          "type": "null"
        }
      ]
    },
    "threshold": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "window_minutes": {
      "type": "integer"
    },
    "sensitivity": {
      "type": "string",
      "description": "Czułość anomalii"
    },
    "goal_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "channel_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Identyfikatory kanałów powiadomień"
    },
    "state": {
      "type": "string",
      "description": "ok lub triggered"
    },
    "enabled": {
      "type": "boolean"
    },
    "muted_until": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_triggered_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_evaluated_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /alerts/:id.json Pobierz alert alerts_get

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/alerts/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator alertu, np. alr_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Identyfikator witryny (null dla alertów zużycia)"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "threshold, anomaly, goal, no_data, usage, uptime, ssl lub vitals"
    },
    "metric": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "operator": {
      "anyOf": [
        {
          "type": "string",
          "description": "gt, gte, lt lub lte"
        },
        {
          "type": "null"
        }
      ]
    },
    "threshold": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "window_minutes": {
      "type": "integer"
    },
    "sensitivity": {
      "type": "string",
      "description": "Czułość anomalii"
    },
    "goal_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "channel_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Identyfikatory kanałów powiadomień"
    },
    "state": {
      "type": "string",
      "description": "ok lub triggered"
    },
    "enabled": {
      "type": "boolean"
    },
    "muted_until": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_triggered_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_evaluated_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
PATCH /alerts/:id.json Zaktualizuj alert alerts_update

Uprawnienie: content.write

Przykład
curl -X PATCH https://privatusanalytics.com/alerts/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny (pa_…). Wymagany, z wyjątkiem alertów zużycia"
    },
    "metric": {
      "type": "string",
      "description": "threshold/anomaly: visitors, visits, pageviews, bounce_rate lub conversion. vitals: lcp, inp, cls, fcp lub ttfb"
    },
    "operator": {
      "type": "string",
      "description": "Porównanie (gt, gte, lt, lte). anomaly: lt tylko spadki, gt tylko skoki, puste oba",
      "enum": [
        "gt",
        "gte",
        "lt",
        "lte"
      ]
    },
    "threshold": {
      "type": "number",
      "description": "threshold: wartość metryki, goal: ukończenia, no_data: godziny, usage: procent, ssl: dni, vitals: ms (CLS: wynik)"
    },
    "window_minutes": {
      "type": "integer",
      "description": "Okno oceny w minutach (od 5 do 10080)"
    },
    "sensitivity": {
      "type": "string",
      "description": "anomaly: low, medium lub high",
      "enum": [
        "low",
        "medium",
        "high"
      ]
    },
    "goal_id": {
      "type": "string",
      "description": "alerty goal i conversion: identyfikator celu (goal_…)"
    },
    "uptime_check_id": {
      "type": "string",
      "description": "uptime/ssl: identyfikator kontroli (domyślnie: wszystkie kontrole witryny)"
    },
    "channel_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Identyfikatory kanałów powiadomień (nch_…)"
    },
    "enabled": {
      "type": "boolean",
      "description": "Oceniaj ten alert"
    },
    "name": {
      "type": "string",
      "description": "Nazwa alertu"
    },
    "kind": {
      "type": "string",
      "description": "Rodzaj alertu",
      "enum": [
        "threshold",
        "anomaly",
        "goal",
        "no_data",
        "usage",
        "uptime",
        "ssl",
        "vitals"
      ]
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator alertu, np. alr_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Identyfikator witryny (null dla alertów zużycia)"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "threshold, anomaly, goal, no_data, usage, uptime, ssl lub vitals"
    },
    "metric": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "operator": {
      "anyOf": [
        {
          "type": "string",
          "description": "gt, gte, lt lub lte"
        },
        {
          "type": "null"
        }
      ]
    },
    "threshold": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "window_minutes": {
      "type": "integer"
    },
    "sensitivity": {
      "type": "string",
      "description": "Czułość anomalii"
    },
    "goal_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "channel_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Identyfikatory kanałów powiadomień"
    },
    "state": {
      "type": "string",
      "description": "ok lub triggered"
    },
    "enabled": {
      "type": "boolean"
    },
    "muted_until": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_triggered_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_evaluated_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/alerts.json Wyświetl alerty witryny site_alerts_list

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/sites/:site_id/alerts.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "state": {
      "type": "string",
      "description": "Tylko alerty ok lub triggered",
      "enum": [
        "ok",
        "triggered"
      ]
    },
    "kind": {
      "type": "string",
      "description": "Tylko ten rodzaj",
      "enum": [
        "threshold",
        "anomaly",
        "goal",
        "no_data",
        "usage",
        "uptime",
        "ssl",
        "vitals"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Strona (od 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Wyników na stronę (maks. 100)"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Identyfikator alertu, np. alr_7Q2K9XH3AB"
      },
      "site_id": {
        "anyOf": [
          {
            "type": "string",
            "description": "Identyfikator witryny (null dla alertów zużycia)"
          },
          {
            "type": "null"
          }
        ]
      },
      "name": {
        "type": "string"
      },
      "kind": {
        "type": "string",
        "description": "threshold, anomaly, goal, no_data, usage, uptime, ssl lub vitals"
      },
      "metric": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "operator": {
        "anyOf": [
          {
            "type": "string",
            "description": "gt, gte, lt lub lte"
          },
          {
            "type": "null"
          }
        ]
      },
      "threshold": {
        "anyOf": [
          {
            "type": "number"
          },
          {
            "type": "null"
          }
        ]
      },
      "window_minutes": {
        "type": "integer"
      },
      "sensitivity": {
        "type": "string",
        "description": "Czułość anomalii"
      },
      "goal_id": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "channel_ids": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Identyfikatory kanałów powiadomień"
      },
      "state": {
        "type": "string",
        "description": "ok lub triggered"
      },
      "enabled": {
        "type": "boolean"
      },
      "muted_until": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "last_triggered_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "last_evaluated_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}

Analityka

GET /sites/:site_id/overview.json Przegląd witryny: metryki, serie wykresów, najlepsze panele, odwiedzający na żywo i notatki stats_overview

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/sites/:site_id/overview.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Gotowy zakres dat. Użyj custom z from/to",
      "enum": [
        "today",
        "yesterday",
        "24h",
        "7d",
        "14d",
        "28d",
        "30d",
        "90d",
        "mtd",
        "last_month",
        "qtd",
        "last_quarter",
        "ytd",
        "12mo",
        "last_year",
        "all",
        "custom"
      ],
      "default": "30d"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Początek własnego zakresu (strefa czasowa witryny)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Koniec własnego zakresu, włącznie"
    },
    "compare": {
      "type": "string",
      "description": "Okres porównawczy",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Początek własnego okresu porównawczego"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Koniec własnego okresu porównawczego"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Dopasuj dni tygodnia w porównaniu",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtry: [[\"dimension\",\"operator\",\"value\"], …]. Operatory: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Opakuj warunki w {\"any\": [...]}, aby uzyskać OR.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Zastosuj zapisany segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Dodaj zaimportowane dane historyczne (daty przed pierwszym natywnym zdarzeniem, ignorowane przy filtrach lub segmencie)",
      "default": false
    },
    "interval": {
      "type": "string",
      "description": "Rozmiar przedziału wykresu",
      "enum": [
        "auto",
        "minute",
        "hour",
        "day",
        "week",
        "month",
        "quarter",
        "year"
      ],
      "default": "auto"
    },
    "panels": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Wymiary, dla których uwzględnić najczęstsze wartości",
      "default": [
        "channel",
        "referrer",
        "page",
        "entry_page",
        "country",
        "device",
        "browser",
        "os",
        "utm_campaign",
        "event",
        "goal"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}
GET /sites/:site_id/experiments.json Raport eksperymentu: współczynnik konwersji na wariant, przyrost względem kontroli i istotność (test z dla dwóch proporcji) experiments_report

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/sites/:site_id/experiments.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Gotowy zakres dat. Użyj custom z from/to",
      "enum": [
        "today",
        "yesterday",
        "24h",
        "7d",
        "14d",
        "28d",
        "30d",
        "90d",
        "mtd",
        "last_month",
        "qtd",
        "last_quarter",
        "ytd",
        "12mo",
        "last_year",
        "all",
        "custom"
      ],
      "default": "30d"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Początek własnego zakresu (strefa czasowa witryny)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Koniec własnego zakresu, włącznie"
    },
    "compare": {
      "type": "string",
      "description": "Okres porównawczy",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Początek własnego okresu porównawczego"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Koniec własnego okresu porównawczego"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Dopasuj dni tygodnia w porównaniu",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtry: [[\"dimension\",\"operator\",\"value\"], …]. Operatory: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Opakuj warunki w {\"any\": [...]}, aby uzyskać OR.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Zastosuj zapisany segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Dodaj zaimportowane dane historyczne (daty przed pierwszym natywnym zdarzeniem, ignorowane przy filtrach lub segmencie)",
      "default": false
    },
    "property": {
      "type": "string",
      "description": "Właściwość zdarzenia przechowująca wariant, np. variant",
      "examples": [
        "variant"
      ]
    },
    "goal_id": {
      "type": "string",
      "description": "Cel liczony jako konwersja (goal_…)"
    },
    "control": {
      "type": "string",
      "description": "Wariant kontrolny (domyślnie \"control\", jeśli istnieje, w przeciwnym razie wariant z największą liczbą wizyt)"
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "property",
    "goal_id",
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}
GET /sites/:site_id/insights.json Istotne zmiany względem poprzedniego okresu, prostym językiem (najwięksi zmieniający się, zmiany konwersji celów) insights_get

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/sites/:site_id/insights.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Pełne dni do wczoraj, porównane z tą samą liczbą dni wcześniej",
      "enum": [
        "7d",
        "14d",
        "28d",
        "30d"
      ],
      "default": "7d"
    },
    "limit": {
      "type": "integer",
      "description": "Maksymalna liczba spostrzeżeń (od 1 do 20)",
      "default": 8
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}
GET /sites/:site_id/journeys.json Ścieżki: najpopularniejsze 3-krokowe ścieżki po stronie (lub dowolnym wejściu) albo przed stroną lub celem journeys_explore

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/sites/:site_id/journeys.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Gotowy zakres dat. Użyj custom z from/to",
      "enum": [
        "today",
        "yesterday",
        "24h",
        "7d",
        "14d",
        "28d",
        "30d",
        "90d",
        "mtd",
        "last_month",
        "qtd",
        "last_quarter",
        "ytd",
        "12mo",
        "last_year",
        "all",
        "custom"
      ],
      "default": "30d"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Początek własnego zakresu (strefa czasowa witryny)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Koniec własnego zakresu, włącznie"
    },
    "compare": {
      "type": "string",
      "description": "Okres porównawczy",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Początek własnego okresu porównawczego"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Koniec własnego okresu porównawczego"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Dopasuj dni tygodnia w porównaniu",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtry: [[\"dimension\",\"operator\",\"value\"], …]. Operatory: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Opakuj warunki w {\"any\": [...]}, aby uzyskać OR.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Zastosuj zapisany segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Dodaj zaimportowane dane historyczne (daty przed pierwszym natywnym zdarzeniem, ignorowane przy filtrach lub segmencie)",
      "default": false
    },
    "mode": {
      "type": "string",
      "description": "forward: strony po stronie początkowej, reverse: strony prowadzące do strony końcowej lub celu",
      "enum": [
        "forward",
        "reverse"
      ],
      "default": "forward"
    },
    "path": {
      "type": "string",
      "description": "Strona początkowa (forward) lub końcowa (reverse). Puste oznacza dowolne wejście (tylko forward)"
    },
    "goal_id": {
      "type": "string",
      "description": "Tryb reverse: zakończ na tym celu (goal_…) zamiast na stronie"
    },
    "limit": {
      "type": "integer",
      "description": "Stron pokazywanych na krok (maks. 12)",
      "default": 6
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}
GET /sites/:site_id/pages/detail.json Szczegóły strony: metryki, poprzednie i następne strony, źródła, Web Vitals, zdarzenia i mapa kliknięć dla jednej ścieżki pages_detail

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/sites/:site_id/pages/detail.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Gotowy zakres dat. Użyj custom z from/to",
      "enum": [
        "today",
        "yesterday",
        "24h",
        "7d",
        "14d",
        "28d",
        "30d",
        "90d",
        "mtd",
        "last_month",
        "qtd",
        "last_quarter",
        "ytd",
        "12mo",
        "last_year",
        "all",
        "custom"
      ],
      "default": "30d"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Początek własnego zakresu (strefa czasowa witryny)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Koniec własnego zakresu, włącznie"
    },
    "compare": {
      "type": "string",
      "description": "Okres porównawczy",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Początek własnego okresu porównawczego"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Koniec własnego okresu porównawczego"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Dopasuj dni tygodnia w porównaniu",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtry: [[\"dimension\",\"operator\",\"value\"], …]. Operatory: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Opakuj warunki w {\"any\": [...]}, aby uzyskać OR.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Zastosuj zapisany segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Dodaj zaimportowane dane historyczne (daty przed pierwszym natywnym zdarzeniem, ignorowane przy filtrach lub segmencie)",
      "default": false
    },
    "path": {
      "type": "string",
      "description": "Ścieżka strony, np. /pricing",
      "examples": [
        "/pricing"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "path",
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}
GET /sites/:site_id/stats/aggregate.json Główne metryki dla okresu (z porównaniem) stats_aggregate

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/sites/:site_id/stats/aggregate.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Gotowy zakres dat. Użyj custom z from/to",
      "enum": [
        "today",
        "yesterday",
        "24h",
        "7d",
        "14d",
        "28d",
        "30d",
        "90d",
        "mtd",
        "last_month",
        "qtd",
        "last_quarter",
        "ytd",
        "12mo",
        "last_year",
        "all",
        "custom"
      ],
      "default": "30d"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Początek własnego zakresu (strefa czasowa witryny)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Koniec własnego zakresu, włącznie"
    },
    "compare": {
      "type": "string",
      "description": "Okres porównawczy",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Początek własnego okresu porównawczego"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Koniec własnego okresu porównawczego"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Dopasuj dni tygodnia w porównaniu",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtry: [[\"dimension\",\"operator\",\"value\"], …]. Operatory: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Opakuj warunki w {\"any\": [...]}, aby uzyskać OR.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Zastosuj zapisany segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Dodaj zaimportowane dane historyczne (daty przed pierwszym natywnym zdarzeniem, ignorowane przy filtrach lub segmencie)",
      "default": false
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}
GET /sites/:site_id/breakdown/:dimension.json Najczęstsze wartości wymiaru (strony, źródła, kraje…) stats_breakdown

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/sites/:site_id/breakdown/:dimension.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Gotowy zakres dat. Użyj custom z from/to",
      "enum": [
        "today",
        "yesterday",
        "24h",
        "7d",
        "14d",
        "28d",
        "30d",
        "90d",
        "mtd",
        "last_month",
        "qtd",
        "last_quarter",
        "ytd",
        "12mo",
        "last_year",
        "all",
        "custom"
      ],
      "default": "30d"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Początek własnego zakresu (strefa czasowa witryny)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Koniec własnego zakresu, włącznie"
    },
    "compare": {
      "type": "string",
      "description": "Okres porównawczy",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Początek własnego okresu porównawczego"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Koniec własnego okresu porównawczego"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Dopasuj dni tygodnia w porównaniu",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtry: [[\"dimension\",\"operator\",\"value\"], …]. Operatory: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Opakuj warunki w {\"any\": [...]}, aby uzyskać OR.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Zastosuj zapisany segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Dodaj zaimportowane dane historyczne (daty przed pierwszym natywnym zdarzeniem, ignorowane przy filtrach lub segmencie)",
      "default": false
    },
    "dimension": {
      "type": "string",
      "description": "Dimension zasobu"
    },
    "limit": {
      "type": "integer",
      "description": "Wierszy na stronę (maks. 1000)",
      "default": 10
    },
    "page": {
      "type": "integer",
      "description": "Numer strony",
      "default": 1
    },
    "sort": {
      "type": "string",
      "description": "Metryka sortowania",
      "enum": [
        "visitors",
        "visits",
        "pageviews",
        "revenue"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "dimension",
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}
GET /sites/:site_id/stats/timeseries.json Metryki na przedział czasu dla wykresów stats_timeseries

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/sites/:site_id/stats/timeseries.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Gotowy zakres dat. Użyj custom z from/to",
      "enum": [
        "today",
        "yesterday",
        "24h",
        "7d",
        "14d",
        "28d",
        "30d",
        "90d",
        "mtd",
        "last_month",
        "qtd",
        "last_quarter",
        "ytd",
        "12mo",
        "last_year",
        "all",
        "custom"
      ],
      "default": "30d"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Początek własnego zakresu (strefa czasowa witryny)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Koniec własnego zakresu, włącznie"
    },
    "compare": {
      "type": "string",
      "description": "Okres porównawczy",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Początek własnego okresu porównawczego"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Koniec własnego okresu porównawczego"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Dopasuj dni tygodnia w porównaniu",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtry: [[\"dimension\",\"operator\",\"value\"], …]. Operatory: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Opakuj warunki w {\"any\": [...]}, aby uzyskać OR.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Zastosuj zapisany segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Dodaj zaimportowane dane historyczne (daty przed pierwszym natywnym zdarzeniem, ignorowane przy filtrach lub segmencie)",
      "default": false
    },
    "interval": {
      "type": "string",
      "description": "Rozmiar przedziału. auto wybiera go dla zakresu",
      "enum": [
        "auto",
        "minute",
        "hour",
        "day",
        "week",
        "month",
        "quarter",
        "year"
      ],
      "default": "auto"
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}

Asystent

POST /sites/:site_id/ask.json Zadaj pytanie w nowej rozmowie (wlicza się do miesięcznego limitu pytań AI) assistant_ask

Uprawnienie: analytics.read

Przykład
curl -X POST https://privatusanalytics.com/sites/:site_id/ask.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "question": {
      "type": "string",
      "description": "Twoje pierwsze pytanie zwykłym językiem",
      "examples": [
        "How many visitors did we have last week?"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "question",
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator rozmowy, np. ask_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Identyfikator witryny"
        },
        {
          "type": "null"
        }
      ]
    },
    "title": {
      "anyOf": [
        {
          "type": "string",
          "description": "Pierwsze pytanie, skrócone"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Czas ostatniej wiadomości"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time",
      "description": "Usuwana automatycznie po tym czasie (30 dni po ostatniej wiadomości)"
    },
    "messages": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Identyfikator wiadomości w rozmowie"
        },
        "role": {
          "type": "string",
          "description": "user (pytanie) lub assistant (odpowiedź)"
        },
        "content": {
          "type": "string",
          "description": "Pytanie lub odpowiedź w Markdown"
        },
        "queries": {
          "type": "array",
          "items": {
            "type": "object"
          },
          "description": "Jak do tego doszedłem: dokładne zapytania API stojące za odpowiedzią, jako [{tool, input, status, error}]"
        },
        "chart": {
          "anyOf": [
            {
              "type": "object",
              "description": "Wykres odpowiedzi: {type: line, labels, series, comparison, metric, format} lub {type: table, columns, rows}"
            },
            {
              "type": "null"
            }
          ]
        },
        "goal_draft": {
          "anyOf": [
            {
              "type": "object",
              "description": "Cel zaproponowany przez asystenta, do potwierdzenia przez goals_create"
            },
            {
              "type": "null"
            }
          ]
        },
        "input_tokens": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Użyte tokeny wejściowe modelu"
            },
            {
              "type": "null"
            }
          ]
        },
        "output_tokens": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Użyte tokeny wyjściowe modelu"
            },
            {
              "type": "null"
            }
          ]
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        }
      },
      "description": "Pytania i odpowiedzi, od najstarszych"
    }
  }
}
DELETE /sites/:site_id/ask/:id.json Usuń rozmowę Ask i jej wiadomości assistant_conversations_delete

Uprawnienie: analytics.read

Przykład
curl -X DELETE https://privatusanalytics.com/sites/:site_id/ask/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator rozmowy, np. ask_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Identyfikator witryny"
        },
        {
          "type": "null"
        }
      ]
    },
    "title": {
      "anyOf": [
        {
          "type": "string",
          "description": "Pierwsze pytanie, skrócone"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Czas ostatniej wiadomości"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time",
      "description": "Usuwana automatycznie po tym czasie (30 dni po ostatniej wiadomości)"
    }
  }
}
GET /sites/:site_id/ask.json Wyświetl swoje rozmowy Ask dla witryny assistant_conversations_list

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/sites/:site_id/ask.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Strona (od 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Wyników na stronę (maks. 100)"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Identyfikator rozmowy, np. ask_7Q2K9XH3AB"
      },
      "site_id": {
        "anyOf": [
          {
            "type": "string",
            "description": "Identyfikator witryny"
          },
          {
            "type": "null"
          }
        ]
      },
      "title": {
        "anyOf": [
          {
            "type": "string",
            "description": "Pierwsze pytanie, skrócone"
          },
          {
            "type": "null"
          }
        ]
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      },
      "updated_at": {
        "type": "string",
        "format": "date-time",
        "description": "Czas ostatniej wiadomości"
      },
      "expires_at": {
        "type": "string",
        "format": "date-time",
        "description": "Usuwana automatycznie po tym czasie (30 dni po ostatniej wiadomości)"
      }
    }
  }
}
GET /sites/:site_id/ask/:id.json Rozmowa Ask: pytania, odpowiedzi, zapytania, na których się opierają, i wykresy assistant_conversations_get

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/sites/:site_id/ask/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator rozmowy, np. ask_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Identyfikator witryny"
        },
        {
          "type": "null"
        }
      ]
    },
    "title": {
      "anyOf": [
        {
          "type": "string",
          "description": "Pierwsze pytanie, skrócone"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Czas ostatniej wiadomości"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time",
      "description": "Usuwana automatycznie po tym czasie (30 dni po ostatniej wiadomości)"
    },
    "messages": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Identyfikator wiadomości w rozmowie"
        },
        "role": {
          "type": "string",
          "description": "user (pytanie) lub assistant (odpowiedź)"
        },
        "content": {
          "type": "string",
          "description": "Pytanie lub odpowiedź w Markdown"
        },
        "queries": {
          "type": "array",
          "items": {
            "type": "object"
          },
          "description": "Jak do tego doszedłem: dokładne zapytania API stojące za odpowiedzią, jako [{tool, input, status, error}]"
        },
        "chart": {
          "anyOf": [
            {
              "type": "object",
              "description": "Wykres odpowiedzi: {type: line, labels, series, comparison, metric, format} lub {type: table, columns, rows}"
            },
            {
              "type": "null"
            }
          ]
        },
        "goal_draft": {
          "anyOf": [
            {
              "type": "object",
              "description": "Cel zaproponowany przez asystenta, do potwierdzenia przez goals_create"
            },
            {
              "type": "null"
            }
          ]
        },
        "input_tokens": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Użyte tokeny wejściowe modelu"
            },
            {
              "type": "null"
            }
          ]
        },
        "output_tokens": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Użyte tokeny wyjściowe modelu"
            },
            {
              "type": "null"
            }
          ]
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        }
      },
      "description": "Pytania i odpowiedzi, od najstarszych"
    }
  }
}
POST /sites/:site_id/ask/:ask_conversation_id/messages.json Zadaj pytanie uzupełniające w rozmowie (wlicza się do miesięcznego limitu pytań AI). Zwraca odpowiedź. assistant_ask_followup

Uprawnienie: analytics.read

Przykład
curl -X POST https://privatusanalytics.com/sites/:site_id/ask/:ask_conversation_id/messages.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "question": {
      "type": "string",
      "description": "Twoje pytanie zwykłym językiem",
      "examples": [
        "Which pages had the most visitors last week?"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    },
    "ask_conversation_id": {
      "type": "string",
      "description": "Ask conversation zasobu"
    }
  },
  "required": [
    "question",
    "site_id",
    "ask_conversation_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Identyfikator wiadomości w rozmowie"
    },
    "role": {
      "type": "string",
      "description": "user (pytanie) lub assistant (odpowiedź)"
    },
    "content": {
      "type": "string",
      "description": "Pytanie lub odpowiedź w Markdown"
    },
    "queries": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Jak do tego doszedłem: dokładne zapytania API stojące za odpowiedzią, jako [{tool, input, status, error}]"
    },
    "chart": {
      "anyOf": [
        {
          "type": "object",
          "description": "Wykres odpowiedzi: {type: line, labels, series, comparison, metric, format} lub {type: table, columns, rows}"
        },
        {
          "type": "null"
        }
      ]
    },
    "goal_draft": {
      "anyOf": [
        {
          "type": "object",
          "description": "Cel zaproponowany przez asystenta, do potwierdzenia przez goals_create"
        },
        {
          "type": "null"
        }
      ]
    },
    "input_tokens": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Użyte tokeny wejściowe modelu"
        },
        {
          "type": "null"
        }
      ]
    },
    "output_tokens": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Użyte tokeny wyjściowe modelu"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Cele

POST /sites/:site_id/goals/:id/archive.json Zarchiwizuj cel (ukryty w raportach) goals_archive

Uprawnienie: content.write

Przykład
curl -X POST https://privatusanalytics.com/sites/:site_id/goals/:id/archive.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator celu, np. goal_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "page, event, engagement, outbound lub download"
    },
    "match_type": {
      "type": "string",
      "description": "exact, prefix, glob lub regex"
    },
    "pattern": {
      "anyOf": [
        {
          "type": "string",
          "description": "Wzorzec ścieżki, domeny lub pliku"
        },
        {
          "type": "null"
        }
      ]
    },
    "hostname": {
      "anyOf": [
        {
          "type": "string",
          "description": "Ograniczenie do nazwy hosta (cele page)"
        },
        {
          "type": "null"
        }
      ]
    },
    "event_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nazwa zdarzenia niestandardowego (cele event)"
        },
        {
          "type": "null"
        }
      ]
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Warunki właściwości zdarzenia"
    },
    "scroll_threshold": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engagement: przewinięcie w %"
        },
        {
          "type": "null"
        }
      ]
    },
    "time_threshold_seconds": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engagement: sekundy na stronie"
        },
        {
          "type": "null"
        }
      ]
    },
    "value_mode": {
      "type": "string",
      "description": "none, fixed lub revenue"
    },
    "fixed_value_minor": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Stała wartość w jednostkach podrzędnych"
        },
        {
          "type": "null"
        }
      ]
    },
    "count_mode": {
      "type": "string",
      "description": "once_per_visit lub every"
    },
    "archived": {
      "type": "boolean"
    },
    "archived_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "stats": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "completions": {
              "type": "integer",
              "description": "Pasujące zdarzenia, z powtórzeniami"
            },
            "conversions": {
              "type": "integer",
              "description": "Wizyty z co najmniej jednym ukończeniem"
            },
            "conversion_rate": {
              "type": "number",
              "description": "Konwersje ÷ wizyty (lub ÷ odwiedzający, zależnie od ustawienia witryny), %"
            },
            "value": {
              "type": "integer",
              "description": "Wartość celu w jednostkach podrzędnych waluty witryny"
            },
            "change": {
              "anyOf": [
                {
                  "type": "number",
                  "description": "Zmiana konwersji względem poprzedniego okresu, %"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Statystyki okresu (tylko lista)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /sites/:site_id/goals.json Utwórz cel goals_create

Uprawnienie: content.write

Przykład
curl -X POST https://privatusanalytics.com/sites/:site_id/goals.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nazwa celu",
      "examples": [
        "Signed up"
      ]
    },
    "kind": {
      "type": "string",
      "description": "page (odwiedzenie strony), event (zdarzenie niestandardowe), engagement (przewijanie lub czas na stronie), outbound (kliknięcie linku wychodzącego) lub download (pobranie pliku)",
      "enum": [
        "page",
        "event",
        "engagement",
        "outbound",
        "download"
      ]
    },
    "match_type": {
      "type": "string",
      "description": "Jak pattern dopasowuje ścieżkę (page, engagement), domenę linku (outbound) lub plik (download): exact, prefix, glob (*) lub regex",
      "enum": [
        "exact",
        "prefix",
        "glob",
        "regex"
      ],
      "default": "exact"
    },
    "pattern": {
      "type": "string",
      "description": "Wzorzec ścieżki, domeny lub pliku, np. /pricing, /blog/*, stripe.com lub *.pdf"
    },
    "hostname": {
      "type": "string",
      "description": "Zliczaj tylko strony w tej nazwie hosta (cele page)"
    },
    "event_name": {
      "type": "string",
      "description": "Nazwa zdarzenia niestandardowego (cele event)"
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      },
      "description": "Warunki właściwości zdarzenia: [{\"key\": \"plan\", \"operator\": \"is|is_not|contains|gt|lt\", \"value\": \"pro\"}]",
      "default": []
    },
    "scroll_threshold": {
      "type": "integer",
      "description": "Engagement: głębokość przewinięcia w %, którą trzeba osiągnąć"
    },
    "time_threshold_seconds": {
      "type": "integer",
      "description": "Engagement: sekundy na stronie"
    },
    "value_mode": {
      "type": "string",
      "description": "none, fixed (fixed_value na konwersję) lub revenue (przychód ze zdarzenia)",
      "enum": [
        "none",
        "fixed",
        "revenue"
      ],
      "default": "none"
    },
    "fixed_value": {
      "type": "number",
      "description": "Stała wartość na konwersję w walucie witryny, np. 50.0"
    },
    "count_mode": {
      "type": "string",
      "description": "Wartość liczy się once_per_visit lub przy każdym ukończeniu",
      "enum": [
        "once_per_visit",
        "every"
      ],
      "default": "once_per_visit"
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "kind",
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator celu, np. goal_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "page, event, engagement, outbound lub download"
    },
    "match_type": {
      "type": "string",
      "description": "exact, prefix, glob lub regex"
    },
    "pattern": {
      "anyOf": [
        {
          "type": "string",
          "description": "Wzorzec ścieżki, domeny lub pliku"
        },
        {
          "type": "null"
        }
      ]
    },
    "hostname": {
      "anyOf": [
        {
          "type": "string",
          "description": "Ograniczenie do nazwy hosta (cele page)"
        },
        {
          "type": "null"
        }
      ]
    },
    "event_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nazwa zdarzenia niestandardowego (cele event)"
        },
        {
          "type": "null"
        }
      ]
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Warunki właściwości zdarzenia"
    },
    "scroll_threshold": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engagement: przewinięcie w %"
        },
        {
          "type": "null"
        }
      ]
    },
    "time_threshold_seconds": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engagement: sekundy na stronie"
        },
        {
          "type": "null"
        }
      ]
    },
    "value_mode": {
      "type": "string",
      "description": "none, fixed lub revenue"
    },
    "fixed_value_minor": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Stała wartość w jednostkach podrzędnych"
        },
        {
          "type": "null"
        }
      ]
    },
    "count_mode": {
      "type": "string",
      "description": "once_per_visit lub every"
    },
    "archived": {
      "type": "boolean"
    },
    "archived_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "stats": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "completions": {
              "type": "integer",
              "description": "Pasujące zdarzenia, z powtórzeniami"
            },
            "conversions": {
              "type": "integer",
              "description": "Wizyty z co najmniej jednym ukończeniem"
            },
            "conversion_rate": {
              "type": "number",
              "description": "Konwersje ÷ wizyty (lub ÷ odwiedzający, zależnie od ustawienia witryny), %"
            },
            "value": {
              "type": "integer",
              "description": "Wartość celu w jednostkach podrzędnych waluty witryny"
            },
            "change": {
              "anyOf": [
                {
                  "type": "number",
                  "description": "Zmiana konwersji względem poprzedniego okresu, %"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Statystyki okresu (tylko lista)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:site_id/goals/:id.json Usuń cel (dane zostają zachowane) goals_delete

Uprawnienie: content.write

Przykład
curl -X DELETE https://privatusanalytics.com/sites/:site_id/goals/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator celu, np. goal_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "page, event, engagement, outbound lub download"
    },
    "match_type": {
      "type": "string",
      "description": "exact, prefix, glob lub regex"
    },
    "pattern": {
      "anyOf": [
        {
          "type": "string",
          "description": "Wzorzec ścieżki, domeny lub pliku"
        },
        {
          "type": "null"
        }
      ]
    },
    "hostname": {
      "anyOf": [
        {
          "type": "string",
          "description": "Ograniczenie do nazwy hosta (cele page)"
        },
        {
          "type": "null"
        }
      ]
    },
    "event_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nazwa zdarzenia niestandardowego (cele event)"
        },
        {
          "type": "null"
        }
      ]
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Warunki właściwości zdarzenia"
    },
    "scroll_threshold": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engagement: przewinięcie w %"
        },
        {
          "type": "null"
        }
      ]
    },
    "time_threshold_seconds": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engagement: sekundy na stronie"
        },
        {
          "type": "null"
        }
      ]
    },
    "value_mode": {
      "type": "string",
      "description": "none, fixed lub revenue"
    },
    "fixed_value_minor": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Stała wartość w jednostkach podrzędnych"
        },
        {
          "type": "null"
        }
      ]
    },
    "count_mode": {
      "type": "string",
      "description": "once_per_visit lub every"
    },
    "archived": {
      "type": "boolean"
    },
    "archived_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "stats": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "completions": {
              "type": "integer",
              "description": "Pasujące zdarzenia, z powtórzeniami"
            },
            "conversions": {
              "type": "integer",
              "description": "Wizyty z co najmniej jednym ukończeniem"
            },
            "conversion_rate": {
              "type": "number",
              "description": "Konwersje ÷ wizyty (lub ÷ odwiedzający, zależnie od ustawienia witryny), %"
            },
            "value": {
              "type": "integer",
              "description": "Wartość celu w jednostkach podrzędnych waluty witryny"
            },
            "change": {
              "anyOf": [
                {
                  "type": "number",
                  "description": "Zmiana konwersji względem poprzedniego okresu, %"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Statystyki okresu (tylko lista)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /sites/:site_id/goals/:id/duplicate.json Skopiuj cel goals_duplicate

Uprawnienie: content.write

Przykład
curl -X POST https://privatusanalytics.com/sites/:site_id/goals/:id/duplicate.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nazwa kopii"
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator celu, np. goal_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "page, event, engagement, outbound lub download"
    },
    "match_type": {
      "type": "string",
      "description": "exact, prefix, glob lub regex"
    },
    "pattern": {
      "anyOf": [
        {
          "type": "string",
          "description": "Wzorzec ścieżki, domeny lub pliku"
        },
        {
          "type": "null"
        }
      ]
    },
    "hostname": {
      "anyOf": [
        {
          "type": "string",
          "description": "Ograniczenie do nazwy hosta (cele page)"
        },
        {
          "type": "null"
        }
      ]
    },
    "event_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nazwa zdarzenia niestandardowego (cele event)"
        },
        {
          "type": "null"
        }
      ]
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Warunki właściwości zdarzenia"
    },
    "scroll_threshold": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engagement: przewinięcie w %"
        },
        {
          "type": "null"
        }
      ]
    },
    "time_threshold_seconds": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engagement: sekundy na stronie"
        },
        {
          "type": "null"
        }
      ]
    },
    "value_mode": {
      "type": "string",
      "description": "none, fixed lub revenue"
    },
    "fixed_value_minor": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Stała wartość w jednostkach podrzędnych"
        },
        {
          "type": "null"
        }
      ]
    },
    "count_mode": {
      "type": "string",
      "description": "once_per_visit lub every"
    },
    "archived": {
      "type": "boolean"
    },
    "archived_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "stats": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "completions": {
              "type": "integer",
              "description": "Pasujące zdarzenia, z powtórzeniami"
            },
            "conversions": {
              "type": "integer",
              "description": "Wizyty z co najmniej jednym ukończeniem"
            },
            "conversion_rate": {
              "type": "number",
              "description": "Konwersje ÷ wizyty (lub ÷ odwiedzający, zależnie od ustawienia witryny), %"
            },
            "value": {
              "type": "integer",
              "description": "Wartość celu w jednostkach podrzędnych waluty witryny"
            },
            "change": {
              "anyOf": [
                {
                  "type": "number",
                  "description": "Zmiana konwersji względem poprzedniego okresu, %"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Statystyki okresu (tylko lista)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/goals.json Wyświetl cele z ukończeniami, konwersjami, współczynnikiem i wartością dla okresu goals_list

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/sites/:site_id/goals.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Gotowy zakres dat. Użyj custom z from/to",
      "enum": [
        "today",
        "yesterday",
        "24h",
        "7d",
        "14d",
        "28d",
        "30d",
        "90d",
        "mtd",
        "last_month",
        "qtd",
        "last_quarter",
        "ytd",
        "12mo",
        "last_year",
        "all",
        "custom"
      ],
      "default": "30d"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Początek własnego zakresu (strefa czasowa witryny)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Koniec własnego zakresu, włącznie"
    },
    "compare": {
      "type": "string",
      "description": "Okres porównawczy",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Początek własnego okresu porównawczego"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Koniec własnego okresu porównawczego"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Dopasuj dni tygodnia w porównaniu",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtry: [[\"dimension\",\"operator\",\"value\"], …]. Operatory: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Opakuj warunki w {\"any\": [...]}, aby uzyskać OR.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Zastosuj zapisany segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Dodaj zaimportowane dane historyczne (daty przed pierwszym natywnym zdarzeniem, ignorowane przy filtrach lub segmencie)",
      "default": false
    },
    "status": {
      "type": "string",
      "description": "Cele active, archived lub all",
      "enum": [
        "active",
        "archived",
        "all"
      ],
      "default": "active"
    },
    "page": {
      "type": "integer",
      "description": "Numer strony",
      "default": 1
    },
    "per_page": {
      "type": "integer",
      "description": "Celów na stronę (maks. 100)",
      "default": 25
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Identyfikator celu, np. goal_7Q2K9XH3AB"
      },
      "name": {
        "type": "string"
      },
      "kind": {
        "type": "string",
        "description": "page, event, engagement, outbound lub download"
      },
      "match_type": {
        "type": "string",
        "description": "exact, prefix, glob lub regex"
      },
      "pattern": {
        "anyOf": [
          {
            "type": "string",
            "description": "Wzorzec ścieżki, domeny lub pliku"
          },
          {
            "type": "null"
          }
        ]
      },
      "hostname": {
        "anyOf": [
          {
            "type": "string",
            "description": "Ograniczenie do nazwy hosta (cele page)"
          },
          {
            "type": "null"
          }
        ]
      },
      "event_name": {
        "anyOf": [
          {
            "type": "string",
            "description": "Nazwa zdarzenia niestandardowego (cele event)"
          },
          {
            "type": "null"
          }
        ]
      },
      "conditions": {
        "type": "array",
        "items": {
          "type": "object"
        },
        "description": "Warunki właściwości zdarzenia"
      },
      "scroll_threshold": {
        "anyOf": [
          {
            "type": "integer",
            "description": "Engagement: przewinięcie w %"
          },
          {
            "type": "null"
          }
        ]
      },
      "time_threshold_seconds": {
        "anyOf": [
          {
            "type": "integer",
            "description": "Engagement: sekundy na stronie"
          },
          {
            "type": "null"
          }
        ]
      },
      "value_mode": {
        "type": "string",
        "description": "none, fixed lub revenue"
      },
      "fixed_value_minor": {
        "anyOf": [
          {
            "type": "integer",
            "description": "Stała wartość w jednostkach podrzędnych"
          },
          {
            "type": "null"
          }
        ]
      },
      "count_mode": {
        "type": "string",
        "description": "once_per_visit lub every"
      },
      "archived": {
        "type": "boolean"
      },
      "archived_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "stats": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "completions": {
                "type": "integer",
                "description": "Pasujące zdarzenia, z powtórzeniami"
              },
              "conversions": {
                "type": "integer",
                "description": "Wizyty z co najmniej jednym ukończeniem"
              },
              "conversion_rate": {
                "type": "number",
                "description": "Konwersje ÷ wizyty (lub ÷ odwiedzający, zależnie od ustawienia witryny), %"
              },
              "value": {
                "type": "integer",
                "description": "Wartość celu w jednostkach podrzędnych waluty witryny"
              },
              "change": {
                "anyOf": [
                  {
                    "type": "number",
                    "description": "Zmiana konwersji względem poprzedniego okresu, %"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "description": "Statystyki okresu (tylko lista)"
          },
          {
            "type": "null"
          }
        ]
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      },
      "updated_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
GET /sites/:site_id/goals/:id.json Raport celu: metryki, wykres, podziały i ścieżka do konwersji goals_get

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/sites/:site_id/goals/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Gotowy zakres dat. Użyj custom z from/to",
      "enum": [
        "today",
        "yesterday",
        "24h",
        "7d",
        "14d",
        "28d",
        "30d",
        "90d",
        "mtd",
        "last_month",
        "qtd",
        "last_quarter",
        "ytd",
        "12mo",
        "last_year",
        "all",
        "custom"
      ],
      "default": "30d"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Początek własnego zakresu (strefa czasowa witryny)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Koniec własnego zakresu, włącznie"
    },
    "compare": {
      "type": "string",
      "description": "Okres porównawczy",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Początek własnego okresu porównawczego"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Koniec własnego okresu porównawczego"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Dopasuj dni tygodnia w porównaniu",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtry: [[\"dimension\",\"operator\",\"value\"], …]. Operatory: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Opakuj warunki w {\"any\": [...]}, aby uzyskać OR.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Zastosuj zapisany segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Dodaj zaimportowane dane historyczne (daty przed pierwszym natywnym zdarzeniem, ignorowane przy filtrach lub segmencie)",
      "default": false
    },
    "interval": {
      "type": "string",
      "description": "Rozmiar przedziału wykresu",
      "enum": [
        "auto",
        "minute",
        "hour",
        "day",
        "week",
        "month",
        "quarter",
        "year"
      ],
      "default": "auto"
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "period": {
      "type": "object",
      "description": "from/to okresu (UTC)"
    },
    "goal": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Identyfikator celu, np. goal_7Q2K9XH3AB"
        },
        "name": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "description": "page, event, engagement, outbound lub download"
        },
        "match_type": {
          "type": "string",
          "description": "exact, prefix, glob lub regex"
        },
        "pattern": {
          "anyOf": [
            {
              "type": "string",
              "description": "Wzorzec ścieżki, domeny lub pliku"
            },
            {
              "type": "null"
            }
          ]
        },
        "hostname": {
          "anyOf": [
            {
              "type": "string",
              "description": "Ograniczenie do nazwy hosta (cele page)"
            },
            {
              "type": "null"
            }
          ]
        },
        "event_name": {
          "anyOf": [
            {
              "type": "string",
              "description": "Nazwa zdarzenia niestandardowego (cele event)"
            },
            {
              "type": "null"
            }
          ]
        },
        "conditions": {
          "type": "array",
          "items": {
            "type": "object"
          },
          "description": "Warunki właściwości zdarzenia"
        },
        "scroll_threshold": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Engagement: przewinięcie w %"
            },
            {
              "type": "null"
            }
          ]
        },
        "time_threshold_seconds": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Engagement: sekundy na stronie"
            },
            {
              "type": "null"
            }
          ]
        },
        "value_mode": {
          "type": "string",
          "description": "none, fixed lub revenue"
        },
        "fixed_value_minor": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Stała wartość w jednostkach podrzędnych"
            },
            {
              "type": "null"
            }
          ]
        },
        "count_mode": {
          "type": "string",
          "description": "once_per_visit lub every"
        },
        "archived": {
          "type": "boolean"
        },
        "archived_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "stats": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "completions": {
                  "type": "integer",
                  "description": "Pasujące zdarzenia, z powtórzeniami"
                },
                "conversions": {
                  "type": "integer",
                  "description": "Wizyty z co najmniej jednym ukończeniem"
                },
                "conversion_rate": {
                  "type": "number",
                  "description": "Konwersje ÷ wizyty (lub ÷ odwiedzający, zależnie od ustawienia witryny), %"
                },
                "value": {
                  "type": "integer",
                  "description": "Wartość celu w jednostkach podrzędnych waluty witryny"
                },
                "change": {
                  "anyOf": [
                    {
                      "type": "number",
                      "description": "Zmiana konwersji względem poprzedniego okresu, %"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "description": "Statystyki okresu (tylko lista)"
            },
            {
              "type": "null"
            }
          ]
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        }
      },
      "description": "Definicja celu"
    },
    "metrics": {
      "type": "object",
      "description": "completions, conversions, conversion_rate (%), value (jednostki podrzędne)"
    },
    "comparison_period": {
      "anyOf": [
        {
          "type": "object",
          "description": "from/to porównania"
        },
        {
          "type": "null"
        }
      ]
    },
    "comparison": {
      "anyOf": [
        {
          "type": "object",
          "description": "Metryki dla okresu porównawczego"
        },
        {
          "type": "null"
        }
      ]
    },
    "change": {
      "anyOf": [
        {
          "type": "object",
          "description": "Zmiana względem porównania, % na metrykę"
        },
        {
          "type": "null"
        }
      ]
    },
    "interval": {
      "type": "string",
      "description": "Rozmiar przedziału wykresu"
    },
    "series": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Na przedział: date, completions, conversions, conversion_rate"
    },
    "breakdowns": {
      "type": "object",
      "description": "Najczęstsze wartości według konwersji dla channel, utm_campaign, entry_page, country i device: value, completions, conversions, conversion_rate"
    },
    "journey": {
      "anyOf": [
        {
          "type": "object",
          "description": "converting_visits, median_seconds_to_convert, median_pages_before i pages_before (strony wyświetlone wcześniej w wizycie, według wizyt z konwersją)"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
POST /sites/:site_id/goals/:id/unarchive.json Przywróć zarchiwizowany cel goals_unarchive

Uprawnienie: content.write

Przykład
curl -X POST https://privatusanalytics.com/sites/:site_id/goals/:id/unarchive.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator celu, np. goal_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "page, event, engagement, outbound lub download"
    },
    "match_type": {
      "type": "string",
      "description": "exact, prefix, glob lub regex"
    },
    "pattern": {
      "anyOf": [
        {
          "type": "string",
          "description": "Wzorzec ścieżki, domeny lub pliku"
        },
        {
          "type": "null"
        }
      ]
    },
    "hostname": {
      "anyOf": [
        {
          "type": "string",
          "description": "Ograniczenie do nazwy hosta (cele page)"
        },
        {
          "type": "null"
        }
      ]
    },
    "event_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nazwa zdarzenia niestandardowego (cele event)"
        },
        {
          "type": "null"
        }
      ]
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Warunki właściwości zdarzenia"
    },
    "scroll_threshold": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engagement: przewinięcie w %"
        },
        {
          "type": "null"
        }
      ]
    },
    "time_threshold_seconds": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engagement: sekundy na stronie"
        },
        {
          "type": "null"
        }
      ]
    },
    "value_mode": {
      "type": "string",
      "description": "none, fixed lub revenue"
    },
    "fixed_value_minor": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Stała wartość w jednostkach podrzędnych"
        },
        {
          "type": "null"
        }
      ]
    },
    "count_mode": {
      "type": "string",
      "description": "once_per_visit lub every"
    },
    "archived": {
      "type": "boolean"
    },
    "archived_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "stats": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "completions": {
              "type": "integer",
              "description": "Pasujące zdarzenia, z powtórzeniami"
            },
            "conversions": {
              "type": "integer",
              "description": "Wizyty z co najmniej jednym ukończeniem"
            },
            "conversion_rate": {
              "type": "number",
              "description": "Konwersje ÷ wizyty (lub ÷ odwiedzający, zależnie od ustawienia witryny), %"
            },
            "value": {
              "type": "integer",
              "description": "Wartość celu w jednostkach podrzędnych waluty witryny"
            },
            "change": {
              "anyOf": [
                {
                  "type": "number",
                  "description": "Zmiana konwersji względem poprzedniego okresu, %"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Statystyki okresu (tylko lista)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
PATCH /sites/:site_id/goals/:id.json Zaktualizuj cel goals_update

Uprawnienie: content.write

Przykład
curl -X PATCH https://privatusanalytics.com/sites/:site_id/goals/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nazwa celu",
      "examples": [
        "Signed up"
      ]
    },
    "kind": {
      "type": "string",
      "description": "page (odwiedzenie strony), event (zdarzenie niestandardowe), engagement (przewijanie lub czas na stronie), outbound (kliknięcie linku wychodzącego) lub download (pobranie pliku)",
      "enum": [
        "page",
        "event",
        "engagement",
        "outbound",
        "download"
      ]
    },
    "match_type": {
      "type": "string",
      "description": "Jak pattern dopasowuje ścieżkę (page, engagement), domenę linku (outbound) lub plik (download): exact, prefix, glob (*) lub regex",
      "enum": [
        "exact",
        "prefix",
        "glob",
        "regex"
      ]
    },
    "pattern": {
      "type": "string",
      "description": "Wzorzec ścieżki, domeny lub pliku, np. /pricing, /blog/*, stripe.com lub *.pdf"
    },
    "hostname": {
      "type": "string",
      "description": "Zliczaj tylko strony w tej nazwie hosta (cele page)"
    },
    "event_name": {
      "type": "string",
      "description": "Nazwa zdarzenia niestandardowego (cele event)"
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      },
      "description": "Warunki właściwości zdarzenia: [{\"key\": \"plan\", \"operator\": \"is|is_not|contains|gt|lt\", \"value\": \"pro\"}]"
    },
    "scroll_threshold": {
      "type": "integer",
      "description": "Engagement: głębokość przewinięcia w %, którą trzeba osiągnąć"
    },
    "time_threshold_seconds": {
      "type": "integer",
      "description": "Engagement: sekundy na stronie"
    },
    "value_mode": {
      "type": "string",
      "description": "none, fixed (fixed_value na konwersję) lub revenue (przychód ze zdarzenia)",
      "enum": [
        "none",
        "fixed",
        "revenue"
      ]
    },
    "fixed_value": {
      "type": "number",
      "description": "Stała wartość na konwersję w walucie witryny, np. 50.0"
    },
    "count_mode": {
      "type": "string",
      "description": "Wartość liczy się once_per_visit lub przy każdym ukończeniu",
      "enum": [
        "once_per_visit",
        "every"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator celu, np. goal_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "page, event, engagement, outbound lub download"
    },
    "match_type": {
      "type": "string",
      "description": "exact, prefix, glob lub regex"
    },
    "pattern": {
      "anyOf": [
        {
          "type": "string",
          "description": "Wzorzec ścieżki, domeny lub pliku"
        },
        {
          "type": "null"
        }
      ]
    },
    "hostname": {
      "anyOf": [
        {
          "type": "string",
          "description": "Ograniczenie do nazwy hosta (cele page)"
        },
        {
          "type": "null"
        }
      ]
    },
    "event_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nazwa zdarzenia niestandardowego (cele event)"
        },
        {
          "type": "null"
        }
      ]
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Warunki właściwości zdarzenia"
    },
    "scroll_threshold": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engagement: przewinięcie w %"
        },
        {
          "type": "null"
        }
      ]
    },
    "time_threshold_seconds": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engagement: sekundy na stronie"
        },
        {
          "type": "null"
        }
      ]
    },
    "value_mode": {
      "type": "string",
      "description": "none, fixed lub revenue"
    },
    "fixed_value_minor": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Stała wartość w jednostkach podrzędnych"
        },
        {
          "type": "null"
        }
      ]
    },
    "count_mode": {
      "type": "string",
      "description": "once_per_visit lub every"
    },
    "archived": {
      "type": "boolean"
    },
    "archived_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "stats": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "completions": {
              "type": "integer",
              "description": "Pasujące zdarzenia, z powtórzeniami"
            },
            "conversions": {
              "type": "integer",
              "description": "Wizyty z co najmniej jednym ukończeniem"
            },
            "conversion_rate": {
              "type": "number",
              "description": "Konwersje ÷ wizyty (lub ÷ odwiedzający, zależnie od ustawienia witryny), %"
            },
            "value": {
              "type": "integer",
              "description": "Wartość celu w jednostkach podrzędnych waluty witryny"
            },
            "change": {
              "anyOf": [
                {
                  "type": "number",
                  "description": "Zmiana konwersji względem poprzedniego okresu, %"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Statystyki okresu (tylko lista)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Członkowie

POST /workspaces/:workspace_id/invitations.json Zaproś osoby e-mailem invitations_create

Uprawnienie: members.manage

Przykład
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/invitations.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "emails": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Adresy e-mail do zaproszenia"
    },
    "role": {
      "type": "string",
      "description": "Rola dla nowych członków (custom wymaga custom_role_id)",
      "enum": [
        "admin",
        "editor",
        "analyst",
        "viewer",
        "billing",
        "custom"
      ],
      "default": "viewer"
    },
    "custom_role_id": {
      "type": "string",
      "description": "Identyfikator roli niestandardowej (Business)"
    },
    "all_sites": {
      "type": "boolean",
      "description": "Dostęp do wszystkich witryn, także przyszłych",
      "default": true
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Identyfikatory witryn (pa_…), gdy all_sites ma wartość false",
      "default": []
    },
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "emails",
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "email": {
      "type": "string"
    },
    "role": {
      "type": "string"
    },
    "custom_role": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "all_sites": {
      "type": "boolean"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "invited_by": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "expires_at": {
      "type": "string",
      "format": "date-time"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /workspaces/:workspace_id/invitations/:id.json Unieważnij oczekujące zaproszenie invitations_delete

Uprawnienie: members.manage

Przykład
curl -X DELETE https://privatusanalytics.com/workspaces/:workspace_id/invitations/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "email": {
      "type": "string"
    },
    "role": {
      "type": "string"
    },
    "custom_role": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "all_sites": {
      "type": "boolean"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "invited_by": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "expires_at": {
      "type": "string",
      "format": "date-time"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /workspaces/:workspace_id/invitations.json Wyświetl oczekujące zaproszenia invitations_list

Uprawnienie: members.manage

Przykład
curl https://privatusanalytics.com/workspaces/:workspace_id/invitations.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Strona (od 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Wyników na stronę (maks. 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "format": "uuid"
      },
      "email": {
        "type": "string"
      },
      "role": {
        "type": "string"
      },
      "custom_role": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "all_sites": {
        "type": "boolean"
      },
      "site_ids": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "invited_by": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "expires_at": {
        "type": "string",
        "format": "date-time"
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
DELETE /workspaces/:workspace_id/members/:id.json Usuń członka (lub opuść przestrzeń roboczą) members_delete

Uprawnienie: member

Przykład
curl -X DELETE https://privatusanalytics.com/workspaces/:workspace_id/members/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Identyfikator członka (użyj go do aktualizacji lub usunięcia członka)"
    },
    "email": {
      "type": "string"
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "role": {
      "type": "string",
      "description": "owner, admin, editor, analyst, viewer, billing lub custom"
    },
    "custom_role": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nazwa roli niestandardowej"
        },
        {
          "type": "null"
        }
      ]
    },
    "custom_role_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ]
    },
    "all_sites": {
      "type": "boolean",
      "description": "Dostęp do wszystkich witryn"
    },
    "include_future_sites": {
      "type": "boolean"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Identyfikatory witryn, gdy all_sites ma wartość false"
    },
    "two_factor": {
      "type": "boolean",
      "description": "Ma 2FA lub klucz dostępu"
    },
    "last_active_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Dołączył"
    }
  }
}
GET /workspaces/:workspace_id/members.json Wyświetl członków przestrzeni roboczej members_list

Uprawnienie: member

Przykład
curl https://privatusanalytics.com/workspaces/:workspace_id/members.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "description": "Filtruj według imienia i nazwiska lub e-maila"
    },
    "role": {
      "type": "string",
      "description": "Tylko członkowie z tą rolą",
      "enum": [
        "owner",
        "admin",
        "editor",
        "analyst",
        "viewer",
        "billing",
        "custom"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Strona (od 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Wyników na stronę (maks. 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "format": "uuid",
        "description": "Identyfikator członka (użyj go do aktualizacji lub usunięcia członka)"
      },
      "email": {
        "type": "string"
      },
      "name": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "role": {
        "type": "string",
        "description": "owner, admin, editor, analyst, viewer, billing lub custom"
      },
      "custom_role": {
        "anyOf": [
          {
            "type": "string",
            "description": "Nazwa roli niestandardowej"
          },
          {
            "type": "null"
          }
        ]
      },
      "custom_role_id": {
        "anyOf": [
          {
            "type": "string",
            "format": "uuid"
          },
          {
            "type": "null"
          }
        ]
      },
      "all_sites": {
        "type": "boolean",
        "description": "Dostęp do wszystkich witryn"
      },
      "include_future_sites": {
        "type": "boolean"
      },
      "site_ids": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Identyfikatory witryn, gdy all_sites ma wartość false"
      },
      "two_factor": {
        "type": "boolean",
        "description": "Ma 2FA lub klucz dostępu"
      },
      "last_active_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "created_at": {
        "type": "string",
        "format": "date-time",
        "description": "Dołączył"
      }
    }
  }
}
PATCH /workspaces/:workspace_id/members/:id.json Zmień rolę członka lub jego dostęp do witryn members_update

Uprawnienie: members.manage

Przykład
curl -X PATCH https://privatusanalytics.com/workspaces/:workspace_id/members/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "role": {
      "type": "string",
      "description": "Nowa rola (custom wymaga custom_role_id)",
      "enum": [
        "admin",
        "editor",
        "analyst",
        "viewer",
        "billing",
        "custom"
      ]
    },
    "custom_role_id": {
      "type": "string",
      "description": "Identyfikator roli niestandardowej (Business)"
    },
    "all_sites": {
      "type": "boolean",
      "description": "Dostęp do wszystkich witryn, także przyszłych"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Identyfikatory witryn (pa_…), gdy all_sites ma wartość false"
    },
    "include_future_sites": {
      "type": "boolean",
      "description": "Przyznaj też witryny dodane później"
    },
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Identyfikator członka (użyj go do aktualizacji lub usunięcia członka)"
    },
    "email": {
      "type": "string"
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "role": {
      "type": "string",
      "description": "owner, admin, editor, analyst, viewer, billing lub custom"
    },
    "custom_role": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nazwa roli niestandardowej"
        },
        {
          "type": "null"
        }
      ]
    },
    "custom_role_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ]
    },
    "all_sites": {
      "type": "boolean",
      "description": "Dostęp do wszystkich witryn"
    },
    "include_future_sites": {
      "type": "boolean"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Identyfikatory witryn, gdy all_sites ma wartość false"
    },
    "two_factor": {
      "type": "boolean",
      "description": "Ma 2FA lub klucz dostępu"
    },
    "last_active_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Dołączył"
    }
  }
}
POST /workspaces/:workspace_id/ownership_transfer.json Przekaż własność przestrzeni roboczej innemu członkowi (tylko właściciel, Ty zostajesz administratorem) ownership_transfers_create

Uprawnienie: member

Przykład
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/ownership_transfer.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "membership_id": {
      "type": "string",
      "description": "Identyfikator członkostwa nowego właściciela"
    },
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "membership_id",
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Identyfikator członka (użyj go do aktualizacji lub usunięcia członka)"
    },
    "email": {
      "type": "string"
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "role": {
      "type": "string",
      "description": "owner, admin, editor, analyst, viewer, billing lub custom"
    },
    "custom_role": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nazwa roli niestandardowej"
        },
        {
          "type": "null"
        }
      ]
    },
    "custom_role_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ]
    },
    "all_sites": {
      "type": "boolean",
      "description": "Dostęp do wszystkich witryn"
    },
    "include_future_sites": {
      "type": "boolean"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Identyfikatory witryn, gdy all_sites ma wartość false"
    },
    "two_factor": {
      "type": "boolean",
      "description": "Ma 2FA lub klucz dostępu"
    },
    "last_active_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Dołączył"
    }
  }
}

Dokumentacja

GET /docs/api.json Wyświetl każdą operację API i narzędzie MCP docs_api

Uprawnienie: public

Przykład
curl https://privatusanalytics.com/docs/api.json
Dane wejściowe
{
  "type": "object",
  "properties": {
    "page": {
      "type": "integer",
      "description": "Strona (od 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Wyników na stronę (maks. 100)"
    }
  },
  "required": []
}
Dane odpowiedzi
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "tool_name": {
        "type": "string",
        "description": "Nazwa narzędzia MCP i operationId OpenAPI"
      },
      "summary": {
        "type": "string"
      },
      "description": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "group": {
        "type": "string"
      },
      "verb": {
        "type": "string",
        "description": "Metoda HTTP"
      },
      "path": {
        "type": "string",
        "description": "Szablon ścieżki. Dodaj .json dla JSON"
      },
      "permission": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "input_schema": {
        "type": "object",
        "description": "Schemat JSON danych wejściowych"
      },
      "response_schema": {
        "type": "object",
        "description": "Schemat JSON pola `data`"
      }
    }
  }
}
GET /docs.json Wyświetl strony dokumentacji docs_list

Uprawnienie: public

Przykład
curl https://privatusanalytics.com/docs.json
Dane wejściowe
{
  "type": "object",
  "properties": {
    "page": {
      "type": "integer",
      "description": "Strona (od 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Wyników na stronę (maks. 100)"
    }
  },
  "required": []
}
Dane odpowiedzi
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "title": {
        "type": "string",
        "description": "Tytuł strony"
      },
      "description": {
        "type": "string",
        "description": "Podsumowanie w jednym zdaniu"
      },
      "path": {
        "type": "string",
        "description": "Ścieżka strony. Dodaj .md dla Markdown lub .json dla JSON"
      },
      "section": {
        "type": "string",
        "description": "Slug sekcji, np. tracker"
      }
    }
  }
}
GET /openapi.json Dokument OpenAPI 3.1 dla całego API docs_openapi

Uprawnienie: public

Przykład
curl https://privatusanalytics.com/openapi.json
Dane wejściowe
{
  "type": "object",
  "properties": {},
  "required": []
}
Dane odpowiedzi
{
  "type": "object"
}
GET /docs/:section/:page.json Odczytaj stronę dokumentacji (Markdown i HTML) docs_get

section i page pochodzą ze ścieżki strony /docs/<section>/<page>. Użyj page "index" dla przeglądu sekcji.

Uprawnienie: public

Przykład
curl https://privatusanalytics.com/docs/:section/:page.json
Dane wejściowe
{
  "type": "object",
  "properties": {
    "section": {
      "type": "string",
      "description": "Section zasobu"
    },
    "page": {
      "type": "string",
      "description": "Page zasobu"
    }
  },
  "required": [
    "section",
    "page"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "description": "Tytuł strony"
    },
    "description": {
      "type": "string",
      "description": "Podsumowanie w jednym zdaniu"
    },
    "path": {
      "type": "string",
      "description": "Ścieżka strony. Dodaj .md dla Markdown lub .json dla JSON"
    },
    "section": {
      "type": "string",
      "description": "Slug sekcji, np. tracker"
    },
    "headings": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Sekcje na stronie (id i tekst)"
    },
    "full_markdown": {
      "type": "string",
      "description": "Strona w Markdown (z tytułem)"
    },
    "html": {
      "type": "string",
      "description": "Treść strony wyrenderowana jako HTML"
    }
  }
}

Dziennik audytu

GET /workspaces/:workspace_id/audit_log.json Wyświetl wpisy dziennika audytu (dodaj .csv, aby wyeksportować) audit_logs_get

Uprawnienie: workspace.manage

Przykład
curl https://privatusanalytics.com/workspaces/:workspace_id/audit_log.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "actor": {
      "type": "string",
      "description": "Tylko zmiany tego członka (e-mail)"
    },
    "item_type": {
      "type": "string",
      "description": "Tylko ten rodzaj rekordu, np. Site"
    },
    "event": {
      "type": "string",
      "description": "Tylko ta akcja",
      "enum": [
        "create",
        "update",
        "destroy"
      ]
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Od daty (włącznie)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Do daty (włącznie)"
    },
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Strona (od 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Wyników na stronę (maks. 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "format": "uuid"
      },
      "created_at": {
        "type": "string",
        "format": "date-time",
        "description": "Kiedy"
      },
      "event": {
        "type": "string",
        "description": "create, update lub destroy"
      },
      "item_type": {
        "type": "string",
        "description": "Rodzaj rekordu, np. Site"
      },
      "item_id": {
        "type": "string",
        "format": "uuid"
      },
      "target": {
        "type": "string",
        "description": "Rekord, z nazwą, jeśli jest znana"
      },
      "actor_email": {
        "anyOf": [
          {
            "type": "string",
            "description": "Członek, który wprowadził zmianę"
          },
          {
            "type": "null"
          }
        ]
      },
      "actor_name": {
        "type": "string"
      },
      "token_name": {
        "anyOf": [
          {
            "type": "string",
            "description": "Użyty token API, jeśli był"
          },
          {
            "type": "null"
          }
        ]
      },
      "changes": {
        "type": "object",
        "description": "Zmienione pola: { field: [przed, po] }"
      },
      "ip": {
        "anyOf": [
          {
            "type": "string",
            "description": "Adres IP członka"
          },
          {
            "type": "null"
          }
        ]
      }
    }
  }
}

Eksporty

POST /workspaces/:workspace_id/exports.json Dodaj eksport do kolejki (tworzony w tle) exports_create

Uprawnienie: analytics.export

Przykład
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/exports.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Witryna do wyeksportowania (pa_…)",
      "examples": [
        "pa_7Q2K9XH3AB"
      ]
    },
    "kind": {
      "type": "string",
      "description": "aggregated: metryki według przedziału czasu i wymiarów. pageviews/events/raw: jeden wiersz na trafienie (Pro i wyżej). imported: zaimportowane statystyki dzienne. dashboard: ZIP z panelami przeglądu",
      "enum": [
        "aggregated",
        "pageviews",
        "events",
        "imported",
        "raw",
        "dashboard"
      ],
      "default": "aggregated"
    },
    "file_format": {
      "type": "string",
      "description": "csv, json lub xlsx (aggregated, pageviews, events, imported), csv lub ndjson (raw), zip (dashboard)",
      "enum": [
        "csv",
        "json",
        "xlsx",
        "ndjson",
        "zip"
      ],
      "default": "csv"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Pierwszy dzień, w strefie czasowej eksportu",
      "examples": [
        "2026-09-01"
      ]
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Ostatni dzień, włącznie (maks. 400 dni, raw 93 dni)",
      "examples": [
        "2026-09-28"
      ]
    },
    "timezone": {
      "type": "string",
      "description": "Strefa czasowa dla dat i grupowania, np. America/New_York (domyślnie: strefa czasowa witryny)"
    },
    "grouping": {
      "type": "string",
      "description": "Przedział czasu dla eksportów aggregated",
      "enum": [
        "hour",
        "day",
        "week",
        "month",
        "quarter",
        "year"
      ],
      "default": "day"
    },
    "dimensions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Wymiary wizyt do grupowania eksportów aggregated (do 6), np. country, channel, entry_page. Dla eksportów imported: uwzględniane wymiary zaimportowane",
      "default": []
    },
    "metrics": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Metryki dla eksportów aggregated (domyślnie wszystkie): visitors, visits, pageviews, bounce_rate, visit_duration, views_per_visit, revenue",
      "default": []
    },
    "fields": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Kolumny dla eksportów pageviews/events/raw (domyślnie wszystkie oprócz visit_id, vital_value, selector): occurred_at, kind, name, visit_id, hostname, path, referrer_host, referrer_path, channel, utm_source, utm_medium, utm_campaign, utm_content, utm_term, ref, paid_click, country, language, device, browser, browser_major, os, os_major, screen_bucket, engaged_ms, scroll_depth, revenue_minor, currency, vital_value, selector, props",
      "default": []
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtry w tym samym formacie co API statystyk: [[\"dimension\",\"operator\",\"value\"], …]",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Zastosuj zapisany segment (seg_…)"
    },
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id",
    "from",
    "to",
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator eksportu, np. exp_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Wyeksportowana witryna (pa_…)"
        },
        {
          "type": "null"
        }
      ]
    },
    "kind": {
      "type": "string",
      "description": "aggregated, pageviews, events, imported, raw lub dashboard"
    },
    "format": {
      "type": "string",
      "description": "csv, json, xlsx, ndjson lub zip"
    },
    "status": {
      "type": "string",
      "description": "queued, running, complete, failed lub expired"
    },
    "params": {
      "type": "object",
      "description": "Definicja eksportu (daty, strefa czasowa, grupowanie, wymiary, metryki, pola, filtry)"
    },
    "row_count": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Zapisane wiersze"
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "anyOf": [
        {
          "type": "string",
          "description": "Dlaczego eksport się nie powiódł"
        },
        {
          "type": "null"
        }
      ]
    },
    "completed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Kiedy plik zostanie usunięty"
        },
        {
          "type": "null"
        }
      ]
    },
    "download_url": {
      "anyOf": [
        {
          "type": "string",
          "description": "Ścieżka zwracająca krótkotrwały podpisany link do pliku (exports_download)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /exports/:id.json Usuń eksport i jego plik exports_delete

Uprawnienie: analytics.export

Przykład
curl -X DELETE https://privatusanalytics.com/exports/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator eksportu, np. exp_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Wyeksportowana witryna (pa_…)"
        },
        {
          "type": "null"
        }
      ]
    },
    "kind": {
      "type": "string",
      "description": "aggregated, pageviews, events, imported, raw lub dashboard"
    },
    "format": {
      "type": "string",
      "description": "csv, json, xlsx, ndjson lub zip"
    },
    "status": {
      "type": "string",
      "description": "queued, running, complete, failed lub expired"
    },
    "params": {
      "type": "object",
      "description": "Definicja eksportu (daty, strefa czasowa, grupowanie, wymiary, metryki, pola, filtry)"
    },
    "row_count": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Zapisane wiersze"
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "anyOf": [
        {
          "type": "string",
          "description": "Dlaczego eksport się nie powiódł"
        },
        {
          "type": "null"
        }
      ]
    },
    "completed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Kiedy plik zostanie usunięty"
        },
        {
          "type": "null"
        }
      ]
    },
    "download_url": {
      "anyOf": [
        {
          "type": "string",
          "description": "Ścieżka zwracająca krótkotrwały podpisany link do pliku (exports_download)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /exports/:id/download.json Pobierz podpisany link do pliku (ważny 10 minut) exports_download

Uprawnienie: analytics.export

Przykład
curl https://privatusanalytics.com/exports/:id/download.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}
GET /workspaces/:workspace_id/exports.json Wyświetl eksporty (kolejka zadań) exports_list

Uprawnienie: analytics.export

Przykład
curl https://privatusanalytics.com/workspaces/:workspace_id/exports.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Tylko eksporty tej witryny (pa_…)"
    },
    "status": {
      "type": "string",
      "description": "Tylko eksporty o tym statusie",
      "enum": [
        "queued",
        "running",
        "complete",
        "failed",
        "expired"
      ]
    },
    "kind": {
      "type": "string",
      "description": "Tylko eksporty tego rodzaju",
      "enum": [
        "aggregated",
        "pageviews",
        "events",
        "imported",
        "raw",
        "dashboard"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Strona (od 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Wyników na stronę (maks. 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Identyfikator eksportu, np. exp_7Q2K9XH3AB"
      },
      "site_id": {
        "anyOf": [
          {
            "type": "string",
            "description": "Wyeksportowana witryna (pa_…)"
          },
          {
            "type": "null"
          }
        ]
      },
      "kind": {
        "type": "string",
        "description": "aggregated, pageviews, events, imported, raw lub dashboard"
      },
      "format": {
        "type": "string",
        "description": "csv, json, xlsx, ndjson lub zip"
      },
      "status": {
        "type": "string",
        "description": "queued, running, complete, failed lub expired"
      },
      "params": {
        "type": "object",
        "description": "Definicja eksportu (daty, strefa czasowa, grupowanie, wymiary, metryki, pola, filtry)"
      },
      "row_count": {
        "anyOf": [
          {
            "type": "integer",
            "description": "Zapisane wiersze"
          },
          {
            "type": "null"
          }
        ]
      },
      "error": {
        "anyOf": [
          {
            "type": "string",
            "description": "Dlaczego eksport się nie powiódł"
          },
          {
            "type": "null"
          }
        ]
      },
      "completed_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "expires_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time",
            "description": "Kiedy plik zostanie usunięty"
          },
          {
            "type": "null"
          }
        ]
      },
      "download_url": {
        "anyOf": [
          {
            "type": "string",
            "description": "Ścieżka zwracająca krótkotrwały podpisany link do pliku (exports_download)"
          },
          {
            "type": "null"
          }
        ]
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
POST /workspaces/:workspace_id/exports/preview.json Podgląd eksportu: pierwsze 20 wierszy i szacowana liczba wierszy exports_preview

Uprawnienie: analytics.export

Przykład
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/exports/preview.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Witryna do wyeksportowania (pa_…)",
      "examples": [
        "pa_7Q2K9XH3AB"
      ]
    },
    "kind": {
      "type": "string",
      "description": "aggregated: metryki według przedziału czasu i wymiarów. pageviews/events/raw: jeden wiersz na trafienie (Pro i wyżej). imported: zaimportowane statystyki dzienne. dashboard: ZIP z panelami przeglądu",
      "enum": [
        "aggregated",
        "pageviews",
        "events",
        "imported",
        "raw",
        "dashboard"
      ],
      "default": "aggregated"
    },
    "file_format": {
      "type": "string",
      "description": "csv, json lub xlsx (aggregated, pageviews, events, imported), csv lub ndjson (raw), zip (dashboard)",
      "enum": [
        "csv",
        "json",
        "xlsx",
        "ndjson",
        "zip"
      ],
      "default": "csv"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Pierwszy dzień, w strefie czasowej eksportu",
      "examples": [
        "2026-09-01"
      ]
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Ostatni dzień, włącznie (maks. 400 dni, raw 93 dni)",
      "examples": [
        "2026-09-28"
      ]
    },
    "timezone": {
      "type": "string",
      "description": "Strefa czasowa dla dat i grupowania, np. America/New_York (domyślnie: strefa czasowa witryny)"
    },
    "grouping": {
      "type": "string",
      "description": "Przedział czasu dla eksportów aggregated",
      "enum": [
        "hour",
        "day",
        "week",
        "month",
        "quarter",
        "year"
      ],
      "default": "day"
    },
    "dimensions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Wymiary wizyt do grupowania eksportów aggregated (do 6), np. country, channel, entry_page. Dla eksportów imported: uwzględniane wymiary zaimportowane",
      "default": []
    },
    "metrics": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Metryki dla eksportów aggregated (domyślnie wszystkie): visitors, visits, pageviews, bounce_rate, visit_duration, views_per_visit, revenue",
      "default": []
    },
    "fields": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Kolumny dla eksportów pageviews/events/raw (domyślnie wszystkie oprócz visit_id, vital_value, selector): occurred_at, kind, name, visit_id, hostname, path, referrer_host, referrer_path, channel, utm_source, utm_medium, utm_campaign, utm_content, utm_term, ref, paid_click, country, language, device, browser, browser_major, os, os_major, screen_bucket, engaged_ms, scroll_depth, revenue_minor, currency, vital_value, selector, props",
      "default": []
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtry w tym samym formacie co API statystyk: [[\"dimension\",\"operator\",\"value\"], …]",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Zastosuj zapisany segment (seg_…)"
    },
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id",
    "from",
    "to",
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}
GET /exports/:id.json Pobierz eksport i jego status exports_get

Uprawnienie: analytics.export

Przykład
curl https://privatusanalytics.com/exports/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator eksportu, np. exp_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Wyeksportowana witryna (pa_…)"
        },
        {
          "type": "null"
        }
      ]
    },
    "kind": {
      "type": "string",
      "description": "aggregated, pageviews, events, imported, raw lub dashboard"
    },
    "format": {
      "type": "string",
      "description": "csv, json, xlsx, ndjson lub zip"
    },
    "status": {
      "type": "string",
      "description": "queued, running, complete, failed lub expired"
    },
    "params": {
      "type": "object",
      "description": "Definicja eksportu (daty, strefa czasowa, grupowanie, wymiary, metryki, pola, filtry)"
    },
    "row_count": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Zapisane wiersze"
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "anyOf": [
        {
          "type": "string",
          "description": "Dlaczego eksport się nie powiódł"
        },
        {
          "type": "null"
        }
      ]
    },
    "completed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Kiedy plik zostanie usunięty"
        },
        {
          "type": "null"
        }
      ]
    },
    "download_url": {
      "anyOf": [
        {
          "type": "string",
          "description": "Ścieżka zwracająca krótkotrwały podpisany link do pliku (exports_download)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Importy

GET /sites/:site_id/imports/google/properties.json Wyświetl usługi Google Analytics 4 do zaimportowania imports_google_properties

Uprawnienie: sites.manage

Przykład
curl https://privatusanalytics.com/sites/:site_id/imports/google/properties.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}
POST /sites/:site_id/imports.json Rozpocznij import (usługa GA4 lub przesłany plik CSV) imports_create

Uprawnienie: sites.manage

Przykład
curl -X POST https://privatusanalytics.com/sites/:site_id/imports.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "source": {
      "type": "string",
      "description": "ga4 (API Google Analytics 4) lub narzędzie, którego eksport CSV przesyłasz",
      "enum": [
        "ga4",
        "universal_analytics",
        "fathom",
        "simple_analytics",
        "plausible",
        "matomo",
        "umami",
        "clicky"
      ]
    },
    "property_id": {
      "type": "string",
      "description": "Usługa GA4, np. properties/123 (zobacz imports_google_properties). Wymagane dla ga4",
      "examples": [
        "properties/123456789"
      ]
    },
    "date_from": {
      "type": "string",
      "format": "date",
      "description": "Pierwszy dzień importu. Wymagane dla ga4. Dla plików CSV bez kolumny daty każdy wiersz dostaje ten dzień"
    },
    "date_to": {
      "type": "string",
      "format": "date",
      "description": "Ostatni dzień importu (ga4 domyślnie dzień przed pierwszym śledzonym zdarzeniem lub wczoraj)"
    },
    "file": {
      "type": "string",
      "format": "binary",
      "description": "Eksport CSV (przesłanie multipart, maks. 50 MB). Wymagane dla źródeł CSV"
    },
    "dimension": {
      "type": "string",
      "description": "Według czego dzielone są wiersze CSV (zastępuje wykrywanie, potrzebne dla eksportów Matomo \"Label\")",
      "enum": [
        "total",
        "page",
        "source",
        "country",
        "device",
        "browser",
        "os"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "source",
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator importu"
    },
    "site_id": {
      "type": "string"
    },
    "source": {
      "type": "string",
      "description": "ga4, universal_analytics, fathom, simple_analytics, plausible, matomo, umami lub clicky"
    },
    "status": {
      "type": "string",
      "description": "queued, running, complete lub failed"
    },
    "date_from": {
      "anyOf": [
        {
          "type": "string",
          "format": "date",
          "description": "Pierwszy zaimportowany dzień"
        },
        {
          "type": "null"
        }
      ]
    },
    "date_to": {
      "anyOf": [
        {
          "type": "string",
          "format": "date",
          "description": "Ostatni zaimportowany dzień"
        },
        {
          "type": "null"
        }
      ]
    },
    "rows_imported": {
      "type": "integer",
      "description": "Zapisane wiersze dzienne"
    },
    "error": {
      "anyOf": [
        {
          "type": "string",
          "description": "Dlaczego import się nie powiódł"
        },
        {
          "type": "null"
        }
      ]
    },
    "completed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:site_id/imports/:id.json Usuń import i wszystkie zaimportowane z niego dane imports_delete

Uprawnienie: sites.manage

Przykład
curl -X DELETE https://privatusanalytics.com/sites/:site_id/imports/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator importu"
    },
    "site_id": {
      "type": "string"
    },
    "source": {
      "type": "string",
      "description": "ga4, universal_analytics, fathom, simple_analytics, plausible, matomo, umami lub clicky"
    },
    "status": {
      "type": "string",
      "description": "queued, running, complete lub failed"
    },
    "date_from": {
      "anyOf": [
        {
          "type": "string",
          "format": "date",
          "description": "Pierwszy zaimportowany dzień"
        },
        {
          "type": "null"
        }
      ]
    },
    "date_to": {
      "anyOf": [
        {
          "type": "string",
          "format": "date",
          "description": "Ostatni zaimportowany dzień"
        },
        {
          "type": "null"
        }
      ]
    },
    "rows_imported": {
      "type": "integer",
      "description": "Zapisane wiersze dzienne"
    },
    "error": {
      "anyOf": [
        {
          "type": "string",
          "description": "Dlaczego import się nie powiódł"
        },
        {
          "type": "null"
        }
      ]
    },
    "completed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/imports.json Wyświetl importy witryny imports_list

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/sites/:site_id/imports.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Tylko importy o tym statusie",
      "enum": [
        "queued",
        "running",
        "complete",
        "failed"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Strona (od 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Wyników na stronę (maks. 100)"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Identyfikator importu"
      },
      "site_id": {
        "type": "string"
      },
      "source": {
        "type": "string",
        "description": "ga4, universal_analytics, fathom, simple_analytics, plausible, matomo, umami lub clicky"
      },
      "status": {
        "type": "string",
        "description": "queued, running, complete lub failed"
      },
      "date_from": {
        "anyOf": [
          {
            "type": "string",
            "format": "date",
            "description": "Pierwszy zaimportowany dzień"
          },
          {
            "type": "null"
          }
        ]
      },
      "date_to": {
        "anyOf": [
          {
            "type": "string",
            "format": "date",
            "description": "Ostatni zaimportowany dzień"
          },
          {
            "type": "null"
          }
        ]
      },
      "rows_imported": {
        "type": "integer",
        "description": "Zapisane wiersze dzienne"
      },
      "error": {
        "anyOf": [
          {
            "type": "string",
            "description": "Dlaczego import się nie powiódł"
          },
          {
            "type": "null"
          }
        ]
      },
      "completed_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
GET /sites/:site_id/imports/:id.json Pobierz import i jego status imports_get

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/sites/:site_id/imports/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator importu"
    },
    "site_id": {
      "type": "string"
    },
    "source": {
      "type": "string",
      "description": "ga4, universal_analytics, fathom, simple_analytics, plausible, matomo, umami lub clicky"
    },
    "status": {
      "type": "string",
      "description": "queued, running, complete lub failed"
    },
    "date_from": {
      "anyOf": [
        {
          "type": "string",
          "format": "date",
          "description": "Pierwszy zaimportowany dzień"
        },
        {
          "type": "null"
        }
      ]
    },
    "date_to": {
      "anyOf": [
        {
          "type": "string",
          "format": "date",
          "description": "Ostatni zaimportowany dzień"
        },
        {
          "type": "null"
        }
      ]
    },
    "rows_imported": {
      "type": "integer",
      "description": "Zapisane wiersze dzienne"
    },
    "error": {
      "anyOf": [
        {
          "type": "string",
          "description": "Dlaczego import się nie powiódł"
        },
        {
          "type": "null"
        }
      ]
    },
    "completed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Kampanie

POST /sites/:site_id/campaigns/costs.json Ustaw wydatki na kampanię w danym miesiącu campaign_costs_create

Uprawnienie: content.write

Przykład
curl -X POST https://privatusanalytics.com/sites/:site_id/campaigns/costs.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "campaign": {
      "type": "string",
      "description": "Wartość utm_campaign, do której należą wydatki",
      "examples": [
        "spring_sale"
      ]
    },
    "month": {
      "type": "string",
      "description": "Miesiąc, RRRR-MM",
      "examples": [
        "2026-09"
      ]
    },
    "amount": {
      "type": "number",
      "description": "Wydatki w głównych jednostkach, np. 1250.50"
    },
    "currency": {
      "type": "string",
      "description": "Waluta ISO 4217 (domyślnie waluta witryny)"
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "campaign",
    "month",
    "amount",
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Identyfikator wpisu kosztu"
    },
    "campaign": {
      "type": "string",
      "description": "Wartość utm_campaign"
    },
    "month": {
      "type": "string",
      "description": "Miesiąc, RRRR-MM"
    },
    "amount_minor": {
      "type": "integer",
      "description": "Wydatki w jednostkach podrzędnych"
    },
    "currency": {
      "type": "string",
      "description": "Waluta kwoty w ISO 4217"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:site_id/campaigns/costs/:id.json Usuń wpis kosztu kampanii campaign_costs_delete

Uprawnienie: content.write

Przykład
curl -X DELETE https://privatusanalytics.com/sites/:site_id/campaigns/costs/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Identyfikator wpisu kosztu"
    },
    "campaign": {
      "type": "string",
      "description": "Wartość utm_campaign"
    },
    "month": {
      "type": "string",
      "description": "Miesiąc, RRRR-MM"
    },
    "amount_minor": {
      "type": "integer",
      "description": "Wydatki w jednostkach podrzędnych"
    },
    "currency": {
      "type": "string",
      "description": "Waluta kwoty w ISO 4217"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /sites/:site_id/campaigns/costs/import.json Zaimportuj koszty kampanii z CSV (campaign,month,amount[,currency]) campaign_costs_import

Uprawnienie: content.write

Przykład
curl -X POST https://privatusanalytics.com/sites/:site_id/campaigns/costs/import.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "file": {
      "type": "string",
      "format": "binary",
      "description": "Przesłanie pliku CSV (formularze multipart)"
    },
    "csv": {
      "type": "string",
      "description": "Tekst CSV: campaign,month,amount[,currency]"
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "imported": {
      "type": "integer",
      "description": "Zapisane wiersze"
    },
    "failed": {
      "type": "integer",
      "description": "Pominięte wiersze"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Dlaczego wiersze zostały pominięte (pierwsze 50)"
    }
  }
}
GET /sites/:site_id/campaigns/costs.json Wyświetl wpisy kosztów kampanii campaign_costs_list

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/sites/:site_id/campaigns/costs.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "campaign": {
      "type": "string",
      "description": "Tylko ta kampania"
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Strona (od 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Wyników na stronę (maks. 100)"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "format": "uuid",
        "description": "Identyfikator wpisu kosztu"
      },
      "campaign": {
        "type": "string",
        "description": "Wartość utm_campaign"
      },
      "month": {
        "type": "string",
        "description": "Miesiąc, RRRR-MM"
      },
      "amount_minor": {
        "type": "integer",
        "description": "Wydatki w jednostkach podrzędnych"
      },
      "currency": {
        "type": "string",
        "description": "Waluta kwoty w ISO 4217"
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      },
      "updated_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
PATCH /sites/:site_id/campaigns/costs/:id.json Zmień wpis kosztu kampanii campaign_costs_update

Uprawnienie: content.write

Przykład
curl -X PATCH https://privatusanalytics.com/sites/:site_id/campaigns/costs/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "campaign": {
      "type": "string",
      "description": "Wartość utm_campaign"
    },
    "month": {
      "type": "string",
      "description": "Miesiąc, RRRR-MM"
    },
    "amount": {
      "type": "number",
      "description": "Wydatki w głównych jednostkach"
    },
    "currency": {
      "type": "string",
      "description": "Waluta ISO 4217"
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Identyfikator wpisu kosztu"
    },
    "campaign": {
      "type": "string",
      "description": "Wartość utm_campaign"
    },
    "month": {
      "type": "string",
      "description": "Miesiąc, RRRR-MM"
    },
    "amount_minor": {
      "type": "integer",
      "description": "Wydatki w jednostkach podrzędnych"
    },
    "currency": {
      "type": "string",
      "description": "Waluta kwoty w ISO 4217"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/campaigns/builder.json Zbuduj i zweryfikuj adres URL ze znacznikami UTM campaigns_builder

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/sites/:site_id/campaigns/builder.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "destination": {
      "type": "string",
      "description": "Adres URL strony docelowej (https://…)",
      "examples": [
        "https://example.com/pricing"
      ]
    },
    "preset": {
      "type": "string",
      "description": "Wypełnij utm_source/utm_medium dla kanału, gdy puste",
      "enum": [
        "newsletter",
        "social",
        "paid_search",
        "paid_social",
        "print",
        "partner"
      ]
    },
    "utm_source": {
      "type": "string",
      "description": "Skąd pochodzi ruch"
    },
    "utm_medium": {
      "type": "string",
      "description": "Medium marketingowe, np. email, cpc"
    },
    "utm_campaign": {
      "type": "string",
      "description": "Nazwa kampanii, np. spring_sale"
    },
    "utm_content": {
      "type": "string",
      "description": "Wariant, np. header_button"
    },
    "utm_term": {
      "type": "string",
      "description": "Słowo kluczowe płatnego wyszukiwania"
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "url": {
      "anyOf": [
        {
          "type": "string",
          "description": "Otagowany adres URL (null, gdy są błędy)"
        },
        {
          "type": "null"
        }
      ]
    },
    "valid": {
      "type": "boolean",
      "description": "True, gdy nie ma błędów"
    },
    "destination": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "preset": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "utm_source": {
      "anyOf": [
        {
          "type": "string",
          "description": "Znormalizowany utm_source"
        },
        {
          "type": "null"
        }
      ]
    },
    "utm_medium": {
      "anyOf": [
        {
          "type": "string",
          "description": "Znormalizowany utm_medium"
        },
        {
          "type": "null"
        }
      ]
    },
    "utm_campaign": {
      "anyOf": [
        {
          "type": "string",
          "description": "Znormalizowany utm_campaign"
        },
        {
          "type": "null"
        }
      ]
    },
    "utm_content": {
      "anyOf": [
        {
          "type": "string",
          "description": "Znormalizowany utm_content"
        },
        {
          "type": "null"
        }
      ]
    },
    "utm_term": {
      "anyOf": [
        {
          "type": "string",
          "description": "Znormalizowany utm_term"
        },
        {
          "type": "null"
        }
      ]
    },
    "issues": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "field, level (error lub warning) i message"
    },
    "presets": {
      "type": "object",
      "description": "Gotowe ustawienia kanałów: utm_source/utm_medium na ustawienie"
    }
  }
}
GET /sites/:site_id/campaigns/hygiene.json Higiena UTM: prawie zduplikowane wartości, problemy ze stylem i nieznane źródła campaigns_hygiene

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/sites/:site_id/campaigns/hygiene.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Gotowy zakres dat. Użyj custom z from/to",
      "enum": [
        "today",
        "yesterday",
        "24h",
        "7d",
        "14d",
        "28d",
        "30d",
        "90d",
        "mtd",
        "last_month",
        "qtd",
        "last_quarter",
        "ytd",
        "12mo",
        "last_year",
        "all",
        "custom"
      ],
      "default": "30d"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Początek własnego zakresu (strefa czasowa witryny)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Koniec własnego zakresu, włącznie"
    },
    "compare": {
      "type": "string",
      "description": "Okres porównawczy",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Początek własnego okresu porównawczego"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Koniec własnego okresu porównawczego"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Dopasuj dni tygodnia w porównaniu",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtry: [[\"dimension\",\"operator\",\"value\"], …]. Operatory: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Opakuj warunki w {\"any\": [...]}, aby uzyskać OR.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Zastosuj zapisany segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Dodaj zaimportowane dane historyczne (daty przed pierwszym natywnym zdarzeniem, ignorowane przy filtrach lub segmencie)",
      "default": false
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "period": {
      "type": "object",
      "description": "from/to okresu (UTC)"
    },
    "duplicates": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Prawie zduplikowane wartości: pole, sugestia i warianty [{value, visits}]"
    },
    "style_issues": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Wartości, które nie są zapisane małymi literami z podkreśleniami: pole, wartość, wizyty, sugestia"
    },
    "unknown_sources": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Wartości utm_source, których nie rozpoznajemy: wartość, wizyty"
    }
  }
}
GET /sites/:site_id/campaigns.json Zestawienie kampanii z konwersjami, przychodem, kosztem, CPA i ROAS campaigns_list

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/sites/:site_id/campaigns.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Gotowy zakres dat. Użyj custom z from/to",
      "enum": [
        "today",
        "yesterday",
        "24h",
        "7d",
        "14d",
        "28d",
        "30d",
        "90d",
        "mtd",
        "last_month",
        "qtd",
        "last_quarter",
        "ytd",
        "12mo",
        "last_year",
        "all",
        "custom"
      ],
      "default": "30d"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Początek własnego zakresu (strefa czasowa witryny)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Koniec własnego zakresu, włącznie"
    },
    "compare": {
      "type": "string",
      "description": "Okres porównawczy",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Początek własnego okresu porównawczego"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Koniec własnego okresu porównawczego"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Dopasuj dni tygodnia w porównaniu",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtry: [[\"dimension\",\"operator\",\"value\"], …]. Operatory: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Opakuj warunki w {\"any\": [...]}, aby uzyskać OR.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Zastosuj zapisany segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Dodaj zaimportowane dane historyczne (daty przed pierwszym natywnym zdarzeniem, ignorowane przy filtrach lub segmencie)",
      "default": false
    },
    "goal_id": {
      "type": "string",
      "description": "Cel (goal_…), którego konwersje liczyć. Domyślnie pierwszy aktywny cel"
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "period": {
      "type": "object",
      "description": "from/to okresu (UTC)"
    },
    "currency": {
      "type": "string",
      "description": "Waluta witryny dla przychodu i kosztu"
    },
    "goal_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Cel liczony jako konwersja"
        },
        {
          "type": "null"
        }
      ]
    },
    "goal_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "campaigns": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Na utm_campaign: visitors, visits, conversions, conversion_rate, revenue, cost, cpa (jednostki podrzędne), roas (przychód ÷ koszt) i sources [{source, medium, visitors, visits, conversions, conversion_rate, revenue}]"
    },
    "totals": {
      "type": "object",
      "description": "Sumy dla wszystkich wymienionych kampanii"
    }
  }
}

Kanały powiadomień

POST /workspaces/:workspace_id/channels.json Dodaj kanał powiadomień notification_channels_create

Uprawnienie: content.write

Przykład
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/channels.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "URL webhooka (slack, teams, discord, webhook), HTTPS"
    },
    "secret": {
      "type": "string",
      "description": "webhook: sekret HMAC dla X-Privatus-Signature"
    },
    "emails": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "email: adresy odbiorców (maks. 20)"
    },
    "routing_key": {
      "type": "string",
      "description": "pagerduty: klucz integracji Events API v2"
    },
    "api_key": {
      "type": "string",
      "description": "opsgenie: klucz integracji API"
    },
    "region": {
      "type": "string",
      "description": "opsgenie: region konta",
      "enum": [
        "us",
        "eu"
      ]
    },
    "kind": {
      "type": "string",
      "description": "email, slack, teams, discord, webhook, pagerduty, opsgenie lub push",
      "enum": [
        "email",
        "slack",
        "teams",
        "discord",
        "webhook",
        "pagerduty",
        "opsgenie",
        "push"
      ]
    },
    "name": {
      "type": "string",
      "description": "Nazwa wyświetlana",
      "examples": [
        "#alerts"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "kind",
    "name",
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator kanału, np. nch_7Q2K9XH3AB"
    },
    "kind": {
      "type": "string",
      "description": "email, slack, teams, discord, webhook, pagerduty, opsgenie lub push"
    },
    "name": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "Zamaskowany cel"
    },
    "last_used_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /channels/:id.json Usuń kanał powiadomień notification_channels_delete

Uprawnienie: content.write

Przykład
curl -X DELETE https://privatusanalytics.com/channels/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator kanału, np. nch_7Q2K9XH3AB"
    },
    "kind": {
      "type": "string",
      "description": "email, slack, teams, discord, webhook, pagerduty, opsgenie lub push"
    },
    "name": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "Zamaskowany cel"
    },
    "last_used_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /workspaces/:workspace_id/channels.json Wyświetl kanały powiadomień notification_channels_list

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/workspaces/:workspace_id/channels.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "description": "Tylko kanały tego rodzaju",
      "enum": [
        "email",
        "slack",
        "teams",
        "discord",
        "webhook",
        "pagerduty",
        "opsgenie",
        "push"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Strona (od 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Wyników na stronę (maks. 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Identyfikator kanału, np. nch_7Q2K9XH3AB"
      },
      "kind": {
        "type": "string",
        "description": "email, slack, teams, discord, webhook, pagerduty, opsgenie lub push"
      },
      "name": {
        "type": "string"
      },
      "target": {
        "type": "string",
        "description": "Zamaskowany cel"
      },
      "last_used_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
POST /channels/:id/send_test.json Wyślij testową wiadomość przez kanał notification_channels_send_test

Uprawnienie: content.write

Przykład
curl -X POST https://privatusanalytics.com/channels/:id/send_test.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator kanału, np. nch_7Q2K9XH3AB"
    },
    "kind": {
      "type": "string",
      "description": "email, slack, teams, discord, webhook, pagerduty, opsgenie lub push"
    },
    "name": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "Zamaskowany cel"
    },
    "last_used_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /channels/:id.json Pobierz kanał powiadomień notification_channels_get

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/channels/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator kanału, np. nch_7Q2K9XH3AB"
    },
    "kind": {
      "type": "string",
      "description": "email, slack, teams, discord, webhook, pagerduty, opsgenie lub push"
    },
    "name": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "Zamaskowany cel"
    },
    "last_used_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
PATCH /channels/:id.json Zaktualizuj kanał powiadomień notification_channels_update

Uprawnienie: content.write

Przykład
curl -X PATCH https://privatusanalytics.com/channels/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "URL webhooka (slack, teams, discord, webhook), HTTPS"
    },
    "secret": {
      "type": "string",
      "description": "webhook: sekret HMAC dla X-Privatus-Signature"
    },
    "emails": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "email: adresy odbiorców (maks. 20)"
    },
    "routing_key": {
      "type": "string",
      "description": "pagerduty: klucz integracji Events API v2"
    },
    "api_key": {
      "type": "string",
      "description": "opsgenie: klucz integracji API"
    },
    "region": {
      "type": "string",
      "description": "opsgenie: region konta",
      "enum": [
        "us",
        "eu"
      ]
    },
    "name": {
      "type": "string",
      "description": "Nazwa wyświetlana"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator kanału, np. nch_7Q2K9XH3AB"
    },
    "kind": {
      "type": "string",
      "description": "email, slack, teams, discord, webhook, pagerduty, opsgenie lub push"
    },
    "name": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "Zamaskowany cel"
    },
    "last_used_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /push_subscription.json Zarejestruj przeglądarkę do powiadomień push push_subscriptions_create

Uprawnienie: member

Przykład
curl -X POST https://privatusanalytics.com/push_subscription.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "endpoint": {
      "type": "string",
      "description": "PushSubscription.endpoint z przeglądarki"
    },
    "p256dh": {
      "type": "string",
      "description": "PushSubscription keys.p256dh (base64url)"
    },
    "auth": {
      "type": "string",
      "description": "PushSubscription keys.auth (base64url)"
    }
  },
  "required": [
    "endpoint",
    "p256dh",
    "auth"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "endpoint_host": {
      "type": "string",
      "description": "Host usługi push"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /push_subscription.json Usuń rejestrację push przeglądarki push_subscriptions_delete

Uprawnienie: member

Przykład
curl -X DELETE https://privatusanalytics.com/push_subscription.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "endpoint": {
      "type": "string",
      "description": "PushSubscription.endpoint do usunięcia"
    }
  },
  "required": [
    "endpoint"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "endpoint_host": {
      "type": "string",
      "description": "Host usługi push"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Konto

GET /account.json Pobierz swój profil i preferencje account_get

Uprawnienie: member

Przykład
curl https://privatusanalytics.com/account.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {},
  "required": []
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "email": {
      "type": "string"
    },
    "unconfirmed_email": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nowy e-mail oczekujący na potwierdzenie"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "theme": {
      "type": "string"
    },
    "default_landing": {
      "type": "string"
    },
    "locale": {
      "type": "string",
      "description": "Kod języka aplikacji dla tego konta (domyślnie en)"
    },
    "timezone": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "shortcuts_enabled": {
      "type": "boolean"
    },
    "reduce_motion": {
      "type": "boolean"
    },
    "product_emails": {
      "type": "boolean"
    },
    "marketing_emails": {
      "type": "boolean",
      "description": "Czy można wysyłać e-maile marketingowe (kampanie drip). false po wypisaniu się"
    },
    "newsletter": {
      "type": "boolean"
    },
    "two_factor": {
      "type": "boolean"
    },
    "passkeys": {
      "type": "integer"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
PATCH /account.json Zaktualizuj swój profil i preferencje account_update

Uprawnienie: member

Przykład
curl -X PATCH https://privatusanalytics.com/account.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Twoje imię i nazwisko"
    },
    "email": {
      "type": "string",
      "description": "Nowy adres e-mail (najpierw potwierdzany e-mailem)"
    },
    "theme": {
      "type": "string",
      "description": "Motyw kolorystyczny",
      "enum": [
        "system",
        "light",
        "dark"
      ]
    },
    "default_landing": {
      "type": "string",
      "description": "Strona po zalogowaniu: sites lub last_site",
      "enum": [
        "sites",
        "last_site"
      ]
    },
    "locale": {
      "type": "string",
      "description": "Język aplikacji po zalogowaniu, jako kod języka (en, de, fr i tak dalej). Strony publiczne i API pozostają bez zmian",
      "enum": [
        "en",
        "de",
        "es",
        "fr",
        "it",
        "nl",
        "pt",
        "pl",
        "sv",
        "da",
        "no",
        "fi",
        "ja",
        "ko",
        "zh-CN",
        "zh-TW"
      ]
    },
    "timezone": {
      "type": "string",
      "description": "Twoja strefa czasowa (nazwa IANA)"
    },
    "shortcuts_enabled": {
      "type": "boolean",
      "description": "Skróty klawiszowe"
    },
    "reduce_motion": {
      "type": "boolean",
      "description": "Ogranicz animacje"
    },
    "product_emails": {
      "type": "boolean",
      "description": "E-maile z nowościami i wskazówkami o produkcie"
    },
    "marketing_emails": {
      "type": "boolean",
      "description": "E-maile marketingowe, na przykład wskazówki na start. Ponowne włączenie ich po wypisaniu wymaga zalogowanej przeglądarki"
    },
    "newsletter": {
      "type": "boolean",
      "description": "Miesięczny newsletter"
    }
  },
  "required": []
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "email": {
      "type": "string"
    },
    "unconfirmed_email": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nowy e-mail oczekujący na potwierdzenie"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "theme": {
      "type": "string"
    },
    "default_landing": {
      "type": "string"
    },
    "locale": {
      "type": "string",
      "description": "Kod języka aplikacji dla tego konta (domyślnie en)"
    },
    "timezone": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "shortcuts_enabled": {
      "type": "boolean"
    },
    "reduce_motion": {
      "type": "boolean"
    },
    "product_emails": {
      "type": "boolean"
    },
    "marketing_emails": {
      "type": "boolean",
      "description": "Czy można wysyłać e-maile marketingowe (kampanie drip). false po wypisaniu się"
    },
    "newsletter": {
      "type": "boolean"
    },
    "two_factor": {
      "type": "boolean"
    },
    "passkeys": {
      "type": "integer"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Lejki

POST /sites/:site_id/funnels.json Utwórz lejek funnels_create

Uprawnienie: content.write

Przykład
curl -X POST https://privatusanalytics.com/sites/:site_id/funnels.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nazwa lejka",
      "examples": [
        "Signup flow"
      ]
    },
    "steps": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      },
      "description": "Uporządkowane kroki (od 2 do limitu Twojego planu): [{\"type\": \"page|event|goal\", \"value\": \"/pricing | Signup | goal_…\", \"match\": \"exact|prefix|glob|regex\" (kroki page), \"name\": \"optional label\"}]"
    },
    "order_mode": {
      "type": "string",
      "description": "strict: kroki w tej kolejności, any: w dowolnej kolejności",
      "enum": [
        "strict",
        "any"
      ],
      "default": "strict"
    },
    "window": {
      "type": "string",
      "description": "Okno konwersji: visit lub day (mierzone w obrębie wizyty, która nigdy nie obejmuje dwóch dni UTC)",
      "enum": [
        "visit",
        "day"
      ],
      "default": "visit"
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "steps",
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator lejka, np. fun_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "steps": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Kroki: {type: page|event|goal, value, match, name}"
    },
    "order_mode": {
      "type": "string",
      "description": "strict lub any"
    },
    "window": {
      "type": "string",
      "description": "visit lub day"
    },
    "stats": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "entered": {
              "type": "integer",
              "description": "Wizyty, które dotarły do kroku 1"
            },
            "completed": {
              "type": "integer",
              "description": "Wizyty, które dotarły do ostatniego kroku"
            },
            "conversion_rate": {
              "type": "number",
              "description": "Ukończone ÷ wejścia, %"
            }
          },
          "description": "Statystyki okresu (tylko lista)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:site_id/funnels/:id.json Usuń lejek funnels_delete

Uprawnienie: content.write

Przykład
curl -X DELETE https://privatusanalytics.com/sites/:site_id/funnels/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator lejka, np. fun_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "steps": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Kroki: {type: page|event|goal, value, match, name}"
    },
    "order_mode": {
      "type": "string",
      "description": "strict lub any"
    },
    "window": {
      "type": "string",
      "description": "visit lub day"
    },
    "stats": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "entered": {
              "type": "integer",
              "description": "Wizyty, które dotarły do kroku 1"
            },
            "completed": {
              "type": "integer",
              "description": "Wizyty, które dotarły do ostatniego kroku"
            },
            "conversion_rate": {
              "type": "number",
              "description": "Ukończone ÷ wejścia, %"
            }
          },
          "description": "Statystyki okresu (tylko lista)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/funnels.json Wyświetl lejki z wejściami, ukończeniami i współczynnikiem funnels_list

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/sites/:site_id/funnels.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Gotowy zakres dat. Użyj custom z from/to",
      "enum": [
        "today",
        "yesterday",
        "24h",
        "7d",
        "14d",
        "28d",
        "30d",
        "90d",
        "mtd",
        "last_month",
        "qtd",
        "last_quarter",
        "ytd",
        "12mo",
        "last_year",
        "all",
        "custom"
      ],
      "default": "30d"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Początek własnego zakresu (strefa czasowa witryny)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Koniec własnego zakresu, włącznie"
    },
    "compare": {
      "type": "string",
      "description": "Okres porównawczy",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Początek własnego okresu porównawczego"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Koniec własnego okresu porównawczego"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Dopasuj dni tygodnia w porównaniu",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtry: [[\"dimension\",\"operator\",\"value\"], …]. Operatory: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Opakuj warunki w {\"any\": [...]}, aby uzyskać OR.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Zastosuj zapisany segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Dodaj zaimportowane dane historyczne (daty przed pierwszym natywnym zdarzeniem, ignorowane przy filtrach lub segmencie)",
      "default": false
    },
    "page": {
      "type": "integer",
      "description": "Numer strony",
      "default": 1
    },
    "per_page": {
      "type": "integer",
      "description": "Lejków na stronę (maks. 100)",
      "default": 25
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Identyfikator lejka, np. fun_7Q2K9XH3AB"
      },
      "name": {
        "type": "string"
      },
      "steps": {
        "type": "array",
        "items": {
          "type": "object"
        },
        "description": "Kroki: {type: page|event|goal, value, match, name}"
      },
      "order_mode": {
        "type": "string",
        "description": "strict lub any"
      },
      "window": {
        "type": "string",
        "description": "visit lub day"
      },
      "stats": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "entered": {
                "type": "integer",
                "description": "Wizyty, które dotarły do kroku 1"
              },
              "completed": {
                "type": "integer",
                "description": "Wizyty, które dotarły do ostatniego kroku"
              },
              "conversion_rate": {
                "type": "number",
                "description": "Ukończone ÷ wejścia, %"
              }
            },
            "description": "Statystyki okresu (tylko lista)"
          },
          {
            "type": "null"
          }
        ]
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      },
      "updated_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
GET /sites/:site_id/funnels/:id.json Raport lejka: liczba w krokach, konwersja, odpływ, czas między krokami i dokąd trafiły wizyty zamiast tego funnels_get

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/sites/:site_id/funnels/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Gotowy zakres dat. Użyj custom z from/to",
      "enum": [
        "today",
        "yesterday",
        "24h",
        "7d",
        "14d",
        "28d",
        "30d",
        "90d",
        "mtd",
        "last_month",
        "qtd",
        "last_quarter",
        "ytd",
        "12mo",
        "last_year",
        "all",
        "custom"
      ],
      "default": "30d"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Początek własnego zakresu (strefa czasowa witryny)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Koniec własnego zakresu, włącznie"
    },
    "compare": {
      "type": "string",
      "description": "Okres porównawczy",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Początek własnego okresu porównawczego"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Koniec własnego okresu porównawczego"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Dopasuj dni tygodnia w porównaniu",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtry: [[\"dimension\",\"operator\",\"value\"], …]. Operatory: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Opakuj warunki w {\"any\": [...]}, aby uzyskać OR.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Zastosuj zapisany segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Dodaj zaimportowane dane historyczne (daty przed pierwszym natywnym zdarzeniem, ignorowane przy filtrach lub segmencie)",
      "default": false
    },
    "breakdown": {
      "type": "string",
      "description": "Podziel liczby w krokach według wymiaru wizyty",
      "enum": [
        "channel",
        "device",
        "country",
        "utm_campaign",
        "utm_source",
        "browser",
        "os"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "period": {
      "type": "object",
      "description": "from/to okresu (UTC)"
    },
    "funnel": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Identyfikator lejka, np. fun_7Q2K9XH3AB"
        },
        "name": {
          "type": "string"
        },
        "steps": {
          "type": "array",
          "items": {
            "type": "object"
          },
          "description": "Kroki: {type: page|event|goal, value, match, name}"
        },
        "order_mode": {
          "type": "string",
          "description": "strict lub any"
        },
        "window": {
          "type": "string",
          "description": "visit lub day"
        },
        "stats": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "entered": {
                  "type": "integer",
                  "description": "Wizyty, które dotarły do kroku 1"
                },
                "completed": {
                  "type": "integer",
                  "description": "Wizyty, które dotarły do ostatniego kroku"
                },
                "conversion_rate": {
                  "type": "number",
                  "description": "Ukończone ÷ wejścia, %"
                }
              },
              "description": "Statystyki okresu (tylko lista)"
            },
            {
              "type": "null"
            }
          ]
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        }
      },
      "description": "Definicja lejka"
    },
    "order_mode": {
      "type": "string",
      "description": "strict lub any"
    },
    "window": {
      "type": "string",
      "description": "visit lub day (day jest mierzone w obrębie wizyty)"
    },
    "steps": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Na krok: index, name, type, value, count, step_conversion_rate, overall_conversion_rate, dropoff, dropoff_rate, median_seconds_from_previous, next_pages [{value, count}]"
    },
    "overall_conversion_rate": {
      "type": "number",
      "description": "Ostatni krok ÷ pierwszy krok, %"
    },
    "breakdown": {
      "anyOf": [
        {
          "type": "object",
          "description": "dimension, label i wiersze [{value, counts, overall_conversion_rate}]"
        },
        {
          "type": "null"
        }
      ]
    },
    "comparison": {
      "anyOf": [
        {
          "type": "object",
          "description": "okres, liczby na krok, overall_conversion_rate i zmiana (%)"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
PATCH /sites/:site_id/funnels/:id.json Zaktualizuj lejek funnels_update

Uprawnienie: content.write

Przykład
curl -X PATCH https://privatusanalytics.com/sites/:site_id/funnels/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nazwa lejka",
      "examples": [
        "Signup flow"
      ]
    },
    "steps": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      },
      "description": "Uporządkowane kroki (od 2 do limitu Twojego planu): [{\"type\": \"page|event|goal\", \"value\": \"/pricing | Signup | goal_…\", \"match\": \"exact|prefix|glob|regex\" (kroki page), \"name\": \"optional label\"}]"
    },
    "order_mode": {
      "type": "string",
      "description": "strict: kroki w tej kolejności, any: w dowolnej kolejności",
      "enum": [
        "strict",
        "any"
      ]
    },
    "window": {
      "type": "string",
      "description": "Okno konwersji: visit lub day (mierzone w obrębie wizyty, która nigdy nie obejmuje dwóch dni UTC)",
      "enum": [
        "visit",
        "day"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator lejka, np. fun_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "steps": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Kroki: {type: page|event|goal, value, match, name}"
    },
    "order_mode": {
      "type": "string",
      "description": "strict lub any"
    },
    "window": {
      "type": "string",
      "description": "visit lub day"
    },
    "stats": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "entered": {
              "type": "integer",
              "description": "Wizyty, które dotarły do kroku 1"
            },
            "completed": {
              "type": "integer",
              "description": "Wizyty, które dotarły do ostatniego kroku"
            },
            "conversion_rate": {
              "type": "number",
              "description": "Ukończone ÷ wejścia, %"
            }
          },
          "description": "Statystyki okresu (tylko lista)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Na żywo

GET /sites/:site_id/live.json Odwiedzający na żywo, strumień aktywności i to, co jest teraz popularne (ostatnie 30 minut) live_get

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/sites/:site_id/live.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "feed": {
      "type": "string",
      "description": "Strumień aktywności: wszystkie trafienia, odsłony lub zdarzenia niestandardowe",
      "enum": [
        "all",
        "pageviews",
        "events"
      ],
      "default": "all"
    },
    "limit": {
      "type": "integer",
      "description": "Wpisy strumienia aktywności (maks. 100)",
      "default": 50
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}
GET /sites/:site_id/live/wallboard.json Karty wallboardu (na żywo i dziś) dla jednej lub wielu witryn live_wallboard

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/sites/:site_id/live/wallboard.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Identyfikatory witryn do rotacji (domyślnie ta witryna)",
      "default": []
    },
    "rotate_seconds": {
      "type": "integer",
      "description": "Sekundy, przez które każda witryna jest na ekranie (5-300)",
      "default": 20
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}
GET /wallboard/:token.json Wallboard dla tokena wallboardu (bez logowania) live_public_wallboard

Uprawnienie: public · Tylko HTTP (nie jest narzędziem MCP)

Przykład
curl https://privatusanalytics.com/wallboard/:token.json
Dane wejściowe
{
  "type": "object",
  "properties": {
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Identyfikatory witryn do rotacji (domyślnie ta witryna)",
      "default": []
    },
    "rotate_seconds": {
      "type": "integer",
      "description": "Sekundy, przez które każda witryna jest na ekranie (5-300)",
      "default": 20
    },
    "token": {
      "type": "string",
      "description": "Token zasobu"
    }
  },
  "required": [
    "token"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}

Notatki

POST /sites/:site_id/notes.json Dodaj notatkę do witryny (użyj źródła "deploy" dla webhooków wydań) notes_create

Uprawnienie: content.write

Przykład
curl -X POST https://privatusanalytics.com/sites/:site_id/notes.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "date": {
      "type": "string",
      "format": "date",
      "description": "Dzień notatki (strefa czasowa witryny). Domyślnie dziś"
    },
    "end_date": {
      "type": "string",
      "format": "date",
      "description": "Ostatni dzień, dla zakresu dat"
    },
    "title": {
      "type": "string",
      "description": "Krótki tytuł pokazywany na wykresach",
      "examples": [
        "Launched new pricing"
      ]
    },
    "body": {
      "type": "string",
      "description": "Szczegóły (Markdown)"
    },
    "url": {
      "type": "string",
      "description": "Link, np. do PR lub dziennika zmian"
    },
    "color": {
      "type": "string",
      "description": "Kolor pinezki",
      "enum": [
        "neutral",
        "brand",
        "blue",
        "amber",
        "red",
        "violet"
      ]
    },
    "source": {
      "type": "string",
      "description": "manual lub deploy dla webhooków wydań",
      "enum": [
        "manual",
        "deploy",
        "system",
        "import",
        "incident"
      ],
      "default": "manual"
    },
    "version": {
      "type": "string",
      "description": "Wdrożenia: wersja wydania lub commit, używane w domyślnym tytule"
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator notatki, np. note_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Witryna lub null dla notatek całej przestrzeni roboczej"
        },
        {
          "type": "null"
        }
      ]
    },
    "date": {
      "type": "string",
      "format": "date"
    },
    "end_date": {
      "anyOf": [
        {
          "type": "string",
          "format": "date"
        },
        {
          "type": "null"
        }
      ]
    },
    "title": {
      "type": "string"
    },
    "body": {
      "anyOf": [
        {
          "type": "string",
          "description": "Markdown"
        },
        {
          "type": "null"
        }
      ]
    },
    "url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "color": {
      "type": "string",
      "description": "neutral, brand, blue, amber, red, violet"
    },
    "source": {
      "type": "string",
      "description": "manual, deploy, system, import, incident"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:site_id/notes/:id.json Usuń notatkę notes_delete

Uprawnienie: content.write

Przykład
curl -X DELETE https://privatusanalytics.com/sites/:site_id/notes/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator notatki, np. note_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Witryna lub null dla notatek całej przestrzeni roboczej"
        },
        {
          "type": "null"
        }
      ]
    },
    "date": {
      "type": "string",
      "format": "date"
    },
    "end_date": {
      "anyOf": [
        {
          "type": "string",
          "format": "date"
        },
        {
          "type": "null"
        }
      ]
    },
    "title": {
      "type": "string"
    },
    "body": {
      "anyOf": [
        {
          "type": "string",
          "description": "Markdown"
        },
        {
          "type": "null"
        }
      ]
    },
    "url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "color": {
      "type": "string",
      "description": "neutral, brand, blue, amber, red, violet"
    },
    "source": {
      "type": "string",
      "description": "manual, deploy, system, import, incident"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/notes.json Wyświetl notatki witryny (w tym notatki całej przestrzeni roboczej) notes_list

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/sites/:site_id/notes.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "from": {
      "type": "string",
      "format": "date",
      "description": "Tylko notatki z tej daty lub późniejsze"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Tylko notatki z tej daty lub wcześniejsze"
    },
    "source": {
      "type": "string",
      "description": "Tylko notatki z tego źródła",
      "enum": [
        "manual",
        "deploy",
        "system",
        "import",
        "incident"
      ]
    },
    "query": {
      "type": "string",
      "description": "Szukaj w tytule, treści i linku"
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Strona (od 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Wyników na stronę (maks. 100)"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Identyfikator notatki, np. note_7Q2K9XH3AB"
      },
      "site_id": {
        "anyOf": [
          {
            "type": "string",
            "description": "Witryna lub null dla notatek całej przestrzeni roboczej"
          },
          {
            "type": "null"
          }
        ]
      },
      "date": {
        "type": "string",
        "format": "date"
      },
      "end_date": {
        "anyOf": [
          {
            "type": "string",
            "format": "date"
          },
          {
            "type": "null"
          }
        ]
      },
      "title": {
        "type": "string"
      },
      "body": {
        "anyOf": [
          {
            "type": "string",
            "description": "Markdown"
          },
          {
            "type": "null"
          }
        ]
      },
      "url": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "color": {
        "type": "string",
        "description": "neutral, brand, blue, amber, red, violet"
      },
      "source": {
        "type": "string",
        "description": "manual, deploy, system, import, incident"
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
GET /sites/:site_id/notes/:id.json Pobierz notatkę notes_get

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/sites/:site_id/notes/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator notatki, np. note_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Witryna lub null dla notatek całej przestrzeni roboczej"
        },
        {
          "type": "null"
        }
      ]
    },
    "date": {
      "type": "string",
      "format": "date"
    },
    "end_date": {
      "anyOf": [
        {
          "type": "string",
          "format": "date"
        },
        {
          "type": "null"
        }
      ]
    },
    "title": {
      "type": "string"
    },
    "body": {
      "anyOf": [
        {
          "type": "string",
          "description": "Markdown"
        },
        {
          "type": "null"
        }
      ]
    },
    "url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "color": {
      "type": "string",
      "description": "neutral, brand, blue, amber, red, violet"
    },
    "source": {
      "type": "string",
      "description": "manual, deploy, system, import, incident"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
PATCH /sites/:site_id/notes/:id.json Edytuj notatkę notes_update

Uprawnienie: content.write

Przykład
curl -X PATCH https://privatusanalytics.com/sites/:site_id/notes/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "date": {
      "type": "string",
      "format": "date",
      "description": "Dzień notatki"
    },
    "end_date": {
      "type": "string",
      "format": "date",
      "description": "Ostatni dzień, dla zakresu dat"
    },
    "title": {
      "type": "string",
      "description": "Krótki tytuł pokazywany na wykresach"
    },
    "body": {
      "type": "string",
      "description": "Szczegóły (Markdown)"
    },
    "url": {
      "type": "string",
      "description": "Link"
    },
    "color": {
      "type": "string",
      "description": "Kolor pinezki",
      "enum": [
        "neutral",
        "brand",
        "blue",
        "amber",
        "red",
        "violet"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator notatki, np. note_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Witryna lub null dla notatek całej przestrzeni roboczej"
        },
        {
          "type": "null"
        }
      ]
    },
    "date": {
      "type": "string",
      "format": "date"
    },
    "end_date": {
      "anyOf": [
        {
          "type": "string",
          "format": "date"
        },
        {
          "type": "null"
        }
      ]
    },
    "title": {
      "type": "string"
    },
    "body": {
      "anyOf": [
        {
          "type": "string",
          "description": "Markdown"
        },
        {
          "type": "null"
        }
      ]
    },
    "url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "color": {
      "type": "string",
      "description": "neutral, brand, blue, amber, red, violet"
    },
    "source": {
      "type": "string",
      "description": "manual, deploy, system, import, incident"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /workspaces/:workspace_id/notes.json Dodaj notatkę całej przestrzeni roboczej (widoczna w każdej witrynie) workspace_notes_create

Uprawnienie: content.write

Przykład
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/notes.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "date": {
      "type": "string",
      "format": "date",
      "description": "Dzień notatki (strefa czasowa witryny). Domyślnie dziś"
    },
    "end_date": {
      "type": "string",
      "format": "date",
      "description": "Ostatni dzień, dla zakresu dat"
    },
    "title": {
      "type": "string",
      "description": "Krótki tytuł pokazywany na wykresach",
      "examples": [
        "Launched new pricing"
      ]
    },
    "body": {
      "type": "string",
      "description": "Szczegóły (Markdown)"
    },
    "url": {
      "type": "string",
      "description": "Link, np. do PR lub dziennika zmian"
    },
    "color": {
      "type": "string",
      "description": "Kolor pinezki",
      "enum": [
        "neutral",
        "brand",
        "blue",
        "amber",
        "red",
        "violet"
      ]
    },
    "source": {
      "type": "string",
      "description": "manual lub deploy dla webhooków wydań",
      "enum": [
        "manual",
        "deploy",
        "system",
        "import",
        "incident"
      ],
      "default": "manual"
    },
    "version": {
      "type": "string",
      "description": "Wdrożenia: wersja wydania lub commit, używane w domyślnym tytule"
    },
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator notatki, np. note_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Witryna lub null dla notatek całej przestrzeni roboczej"
        },
        {
          "type": "null"
        }
      ]
    },
    "date": {
      "type": "string",
      "format": "date"
    },
    "end_date": {
      "anyOf": [
        {
          "type": "string",
          "format": "date"
        },
        {
          "type": "null"
        }
      ]
    },
    "title": {
      "type": "string"
    },
    "body": {
      "anyOf": [
        {
          "type": "string",
          "description": "Markdown"
        },
        {
          "type": "null"
        }
      ]
    },
    "url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "color": {
      "type": "string",
      "description": "neutral, brand, blue, amber, red, violet"
    },
    "source": {
      "type": "string",
      "description": "manual, deploy, system, import, incident"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /workspaces/:workspace_id/notes/:id.json Usuń notatkę przestrzeni roboczej workspace_notes_delete

Uprawnienie: content.write

Przykład
curl -X DELETE https://privatusanalytics.com/workspaces/:workspace_id/notes/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator notatki, np. note_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Witryna lub null dla notatek całej przestrzeni roboczej"
        },
        {
          "type": "null"
        }
      ]
    },
    "date": {
      "type": "string",
      "format": "date"
    },
    "end_date": {
      "anyOf": [
        {
          "type": "string",
          "format": "date"
        },
        {
          "type": "null"
        }
      ]
    },
    "title": {
      "type": "string"
    },
    "body": {
      "anyOf": [
        {
          "type": "string",
          "description": "Markdown"
        },
        {
          "type": "null"
        }
      ]
    },
    "url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "color": {
      "type": "string",
      "description": "neutral, brand, blue, amber, red, violet"
    },
    "source": {
      "type": "string",
      "description": "manual, deploy, system, import, incident"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /workspaces/:workspace_id/notes.json Wyświetl notatki całej przestrzeni roboczej workspace_notes_list

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/workspaces/:workspace_id/notes.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "from": {
      "type": "string",
      "format": "date",
      "description": "Tylko notatki z tej daty lub późniejsze"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Tylko notatki z tej daty lub wcześniejsze"
    },
    "source": {
      "type": "string",
      "description": "Tylko notatki z tego źródła",
      "enum": [
        "manual",
        "deploy",
        "system",
        "import",
        "incident"
      ]
    },
    "query": {
      "type": "string",
      "description": "Szukaj w tytule, treści i linku"
    },
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Strona (od 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Wyników na stronę (maks. 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Identyfikator notatki, np. note_7Q2K9XH3AB"
      },
      "site_id": {
        "anyOf": [
          {
            "type": "string",
            "description": "Witryna lub null dla notatek całej przestrzeni roboczej"
          },
          {
            "type": "null"
          }
        ]
      },
      "date": {
        "type": "string",
        "format": "date"
      },
      "end_date": {
        "anyOf": [
          {
            "type": "string",
            "format": "date"
          },
          {
            "type": "null"
          }
        ]
      },
      "title": {
        "type": "string"
      },
      "body": {
        "anyOf": [
          {
            "type": "string",
            "description": "Markdown"
          },
          {
            "type": "null"
          }
        ]
      },
      "url": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "color": {
        "type": "string",
        "description": "neutral, brand, blue, amber, red, violet"
      },
      "source": {
        "type": "string",
        "description": "manual, deploy, system, import, incident"
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
PATCH /workspaces/:workspace_id/notes/:id.json Edytuj notatkę przestrzeni roboczej workspace_notes_update

Uprawnienie: content.write

Przykład
curl -X PATCH https://privatusanalytics.com/workspaces/:workspace_id/notes/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "date": {
      "type": "string",
      "format": "date",
      "description": "Dzień notatki"
    },
    "end_date": {
      "type": "string",
      "format": "date",
      "description": "Ostatni dzień, dla zakresu dat"
    },
    "title": {
      "type": "string",
      "description": "Krótki tytuł pokazywany na wykresach"
    },
    "body": {
      "type": "string",
      "description": "Szczegóły (Markdown)"
    },
    "url": {
      "type": "string",
      "description": "Link"
    },
    "color": {
      "type": "string",
      "description": "Kolor pinezki",
      "enum": [
        "neutral",
        "brand",
        "blue",
        "amber",
        "red",
        "violet"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator notatki, np. note_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Witryna lub null dla notatek całej przestrzeni roboczej"
        },
        {
          "type": "null"
        }
      ]
    },
    "date": {
      "type": "string",
      "format": "date"
    },
    "end_date": {
      "anyOf": [
        {
          "type": "string",
          "format": "date"
        },
        {
          "type": "null"
        }
      ]
    },
    "title": {
      "type": "string"
    },
    "body": {
      "anyOf": [
        {
          "type": "string",
          "description": "Markdown"
        },
        {
          "type": "null"
        }
      ]
    },
    "url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "color": {
      "type": "string",
      "description": "neutral, brand, blue, amber, red, violet"
    },
    "source": {
      "type": "string",
      "description": "manual, deploy, system, import, incident"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Plany

GET /plans.json Wyświetl plany, ceny i limity plans_list

Uprawnienie: public

Przykład
curl https://privatusanalytics.com/plans.json
Dane wejściowe
{
  "type": "object",
  "properties": {
    "page": {
      "type": "integer",
      "description": "Strona (od 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Wyników na stronę (maks. 100)"
    }
  },
  "required": []
}
Dane odpowiedzi
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "name": {
        "type": "string",
        "description": "free, pro, business lub enterprise"
      },
      "events": {
        "anyOf": [
          {
            "type": "integer",
            "description": "Zdarzenia miesięcznie w cenie (tylko plan bezpłatny)"
          },
          {
            "type": "null"
          }
        ]
      },
      "badge_bonus": {
        "anyOf": [
          {
            "type": "integer",
            "description": "Dodatkowe zdarzenia miesięcznie za pokazywanie odznaki (plan bezpłatny)"
          },
          {
            "type": "null"
          }
        ]
      },
      "limits": {
        "type": "object",
        "description": "Limity planu. Null oznacza bez limitu"
      },
      "tiers": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "events": {
              "type": "integer",
              "description": "Zdarzenia miesięcznie w cenie"
            },
            "monthly": {
              "type": "integer",
              "description": "USD miesięcznie, rozliczane miesięcznie"
            },
            "yearly": {
              "type": "integer",
              "description": "USD rocznie, rozliczane rocznie (2 miesiące gratis)"
            },
            "monthly_price_id": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Identyfikator ceny Paddle (miesięcznie)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "yearly_price_id": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Identyfikator ceny Paddle (rocznie)"
                },
                {
                  "type": "null"
                }
              ]
            }
          }
        },
        "description": "Drabinka cen według zdarzeń miesięcznie"
      },
      "contact_sales": {
        "type": "boolean",
        "description": "Cena według umowy"
      }
    }
  }
}

Pomoc i opinie

POST /help.json Wyślij pytanie lub opinię do zespołu Privatus Analytics support_message_send

Wiadomość jest wysyłana e-mailem do zespołu wraz ze szczegółami Twojego konta, przestrzeni roboczej i planu. Odpowiedź i potwierdzenie trafiają na e-mail Twojego konta. Do 10 wiadomości dziennie.

Uprawnienie: member

Przykład
curl -X POST https://privatusanalytics.com/help.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "subject": {
      "type": "string",
      "description": "Czego dotyczy wiadomość (do 150 znaków)",
      "examples": [
        "Funnel shows no data"
      ]
    },
    "message": {
      "type": "string",
      "description": "Twoje pytanie lub opinia (od 10 do 5000 znaków)"
    }
  },
  "required": [
    "subject",
    "message"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "received": {
      "type": "boolean",
      "description": "Zawsze true, gdy zgłoszenie zostało przyjęte"
    },
    "message": {
      "type": "string",
      "description": "Co dzieje się dalej"
    }
  }
}

Program afiliacyjny

GET /account/affiliate/commissions.json Wyświetl swoje prowizje afiliacyjne affiliate_commissions_list

Prowizje, korekty za zwroty i chargebacki oraz ich cofnięcia, od najnowszych. Kwoty są w centach.

Uprawnienie: member

Przykład
curl https://privatusanalytics.com/account/affiliate/commissions.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Tylko prowizje o tym statusie",
      "enum": [
        "pending",
        "approved",
        "paid",
        "void"
      ]
    },
    "page": {
      "type": "integer",
      "description": "Strona (od 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Wyników na stronę (maks. 100)"
    }
  },
  "required": []
}
Dane odpowiedzi
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "format": "uuid",
        "description": "Identyfikator prowizji"
      },
      "kind": {
        "type": "string",
        "description": "commission, clawback (zwrot lub chargeback) lub reversal"
      },
      "status": {
        "type": "string",
        "description": "pending (wstrzymana), approved (do wypłaty), paid lub void"
      },
      "amount_cents": {
        "type": "integer",
        "description": "Twój udział w centach (ujemny dla korekty)"
      },
      "basis_cents": {
        "type": "integer",
        "description": "Płatność netto (bez podatku), od której go naliczono, w centach"
      },
      "currency": {
        "type": "string",
        "description": "Kod waluty ISO"
      },
      "earned_at": {
        "type": "string",
        "format": "date-time",
        "description": "Kiedy nastąpiła płatność (lub zwrot)"
      },
      "approved_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time",
            "description": "Kiedy stała się możliwa do wypłaty"
          },
          {
            "type": "null"
          }
        ]
      },
      "paid_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time",
            "description": "Kiedy została wypłacona"
          },
          {
            "type": "null"
          }
        ]
      }
    }
  }
}
GET /account/affiliate/signup-box.json Pobierz kod swojego formularza rejestracji afiliacyjnej i wyniki affiliate_signup_box_get

Kod osadzenia formularza rejestracji (skrypt i zwykły iframe) dla wybranego motywu, atrybuty wstępnie wypełniające formularz, zdarzenia wywoływane przez skrypt na Twojej stronie oraz liczby dla formularza: rejestracje oczekujące na potwierdzenie, potwierdzone rejestracje i płacący klienci. available ma wartość false, dopóki Twoje zgłoszenie do programu afiliacyjnego nie zostanie zatwierdzone.

Uprawnienie: member

Przykład
curl https://privatusanalytics.com/account/affiliate/signup-box.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "theme": {
      "type": "string",
      "description": "Motyw formularza: auto (dopasowany do urządzenia odwiedzającego), light lub dark",
      "enum": [
        "auto",
        "light",
        "dark"
      ],
      "examples": [
        "auto"
      ],
      "default": "auto"
    }
  },
  "required": []
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "available": {
      "type": "boolean",
      "description": "Czy masz formularz rejestracji (tylko zatwierdzeni afilianci)"
    },
    "theme": {
      "type": "string",
      "description": "Motyw, dla którego zbudowano kod"
    },
    "frame_url": {
      "anyOf": [
        {
          "type": "string",
          "description": "Adres formularza, dla zwykłego iframe"
        },
        {
          "type": "null"
        }
      ]
    },
    "script": {
      "anyOf": [
        {
          "type": "string",
          "description": "Kod osadzenia ze skryptem: element i skrypt ładujący"
        },
        {
          "type": "null"
        }
      ]
    },
    "iframe": {
      "anyOf": [
        {
          "type": "string",
          "description": "Kod osadzenia ze zwykłym iframe"
        },
        {
          "type": "null"
        }
      ]
    },
    "prefill_attributes": {
      "type": "array",
      "description": "Atrybuty elementu, które wstępnie wypełniają formularz dla zalogowanych odwiedzających"
    },
    "events": {
      "type": "array",
      "description": "Zdarzenia DOM wywoływane przez skrypt na elemencie"
    },
    "waiting": {
      "type": "integer",
      "description": "Rejestracje, w których link z e-maila nie został jeszcze otwarty"
    },
    "signups": {
      "type": "integer",
      "description": "Potwierdzone rejestracje dokonane przez formularz"
    },
    "customers": {
      "type": "integer",
      "description": "Te, które stały się płacącymi klientami"
    }
  }
}
GET /account/affiliate.json Pobierz swój status afilianta, link polecający i statystyki affiliate_get

Status Twojego zgłoszenia do programu afiliacyjnego, link polecający, poleceni przez Ciebie zarejestrowani i płacący klienci oraz salda w każdej walucie (wstrzymane, do wypłaty, wypłacone). status ma wartość none, jeśli nie złożono zgłoszenia.

Uprawnienie: member

Przykład
curl https://privatusanalytics.com/account/affiliate.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {},
  "required": []
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "none (brak zgłoszenia), pending, approved, rejected lub suspended"
    },
    "code": {
      "anyOf": [
        {
          "type": "string",
          "description": "Twój kod polecający"
        },
        {
          "type": "null"
        }
      ]
    },
    "referral_url": {
      "anyOf": [
        {
          "type": "string",
          "description": "Link do udostępniania (tylko zatwierdzeni afilianci)"
        },
        {
          "type": "null"
        }
      ]
    },
    "payout_method": {
      "anyOf": [
        {
          "type": "string",
          "description": "wise lub credit"
        },
        {
          "type": "null"
        }
      ]
    },
    "rejection_reason": {
      "anyOf": [
        {
          "type": "string",
          "description": "Dlaczego ostatnie zgłoszenie zostało odrzucone"
        },
        {
          "type": "null"
        }
      ]
    },
    "applied_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Kiedy złożono zgłoszenie"
        },
        {
          "type": "null"
        }
      ]
    },
    "approved_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Kiedy zgłoszenie zostało zatwierdzone"
        },
        {
          "type": "null"
        }
      ]
    },
    "credit_blocked": {
      "anyOf": [
        {
          "type": "string",
          "description": "Dlaczego kredyt na koncie czeka: program (przestrzeń robocza jest w programie zniżkowym), no_subscription lub no_workspace. null, gdy nic go nie blokuje"
        },
        {
          "type": "null"
        }
      ]
    },
    "signups": {
      "type": "integer",
      "description": "Konta utworzone przez Twój link lub kod"
    },
    "customers": {
      "type": "integer",
      "description": "Polecone przestrzenie robocze, które zapłaciły"
    },
    "balances": {
      "type": "array",
      "description": "Dla każdej waluty: pending_cents (wstrzymane), approved_cents (do wypłaty) i paid_cents"
    },
    "payouts": {
      "type": "array",
      "description": "Ostatnie wypłaty z polami amount_cents, currency, payout_method, status (applied: kredyt na koncie czekający na następne odnowienie, lub paid), applied_at i paid_at"
    },
    "terms": {
      "type": "object",
      "description": "Procent prowizji, liczba miesięcy, dni wstrzymania i próg wypłaty przez Wise w centach"
    }
  }
}

Przestrzenie robocze

GET /workspaces/:workspace_id/white_label.json Pobierz markę white label white_label_get

Uprawnienie: workspace.manage

Przykład
curl https://privatusanalytics.com/workspaces/:workspace_id/white_label.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string"
    },
    "brand_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nazwa pokazywana zamiast Privatus Analytics"
        },
        {
          "type": "null"
        }
      ]
    },
    "brand_logo_url": {
      "anyOf": [
        {
          "type": "string",
          "description": "Adres URL obrazu logo"
        },
        {
          "type": "null"
        }
      ]
    },
    "brand_color": {
      "anyOf": [
        {
          "type": "string",
          "description": "Kolor akcentu"
        },
        {
          "type": "null"
        }
      ]
    },
    "hide_branding": {
      "type": "boolean",
      "description": "Marka Privatus Analytics jest ukryta"
    },
    "available": {
      "type": "boolean",
      "description": "Plan obejmuje white label"
    },
    "active": {
      "type": "boolean",
      "description": "Marka jest obecnie stosowana"
    }
  }
}
PATCH /workspaces/:workspace_id/white_label.json Ustaw markę white label dla udostępnionych pulpitów i raportów e-mail (Business) white_label_update

Uprawnienie: workspace.manage

Przykład
curl -X PATCH https://privatusanalytics.com/workspaces/:workspace_id/white_label.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "brand_name": {
      "type": "string",
      "description": "Nazwa pokazywana zamiast Privatus Analytics (puste ją usuwa)"
    },
    "brand_logo_url": {
      "type": "string",
      "description": "Adres URL https obrazu logo (puste go usuwa)"
    },
    "brand_color": {
      "type": "string",
      "description": "Kolor akcentu, np. #06755b"
    },
    "hide_branding": {
      "type": "boolean",
      "description": "Ukryj \"Privatus Analytics\" na udostępnionych pulpitach i raportach e-mail"
    },
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string"
    },
    "brand_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nazwa pokazywana zamiast Privatus Analytics"
        },
        {
          "type": "null"
        }
      ]
    },
    "brand_logo_url": {
      "anyOf": [
        {
          "type": "string",
          "description": "Adres URL obrazu logo"
        },
        {
          "type": "null"
        }
      ]
    },
    "brand_color": {
      "anyOf": [
        {
          "type": "string",
          "description": "Kolor akcentu"
        },
        {
          "type": "null"
        }
      ]
    },
    "hide_branding": {
      "type": "boolean",
      "description": "Marka Privatus Analytics jest ukryta"
    },
    "available": {
      "type": "boolean",
      "description": "Plan obejmuje white label"
    },
    "active": {
      "type": "boolean",
      "description": "Marka jest obecnie stosowana"
    }
  }
}
GET /workspaces/:workspace_id/security.json Pobierz ustawienia bezpieczeństwa przestrzeni roboczej workspace_security_get

Uprawnienie: workspace.manage

Przykład
curl https://privatusanalytics.com/workspaces/:workspace_id/security.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string"
    },
    "enforce_2fa": {
      "type": "boolean",
      "description": "Członkowie muszą skonfigurować 2FA"
    },
    "login_methods": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Dozwolone metody logowania"
    },
    "session_ttl_hours": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Czas życia sesji (null = brak)"
        },
        {
          "type": "null"
        }
      ]
    },
    "app_ip_allowlist": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Dozwolone adresy IP/CIDR (puste = z dowolnego miejsca)"
    },
    "support_access_until": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Wsparcie Privatus Analytics może przeglądać przestrzeń roboczą do"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
PATCH /workspaces/:workspace_id/security.json Zaktualizuj ustawienia bezpieczeństwa przestrzeni roboczej (2FA, metody logowania, czas trwania sesji, lista dozwolonych IP, dostęp wsparcia) workspace_security_update

Uprawnienie: workspace.manage

Przykład
curl -X PATCH https://privatusanalytics.com/workspaces/:workspace_id/security.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "enforce_2fa": {
      "type": "boolean",
      "description": "Wymagaj od członków skonfigurowania 2FA"
    },
    "login_methods": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "password",
          "magic_link",
          "passkey",
          "google",
          "github",
          "sso"
        ]
      },
      "description": "Dozwolone metody logowania"
    },
    "session_ttl_hours": {
      "type": "integer",
      "description": "Wyloguj członków po tylu godzinach (0 = bez limitu)"
    },
    "app_ip_allowlist": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Zezwalaj na dostęp do aplikacji i API tylko z tych adresów IP/CIDR (Business). Puste = z dowolnego miejsca"
    },
    "support_access": {
      "type": "boolean",
      "description": "Pozwól wsparciu Privatus Analytics przeglądać przestrzeń roboczą przez 7 dni"
    },
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string"
    },
    "enforce_2fa": {
      "type": "boolean",
      "description": "Członkowie muszą skonfigurować 2FA"
    },
    "login_methods": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Dozwolone metody logowania"
    },
    "session_ttl_hours": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Czas życia sesji (null = brak)"
        },
        {
          "type": "null"
        }
      ]
    },
    "app_ip_allowlist": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Dozwolone adresy IP/CIDR (puste = z dowolnego miejsca)"
    },
    "support_access_until": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Wsparcie Privatus Analytics może przeglądać przestrzeń roboczą do"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
POST /workspaces.json Utwórz przestrzeń roboczą (zostajesz właścicielem) workspaces_create

Uprawnienie: member · Tylko HTTP (nie jest narzędziem MCP)

Przykład
curl -X POST https://privatusanalytics.com/workspaces.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nazwa przestrzeni roboczej",
      "examples": [
        "Acme Inc"
      ]
    },
    "timezone": {
      "type": "string",
      "description": "Domyślna strefa czasowa raportowania (domyślnie strefa użytkownika)"
    },
    "currency": {
      "type": "string",
      "description": "Domyślna waluta (ISO 4217)",
      "default": "USD"
    },
    "how_heard": {
      "type": "string",
      "description": "Skąd o nas wiesz"
    }
  },
  "required": [
    "name"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "timezone": {
      "type": "string",
      "description": "Domyślna strefa czasowa raportowania"
    },
    "currency": {
      "type": "string",
      "description": "Domyślna waluta"
    },
    "plan": {
      "type": "string",
      "description": "free, pro, business lub enterprise"
    },
    "plan_events": {
      "type": "integer",
      "description": "Zdarzenia miesięcznie wliczone w plan"
    },
    "subscription_status": {
      "type": "string"
    },
    "role": {
      "type": "string",
      "description": "Twoja rola w tej przestrzeni roboczej"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /workspaces/:id.json Usuń przestrzeń roboczą i wszystkie jej witryny (tylko właściciel, anuluje każdą subskrypcję) workspaces_delete

Uprawnienie: workspace.manage

Przykład
curl -X DELETE https://privatusanalytics.com/workspaces/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "confirm": {
      "type": "string",
      "description": "Wpisz nazwę przestrzeni roboczej, aby potwierdzić"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "confirm",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "timezone": {
      "type": "string",
      "description": "Domyślna strefa czasowa raportowania"
    },
    "currency": {
      "type": "string",
      "description": "Domyślna waluta"
    },
    "plan": {
      "type": "string",
      "description": "free, pro, business lub enterprise"
    },
    "plan_events": {
      "type": "integer",
      "description": "Zdarzenia miesięcznie wliczone w plan"
    },
    "subscription_status": {
      "type": "string"
    },
    "role": {
      "type": "string",
      "description": "Twoja rola w tej przestrzeni roboczej"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /workspaces.json Wyświetl swoje przestrzenie robocze workspaces_list

Uprawnienie: member

Przykład
curl https://privatusanalytics.com/workspaces.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "page": {
      "type": "integer",
      "description": "Strona (od 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Wyników na stronę (maks. 100)"
    }
  },
  "required": []
}
Dane odpowiedzi
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
      },
      "name": {
        "type": "string"
      },
      "timezone": {
        "type": "string",
        "description": "Domyślna strefa czasowa raportowania"
      },
      "currency": {
        "type": "string",
        "description": "Domyślna waluta"
      },
      "plan": {
        "type": "string",
        "description": "free, pro, business lub enterprise"
      },
      "plan_events": {
        "type": "integer",
        "description": "Zdarzenia miesięcznie wliczone w plan"
      },
      "subscription_status": {
        "type": "string"
      },
      "role": {
        "type": "string",
        "description": "Twoja rola w tej przestrzeni roboczej"
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
GET /workspaces/:id.json Pobierz przestrzeń roboczą workspaces_get

Uprawnienie: member

Przykład
curl https://privatusanalytics.com/workspaces/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "timezone": {
      "type": "string",
      "description": "Domyślna strefa czasowa raportowania"
    },
    "currency": {
      "type": "string",
      "description": "Domyślna waluta"
    },
    "plan": {
      "type": "string",
      "description": "free, pro, business lub enterprise"
    },
    "plan_events": {
      "type": "integer",
      "description": "Zdarzenia miesięcznie wliczone w plan"
    },
    "subscription_status": {
      "type": "string"
    },
    "role": {
      "type": "string",
      "description": "Twoja rola w tej przestrzeni roboczej"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
PATCH /workspaces/:id.json Zaktualizuj ustawienia przestrzeni roboczej workspaces_update

Uprawnienie: workspace.manage

Przykład
curl -X PATCH https://privatusanalytics.com/workspaces/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nazwa przestrzeni roboczej"
    },
    "timezone": {
      "type": "string",
      "description": "Domyślna strefa czasowa raportowania"
    },
    "currency": {
      "type": "string",
      "description": "Domyślna waluta (ISO 4217)"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "timezone": {
      "type": "string",
      "description": "Domyślna strefa czasowa raportowania"
    },
    "currency": {
      "type": "string",
      "description": "Domyślna waluta"
    },
    "plan": {
      "type": "string",
      "description": "free, pro, business lub enterprise"
    },
    "plan_events": {
      "type": "integer",
      "description": "Zdarzenia miesięcznie wliczone w plan"
    },
    "subscription_status": {
      "type": "string"
    },
    "role": {
      "type": "string",
      "description": "Twoja rola w tej przestrzeni roboczej"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Pulpity

GET /workspaces/:workspace_id/dashboards/:id/cards/:index.json Dane jednej karty pulpitu niestandardowego dashboards_card

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/workspaces/:workspace_id/dashboards/:id/cards/:index.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    },
    "index": {
      "type": "string",
      "description": "Index zasobu"
    }
  },
  "required": [
    "workspace_id",
    "id",
    "index"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}
POST /workspaces/:workspace_id/dashboards.json Utwórz pulpit niestandardowy dashboards_create

Uprawnienie: content.write

Przykład
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/dashboards.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nazwa pulpitu",
      "examples": [
        "Client: Acme"
      ]
    },
    "cards": {
      "type": "array",
      "items": {},
      "description": "Karty po kolei (maks. 40): [{\"type\": \"metric|chart|breakdown|goal|live|funnel|uptime|vitals\", \"site_id\": \"pa_…\", \"title\": \"optional\", \"params\": {\"period\": \"30d\", \"metric\": \"visitors\", \"dimension\": \"page\", \"funnel_id\": \"fun_…\"}}]. Parametry nieużywane przez dany typ są ignorowane",
      "default": []
    },
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator pulpitu, np. dash_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "cards": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Karty po kolei: [{type, site_id, title, params}]"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /workspaces/:workspace_id/dashboards/:id.json Usuń pulpit niestandardowy dashboards_delete

Uprawnienie: content.write

Przykład
curl -X DELETE https://privatusanalytics.com/workspaces/:workspace_id/dashboards/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator pulpitu, np. dash_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "cards": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Karty po kolei: [{type, site_id, title, params}]"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /workspaces/:workspace_id/dashboards.json Wyświetl pulpity niestandardowe dashboards_list

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/workspaces/:workspace_id/dashboards.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Strona (od 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Wyników na stronę (maks. 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Identyfikator pulpitu, np. dash_7Q2K9XH3AB"
      },
      "name": {
        "type": "string"
      },
      "cards": {
        "type": "array",
        "items": {
          "type": "object"
        },
        "description": "Karty po kolei: [{type, site_id, title, params}]"
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      },
      "updated_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
GET /workspaces/:workspace_id/dashboards/:id.json Pobierz pulpit niestandardowy i jego karty dashboards_get

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/workspaces/:workspace_id/dashboards/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator pulpitu, np. dash_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "cards": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Karty po kolei: [{type, site_id, title, params}]"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
PATCH /workspaces/:workspace_id/dashboards/:id.json Zmień nazwę pulpitu niestandardowego lub zastąp jego karty dashboards_update

Uprawnienie: content.write

Przykład
curl -X PATCH https://privatusanalytics.com/workspaces/:workspace_id/dashboards/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nowa nazwa (bez zmian, gdy puste)"
    },
    "cards": {
      "type": "array",
      "items": {},
      "description": "Zastępuje wszystkie karty. Karty po kolei (maks. 40): [{\"type\": \"metric|chart|breakdown|goal|live|funnel|uptime|vitals\", \"site_id\": \"pa_…\", \"title\": \"optional\", \"params\": {\"period\": \"30d\", \"metric\": \"visitors\", \"dimension\": \"page\", \"funnel_id\": \"fun_…\"}}]. Parametry nieużywane przez dany typ są ignorowane"
    },
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator pulpitu, np. dash_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "cards": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Karty po kolei: [{type, site_id, title, params}]"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Raporty e-mail

DELETE /recipients/:id.json Usuń odbiorcę z raportu e-mail email_report_recipients_delete

Uprawnienie: content.write

Przykład
curl -X DELETE https://privatusanalytics.com/recipients/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator odbiorcy, np. rcp_7Q2K9XH3AB"
    },
    "email": {
      "type": "string",
      "description": "Adres"
    },
    "status": {
      "type": "string",
      "description": "active, pending, declined lub unsubscribed"
    },
    "invited_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Kiedy wysłano ostatnie zaproszenie"
        },
        {
          "type": "null"
        }
      ]
    },
    "expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Kiedy wygasa oczekujące zaproszenie"
        },
        {
          "type": "null"
        }
      ]
    },
    "confirmed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Kiedy adres stał się aktywny"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
GET /reports/:report_id/recipients.json Wyświetl odbiorców raportu e-mail wraz z ich statusem email_report_recipients_list

Statusy: active (otrzymuje raporty), pending (zaproszony, jeszcze nie zaakceptował), declined lub unsubscribed. Adresy dodasz lub usuniesz na liście odbiorców raportu.

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/reports/:report_id/recipients.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Tylko odbiorcy o tym statusie",
      "enum": [
        "pending",
        "active",
        "declined",
        "unsubscribed"
      ]
    },
    "report_id": {
      "type": "string",
      "description": "Report zasobu"
    },
    "page": {
      "type": "integer",
      "description": "Strona (od 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Wyników na stronę (maks. 100)"
    }
  },
  "required": [
    "report_id"
  ]
}
Dane odpowiedzi
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Identyfikator odbiorcy, np. rcp_7Q2K9XH3AB"
      },
      "email": {
        "type": "string",
        "description": "Adres"
      },
      "status": {
        "type": "string",
        "description": "active, pending, declined lub unsubscribed"
      },
      "invited_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time",
            "description": "Kiedy wysłano ostatnie zaproszenie"
          },
          {
            "type": "null"
          }
        ]
      },
      "expires_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time",
            "description": "Kiedy wygasa oczekujące zaproszenie"
          },
          {
            "type": "null"
          }
        ]
      },
      "confirmed_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time",
            "description": "Kiedy adres stał się aktywny"
          },
          {
            "type": "null"
          }
        ]
      }
    }
  }
}
POST /recipients/:id/resend.json Wyślij ponownie oczekujące zaproszenie do raportu email_report_recipients_resend

Wysyła zaproszenie ponownie, z nowymi linkami. Dozwolone raz na 7 dni dla danego adresu i raportu.

Uprawnienie: content.write

Przykład
curl -X POST https://privatusanalytics.com/recipients/:id/resend.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator odbiorcy, np. rcp_7Q2K9XH3AB"
    },
    "email": {
      "type": "string",
      "description": "Adres"
    },
    "status": {
      "type": "string",
      "description": "active, pending, declined lub unsubscribed"
    },
    "invited_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Kiedy wysłano ostatnie zaproszenie"
        },
        {
          "type": "null"
        }
      ]
    },
    "expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Kiedy wygasa oczekujące zaproszenie"
        },
        {
          "type": "null"
        }
      ]
    },
    "confirmed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Kiedy adres stał się aktywny"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
POST /workspaces/:workspace_id/reports.json Utwórz raport e-mail email_reports_create

Uprawnienie: content.write

Przykład
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/reports.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Identyfikatory witryn (pa_…) uwzględnionych w raporcie"
    },
    "frequency": {
      "type": "string",
      "description": "daily, weekly (w dzień tygodnia) lub monthly (pierwszego dnia)",
      "enum": [
        "daily",
        "weekly",
        "monthly"
      ]
    },
    "hour": {
      "type": "integer",
      "description": "Godzina wysyłki (od 0 do 23, strefa czasowa przestrzeni roboczej)"
    },
    "weekday": {
      "type": "integer",
      "description": "Raporty tygodniowe: 0 = niedziela … 6 = sobota"
    },
    "recipients": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Adresy e-mail (konto nie jest potrzebne). Wpisy można oddzielać przecinkami lub nowymi liniami. Członkowie przestrzeni roboczej są dodawani od razu. Pozostali dostają zaproszenie i otrzymują raporty dopiero po jego zaakceptowaniu. Adresy, które zrezygnowały z raportów, są odrzucane"
    },
    "blocks": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Zawartość: kpis, chart, pages, sources, goals, campaigns, vitals, uptime"
    },
    "attach_pdf": {
      "type": "boolean",
      "description": "Dołącz wersję PDF"
    },
    "intro": {
      "type": "string",
      "description": "Własny tekst wstępny (maks. 2000 znaków)"
    },
    "enabled": {
      "type": "boolean",
      "description": "Wysyłaj według harmonogramu"
    },
    "name": {
      "type": "string",
      "description": "Nazwa raportu",
      "examples": [
        "Weekly traffic"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator raportu, np. rep_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Identyfikatory witryn w raporcie"
    },
    "frequency": {
      "type": "string",
      "description": "daily, weekly lub monthly"
    },
    "hour": {
      "type": "integer",
      "description": "Godzina wysyłki (strefa czasowa przestrzeni roboczej)"
    },
    "weekday": {
      "type": "integer",
      "description": "Tygodniowo: 0 = niedziela … 6 = sobota"
    },
    "recipients": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Każdy adres w raporcie, niezależnie od statusu"
    },
    "recipient_details": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Identyfikator odbiorcy, np. rcp_7Q2K9XH3AB"
          },
          "email": {
            "type": "string",
            "description": "Adres"
          },
          "status": {
            "type": "string",
            "description": "active, pending, declined lub unsubscribed"
          },
          "invited_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Kiedy wysłano ostatnie zaproszenie"
              },
              {
                "type": "null"
              }
            ]
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Kiedy wygasa oczekujące zaproszenie"
              },
              {
                "type": "null"
              }
            ]
          },
          "confirmed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Kiedy adres stał się aktywny"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "description": "Każdy odbiorca ze statusem zgody (raporty otrzymują tylko aktywni odbiorcy)"
    },
    "blocks": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Bloki treści"
    },
    "attach_pdf": {
      "type": "boolean"
    },
    "intro": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "enabled": {
      "type": "boolean"
    },
    "last_sent_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "next_run_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /reports/:id/deliveries.json Dziennik dostarczeń raportu e-mail email_reports_deliveries

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/reports/:id/deliveries.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Tylko dostarczenia o tym statusie",
      "enum": [
        "sent",
        "test",
        "failed",
        "skipped"
      ]
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    },
    "page": {
      "type": "integer",
      "description": "Strona (od 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Wyników na stronę (maks. 100)"
    }
  },
  "required": [
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "status": {
        "type": "string",
        "description": "sent, test, failed lub skipped"
      },
      "recipients_count": {
        "type": "integer"
      },
      "error": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "sent_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
DELETE /reports/:id.json Usuń raport e-mail email_reports_delete

Uprawnienie: content.write

Przykład
curl -X DELETE https://privatusanalytics.com/reports/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator raportu, np. rep_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Identyfikatory witryn w raporcie"
    },
    "frequency": {
      "type": "string",
      "description": "daily, weekly lub monthly"
    },
    "hour": {
      "type": "integer",
      "description": "Godzina wysyłki (strefa czasowa przestrzeni roboczej)"
    },
    "weekday": {
      "type": "integer",
      "description": "Tygodniowo: 0 = niedziela … 6 = sobota"
    },
    "recipients": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Każdy adres w raporcie, niezależnie od statusu"
    },
    "recipient_details": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Identyfikator odbiorcy, np. rcp_7Q2K9XH3AB"
          },
          "email": {
            "type": "string",
            "description": "Adres"
          },
          "status": {
            "type": "string",
            "description": "active, pending, declined lub unsubscribed"
          },
          "invited_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Kiedy wysłano ostatnie zaproszenie"
              },
              {
                "type": "null"
              }
            ]
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Kiedy wygasa oczekujące zaproszenie"
              },
              {
                "type": "null"
              }
            ]
          },
          "confirmed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Kiedy adres stał się aktywny"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "description": "Każdy odbiorca ze statusem zgody (raporty otrzymują tylko aktywni odbiorcy)"
    },
    "blocks": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Bloki treści"
    },
    "attach_pdf": {
      "type": "boolean"
    },
    "intro": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "enabled": {
      "type": "boolean"
    },
    "last_sent_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "next_run_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /workspaces/:workspace_id/reports.json Wyświetl raporty e-mail email_reports_list

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/workspaces/:workspace_id/reports.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "frequency": {
      "type": "string",
      "description": "Tylko raporty o tej częstotliwości",
      "enum": [
        "daily",
        "weekly",
        "monthly"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Strona (od 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Wyników na stronę (maks. 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Identyfikator raportu, np. rep_7Q2K9XH3AB"
      },
      "name": {
        "type": "string"
      },
      "site_ids": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Identyfikatory witryn w raporcie"
      },
      "frequency": {
        "type": "string",
        "description": "daily, weekly lub monthly"
      },
      "hour": {
        "type": "integer",
        "description": "Godzina wysyłki (strefa czasowa przestrzeni roboczej)"
      },
      "weekday": {
        "type": "integer",
        "description": "Tygodniowo: 0 = niedziela … 6 = sobota"
      },
      "recipients": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Każdy adres w raporcie, niezależnie od statusu"
      },
      "recipient_details": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "description": "Identyfikator odbiorcy, np. rcp_7Q2K9XH3AB"
            },
            "email": {
              "type": "string",
              "description": "Adres"
            },
            "status": {
              "type": "string",
              "description": "active, pending, declined lub unsubscribed"
            },
            "invited_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Kiedy wysłano ostatnie zaproszenie"
                },
                {
                  "type": "null"
                }
              ]
            },
            "expires_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Kiedy wygasa oczekujące zaproszenie"
                },
                {
                  "type": "null"
                }
              ]
            },
            "confirmed_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Kiedy adres stał się aktywny"
                },
                {
                  "type": "null"
                }
              ]
            }
          }
        },
        "description": "Każdy odbiorca ze statusem zgody (raporty otrzymują tylko aktywni odbiorcy)"
      },
      "blocks": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Bloki treści"
      },
      "attach_pdf": {
        "type": "boolean"
      },
      "intro": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "enabled": {
        "type": "boolean"
      },
      "last_sent_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "next_run_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
POST /reports/:id/send_test.json Wyślij raport e-mail teraz jako test email_reports_send_test

Uprawnienie: content.write

Przykład
curl -X POST https://privatusanalytics.com/reports/:id/send_test.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "recipient": {
      "type": "string",
      "description": "Wyślij test na ten adres (domyślnie: Twój e-mail)"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "sent, test, failed lub skipped"
    },
    "recipients_count": {
      "type": "integer"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "sent_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /reports/:id.json Pobierz raport e-mail email_reports_get

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/reports/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator raportu, np. rep_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Identyfikatory witryn w raporcie"
    },
    "frequency": {
      "type": "string",
      "description": "daily, weekly lub monthly"
    },
    "hour": {
      "type": "integer",
      "description": "Godzina wysyłki (strefa czasowa przestrzeni roboczej)"
    },
    "weekday": {
      "type": "integer",
      "description": "Tygodniowo: 0 = niedziela … 6 = sobota"
    },
    "recipients": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Każdy adres w raporcie, niezależnie od statusu"
    },
    "recipient_details": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Identyfikator odbiorcy, np. rcp_7Q2K9XH3AB"
          },
          "email": {
            "type": "string",
            "description": "Adres"
          },
          "status": {
            "type": "string",
            "description": "active, pending, declined lub unsubscribed"
          },
          "invited_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Kiedy wysłano ostatnie zaproszenie"
              },
              {
                "type": "null"
              }
            ]
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Kiedy wygasa oczekujące zaproszenie"
              },
              {
                "type": "null"
              }
            ]
          },
          "confirmed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Kiedy adres stał się aktywny"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "description": "Każdy odbiorca ze statusem zgody (raporty otrzymują tylko aktywni odbiorcy)"
    },
    "blocks": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Bloki treści"
    },
    "attach_pdf": {
      "type": "boolean"
    },
    "intro": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "enabled": {
      "type": "boolean"
    },
    "last_sent_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "next_run_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
PATCH /reports/:id.json Zaktualizuj raport e-mail email_reports_update

Uprawnienie: content.write

Przykład
curl -X PATCH https://privatusanalytics.com/reports/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Identyfikatory witryn (pa_…) uwzględnionych w raporcie"
    },
    "frequency": {
      "type": "string",
      "description": "daily, weekly (w dzień tygodnia) lub monthly (pierwszego dnia)",
      "enum": [
        "daily",
        "weekly",
        "monthly"
      ]
    },
    "hour": {
      "type": "integer",
      "description": "Godzina wysyłki (od 0 do 23, strefa czasowa przestrzeni roboczej)"
    },
    "weekday": {
      "type": "integer",
      "description": "Raporty tygodniowe: 0 = niedziela … 6 = sobota"
    },
    "recipients": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Adresy e-mail (konto nie jest potrzebne). Wpisy można oddzielać przecinkami lub nowymi liniami. Członkowie przestrzeni roboczej są dodawani od razu. Pozostali dostają zaproszenie i otrzymują raporty dopiero po jego zaakceptowaniu. Adresy, które zrezygnowały z raportów, są odrzucane"
    },
    "blocks": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Zawartość: kpis, chart, pages, sources, goals, campaigns, vitals, uptime"
    },
    "attach_pdf": {
      "type": "boolean",
      "description": "Dołącz wersję PDF"
    },
    "intro": {
      "type": "string",
      "description": "Własny tekst wstępny (maks. 2000 znaków)"
    },
    "enabled": {
      "type": "boolean",
      "description": "Wysyłaj według harmonogramu"
    },
    "name": {
      "type": "string",
      "description": "Nazwa raportu"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator raportu, np. rep_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Identyfikatory witryn w raporcie"
    },
    "frequency": {
      "type": "string",
      "description": "daily, weekly lub monthly"
    },
    "hour": {
      "type": "integer",
      "description": "Godzina wysyłki (strefa czasowa przestrzeni roboczej)"
    },
    "weekday": {
      "type": "integer",
      "description": "Tygodniowo: 0 = niedziela … 6 = sobota"
    },
    "recipients": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Każdy adres w raporcie, niezależnie od statusu"
    },
    "recipient_details": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Identyfikator odbiorcy, np. rcp_7Q2K9XH3AB"
          },
          "email": {
            "type": "string",
            "description": "Adres"
          },
          "status": {
            "type": "string",
            "description": "active, pending, declined lub unsubscribed"
          },
          "invited_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Kiedy wysłano ostatnie zaproszenie"
              },
              {
                "type": "null"
              }
            ]
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Kiedy wygasa oczekujące zaproszenie"
              },
              {
                "type": "null"
              }
            ]
          },
          "confirmed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Kiedy adres stał się aktywny"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "description": "Każdy odbiorca ze statusem zgody (raporty otrzymują tylko aktywni odbiorcy)"
    },
    "blocks": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Bloki treści"
    },
    "attach_pdf": {
      "type": "boolean"
    },
    "intro": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "enabled": {
      "type": "boolean"
    },
    "last_sent_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "next_run_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /reports/invites/:token/accept.json Zaakceptuj zaproszenie do raportu report_invites_accept

Uprawnienie: public · Tylko HTTP (nie jest narzędziem MCP)

Przykład
curl -X POST https://privatusanalytics.com/reports/invites/:token/accept.json \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Token zasobu"
    }
  },
  "required": [
    "token"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator odbiorcy, np. rcp_7Q2K9XH3AB"
    },
    "email": {
      "type": "string",
      "description": "Adres"
    },
    "status": {
      "type": "string",
      "description": "active, pending, declined lub unsubscribed"
    },
    "invited_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Kiedy wysłano ostatnie zaproszenie"
        },
        {
          "type": "null"
        }
      ]
    },
    "expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Kiedy wygasa oczekujące zaproszenie"
        },
        {
          "type": "null"
        }
      ]
    },
    "confirmed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Kiedy adres stał się aktywny"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
POST /reports/invites/:token/decline.json Odrzuć zaproszenie do raportu report_invites_decline

Uprawnienie: public · Tylko HTTP (nie jest narzędziem MCP)

Przykład
curl -X POST https://privatusanalytics.com/reports/invites/:token/decline.json \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Token zasobu"
    }
  },
  "required": [
    "token"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator odbiorcy, np. rcp_7Q2K9XH3AB"
    },
    "email": {
      "type": "string",
      "description": "Adres"
    },
    "status": {
      "type": "string",
      "description": "active, pending, declined lub unsubscribed"
    },
    "invited_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Kiedy wysłano ostatnie zaproszenie"
        },
        {
          "type": "null"
        }
      ]
    },
    "expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Kiedy wygasa oczekujące zaproszenie"
        },
        {
          "type": "null"
        }
      ]
    },
    "confirmed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Kiedy adres stał się aktywny"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
POST /reports/resubscribe/:token.json Otrzymuj raporty ponownie po wcześniejszej rezygnacji report_resubscribes_confirm

Uprawnienie: public · Tylko HTTP (nie jest narzędziem MCP)

Przykład
curl -X POST https://privatusanalytics.com/reports/resubscribe/:token.json \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Token zasobu"
    }
  },
  "required": [
    "token"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}
POST /reports/unsubscribe/:token/resubscribe.json Wyślij na adres link do ponownego otrzymywania raportów report_resubscribes_create

Uprawnienie: public · Tylko HTTP (nie jest narzędziem MCP)

Przykład
curl -X POST https://privatusanalytics.com/reports/unsubscribe/:token/resubscribe.json \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Token zasobu"
    }
  },
  "required": [
    "token"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}
POST /reports/unsubscribe/:token.json Wypisz adres z raportu e-mail report_unsubscribes_create

Uprawnienie: public · Tylko HTTP (nie jest narzędziem MCP)

Przykład
curl -X POST https://privatusanalytics.com/reports/unsubscribe/:token.json \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Token zasobu"
    }
  },
  "required": [
    "token"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}

Reguły kanałów

POST /sites/:site_id/channel_rules.json Dodaj regułę kanału channel_rules_create

Uprawnienie: sites.manage

Przykład
curl -X POST https://privatusanalytics.com/sites/:site_id/channel_rules.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "channel": {
      "type": "string",
      "description": "Nazwa kanału do przypisania, np. Partnerzy"
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "operator": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        }
      },
      "description": "Warunki, które muszą pasować wszystkie: [{\"field\": \"utm_source\", \"operator\": \"is\", \"value\": \"newsletter\"}]. Pola: referrer_host, utm_source, utm_medium, utm_campaign, ref, path. Operatory: is, contains, starts_with, regex."
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "channel",
    "conditions",
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Identyfikator reguły"
    },
    "channel": {
      "type": "string",
      "description": "Kanał przypisywany, gdy wszystkie warunki pasują"
    },
    "position": {
      "type": "integer",
      "description": "Kolejność oceny (wygrywa pierwsze dopasowanie)"
    },
    "conditions": {
      "type": "array",
      "description": "Warunki: field, operator, value"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:site_id/channel_rules/:id.json Usuń regułę kanału channel_rules_delete

Uprawnienie: sites.manage

Przykład
curl -X DELETE https://privatusanalytics.com/sites/:site_id/channel_rules/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Identyfikator reguły"
    },
    "channel": {
      "type": "string",
      "description": "Kanał przypisywany, gdy wszystkie warunki pasują"
    },
    "position": {
      "type": "integer",
      "description": "Kolejność oceny (wygrywa pierwsze dopasowanie)"
    },
    "conditions": {
      "type": "array",
      "description": "Warunki: field, operator, value"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/channel_rules.json Wyświetl reguły kanałów w kolejności channel_rules_list

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/sites/:site_id/channel_rules.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Identyfikator reguły"
    },
    "channel": {
      "type": "string",
      "description": "Kanał przypisywany, gdy wszystkie warunki pasują"
    },
    "position": {
      "type": "integer",
      "description": "Kolejność oceny (wygrywa pierwsze dopasowanie)"
    },
    "conditions": {
      "type": "array",
      "description": "Warunki: field, operator, value"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
PATCH /sites/:site_id/channel_rules/:id/move.json Przesuń regułę kanału w górę lub w dół channel_rules_move

Uprawnienie: sites.manage

Przykład
curl -X PATCH https://privatusanalytics.com/sites/:site_id/channel_rules/:id/move.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "direction": {
      "type": "string",
      "description": "Dokąd przesunąć regułę",
      "enum": [
        "up",
        "down",
        "top",
        "bottom"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "direction",
    "site_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Identyfikator reguły"
    },
    "channel": {
      "type": "string",
      "description": "Kanał przypisywany, gdy wszystkie warunki pasują"
    },
    "position": {
      "type": "integer",
      "description": "Kolejność oceny (wygrywa pierwsze dopasowanie)"
    },
    "conditions": {
      "type": "array",
      "description": "Warunki: field, operator, value"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /sites/:site_id/channel_rules/preview.json Podgląd kanału dla przykładowego źródła odwołania i znaczników UTM channel_rules_preview

Uprawnienie: analytics.read

Przykład
curl -X POST https://privatusanalytics.com/sites/:site_id/channel_rules/preview.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "referrer": {
      "type": "string",
      "description": "Adres URL lub nazwa hosta źródła odwołania"
    },
    "utm_source": {
      "type": "string",
      "description": "Wartość utm_source"
    },
    "utm_medium": {
      "type": "string",
      "description": "Wartość utm_medium"
    },
    "utm_campaign": {
      "type": "string",
      "description": "Wartość utm_campaign"
    },
    "ref": {
      "type": "string",
      "description": "Parametr ref / via / source"
    },
    "path": {
      "type": "string",
      "description": "Ścieżka strony docelowej, np. /pricing"
    },
    "paid_click": {
      "type": "boolean",
      "description": "Adres URL zawierał identyfikator kliknięcia, taki jak gclid",
      "default": false
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}
PATCH /sites/:site_id/channel_rules/:id.json Zmień regułę kanału channel_rules_update

Uprawnienie: sites.manage

Przykład
curl -X PATCH https://privatusanalytics.com/sites/:site_id/channel_rules/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "channel": {
      "type": "string",
      "description": "Nazwa kanału do przypisania"
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "operator": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        }
      },
      "description": "Warunki, które muszą pasować wszystkie: [{\"field\": \"utm_source\", \"operator\": \"is\", \"value\": \"newsletter\"}]. Pola: referrer_host, utm_source, utm_medium, utm_campaign, ref, path. Operatory: is, contains, starts_with, regex."
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Identyfikator reguły"
    },
    "channel": {
      "type": "string",
      "description": "Kanał przypisywany, gdy wszystkie warunki pasują"
    },
    "position": {
      "type": "integer",
      "description": "Kolejność oceny (wygrywa pierwsze dopasowanie)"
    },
    "conditions": {
      "type": "array",
      "description": "Warunki: field, operator, value"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Reguły ruchu

POST /sites/:site_id/traffic_rules.json Dodaj regułę ruchu traffic_rules_create

Uprawnienie: sites.manage

Przykład
curl -X POST https://privatusanalytics.com/sites/:site_id/traffic_rules.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "list": {
      "type": "string",
      "description": "hostnames, paths, referrers, countries, ip_ranges, user_agents lub events",
      "enum": [
        "hostnames",
        "paths",
        "referrers",
        "countries",
        "ip_ranges",
        "user_agents",
        "events"
      ]
    },
    "pattern": {
      "type": "string",
      "description": "Wartość do dopasowania. * to symbol wieloznaczny. ip_ranges przyjmują IP lub CIDR (v4/v6), countries kod ISO",
      "examples": [
        "/admin/*"
      ]
    },
    "label": {
      "type": "string",
      "description": "Opcjonalna notatka, np. \"Biuro\""
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "list",
    "pattern",
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Identyfikator reguły"
    },
    "list": {
      "type": "string",
      "description": "hostnames, paths, referrers, countries, ip_ranges, user_agents lub events"
    },
    "pattern": {
      "type": "string",
      "description": "Wzorzec (symbole wieloznaczne *, CIDR dla ip_ranges)"
    },
    "label": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "mode": {
      "type": "string",
      "description": "block lub allow (tryb jej listy)"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:site_id/traffic_rules/:id.json Usuń regułę ruchu traffic_rules_delete

Uprawnienie: sites.manage

Przykład
curl -X DELETE https://privatusanalytics.com/sites/:site_id/traffic_rules/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Identyfikator reguły"
    },
    "list": {
      "type": "string",
      "description": "hostnames, paths, referrers, countries, ip_ranges, user_agents lub events"
    },
    "pattern": {
      "type": "string",
      "description": "Wzorzec (symbole wieloznaczne *, CIDR dla ip_ranges)"
    },
    "label": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "mode": {
      "type": "string",
      "description": "block lub allow (tryb jej listy)"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/traffic_rules.json Wyświetl reguły ruchu traffic_rules_list

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/sites/:site_id/traffic_rules.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "list": {
      "type": "string",
      "description": "Tylko reguły z tej listy",
      "enum": [
        "hostnames",
        "paths",
        "referrers",
        "countries",
        "ip_ranges",
        "user_agents",
        "events"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Identyfikator reguły"
    },
    "list": {
      "type": "string",
      "description": "hostnames, paths, referrers, countries, ip_ranges, user_agents lub events"
    },
    "pattern": {
      "type": "string",
      "description": "Wzorzec (symbole wieloznaczne *, CIDR dla ip_ranges)"
    },
    "label": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "mode": {
      "type": "string",
      "description": "block lub allow (tryb jej listy)"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /sites/:site_id/traffic_rules/test.json Sprawdź, czy trafienie zostałoby zliczone przy bieżących regułach witryny traffic_rules_test

Uprawnienie: analytics.read

Przykład
curl -X POST https://privatusanalytics.com/sites/:site_id/traffic_rules/test.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Adres URL strony, np. https://example.com/a"
    },
    "referrer": {
      "type": "string",
      "description": "Adres URL lub nazwa hosta źródła odwołania"
    },
    "country": {
      "type": "string",
      "description": "Kod kraju ISO, np. US"
    },
    "ip": {
      "type": "string",
      "description": "Adres IP do sprawdzenia względem ip_ranges (nie jest zapisywany)"
    },
    "user_agent": {
      "type": "string",
      "description": "Ciąg User-Agent (skracany do przeglądarki i wersji głównej, jak przy ingest)"
    },
    "event": {
      "type": "string",
      "description": "Nazwa zdarzenia niestandardowego"
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}
PATCH /sites/:site_id/traffic_rules/:id.json Zmień regułę ruchu traffic_rules_update

Uprawnienie: sites.manage

Przykład
curl -X PATCH https://privatusanalytics.com/sites/:site_id/traffic_rules/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "pattern": {
      "type": "string",
      "description": "Nowy wzorzec"
    },
    "label": {
      "type": "string",
      "description": "Nowa etykieta"
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Identyfikator reguły"
    },
    "list": {
      "type": "string",
      "description": "hostnames, paths, referrers, countries, ip_ranges, user_agents lub events"
    },
    "pattern": {
      "type": "string",
      "description": "Wzorzec (symbole wieloznaczne *, CIDR dla ip_ranges)"
    },
    "label": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "mode": {
      "type": "string",
      "description": "block lub allow (tryb jej listy)"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Roboty indeksujące

POST /sites/:site_id/crawlers/connection.json Synchronizuj wejścia crawlerów AI ze strefy Cloudflare (wymaga zgody Cloudflare udzielonej w przeglądarce) crawlers_cloudflare_connect

Uprawnienie: sites.manage

Przykład
curl -X POST https://privatusanalytics.com/sites/:site_id/crawlers/connection.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "zone_id": {
      "type": "string",
      "description": "Identyfikator strefy Cloudflare z crawlers_cloudflare_zones",
      "examples": [
        "023e105f4ecef8ad9ca31a8372d0c353"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "zone_id",
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "zone_id": {
      "type": "string",
      "description": "Identyfikator strefy Cloudflare"
    },
    "zone_name": {
      "type": "string",
      "description": "Nazwa strefy Cloudflare, np. example.com"
    },
    "status": {
      "type": "string",
      "description": "active lub error"
    },
    "last_synced_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Kiedy ostatnio zaimportowano wejścia crawlerów, lub null przed pierwszym importem"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:site_id/crawlers/connection.json Odłącz Cloudflare i usuń zaimportowane stamtąd wejścia crawlerów crawlers_cloudflare_disconnect

Uprawnienie: sites.manage

Przykład
curl -X DELETE https://privatusanalytics.com/sites/:site_id/crawlers/connection.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "zone_id": {
      "type": "string",
      "description": "Identyfikator strefy Cloudflare"
    },
    "zone_name": {
      "type": "string",
      "description": "Nazwa strefy Cloudflare, np. example.com"
    },
    "status": {
      "type": "string",
      "description": "active lub error"
    },
    "last_synced_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Kiedy ostatnio zaimportowano wejścia crawlerów, lub null przed pierwszym importem"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /sites/:site_id/crawlers/sync.json Zaimportuj teraz wejścia crawlerów z Cloudflare crawlers_cloudflare_sync

Uprawnienie: sites.manage

Przykład
curl -X POST https://privatusanalytics.com/sites/:site_id/crawlers/sync.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "zone_id": {
      "type": "string",
      "description": "Identyfikator strefy Cloudflare"
    },
    "zone_name": {
      "type": "string",
      "description": "Nazwa strefy Cloudflare, np. example.com"
    },
    "status": {
      "type": "string",
      "description": "active lub error"
    },
    "last_synced_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Kiedy ostatnio zaimportowano wejścia crawlerów, lub null przed pierwszym importem"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/crawlers/zones.json Wyświetl strefy Cloudflare, które możesz połączyć (wymaga zgody Cloudflare udzielonej w przeglądarce) crawlers_cloudflare_zones

Uprawnienie: sites.manage

Przykład
curl https://privatusanalytics.com/sites/:site_id/crawlers/zones.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}
GET /sites/:site_id/crawlers.json Raport robotów AI: trafienia według robota w czasie, najpopularniejsze ścieżki na robota, według kategorii crawlers_report

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/sites/:site_id/crawlers.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Gotowy zakres dat. Użyj custom z from/to",
      "enum": [
        "today",
        "yesterday",
        "24h",
        "7d",
        "14d",
        "28d",
        "30d",
        "90d",
        "mtd",
        "last_month",
        "qtd",
        "last_quarter",
        "ytd",
        "12mo",
        "last_year",
        "all",
        "custom"
      ],
      "default": "30d"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Początek własnego zakresu (strefa czasowa witryny)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Koniec własnego zakresu, włącznie"
    },
    "category": {
      "type": "string",
      "description": "ai, search, seo, other lub all",
      "enum": [
        "all",
        "ai",
        "search",
        "seo",
        "other"
      ],
      "default": "ai"
    },
    "crawler": {
      "type": "string",
      "description": "Tylko ten robot, np. GPTBot"
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}

Role

POST /workspaces/:workspace_id/roles.json Utwórz rolę niestandardową roles_create

Uprawnienie: members.manage

Przykład
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/roles.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nazwa roli",
      "examples": [
        "Client reviewer"
      ]
    },
    "permissions": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "analytics.read",
          "analytics.export",
          "content.write",
          "sites.manage",
          "uptime.manage",
          "members.manage",
          "tokens.manage",
          "billing.manage",
          "workspace.manage"
        ]
      },
      "description": "Uprawnienia przyznawane przez rolę"
    },
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "permissions",
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Identyfikator roli niestandardowej (custom_role_id u członków)"
    },
    "name": {
      "type": "string"
    },
    "permissions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Przyznane uprawnienia"
    },
    "members": {
      "type": "integer",
      "description": "Członkowie z tą rolą"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /workspaces/:workspace_id/roles/:id.json Usuń rolę niestandardową (nie może być używana) roles_delete

Uprawnienie: members.manage

Przykład
curl -X DELETE https://privatusanalytics.com/workspaces/:workspace_id/roles/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Identyfikator roli niestandardowej (custom_role_id u członków)"
    },
    "name": {
      "type": "string"
    },
    "permissions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Przyznane uprawnienia"
    },
    "members": {
      "type": "integer",
      "description": "Członkowie z tą rolą"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /workspaces/:workspace_id/roles.json Wyświetl role niestandardowe roles_list

Uprawnienie: member

Przykład
curl https://privatusanalytics.com/workspaces/:workspace_id/roles.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Strona (od 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Wyników na stronę (maks. 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "format": "uuid",
        "description": "Identyfikator roli niestandardowej (custom_role_id u członków)"
      },
      "name": {
        "type": "string"
      },
      "permissions": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Przyznane uprawnienia"
      },
      "members": {
        "type": "integer",
        "description": "Członkowie z tą rolą"
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
PATCH /workspaces/:workspace_id/roles/:id.json Zaktualizuj rolę niestandardową roles_update

Uprawnienie: members.manage

Przykład
curl -X PATCH https://privatusanalytics.com/workspaces/:workspace_id/roles/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nazwa roli"
    },
    "permissions": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "analytics.read",
          "analytics.export",
          "content.write",
          "sites.manage",
          "uptime.manage",
          "members.manage",
          "tokens.manage",
          "billing.manage",
          "workspace.manage"
        ]
      },
      "description": "Uprawnienia przyznawane przez rolę"
    },
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Identyfikator roli niestandardowej (custom_role_id u członków)"
    },
    "name": {
      "type": "string"
    },
    "permissions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Przyznane uprawnienia"
    },
    "members": {
      "type": "integer",
      "description": "Członkowie z tą rolą"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Rozliczenia

POST /workspaces/:workspace_id/billing/badge.json Włącz lub wyłącz bonus za odznakę (plan bezpłatny) billing_badge

Uprawnienie: billing.manage

Przykład
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/billing/badge.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "enabled": {
      "type": "boolean",
      "description": "true, aby zweryfikować odznakę i zdobyć bonus"
    },
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "enabled",
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string"
    },
    "plan": {
      "type": "string",
      "description": "free, pro, business lub enterprise"
    },
    "plan_events": {
      "type": "integer",
      "description": "Zdarzenia miesięcznie w płatnym poziomie"
    },
    "allowance": {
      "type": "integer",
      "description": "Zdarzenia miesięcznie łącznie z ewentualnym bonusem za odznakę"
    },
    "billing_interval": {
      "anyOf": [
        {
          "type": "string",
          "description": "month lub year"
        },
        {
          "type": "null"
        }
      ]
    },
    "price": {
      "anyOf": [
        {
          "type": "integer",
          "description": "USD za okres rozliczeniowy"
        },
        {
          "type": "null"
        }
      ]
    },
    "subscription_status": {
      "type": "string",
      "description": "none, trialing, active, past_due, paused lub canceled"
    },
    "current_period_ends_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Odnawia się lub kończy"
        },
        {
          "type": "null"
        }
      ]
    },
    "cancel_at_period_end": {
      "type": "boolean"
    },
    "canceled_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "auto_upgrade": {
      "type": "boolean"
    },
    "discount": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "program": {
              "type": "string",
              "description": "nonprofit, education, open_source, open_source_free lub agency"
            },
            "status": {
              "type": "string",
              "description": "pending, approved (jeszcze nie w subskrypcji), active, rejected lub revoked"
            },
            "percent": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Procent zniżki na Pro i Business (null dla darmowego programu open source)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "comp_events": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Darmowe zdarzenia miesięcznie (tylko darmowy program open source)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "organization_name": {
              "type": "string",
              "description": "Nazwa organizacji, szkoły, projektu lub agencji"
            },
            "website": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Strona internetowa"
                },
                {
                  "type": "null"
                }
              ]
            },
            "proof_url": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Link do potwierdzenia lub adres URL repozytorium"
                },
                {
                  "type": "null"
                }
              ]
            },
            "license": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Licencja OSI (open source)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "note": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Notatka do weryfikacji"
                },
                {
                  "type": "null"
                }
              ]
            },
            "rejection_reason": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Dlaczego wniosek nie został zatwierdzony"
                },
                {
                  "type": "null"
                }
              ]
            },
            "created_at": {
              "type": "string",
              "format": "date-time",
              "description": "Data złożenia wniosku"
            },
            "reviewed_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Data rozpatrzenia"
                },
                {
                  "type": "null"
                }
              ]
            },
            "applied_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Zniżka aktywna od"
                },
                {
                  "type": "null"
                }
              ]
            },
            "revoked_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Data zakończenia programu"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Najnowszy wniosek o program zniżkowy lub null"
        },
        {
          "type": "null"
        }
      ]
    },
    "discount_percent": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Procent zniżki na Pro i Business z zatwierdzonego programu lub null"
        },
        {
          "type": "null"
        }
      ]
    },
    "billing_emails": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "tax_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "badge": {
      "type": "object",
      "description": "Bonus za odznakę (plan bezpłatny)"
    },
    "usage": {
      "type": "object",
      "properties": {
        "month": {
          "type": "string",
          "format": "date",
          "description": "Pierwszy dzień raportowanego miesiąca"
        },
        "events": {
          "type": "integer",
          "description": "Zdarzenia rozliczane (odsłony i zdarzenia niestandardowe)"
        },
        "bots": {
          "type": "integer",
          "description": "Odfiltrowane trafienia botów (nierozliczane)"
        },
        "allowance": {
          "type": "integer",
          "description": "Zdarzenia w planie, wraz z ewentualnym bonusem za odznakę"
        },
        "percent": {
          "type": "number",
          "description": "Zdarzenia jako procent limitu"
        },
        "forecast": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Prognozowana liczba zdarzeń na koniec miesiąca"
            },
            {
              "type": "null"
            }
          ]
        },
        "forecast_percent": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "days_left": {
          "type": "integer",
          "description": "Dni pozostałe w miesiącu"
        },
        "status": {
          "type": "string",
          "description": "ok, warning (80%+), over (miniony miesiąc z osiągniętym lub przekroczonym limitem), locked lub paused"
        },
        "sites": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "site_id": {
                "type": "string"
              },
              "domain": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "events": {
                "type": "integer",
                "description": "Odsłony i zdarzenia niestandardowe w tym miesiącu"
              },
              "share": {
                "type": "number",
                "description": "Procent całości przestrzeni roboczej"
              }
            }
          },
          "description": "Zdarzenia według witryny"
        },
        "history": {
          "type": "array",
          "description": "Poprzednie miesiące, od najnowszego"
        },
        "access_locked_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Od kiedy pulpity są zablokowane przez zespół Privatus Analytics"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused": {
          "type": "boolean",
          "description": "True, gdy nowe zdarzenia są odrzucane (osiągnięto miesięczny limit albo zespół wstrzymał zbieranie)"
        },
        "pause_reason": {
          "anyOf": [
            {
              "type": "string",
              "description": "Dlaczego zbieranie jest wstrzymane: limit (osiągnięto miesięczny limit) lub staff. null, gdy dane są zbierane"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Kiedy zespół wstrzymał zbieranie"
            },
            {
              "type": "null"
            }
          ]
        },
        "resumes_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Kiedy kończy się wstrzymanie z powodu limitu: początek następnego miesiąca (UTC) lub wcześniej po przejściu na wyższy plan. W innych przypadkach null"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "description": "Ten miesiąc do tej pory"
    }
  }
}
POST /workspaces/:workspace_id/billing/cancel.json Anuluj na koniec okresu rozliczeniowego billing_cancel

Uprawnienie: billing.manage

Przykład
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/billing/cancel.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "reason": {
      "type": "string",
      "description": "Główny powód anulowania (opcjonalna ankieta)",
      "enum": [
        "too_expensive",
        "missing_features",
        "switching_tool",
        "not_using",
        "temporary",
        "other"
      ]
    },
    "comment": {
      "type": "string",
      "description": "Co moglibyśmy zrobić lepiej"
    },
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string"
    },
    "plan": {
      "type": "string",
      "description": "free, pro, business lub enterprise"
    },
    "plan_events": {
      "type": "integer",
      "description": "Zdarzenia miesięcznie w płatnym poziomie"
    },
    "allowance": {
      "type": "integer",
      "description": "Zdarzenia miesięcznie łącznie z ewentualnym bonusem za odznakę"
    },
    "billing_interval": {
      "anyOf": [
        {
          "type": "string",
          "description": "month lub year"
        },
        {
          "type": "null"
        }
      ]
    },
    "price": {
      "anyOf": [
        {
          "type": "integer",
          "description": "USD za okres rozliczeniowy"
        },
        {
          "type": "null"
        }
      ]
    },
    "subscription_status": {
      "type": "string",
      "description": "none, trialing, active, past_due, paused lub canceled"
    },
    "current_period_ends_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Odnawia się lub kończy"
        },
        {
          "type": "null"
        }
      ]
    },
    "cancel_at_period_end": {
      "type": "boolean"
    },
    "canceled_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "auto_upgrade": {
      "type": "boolean"
    },
    "discount": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "program": {
              "type": "string",
              "description": "nonprofit, education, open_source, open_source_free lub agency"
            },
            "status": {
              "type": "string",
              "description": "pending, approved (jeszcze nie w subskrypcji), active, rejected lub revoked"
            },
            "percent": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Procent zniżki na Pro i Business (null dla darmowego programu open source)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "comp_events": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Darmowe zdarzenia miesięcznie (tylko darmowy program open source)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "organization_name": {
              "type": "string",
              "description": "Nazwa organizacji, szkoły, projektu lub agencji"
            },
            "website": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Strona internetowa"
                },
                {
                  "type": "null"
                }
              ]
            },
            "proof_url": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Link do potwierdzenia lub adres URL repozytorium"
                },
                {
                  "type": "null"
                }
              ]
            },
            "license": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Licencja OSI (open source)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "note": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Notatka do weryfikacji"
                },
                {
                  "type": "null"
                }
              ]
            },
            "rejection_reason": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Dlaczego wniosek nie został zatwierdzony"
                },
                {
                  "type": "null"
                }
              ]
            },
            "created_at": {
              "type": "string",
              "format": "date-time",
              "description": "Data złożenia wniosku"
            },
            "reviewed_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Data rozpatrzenia"
                },
                {
                  "type": "null"
                }
              ]
            },
            "applied_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Zniżka aktywna od"
                },
                {
                  "type": "null"
                }
              ]
            },
            "revoked_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Data zakończenia programu"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Najnowszy wniosek o program zniżkowy lub null"
        },
        {
          "type": "null"
        }
      ]
    },
    "discount_percent": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Procent zniżki na Pro i Business z zatwierdzonego programu lub null"
        },
        {
          "type": "null"
        }
      ]
    },
    "billing_emails": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "tax_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "badge": {
      "type": "object",
      "description": "Bonus za odznakę (plan bezpłatny)"
    },
    "usage": {
      "type": "object",
      "properties": {
        "month": {
          "type": "string",
          "format": "date",
          "description": "Pierwszy dzień raportowanego miesiąca"
        },
        "events": {
          "type": "integer",
          "description": "Zdarzenia rozliczane (odsłony i zdarzenia niestandardowe)"
        },
        "bots": {
          "type": "integer",
          "description": "Odfiltrowane trafienia botów (nierozliczane)"
        },
        "allowance": {
          "type": "integer",
          "description": "Zdarzenia w planie, wraz z ewentualnym bonusem za odznakę"
        },
        "percent": {
          "type": "number",
          "description": "Zdarzenia jako procent limitu"
        },
        "forecast": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Prognozowana liczba zdarzeń na koniec miesiąca"
            },
            {
              "type": "null"
            }
          ]
        },
        "forecast_percent": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "days_left": {
          "type": "integer",
          "description": "Dni pozostałe w miesiącu"
        },
        "status": {
          "type": "string",
          "description": "ok, warning (80%+), over (miniony miesiąc z osiągniętym lub przekroczonym limitem), locked lub paused"
        },
        "sites": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "site_id": {
                "type": "string"
              },
              "domain": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "events": {
                "type": "integer",
                "description": "Odsłony i zdarzenia niestandardowe w tym miesiącu"
              },
              "share": {
                "type": "number",
                "description": "Procent całości przestrzeni roboczej"
              }
            }
          },
          "description": "Zdarzenia według witryny"
        },
        "history": {
          "type": "array",
          "description": "Poprzednie miesiące, od najnowszego"
        },
        "access_locked_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Od kiedy pulpity są zablokowane przez zespół Privatus Analytics"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused": {
          "type": "boolean",
          "description": "True, gdy nowe zdarzenia są odrzucane (osiągnięto miesięczny limit albo zespół wstrzymał zbieranie)"
        },
        "pause_reason": {
          "anyOf": [
            {
              "type": "string",
              "description": "Dlaczego zbieranie jest wstrzymane: limit (osiągnięto miesięczny limit) lub staff. null, gdy dane są zbierane"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Kiedy zespół wstrzymał zbieranie"
            },
            {
              "type": "null"
            }
          ]
        },
        "resumes_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Kiedy kończy się wstrzymanie z powodu limitu: początek następnego miesiąca (UTC) lub wcześniej po przejściu na wyższy plan. W innych przypadkach null"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "description": "Ten miesiąc do tej pory"
    }
  }
}
POST /workspaces/:workspace_id/billing/change_plan.json Zmień plan, poziom lub okres (z proporcjonalnym rozliczeniem) billing_change_plan

Uprawnienie: billing.manage

Przykład
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/billing/change_plan.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "plan": {
      "type": "string",
      "description": "Plan, na który przechodzisz: pro lub business",
      "enum": [
        "pro",
        "business"
      ]
    },
    "events": {
      "type": "integer",
      "description": "Zdarzenia miesięcznie w poziomie, z GET /plans",
      "examples": [
        1000000
      ]
    },
    "interval": {
      "type": "string",
      "description": "Okres rozliczeniowy. Roczny daje 2 miesiące gratis",
      "enum": [
        "month",
        "year"
      ],
      "default": "month"
    },
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "plan",
    "events",
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string"
    },
    "plan": {
      "type": "string",
      "description": "free, pro, business lub enterprise"
    },
    "plan_events": {
      "type": "integer",
      "description": "Zdarzenia miesięcznie w płatnym poziomie"
    },
    "allowance": {
      "type": "integer",
      "description": "Zdarzenia miesięcznie łącznie z ewentualnym bonusem za odznakę"
    },
    "billing_interval": {
      "anyOf": [
        {
          "type": "string",
          "description": "month lub year"
        },
        {
          "type": "null"
        }
      ]
    },
    "price": {
      "anyOf": [
        {
          "type": "integer",
          "description": "USD za okres rozliczeniowy"
        },
        {
          "type": "null"
        }
      ]
    },
    "subscription_status": {
      "type": "string",
      "description": "none, trialing, active, past_due, paused lub canceled"
    },
    "current_period_ends_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Odnawia się lub kończy"
        },
        {
          "type": "null"
        }
      ]
    },
    "cancel_at_period_end": {
      "type": "boolean"
    },
    "canceled_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "auto_upgrade": {
      "type": "boolean"
    },
    "discount": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "program": {
              "type": "string",
              "description": "nonprofit, education, open_source, open_source_free lub agency"
            },
            "status": {
              "type": "string",
              "description": "pending, approved (jeszcze nie w subskrypcji), active, rejected lub revoked"
            },
            "percent": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Procent zniżki na Pro i Business (null dla darmowego programu open source)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "comp_events": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Darmowe zdarzenia miesięcznie (tylko darmowy program open source)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "organization_name": {
              "type": "string",
              "description": "Nazwa organizacji, szkoły, projektu lub agencji"
            },
            "website": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Strona internetowa"
                },
                {
                  "type": "null"
                }
              ]
            },
            "proof_url": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Link do potwierdzenia lub adres URL repozytorium"
                },
                {
                  "type": "null"
                }
              ]
            },
            "license": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Licencja OSI (open source)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "note": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Notatka do weryfikacji"
                },
                {
                  "type": "null"
                }
              ]
            },
            "rejection_reason": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Dlaczego wniosek nie został zatwierdzony"
                },
                {
                  "type": "null"
                }
              ]
            },
            "created_at": {
              "type": "string",
              "format": "date-time",
              "description": "Data złożenia wniosku"
            },
            "reviewed_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Data rozpatrzenia"
                },
                {
                  "type": "null"
                }
              ]
            },
            "applied_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Zniżka aktywna od"
                },
                {
                  "type": "null"
                }
              ]
            },
            "revoked_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Data zakończenia programu"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Najnowszy wniosek o program zniżkowy lub null"
        },
        {
          "type": "null"
        }
      ]
    },
    "discount_percent": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Procent zniżki na Pro i Business z zatwierdzonego programu lub null"
        },
        {
          "type": "null"
        }
      ]
    },
    "billing_emails": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "tax_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "badge": {
      "type": "object",
      "description": "Bonus za odznakę (plan bezpłatny)"
    },
    "usage": {
      "type": "object",
      "properties": {
        "month": {
          "type": "string",
          "format": "date",
          "description": "Pierwszy dzień raportowanego miesiąca"
        },
        "events": {
          "type": "integer",
          "description": "Zdarzenia rozliczane (odsłony i zdarzenia niestandardowe)"
        },
        "bots": {
          "type": "integer",
          "description": "Odfiltrowane trafienia botów (nierozliczane)"
        },
        "allowance": {
          "type": "integer",
          "description": "Zdarzenia w planie, wraz z ewentualnym bonusem za odznakę"
        },
        "percent": {
          "type": "number",
          "description": "Zdarzenia jako procent limitu"
        },
        "forecast": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Prognozowana liczba zdarzeń na koniec miesiąca"
            },
            {
              "type": "null"
            }
          ]
        },
        "forecast_percent": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "days_left": {
          "type": "integer",
          "description": "Dni pozostałe w miesiącu"
        },
        "status": {
          "type": "string",
          "description": "ok, warning (80%+), over (miniony miesiąc z osiągniętym lub przekroczonym limitem), locked lub paused"
        },
        "sites": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "site_id": {
                "type": "string"
              },
              "domain": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "events": {
                "type": "integer",
                "description": "Odsłony i zdarzenia niestandardowe w tym miesiącu"
              },
              "share": {
                "type": "number",
                "description": "Procent całości przestrzeni roboczej"
              }
            }
          },
          "description": "Zdarzenia według witryny"
        },
        "history": {
          "type": "array",
          "description": "Poprzednie miesiące, od najnowszego"
        },
        "access_locked_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Od kiedy pulpity są zablokowane przez zespół Privatus Analytics"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused": {
          "type": "boolean",
          "description": "True, gdy nowe zdarzenia są odrzucane (osiągnięto miesięczny limit albo zespół wstrzymał zbieranie)"
        },
        "pause_reason": {
          "anyOf": [
            {
              "type": "string",
              "description": "Dlaczego zbieranie jest wstrzymane: limit (osiągnięto miesięczny limit) lub staff. null, gdy dane są zbierane"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Kiedy zespół wstrzymał zbieranie"
            },
            {
              "type": "null"
            }
          ]
        },
        "resumes_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Kiedy kończy się wstrzymanie z powodu limitu: początek następnego miesiąca (UTC) lub wcześniej po przejściu na wyższy plan. W innych przypadkach null"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "description": "Ten miesiąc do tej pory"
    }
  }
}
POST /workspaces/:workspace_id/billing/checkout.json Rozpocznij płatność Paddle za plan płatny billing_checkout

Uprawnienie: billing.manage

Przykład
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/billing/checkout.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "plan": {
      "type": "string",
      "description": "Plan, na który przechodzisz: pro lub business",
      "enum": [
        "pro",
        "business"
      ]
    },
    "events": {
      "type": "integer",
      "description": "Zdarzenia miesięcznie w poziomie, z GET /plans",
      "examples": [
        1000000
      ]
    },
    "interval": {
      "type": "string",
      "description": "Okres rozliczeniowy. Roczny daje 2 miesiące gratis",
      "enum": [
        "month",
        "year"
      ],
      "default": "month"
    },
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "plan",
    "events",
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "transaction_id": {
      "type": "string",
      "description": "Identyfikator transakcji Paddle (txn_...)"
    },
    "url": {
      "anyOf": [
        {
          "type": "string",
          "description": "Adres URL hostowanej płatności"
        },
        {
          "type": "null"
        }
      ]
    },
    "price_id": {
      "type": "string"
    },
    "plan": {
      "type": "string"
    },
    "events": {
      "type": "integer"
    },
    "interval": {
      "type": "string"
    },
    "amount": {
      "type": "integer",
      "description": "USD na okres"
    },
    "client_token": {
      "anyOf": [
        {
          "type": "string",
          "description": "Token kliencki Paddle.js"
        },
        {
          "type": "null"
        }
      ]
    },
    "environment": {
      "type": "string",
      "description": "sandbox lub production"
    },
    "custom_data": {
      "type": "object",
      "description": "Przekazywane do Paddle w celu powiązania subskrypcji"
    },
    "discount_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Identyfikator zniżki Paddle z zatwierdzonego programu, zastosowanej do tej płatności"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
POST /workspaces/:workspace_id/billing/discount.json Złóż wniosek o zniżkę dla organizacji non-profit, edukacji lub open source billing_discount

Uprawnienie: billing.manage

Przykład
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/billing/discount.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "program": {
      "type": "string",
      "description": "nonprofit, education, open_source (50% zniżki), open_source_free (darmowy Pro do 1M zdarzeń miesięcznie) lub agency (20% zniżki na każdą przestrzeń roboczą, której jesteś właścicielem)",
      "enum": [
        "nonprofit",
        "education",
        "open_source",
        "open_source_free",
        "agency"
      ]
    },
    "organization_name": {
      "type": "string",
      "description": "Nazwa organizacji, szkoły, projektu lub agencji"
    },
    "website": {
      "type": "string",
      "description": "Jej strona internetowa"
    },
    "proof_url": {
      "type": "string",
      "description": "Link do potwierdzenia. Dla open source adres URL repozytorium"
    },
    "license": {
      "type": "string",
      "description": "Licencja OSI projektu (tylko open source)"
    },
    "note": {
      "type": "string",
      "description": "Wszystko, co pomoże w weryfikacji, do 1000 znaków"
    },
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "program",
    "organization_name",
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "program": {
      "type": "string",
      "description": "nonprofit, education, open_source, open_source_free lub agency"
    },
    "status": {
      "type": "string",
      "description": "pending, approved (jeszcze nie w subskrypcji), active, rejected lub revoked"
    },
    "percent": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Procent zniżki na Pro i Business (null dla darmowego programu open source)"
        },
        {
          "type": "null"
        }
      ]
    },
    "comp_events": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Darmowe zdarzenia miesięcznie (tylko darmowy program open source)"
        },
        {
          "type": "null"
        }
      ]
    },
    "organization_name": {
      "type": "string",
      "description": "Nazwa organizacji, szkoły, projektu lub agencji"
    },
    "website": {
      "anyOf": [
        {
          "type": "string",
          "description": "Strona internetowa"
        },
        {
          "type": "null"
        }
      ]
    },
    "proof_url": {
      "anyOf": [
        {
          "type": "string",
          "description": "Link do potwierdzenia lub adres URL repozytorium"
        },
        {
          "type": "null"
        }
      ]
    },
    "license": {
      "anyOf": [
        {
          "type": "string",
          "description": "Licencja OSI (open source)"
        },
        {
          "type": "null"
        }
      ]
    },
    "note": {
      "anyOf": [
        {
          "type": "string",
          "description": "Notatka do weryfikacji"
        },
        {
          "type": "null"
        }
      ]
    },
    "rejection_reason": {
      "anyOf": [
        {
          "type": "string",
          "description": "Dlaczego wniosek nie został zatwierdzony"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Data złożenia wniosku"
    },
    "reviewed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Data rozpatrzenia"
        },
        {
          "type": "null"
        }
      ]
    },
    "applied_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Zniżka aktywna od"
        },
        {
          "type": "null"
        }
      ]
    },
    "revoked_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Data zakończenia programu"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
POST /workspaces/:workspace_id/billing/payment_method.json Pobierz link do aktualizacji metody płatności billing_payment_method

Uprawnienie: billing.manage

Przykład
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/billing/payment_method.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "description": "portal, payment_method lub invoice"
    },
    "url": {
      "anyOf": [
        {
          "type": "string",
          "description": "Krótkotrwały adres URL Paddle"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
POST /workspaces/:workspace_id/billing/portal.json Pobierz link do portalu klienta Paddle billing_portal

Uprawnienie: billing.manage

Przykład
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/billing/portal.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "description": "portal, payment_method lub invoice"
    },
    "url": {
      "anyOf": [
        {
          "type": "string",
          "description": "Krótkotrwały adres URL Paddle"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
GET /workspaces/:workspace_id/billing/preview.json Podgląd zmiany planu z proporcjonalnym rozliczeniem billing_preview

Uprawnienie: billing.manage

Przykład
curl https://privatusanalytics.com/workspaces/:workspace_id/billing/preview.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "plan": {
      "type": "string",
      "description": "Plan, na który przechodzisz: pro lub business",
      "enum": [
        "pro",
        "business"
      ]
    },
    "events": {
      "type": "integer",
      "description": "Zdarzenia miesięcznie w poziomie, z GET /plans",
      "examples": [
        1000000
      ]
    },
    "interval": {
      "type": "string",
      "description": "Okres rozliczeniowy. Roczny daje 2 miesiące gratis",
      "enum": [
        "month",
        "year"
      ],
      "default": "month"
    },
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "plan",
    "events",
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "plan": {
      "type": "string"
    },
    "events": {
      "type": "integer"
    },
    "interval": {
      "type": "string"
    },
    "price_id": {
      "type": "string"
    },
    "amount": {
      "type": "integer",
      "description": "Nowa cena w USD na okres"
    },
    "currency": {
      "type": "string"
    },
    "charge_minor": {
      "type": "integer",
      "description": "Naliczone teraz, w jednostkach podrzędnych"
    },
    "credit_minor": {
      "type": "integer",
      "description": "Kredyt za niewykorzystany czas, w jednostkach podrzędnych"
    },
    "result_action": {
      "anyOf": [
        {
          "type": "string",
          "description": "charge lub credit"
        },
        {
          "type": "null"
        }
      ]
    },
    "result_minor": {
      "type": "integer",
      "description": "Kwota netto do zapłaty lub kredyt, w jednostkach podrzędnych"
    },
    "next_billed_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Zużycie lub limity, których nowy plan by nie pokrył"
    }
  }
}
POST /workspaces/:workspace_id/billing/resume.json Cofnij zaplanowane anulowanie lub wznów wstrzymanie billing_resume

Uprawnienie: billing.manage

Przykład
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/billing/resume.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string"
    },
    "plan": {
      "type": "string",
      "description": "free, pro, business lub enterprise"
    },
    "plan_events": {
      "type": "integer",
      "description": "Zdarzenia miesięcznie w płatnym poziomie"
    },
    "allowance": {
      "type": "integer",
      "description": "Zdarzenia miesięcznie łącznie z ewentualnym bonusem za odznakę"
    },
    "billing_interval": {
      "anyOf": [
        {
          "type": "string",
          "description": "month lub year"
        },
        {
          "type": "null"
        }
      ]
    },
    "price": {
      "anyOf": [
        {
          "type": "integer",
          "description": "USD za okres rozliczeniowy"
        },
        {
          "type": "null"
        }
      ]
    },
    "subscription_status": {
      "type": "string",
      "description": "none, trialing, active, past_due, paused lub canceled"
    },
    "current_period_ends_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Odnawia się lub kończy"
        },
        {
          "type": "null"
        }
      ]
    },
    "cancel_at_period_end": {
      "type": "boolean"
    },
    "canceled_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "auto_upgrade": {
      "type": "boolean"
    },
    "discount": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "program": {
              "type": "string",
              "description": "nonprofit, education, open_source, open_source_free lub agency"
            },
            "status": {
              "type": "string",
              "description": "pending, approved (jeszcze nie w subskrypcji), active, rejected lub revoked"
            },
            "percent": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Procent zniżki na Pro i Business (null dla darmowego programu open source)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "comp_events": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Darmowe zdarzenia miesięcznie (tylko darmowy program open source)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "organization_name": {
              "type": "string",
              "description": "Nazwa organizacji, szkoły, projektu lub agencji"
            },
            "website": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Strona internetowa"
                },
                {
                  "type": "null"
                }
              ]
            },
            "proof_url": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Link do potwierdzenia lub adres URL repozytorium"
                },
                {
                  "type": "null"
                }
              ]
            },
            "license": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Licencja OSI (open source)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "note": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Notatka do weryfikacji"
                },
                {
                  "type": "null"
                }
              ]
            },
            "rejection_reason": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Dlaczego wniosek nie został zatwierdzony"
                },
                {
                  "type": "null"
                }
              ]
            },
            "created_at": {
              "type": "string",
              "format": "date-time",
              "description": "Data złożenia wniosku"
            },
            "reviewed_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Data rozpatrzenia"
                },
                {
                  "type": "null"
                }
              ]
            },
            "applied_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Zniżka aktywna od"
                },
                {
                  "type": "null"
                }
              ]
            },
            "revoked_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Data zakończenia programu"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Najnowszy wniosek o program zniżkowy lub null"
        },
        {
          "type": "null"
        }
      ]
    },
    "discount_percent": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Procent zniżki na Pro i Business z zatwierdzonego programu lub null"
        },
        {
          "type": "null"
        }
      ]
    },
    "billing_emails": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "tax_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "badge": {
      "type": "object",
      "description": "Bonus za odznakę (plan bezpłatny)"
    },
    "usage": {
      "type": "object",
      "properties": {
        "month": {
          "type": "string",
          "format": "date",
          "description": "Pierwszy dzień raportowanego miesiąca"
        },
        "events": {
          "type": "integer",
          "description": "Zdarzenia rozliczane (odsłony i zdarzenia niestandardowe)"
        },
        "bots": {
          "type": "integer",
          "description": "Odfiltrowane trafienia botów (nierozliczane)"
        },
        "allowance": {
          "type": "integer",
          "description": "Zdarzenia w planie, wraz z ewentualnym bonusem za odznakę"
        },
        "percent": {
          "type": "number",
          "description": "Zdarzenia jako procent limitu"
        },
        "forecast": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Prognozowana liczba zdarzeń na koniec miesiąca"
            },
            {
              "type": "null"
            }
          ]
        },
        "forecast_percent": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "days_left": {
          "type": "integer",
          "description": "Dni pozostałe w miesiącu"
        },
        "status": {
          "type": "string",
          "description": "ok, warning (80%+), over (miniony miesiąc z osiągniętym lub przekroczonym limitem), locked lub paused"
        },
        "sites": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "site_id": {
                "type": "string"
              },
              "domain": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "events": {
                "type": "integer",
                "description": "Odsłony i zdarzenia niestandardowe w tym miesiącu"
              },
              "share": {
                "type": "number",
                "description": "Procent całości przestrzeni roboczej"
              }
            }
          },
          "description": "Zdarzenia według witryny"
        },
        "history": {
          "type": "array",
          "description": "Poprzednie miesiące, od najnowszego"
        },
        "access_locked_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Od kiedy pulpity są zablokowane przez zespół Privatus Analytics"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused": {
          "type": "boolean",
          "description": "True, gdy nowe zdarzenia są odrzucane (osiągnięto miesięczny limit albo zespół wstrzymał zbieranie)"
        },
        "pause_reason": {
          "anyOf": [
            {
              "type": "string",
              "description": "Dlaczego zbieranie jest wstrzymane: limit (osiągnięto miesięczny limit) lub staff. null, gdy dane są zbierane"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Kiedy zespół wstrzymał zbieranie"
            },
            {
              "type": "null"
            }
          ]
        },
        "resumes_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Kiedy kończy się wstrzymanie z powodu limitu: początek następnego miesiąca (UTC) lub wcześniej po przejściu na wyższy plan. W innych przypadkach null"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "description": "Ten miesiąc do tej pory"
    }
  }
}
GET /workspaces/:workspace_id/billing.json Pobierz plan, subskrypcję i zużycie billing_get

Uprawnienie: billing.manage

Przykład
curl https://privatusanalytics.com/workspaces/:workspace_id/billing.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string"
    },
    "plan": {
      "type": "string",
      "description": "free, pro, business lub enterprise"
    },
    "plan_events": {
      "type": "integer",
      "description": "Zdarzenia miesięcznie w płatnym poziomie"
    },
    "allowance": {
      "type": "integer",
      "description": "Zdarzenia miesięcznie łącznie z ewentualnym bonusem za odznakę"
    },
    "billing_interval": {
      "anyOf": [
        {
          "type": "string",
          "description": "month lub year"
        },
        {
          "type": "null"
        }
      ]
    },
    "price": {
      "anyOf": [
        {
          "type": "integer",
          "description": "USD za okres rozliczeniowy"
        },
        {
          "type": "null"
        }
      ]
    },
    "subscription_status": {
      "type": "string",
      "description": "none, trialing, active, past_due, paused lub canceled"
    },
    "current_period_ends_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Odnawia się lub kończy"
        },
        {
          "type": "null"
        }
      ]
    },
    "cancel_at_period_end": {
      "type": "boolean"
    },
    "canceled_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "auto_upgrade": {
      "type": "boolean"
    },
    "discount": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "program": {
              "type": "string",
              "description": "nonprofit, education, open_source, open_source_free lub agency"
            },
            "status": {
              "type": "string",
              "description": "pending, approved (jeszcze nie w subskrypcji), active, rejected lub revoked"
            },
            "percent": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Procent zniżki na Pro i Business (null dla darmowego programu open source)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "comp_events": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Darmowe zdarzenia miesięcznie (tylko darmowy program open source)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "organization_name": {
              "type": "string",
              "description": "Nazwa organizacji, szkoły, projektu lub agencji"
            },
            "website": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Strona internetowa"
                },
                {
                  "type": "null"
                }
              ]
            },
            "proof_url": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Link do potwierdzenia lub adres URL repozytorium"
                },
                {
                  "type": "null"
                }
              ]
            },
            "license": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Licencja OSI (open source)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "note": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Notatka do weryfikacji"
                },
                {
                  "type": "null"
                }
              ]
            },
            "rejection_reason": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Dlaczego wniosek nie został zatwierdzony"
                },
                {
                  "type": "null"
                }
              ]
            },
            "created_at": {
              "type": "string",
              "format": "date-time",
              "description": "Data złożenia wniosku"
            },
            "reviewed_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Data rozpatrzenia"
                },
                {
                  "type": "null"
                }
              ]
            },
            "applied_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Zniżka aktywna od"
                },
                {
                  "type": "null"
                }
              ]
            },
            "revoked_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Data zakończenia programu"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Najnowszy wniosek o program zniżkowy lub null"
        },
        {
          "type": "null"
        }
      ]
    },
    "discount_percent": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Procent zniżki na Pro i Business z zatwierdzonego programu lub null"
        },
        {
          "type": "null"
        }
      ]
    },
    "billing_emails": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "tax_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "badge": {
      "type": "object",
      "description": "Bonus za odznakę (plan bezpłatny)"
    },
    "usage": {
      "type": "object",
      "properties": {
        "month": {
          "type": "string",
          "format": "date",
          "description": "Pierwszy dzień raportowanego miesiąca"
        },
        "events": {
          "type": "integer",
          "description": "Zdarzenia rozliczane (odsłony i zdarzenia niestandardowe)"
        },
        "bots": {
          "type": "integer",
          "description": "Odfiltrowane trafienia botów (nierozliczane)"
        },
        "allowance": {
          "type": "integer",
          "description": "Zdarzenia w planie, wraz z ewentualnym bonusem za odznakę"
        },
        "percent": {
          "type": "number",
          "description": "Zdarzenia jako procent limitu"
        },
        "forecast": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Prognozowana liczba zdarzeń na koniec miesiąca"
            },
            {
              "type": "null"
            }
          ]
        },
        "forecast_percent": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "days_left": {
          "type": "integer",
          "description": "Dni pozostałe w miesiącu"
        },
        "status": {
          "type": "string",
          "description": "ok, warning (80%+), over (miniony miesiąc z osiągniętym lub przekroczonym limitem), locked lub paused"
        },
        "sites": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "site_id": {
                "type": "string"
              },
              "domain": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "events": {
                "type": "integer",
                "description": "Odsłony i zdarzenia niestandardowe w tym miesiącu"
              },
              "share": {
                "type": "number",
                "description": "Procent całości przestrzeni roboczej"
              }
            }
          },
          "description": "Zdarzenia według witryny"
        },
        "history": {
          "type": "array",
          "description": "Poprzednie miesiące, od najnowszego"
        },
        "access_locked_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Od kiedy pulpity są zablokowane przez zespół Privatus Analytics"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused": {
          "type": "boolean",
          "description": "True, gdy nowe zdarzenia są odrzucane (osiągnięto miesięczny limit albo zespół wstrzymał zbieranie)"
        },
        "pause_reason": {
          "anyOf": [
            {
              "type": "string",
              "description": "Dlaczego zbieranie jest wstrzymane: limit (osiągnięto miesięczny limit) lub staff. null, gdy dane są zbierane"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Kiedy zespół wstrzymał zbieranie"
            },
            {
              "type": "null"
            }
          ]
        },
        "resumes_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Kiedy kończy się wstrzymanie z powodu limitu: początek następnego miesiąca (UTC) lub wcześniej po przejściu na wyższy plan. W innych przypadkach null"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "description": "Ten miesiąc do tej pory"
    }
  }
}
PATCH /workspaces/:workspace_id/billing.json Zaktualizuj e-maile rozliczeniowe, numer podatkowy i automatyczne przejście na wyższy plan billing_update

Uprawnienie: billing.manage

Przykład
curl -X PATCH https://privatusanalytics.com/workspaces/:workspace_id/billing.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "billing_emails": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Dodatkowe adresy dla faktur i powiadomień rozliczeniowych (do 5)"
    },
    "tax_id": {
      "type": "string",
      "description": "Numer VAT/GST/podatkowy widoczny na fakturach"
    },
    "auto_upgrade": {
      "type": "boolean",
      "description": "true, aby po osiągnięciu miesięcznego limitu przejść na następny próg i pobrać różnicę, zamiast wstrzymywać zbieranie danych. Domyślnie wyłączone"
    },
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string"
    },
    "plan": {
      "type": "string",
      "description": "free, pro, business lub enterprise"
    },
    "plan_events": {
      "type": "integer",
      "description": "Zdarzenia miesięcznie w płatnym poziomie"
    },
    "allowance": {
      "type": "integer",
      "description": "Zdarzenia miesięcznie łącznie z ewentualnym bonusem za odznakę"
    },
    "billing_interval": {
      "anyOf": [
        {
          "type": "string",
          "description": "month lub year"
        },
        {
          "type": "null"
        }
      ]
    },
    "price": {
      "anyOf": [
        {
          "type": "integer",
          "description": "USD za okres rozliczeniowy"
        },
        {
          "type": "null"
        }
      ]
    },
    "subscription_status": {
      "type": "string",
      "description": "none, trialing, active, past_due, paused lub canceled"
    },
    "current_period_ends_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Odnawia się lub kończy"
        },
        {
          "type": "null"
        }
      ]
    },
    "cancel_at_period_end": {
      "type": "boolean"
    },
    "canceled_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "auto_upgrade": {
      "type": "boolean"
    },
    "discount": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "program": {
              "type": "string",
              "description": "nonprofit, education, open_source, open_source_free lub agency"
            },
            "status": {
              "type": "string",
              "description": "pending, approved (jeszcze nie w subskrypcji), active, rejected lub revoked"
            },
            "percent": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Procent zniżki na Pro i Business (null dla darmowego programu open source)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "comp_events": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Darmowe zdarzenia miesięcznie (tylko darmowy program open source)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "organization_name": {
              "type": "string",
              "description": "Nazwa organizacji, szkoły, projektu lub agencji"
            },
            "website": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Strona internetowa"
                },
                {
                  "type": "null"
                }
              ]
            },
            "proof_url": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Link do potwierdzenia lub adres URL repozytorium"
                },
                {
                  "type": "null"
                }
              ]
            },
            "license": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Licencja OSI (open source)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "note": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Notatka do weryfikacji"
                },
                {
                  "type": "null"
                }
              ]
            },
            "rejection_reason": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Dlaczego wniosek nie został zatwierdzony"
                },
                {
                  "type": "null"
                }
              ]
            },
            "created_at": {
              "type": "string",
              "format": "date-time",
              "description": "Data złożenia wniosku"
            },
            "reviewed_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Data rozpatrzenia"
                },
                {
                  "type": "null"
                }
              ]
            },
            "applied_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Zniżka aktywna od"
                },
                {
                  "type": "null"
                }
              ]
            },
            "revoked_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Data zakończenia programu"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Najnowszy wniosek o program zniżkowy lub null"
        },
        {
          "type": "null"
        }
      ]
    },
    "discount_percent": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Procent zniżki na Pro i Business z zatwierdzonego programu lub null"
        },
        {
          "type": "null"
        }
      ]
    },
    "billing_emails": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "tax_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "badge": {
      "type": "object",
      "description": "Bonus za odznakę (plan bezpłatny)"
    },
    "usage": {
      "type": "object",
      "properties": {
        "month": {
          "type": "string",
          "format": "date",
          "description": "Pierwszy dzień raportowanego miesiąca"
        },
        "events": {
          "type": "integer",
          "description": "Zdarzenia rozliczane (odsłony i zdarzenia niestandardowe)"
        },
        "bots": {
          "type": "integer",
          "description": "Odfiltrowane trafienia botów (nierozliczane)"
        },
        "allowance": {
          "type": "integer",
          "description": "Zdarzenia w planie, wraz z ewentualnym bonusem za odznakę"
        },
        "percent": {
          "type": "number",
          "description": "Zdarzenia jako procent limitu"
        },
        "forecast": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Prognozowana liczba zdarzeń na koniec miesiąca"
            },
            {
              "type": "null"
            }
          ]
        },
        "forecast_percent": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "days_left": {
          "type": "integer",
          "description": "Dni pozostałe w miesiącu"
        },
        "status": {
          "type": "string",
          "description": "ok, warning (80%+), over (miniony miesiąc z osiągniętym lub przekroczonym limitem), locked lub paused"
        },
        "sites": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "site_id": {
                "type": "string"
              },
              "domain": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "events": {
                "type": "integer",
                "description": "Odsłony i zdarzenia niestandardowe w tym miesiącu"
              },
              "share": {
                "type": "number",
                "description": "Procent całości przestrzeni roboczej"
              }
            }
          },
          "description": "Zdarzenia według witryny"
        },
        "history": {
          "type": "array",
          "description": "Poprzednie miesiące, od najnowszego"
        },
        "access_locked_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Od kiedy pulpity są zablokowane przez zespół Privatus Analytics"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused": {
          "type": "boolean",
          "description": "True, gdy nowe zdarzenia są odrzucane (osiągnięto miesięczny limit albo zespół wstrzymał zbieranie)"
        },
        "pause_reason": {
          "anyOf": [
            {
              "type": "string",
              "description": "Dlaczego zbieranie jest wstrzymane: limit (osiągnięto miesięczny limit) lub staff. null, gdy dane są zbierane"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Kiedy zespół wstrzymał zbieranie"
            },
            {
              "type": "null"
            }
          ]
        },
        "resumes_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Kiedy kończy się wstrzymanie z powodu limitu: początek następnego miesiąca (UTC) lub wcześniej po przejściu na wyższy plan. W innych przypadkach null"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "description": "Ten miesiąc do tej pory"
    }
  }
}
GET /workspaces/:workspace_id/billing/usage.json Pobierz zużycie w tym miesiącu, prognozę i podział na witryny billing_usage

Uprawnienie: billing.manage

Przykład
curl https://privatusanalytics.com/workspaces/:workspace_id/billing/usage.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "month": {
      "type": "string",
      "format": "date",
      "description": "Dowolny dzień miesiąca do raportu (domyślnie bieżący miesiąc)",
      "examples": [
        "2026-09-01"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "month": {
      "type": "string",
      "format": "date",
      "description": "Pierwszy dzień raportowanego miesiąca"
    },
    "events": {
      "type": "integer",
      "description": "Zdarzenia rozliczane (odsłony i zdarzenia niestandardowe)"
    },
    "bots": {
      "type": "integer",
      "description": "Odfiltrowane trafienia botów (nierozliczane)"
    },
    "allowance": {
      "type": "integer",
      "description": "Zdarzenia w planie, wraz z ewentualnym bonusem za odznakę"
    },
    "percent": {
      "type": "number",
      "description": "Zdarzenia jako procent limitu"
    },
    "forecast": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Prognozowana liczba zdarzeń na koniec miesiąca"
        },
        {
          "type": "null"
        }
      ]
    },
    "forecast_percent": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "days_left": {
      "type": "integer",
      "description": "Dni pozostałe w miesiącu"
    },
    "status": {
      "type": "string",
      "description": "ok, warning (80%+), over (miniony miesiąc z osiągniętym lub przekroczonym limitem), locked lub paused"
    },
    "sites": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "site_id": {
            "type": "string"
          },
          "domain": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "events": {
            "type": "integer",
            "description": "Odsłony i zdarzenia niestandardowe w tym miesiącu"
          },
          "share": {
            "type": "number",
            "description": "Procent całości przestrzeni roboczej"
          }
        }
      },
      "description": "Zdarzenia według witryny"
    },
    "history": {
      "type": "array",
      "description": "Poprzednie miesiące, od najnowszego"
    },
    "access_locked_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Od kiedy pulpity są zablokowane przez zespół Privatus Analytics"
        },
        {
          "type": "null"
        }
      ]
    },
    "collection_paused": {
      "type": "boolean",
      "description": "True, gdy nowe zdarzenia są odrzucane (osiągnięto miesięczny limit albo zespół wstrzymał zbieranie)"
    },
    "pause_reason": {
      "anyOf": [
        {
          "type": "string",
          "description": "Dlaczego zbieranie jest wstrzymane: limit (osiągnięto miesięczny limit) lub staff. null, gdy dane są zbierane"
        },
        {
          "type": "null"
        }
      ]
    },
    "collection_paused_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Kiedy zespół wstrzymał zbieranie"
        },
        {
          "type": "null"
        }
      ]
    },
    "resumes_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Kiedy kończy się wstrzymanie z powodu limitu: początek następnego miesiąca (UTC) lub wcześniej po przejściu na wyższy plan. W innych przypadkach null"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
GET /workspaces/:workspace_id/billing/invoices.json Wyświetl faktury billing_invoices_list

Uprawnienie: billing.manage

Przykład
curl https://privatusanalytics.com/workspaces/:workspace_id/billing/invoices.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Strona (od 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Wyników na stronę (maks. 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Identyfikator transakcji Paddle"
      },
      "invoice_number": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "status": {
        "type": "string",
        "description": "paid, completed, payment_failed, ..."
      },
      "amount_minor": {
        "type": "integer",
        "description": "Suma w jednostkach podrzędnych (centy)"
      },
      "currency": {
        "type": "string"
      },
      "billed_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      }
    }
  }
}
GET /workspaces/:workspace_id/billing/invoices/:id.json Pobierz link do PDF faktury billing_invoices_get

Uprawnienie: billing.manage

Przykład
curl https://privatusanalytics.com/workspaces/:workspace_id/billing/invoices/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "description": "portal, payment_method lub invoice"
    },
    "url": {
      "anyOf": [
        {
          "type": "string",
          "description": "Krótkotrwały adres URL Paddle"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}

SCIM

POST /scim/v2/Users.json Utwórz użytkownika (provisioning) scim_users_create

Uprawnienie: public · Tylko HTTP (nie jest narzędziem MCP)

Przykład
curl -X POST https://privatusanalytics.com/scim/v2/Users.json \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "userName": {
      "type": "string",
      "description": "Adres e-mail"
    },
    "name": {
      "type": "object",
      "additionalProperties": true,
      "description": "givenName, familyName, formatted",
      "default": {}
    },
    "active": {
      "type": "boolean",
      "description": "Członek przestrzeni roboczej",
      "default": true
    }
  },
  "required": [
    "userName"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}
DELETE /scim/v2/Users/:id.json Usuń użytkownika (deprovisioning) scim_users_delete

Uprawnienie: public · Tylko HTTP (nie jest narzędziem MCP)

Przykład
curl -X DELETE https://privatusanalytics.com/scim/v2/Users/:id.json \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}
GET /scim/v2/Users.json Wyświetl użytkowników z provisioningu scim_users_list

Uprawnienie: public · Tylko HTTP (nie jest narzędziem MCP)

Przykład
curl https://privatusanalytics.com/scim/v2/Users.json
Dane wejściowe
{
  "type": "object",
  "properties": {
    "scim_filter": {
      "type": "string",
      "description": "Filtr SCIM (parametr zapytania `filter`), np. userName eq \"[email protected]\""
    },
    "startIndex": {
      "type": "integer",
      "description": "Indeks pierwszego wyniku liczony od 1",
      "default": 1
    },
    "count": {
      "type": "integer",
      "description": "Rozmiar strony (maks. 200)",
      "default": 100
    }
  },
  "required": []
}
Dane odpowiedzi
{
  "type": "object"
}
GET /scim/v2/Users/:id.json Pobierz użytkownika z provisioningu scim_users_get

Uprawnienie: public · Tylko HTTP (nie jest narzędziem MCP)

Przykład
curl https://privatusanalytics.com/scim/v2/Users/:id.json
Dane wejściowe
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}
PATCH /scim/v2/Users/:id.json Zaktualizuj użytkownika (PATCH active, name) scim_users_update

Uprawnienie: public · Tylko HTTP (nie jest narzędziem MCP)

Przykład
curl -X PATCH https://privatusanalytics.com/scim/v2/Users/:id.json \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "Operations": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      },
      "description": "Operacje SCIM PatchOp"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "Operations",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}

SSO

POST /workspaces/:workspace_id/sso/activate.json Aktywuj przetestowaną konfigurację SSO sso_activate

Uprawnienie: workspace.manage

Przykład
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/sso/activate.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "protocol": {
      "type": "string",
      "description": "saml lub oidc"
    },
    "status": {
      "type": "string",
      "description": "draft, testing, tested lub active"
    },
    "enforced": {
      "type": "boolean",
      "description": "SSO jest jedyną drogą logowania (z wyjątkiem właściciela)"
    },
    "domains": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Zweryfikowane domeny e-mail"
    },
    "idp_sso_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "idp_entity_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "idp_cert_present": {
      "type": "boolean"
    },
    "oidc_issuer": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "oidc_client_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "oidc_client_secret_present": {
      "type": "boolean"
    },
    "default_role": {
      "type": "string"
    },
    "jit_provisioning": {
      "type": "boolean"
    },
    "scim_enabled": {
      "type": "boolean"
    }
  }
}
POST /workspaces/:workspace_id/sso/deactivate.json Wyłącz SSO (powrót do wersji roboczej) sso_deactivate

Uprawnienie: workspace.manage

Przykład
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/sso/deactivate.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "protocol": {
      "type": "string",
      "description": "saml lub oidc"
    },
    "status": {
      "type": "string",
      "description": "draft, testing, tested lub active"
    },
    "enforced": {
      "type": "boolean",
      "description": "SSO jest jedyną drogą logowania (z wyjątkiem właściciela)"
    },
    "domains": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Zweryfikowane domeny e-mail"
    },
    "idp_sso_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "idp_entity_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "idp_cert_present": {
      "type": "boolean"
    },
    "oidc_issuer": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "oidc_client_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "oidc_client_secret_present": {
      "type": "boolean"
    },
    "default_role": {
      "type": "string"
    },
    "jit_provisioning": {
      "type": "boolean"
    },
    "scim_enabled": {
      "type": "boolean"
    }
  }
}
POST /workspaces/:workspace_id/sso/scim_token.json Wygeneruj nowy token SCIM (pokazywany raz) sso_scim_token

Uprawnienie: workspace.manage · Tylko HTTP (nie jest narzędziem MCP)

Przykład
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/sso/scim_token.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}
GET /workspaces/:workspace_id/sso.json Pobierz ustawienia SSO sso_get

Uprawnienie: workspace.manage

Przykład
curl https://privatusanalytics.com/workspaces/:workspace_id/sso.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "protocol": {
      "type": "string",
      "description": "saml lub oidc"
    },
    "status": {
      "type": "string",
      "description": "draft, testing, tested lub active"
    },
    "enforced": {
      "type": "boolean",
      "description": "SSO jest jedyną drogą logowania (z wyjątkiem właściciela)"
    },
    "domains": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Zweryfikowane domeny e-mail"
    },
    "idp_sso_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "idp_entity_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "idp_cert_present": {
      "type": "boolean"
    },
    "oidc_issuer": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "oidc_client_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "oidc_client_secret_present": {
      "type": "boolean"
    },
    "default_role": {
      "type": "string"
    },
    "jit_provisioning": {
      "type": "boolean"
    },
    "scim_enabled": {
      "type": "boolean"
    }
  }
}
PATCH /workspaces/:workspace_id/sso.json Utwórz lub zaktualizuj ustawienia SSO sso_update

Uprawnienie: workspace.manage

Przykład
curl -X PATCH https://privatusanalytics.com/workspaces/:workspace_id/sso.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "protocol": {
      "type": "string",
      "description": "saml lub oidc",
      "enum": [
        "saml",
        "oidc"
      ]
    },
    "idp_sso_url": {
      "type": "string",
      "description": "SAML: URL jednokrotnego logowania IdP"
    },
    "idp_entity_id": {
      "type": "string",
      "description": "SAML: identyfikator encji IdP (wystawca)"
    },
    "idp_cert": {
      "type": "string",
      "description": "SAML: certyfikat podpisu X.509 IdP (PEM)"
    },
    "oidc_issuer": {
      "type": "string",
      "description": "OIDC: URL wystawcy (discovery)"
    },
    "oidc_client_id": {
      "type": "string",
      "description": "OIDC: identyfikator klienta"
    },
    "oidc_client_secret": {
      "type": "string",
      "description": "OIDC: sekret klienta (tylko do zapisu)"
    },
    "domains": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Zweryfikowane domeny e-mail, które używają tego SSO"
    },
    "default_role": {
      "type": "string",
      "description": "Rola dla członków tworzonych przez JIT lub SCIM",
      "enum": [
        "admin",
        "editor",
        "analyst",
        "viewer",
        "billing"
      ]
    },
    "jit_provisioning": {
      "type": "boolean",
      "description": "Twórz członków przy pierwszym logowaniu SSO"
    },
    "enforced": {
      "type": "boolean",
      "description": "Zezwalaj tylko na logowanie SSO (wymaga aktywnej konfiguracji)"
    },
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "protocol": {
      "type": "string",
      "description": "saml lub oidc"
    },
    "status": {
      "type": "string",
      "description": "draft, testing, tested lub active"
    },
    "enforced": {
      "type": "boolean",
      "description": "SSO jest jedyną drogą logowania (z wyjątkiem właściciela)"
    },
    "domains": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Zweryfikowane domeny e-mail"
    },
    "idp_sso_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "idp_entity_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "idp_cert_present": {
      "type": "boolean"
    },
    "oidc_issuer": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "oidc_client_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "oidc_client_secret_present": {
      "type": "boolean"
    },
    "default_role": {
      "type": "string"
    },
    "jit_provisioning": {
      "type": "boolean"
    },
    "scim_enabled": {
      "type": "boolean"
    }
  }
}

Segmenty

POST /sites/:site_id/segments.json Zapisz filtry jako segment segments_create

Uprawnienie: content.write

Przykład
curl -X POST https://privatusanalytics.com/sites/:site_id/segments.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nazwa segmentu, np. „Odwiedzający mobilni z reklam”",
      "examples": [
        "Mobile visitors from ads"
      ]
    },
    "description": {
      "type": "string",
      "description": "Opcjonalna notatka o tym, do czego służy segment (maksymalnie 300 znaków)",
      "examples": [
        "People who might buy the Pro plan"
      ]
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtry, z których wszystkie muszą pasować. Każdy element to warunek [\"dimension\", \"operator\", \"value\"] albo {\"any\": [conditions]}, gdy wystarczy dopasowanie jednego z kilku. Wymiary: page, entry_page, exit_page, hostname, channel, referrer, referrer_url, ref, utm_source, utm_medium, utm_campaign, utm_content, utm_term, country (kod ISO, np. US), language, device (desktop, mobile, tablet, tv, other), browser, browser_version, os, os_version, screen, goal (identyfikator celu), event (nazwa zdarzenia niestandardowego) oraz prop:<key> (właściwość zdarzenia niestandardowego). Operatory: is, is_not, contains, not_contains, starts_with, regex, not_regex, any_of i none_of (wartość jest listą), gt i lt (liczba), between (lista dwóch liczb). Akceptowane są też wiersze z formularza segmentu: {\"dimension\", \"operator\", \"value\", \"property\" (dla wymiaru prop), \"join\": \"and\" lub \"or\" (or łączy wiersz z poprzednim)}. Przykład: [[\"country\", \"is\", \"US\"], [\"device\", \"is\", \"mobile\"], {\"any\": [[\"page\", \"starts_with\", \"/pricing\"], [\"goal\", \"is\", \"goal_7Q2K9XH3AB\"]]}]",
      "examples": [
        [
          [
            "country",
            "is",
            "US"
          ],
          [
            "device",
            "is",
            "mobile"
          ],
          {
            "any": [
              [
                "page",
                "starts_with",
                "/pricing"
              ],
              [
                "goal",
                "is",
                "goal_7Q2K9XH3AB"
              ]
            ]
          }
        ]
      ]
    },
    "shared": {
      "type": "boolean",
      "description": "Widoczny dla wszystkich z dostępem do witryny (false: tylko dla Ciebie)",
      "default": true
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "filters",
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator segmentu, np. seg_7Q2K9XH3AB"
    },
    "site_id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "anyOf": [
        {
          "type": "string",
          "description": "Do czego służy segment lub null"
        },
        {
          "type": "null"
        }
      ]
    },
    "filters": {
      "type": "array",
      "description": "Filtry w formacie filtrów statystyk: warunki [\"dimension\", \"operator\", \"value\"], które muszą pasować wszystkie, oraz grupy {\"any\": [conditions]}"
    },
    "summary": {
      "type": "string",
      "description": "Filtry opisane zwykłym językiem, np. „Odwiedzający ze Stanów Zjednoczonych na urządzeniach mobilnych, którzy wyświetlili /pricing”"
    },
    "shared": {
      "type": "boolean",
      "description": "Widoczny dla wszystkich z dostępem do witryny"
    },
    "mine": {
      "type": "boolean",
      "description": "Utworzony przez Ciebie"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:site_id/segments/:id.json Usuń segment segments_delete

Uprawnienie: content.write

Przykład
curl -X DELETE https://privatusanalytics.com/sites/:site_id/segments/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator segmentu, np. seg_7Q2K9XH3AB"
    },
    "site_id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "anyOf": [
        {
          "type": "string",
          "description": "Do czego służy segment lub null"
        },
        {
          "type": "null"
        }
      ]
    },
    "filters": {
      "type": "array",
      "description": "Filtry w formacie filtrów statystyk: warunki [\"dimension\", \"operator\", \"value\"], które muszą pasować wszystkie, oraz grupy {\"any\": [conditions]}"
    },
    "summary": {
      "type": "string",
      "description": "Filtry opisane zwykłym językiem, np. „Odwiedzający ze Stanów Zjednoczonych na urządzeniach mobilnych, którzy wyświetlili /pricing”"
    },
    "shared": {
      "type": "boolean",
      "description": "Widoczny dla wszystkich z dostępem do witryny"
    },
    "mine": {
      "type": "boolean",
      "description": "Utworzony przez Ciebie"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/segments.json Wyświetl segmenty, których możesz użyć w witrynie segments_list

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/sites/:site_id/segments.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Strona (od 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Wyników na stronę (maks. 100)"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Identyfikator segmentu, np. seg_7Q2K9XH3AB"
      },
      "site_id": {
        "type": "string"
      },
      "name": {
        "type": "string"
      },
      "description": {
        "anyOf": [
          {
            "type": "string",
            "description": "Do czego służy segment lub null"
          },
          {
            "type": "null"
          }
        ]
      },
      "filters": {
        "type": "array",
        "description": "Filtry w formacie filtrów statystyk: warunki [\"dimension\", \"operator\", \"value\"], które muszą pasować wszystkie, oraz grupy {\"any\": [conditions]}"
      },
      "summary": {
        "type": "string",
        "description": "Filtry opisane zwykłym językiem, np. „Odwiedzający ze Stanów Zjednoczonych na urządzeniach mobilnych, którzy wyświetlili /pricing”"
      },
      "shared": {
        "type": "boolean",
        "description": "Widoczny dla wszystkich z dostępem do witryny"
      },
      "mine": {
        "type": "boolean",
        "description": "Utworzony przez Ciebie"
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      },
      "updated_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
POST /sites/:site_id/segments/preview.json Opisz filtry zwykłym językiem i policz odwiedzających, którzy pasowali do nich w ostatnich 30 dniach segments_preview

Uprawnienie: analytics.read

Przykład
curl -X POST https://privatusanalytics.com/sites/:site_id/segments/preview.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtry, z których wszystkie muszą pasować. Każdy element to warunek [\"dimension\", \"operator\", \"value\"] albo {\"any\": [conditions]}, gdy wystarczy dopasowanie jednego z kilku. Wymiary: page, entry_page, exit_page, hostname, channel, referrer, referrer_url, ref, utm_source, utm_medium, utm_campaign, utm_content, utm_term, country (kod ISO, np. US), language, device (desktop, mobile, tablet, tv, other), browser, browser_version, os, os_version, screen, goal (identyfikator celu), event (nazwa zdarzenia niestandardowego) oraz prop:<key> (właściwość zdarzenia niestandardowego). Operatory: is, is_not, contains, not_contains, starts_with, regex, not_regex, any_of i none_of (wartość jest listą), gt i lt (liczba), between (lista dwóch liczb). Akceptowane są też wiersze z formularza segmentu: {\"dimension\", \"operator\", \"value\", \"property\" (dla wymiaru prop), \"join\": \"and\" lub \"or\" (or łączy wiersz z poprzednim)}. Przykład: [[\"country\", \"is\", \"US\"], [\"device\", \"is\", \"mobile\"], {\"any\": [[\"page\", \"starts_with\", \"/pricing\"], [\"goal\", \"is\", \"goal_7Q2K9XH3AB\"]]}]",
      "examples": [
        [
          [
            "country",
            "is",
            "US"
          ],
          [
            "device",
            "is",
            "mobile"
          ],
          {
            "any": [
              [
                "page",
                "starts_with",
                "/pricing"
              ],
              [
                "goal",
                "is",
                "goal_7Q2K9XH3AB"
              ]
            ]
          }
        ]
      ],
      "default": []
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}
GET /sites/:site_id/segments/:id.json Pobierz segment segments_get

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/sites/:site_id/segments/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator segmentu, np. seg_7Q2K9XH3AB"
    },
    "site_id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "anyOf": [
        {
          "type": "string",
          "description": "Do czego służy segment lub null"
        },
        {
          "type": "null"
        }
      ]
    },
    "filters": {
      "type": "array",
      "description": "Filtry w formacie filtrów statystyk: warunki [\"dimension\", \"operator\", \"value\"], które muszą pasować wszystkie, oraz grupy {\"any\": [conditions]}"
    },
    "summary": {
      "type": "string",
      "description": "Filtry opisane zwykłym językiem, np. „Odwiedzający ze Stanów Zjednoczonych na urządzeniach mobilnych, którzy wyświetlili /pricing”"
    },
    "shared": {
      "type": "boolean",
      "description": "Widoczny dla wszystkich z dostępem do witryny"
    },
    "mine": {
      "type": "boolean",
      "description": "Utworzony przez Ciebie"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
PATCH /sites/:site_id/segments/:id.json Zmień nazwę segmentu lub jego filtry albo udostępnianie segments_update

Uprawnienie: content.write

Przykład
curl -X PATCH https://privatusanalytics.com/sites/:site_id/segments/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nazwa segmentu"
    },
    "description": {
      "type": "string",
      "description": "Opcjonalna notatka o tym, do czego służy segment (maksymalnie 300 znaków, puste pole ją usuwa)"
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtry zastępcze, w tym samym formacie co przy tworzeniu. Filtry, z których wszystkie muszą pasować. Każdy element to warunek [\"dimension\", \"operator\", \"value\"] albo {\"any\": [conditions]}, gdy wystarczy dopasowanie jednego z kilku. Wymiary: page, entry_page, exit_page, hostname, channel, referrer, referrer_url, ref, utm_source, utm_medium, utm_campaign, utm_content, utm_term, country (kod ISO, np. US), language, device (desktop, mobile, tablet, tv, other), browser, browser_version, os, os_version, screen, goal (identyfikator celu), event (nazwa zdarzenia niestandardowego) oraz prop:<key> (właściwość zdarzenia niestandardowego). Operatory: is, is_not, contains, not_contains, starts_with, regex, not_regex, any_of i none_of (wartość jest listą), gt i lt (liczba), between (lista dwóch liczb). Akceptowane są też wiersze z formularza segmentu: {\"dimension\", \"operator\", \"value\", \"property\" (dla wymiaru prop), \"join\": \"and\" lub \"or\" (or łączy wiersz z poprzednim)}. Przykład: [[\"country\", \"is\", \"US\"], [\"device\", \"is\", \"mobile\"], {\"any\": [[\"page\", \"starts_with\", \"/pricing\"], [\"goal\", \"is\", \"goal_7Q2K9XH3AB\"]]}]",
      "examples": [
        [
          [
            "country",
            "is",
            "US"
          ],
          [
            "device",
            "is",
            "mobile"
          ],
          {
            "any": [
              [
                "page",
                "starts_with",
                "/pricing"
              ],
              [
                "goal",
                "is",
                "goal_7Q2K9XH3AB"
              ]
            ]
          }
        ]
      ]
    },
    "shared": {
      "type": "boolean",
      "description": "Widoczny dla wszystkich w witrynie"
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator segmentu, np. seg_7Q2K9XH3AB"
    },
    "site_id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "anyOf": [
        {
          "type": "string",
          "description": "Do czego służy segment lub null"
        },
        {
          "type": "null"
        }
      ]
    },
    "filters": {
      "type": "array",
      "description": "Filtry w formacie filtrów statystyk: warunki [\"dimension\", \"operator\", \"value\"], które muszą pasować wszystkie, oraz grupy {\"any\": [conditions]}"
    },
    "summary": {
      "type": "string",
      "description": "Filtry opisane zwykłym językiem, np. „Odwiedzający ze Stanów Zjednoczonych na urządzeniach mobilnych, którzy wyświetlili /pricing”"
    },
    "shared": {
      "type": "boolean",
      "description": "Widoczny dla wszystkich z dostępem do witryny"
    },
    "mine": {
      "type": "boolean",
      "description": "Utworzony przez Ciebie"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Strona internetowa

GET /changelog.json Wyświetl wpisy dziennika zmian changelog_list

Opublikowane aktualizacje produktu, od najnowszych. Dostępne też jako RSS pod /changelog.rss.

Uprawnienie: public

Przykład
curl https://privatusanalytics.com/changelog.json
Dane wejściowe
{
  "type": "object",
  "properties": {
    "area": {
      "type": "string",
      "description": "Tylko wpisy dla tego obszaru produktu",
      "enum": [
        "product",
        "dashboard",
        "tracker",
        "privacy",
        "api",
        "integrations",
        "billing",
        "docs"
      ]
    },
    "page": {
      "type": "integer",
      "description": "Strona (od 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Wyników na stronę (maks. 100)"
    }
  },
  "required": []
}
Dane odpowiedzi
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Identyfikator wpisu, np. chg_7Q2K9XH3AB"
      },
      "title": {
        "type": "string",
        "description": "Nagłówek"
      },
      "area": {
        "type": "string",
        "description": "Obszar produktu, np. dashboard, tracker, api"
      },
      "body": {
        "type": "string",
        "description": "Treść w Markdown"
      },
      "published_at": {
        "type": "string",
        "format": "date-time",
        "description": "Czas publikacji"
      },
      "url": {
        "type": "string",
        "description": "Stały link"
      }
    }
  }
}
GET /changelog/:id.json Pobierz wpis dziennika zmian changelog_get

Uprawnienie: public

Przykład
curl https://privatusanalytics.com/changelog/:id.json
Dane wejściowe
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator wpisu, np. chg_7Q2K9XH3AB"
    },
    "title": {
      "type": "string",
      "description": "Nagłówek"
    },
    "area": {
      "type": "string",
      "description": "Obszar produktu, np. dashboard, tracker, api"
    },
    "body": {
      "type": "string",
      "description": "Treść w Markdown"
    },
    "published_at": {
      "type": "string",
      "format": "date-time",
      "description": "Czas publikacji"
    },
    "url": {
      "type": "string",
      "description": "Stały link"
    }
  }
}
POST /contact.json Wyślij wiadomość do zespołu Privatus Analytics contact_create

Klienci przeglądarkowi wysyłają token Cloudflare Turnstile jako `cf-turnstile-response`. Żądania z tokenem API nie wymagają go.

Uprawnienie: public · Tylko HTTP (nie jest narzędziem MCP)

Przykład
curl -X POST https://privatusanalytics.com/contact.json \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Twoje imię i nazwisko",
      "examples": [
        "Ada Lovelace"
      ]
    },
    "email": {
      "type": "string",
      "description": "Na jaki adres mamy odpowiedzieć",
      "examples": [
        "[email protected]"
      ]
    },
    "company": {
      "type": "string",
      "description": "Firma lub organizacja (opcjonalnie)"
    },
    "topic": {
      "type": "string",
      "description": "Czego dotyczy wiadomość",
      "enum": [
        "general",
        "sales",
        "support",
        "privacy",
        "security",
        "partnerships",
        "press"
      ],
      "default": "general"
    },
    "message": {
      "type": "string",
      "description": "Twoja wiadomość (od 10 do 5000 znaków)"
    },
    "website": {
      "type": "string",
      "description": "Pozostaw puste. Pułapka na boty. Wypełnione zgłoszenia są odrzucane"
    }
  },
  "required": [
    "name",
    "email",
    "message"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "received": {
      "type": "boolean",
      "description": "Zawsze true, gdy zgłoszenie zostało przyjęte"
    },
    "message": {
      "type": "string",
      "description": "Co dzieje się dalej"
    }
  }
}
POST /newsletter/confirm.json Potwierdź subskrypcję newslettera (podpisany token) newsletter_confirm

Uprawnienie: public · Tylko HTTP (nie jest narzędziem MCP)

Przykład
curl -X POST https://privatusanalytics.com/newsletter/confirm.json \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Podpisany token z e-maila potwierdzającego"
    }
  },
  "required": [
    "token"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "received": {
      "type": "boolean",
      "description": "Zawsze true, gdy zgłoszenie zostało przyjęte"
    },
    "message": {
      "type": "string",
      "description": "Co dzieje się dalej"
    }
  }
}
POST /newsletter.json Zapisz adres e-mail do newslettera newsletter_subscribe

Klienci przeglądarkowi wysyłają token Cloudflare Turnstile jako `cf-turnstile-response`. Żądania z tokenem API nie wymagają go.

Uprawnienie: public · Tylko HTTP (nie jest narzędziem MCP)

Przykład
curl -X POST https://privatusanalytics.com/newsletter.json \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "description": "Adres e-mail do zapisania. Wyślemy na niego link potwierdzający",
      "examples": [
        "[email protected]"
      ]
    },
    "website": {
      "type": "string",
      "description": "Pozostaw puste. Pułapka na boty. Wypełnione zgłoszenia są odrzucane"
    }
  },
  "required": [
    "email"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "received": {
      "type": "boolean",
      "description": "Zawsze true, gdy zgłoszenie zostało przyjęte"
    },
    "message": {
      "type": "string",
      "description": "Co dzieje się dalej"
    }
  }
}
POST /newsletter/unsubscribe.json Wypisz się za pomocą podpisanego tokena z linku newsletter_unsubscribe

Uprawnienie: public · Tylko HTTP (nie jest narzędziem MCP)

Przykład
curl -X POST https://privatusanalytics.com/newsletter/unsubscribe.json \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Podpisany token z linku do wypisania"
    },
    "list": {
      "type": "string",
      "description": "newsletter (domyślnie: lista, dla której był link) lub marketing (wszystkie e-maile marketingowe)",
      "enum": [
        "newsletter",
        "marketing"
      ]
    }
  },
  "required": [
    "token"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "received": {
      "type": "boolean",
      "description": "Zawsze true, gdy zgłoszenie zostało przyjęte"
    },
    "message": {
      "type": "string",
      "description": "Co dzieje się dalej"
    }
  }
}
GET /pricing.json Pobierz plany, ceny i limity planów pricing_get

Te same dane co na stronie cennika: drabinka zdarzeń, każdy limit planu i to, co wlicza się jako zdarzenie. Przekaż events, aby otrzymać pasujący poziom.

Uprawnienie: public

Przykład
curl https://privatusanalytics.com/pricing.json
Dane wejściowe
{
  "type": "object",
  "properties": {
    "events": {
      "type": "integer",
      "description": "Spodziewane odsłony plus zdarzenia niestandardowe miesięcznie. Zwraca pasujący poziom jako `recommendation`",
      "examples": [
        750000
      ]
    },
    "interval": {
      "type": "string",
      "description": "Okres rozliczeniowy dla pokazanych cen: month lub year (10x cena miesięczna)",
      "enum": [
        "month",
        "year"
      ],
      "default": "month"
    }
  },
  "required": []
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "currency": {
      "type": "string",
      "description": "Waluta każdej ceny (USD)"
    },
    "tax_included": {
      "type": "boolean",
      "description": "Zawsze true. Ceny zawierają VAT lub podatek od sprzedaży, więc cena widoczna to cena do zapłaty"
    },
    "interval": {
      "type": "string",
      "description": "month lub year. Ceny dotyczą tego okresu"
    },
    "annual_multiplier": {
      "type": "integer",
      "description": "Cena roczna = cena miesięczna x to (dwa miesiące gratis)"
    },
    "free_events": {
      "type": "integer",
      "description": "Zdarzenia miesięcznie w planie Free"
    },
    "badge_bonus": {
      "type": "integer",
      "description": "Dodatkowe bezpłatne zdarzenia miesięcznie, gdy pokazywana jest opcjonalna odznaka"
    },
    "tiers": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Drabinka zdarzeń: { events, pro, business } ceny dla okresu (pro jest null tam, gdzie oferowany jest tylko Business), plus ceny miesięczne"
    },
    "plans": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Plany z { id, name, from_price, limits }. Limity null oznaczają bez limitu"
    },
    "counted": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Co wlicza się jako zdarzenie rozliczane"
    },
    "not_counted": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Co nigdy nie wlicza się do zużycia"
    },
    "recommendation": {
      "anyOf": [
        {
          "type": "object",
          "description": "{ events, plan, tier_events, price } dla danych wejściowych `events` lub null, gdy nie podano wolumenu"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
GET /status.json Pobierz aktualny status systemu status_get

Kondycja bazy danych, Redis i zadań w tle, sprawdzana najwyżej co 15 sekund.

Uprawnienie: public

Przykład
curl https://privatusanalytics.com/status.json
Dane wejściowe
{
  "type": "object",
  "properties": {
    "fresh": {
      "type": "boolean",
      "description": "Pomiń 15-sekundowy cache i sprawdź ponownie teraz",
      "default": false
    }
  },
  "required": []
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Ogólnie: operational, degraded lub outage"
    },
    "checked_at": {
      "type": "string",
      "format": "date-time",
      "description": "Kiedy wykonano kontrole (cache do 15 s)"
    },
    "components": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Na komponent: { id, name, status, detail, latency_ms }, plus queue_latency_s i queue_depth dla kolejek"
    }
  }
}
GET /tools/header-checker.json Sprawdź Referrer-Policy i CSP strony pod kątem analityki tools_header_check

Uprawnienie: public

Przykład
curl https://privatusanalytics.com/tools/header-checker.json
Dane wejściowe
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Strona publiczna do sprawdzenia (http lub https)",
      "examples": [
        "https://example.com"
      ]
    }
  },
  "required": [
    "url"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Końcowy adres URL po przekierowaniach"
    },
    "status": {
      "type": "integer",
      "description": "Status HTTP końcowej odpowiedzi"
    },
    "findings": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Kontrole: { check, value, level (ok, warn, info), note }"
    }
  }
}
GET /tools/privacy-policy-generator.json Przygotuj szkic akapitu polityki prywatności dla Privatus Analytics tools_privacy_policy

Uprawnienie: public

Przykład
curl https://privatusanalytics.com/tools/privacy-policy-generator.json
Dane wejściowe
{
  "type": "object",
  "properties": {
    "site_name": {
      "type": "string",
      "description": "Nazwa Twojej strony lub firmy",
      "examples": [
        "Example Books"
      ]
    },
    "contact_email": {
      "type": "string",
      "description": "Kontakt w sprawie prywatności do wspomnienia (opcjonalnie)"
    },
    "honors_gpc": {
      "type": "boolean",
      "description": "Czy Do Not Track i Global Privacy Control są respektowane (domyślnie tak)",
      "default": true
    }
  },
  "required": [
    "site_name"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "site_name": {
      "type": "string",
      "description": "Dane wejściowe: nazwa strony lub firmy"
    },
    "paragraphs": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Tekst polityki, jeden akapit na element"
    },
    "text": {
      "type": "string",
      "description": "Akapity połączone pustymi wierszami"
    }
  }
}
GET /tools/qr-code.json Wygeneruj kod QR jako SVG tools_qr_code

Uprawnienie: public

Przykład
curl https://privatusanalytics.com/tools/qr-code.json
Dane wejściowe
{
  "type": "object",
  "properties": {
    "text": {
      "type": "string",
      "description": "Adres URL lub tekst do zakodowania (do 1000 znaków)",
      "examples": [
        "https://example.com/?utm_source=poster"
      ]
    },
    "level": {
      "type": "string",
      "description": "Korekcja błędów: l (7%), m (15%), q (25%), h (30%)",
      "enum": [
        "l",
        "m",
        "q",
        "h"
      ],
      "default": "m"
    }
  },
  "required": [
    "text"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "text": {
      "type": "string",
      "description": "Zakodowany tekst"
    },
    "level": {
      "type": "string",
      "description": "Poziom korekcji błędów"
    },
    "size": {
      "type": "integer",
      "description": "Modułów na bok"
    },
    "svg": {
      "type": "string",
      "description": "Samodzielny dokument SVG"
    }
  }
}
GET /tools/tracker-scanner.json Wyświetl pliki cookie i znane trackery na stronie tools_tracker_scan

Uprawnienie: public

Przykład
curl https://privatusanalytics.com/tools/tracker-scanner.json
Dane wejściowe
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Strona publiczna do skanowania (http lub https)",
      "examples": [
        "https://example.com"
      ]
    }
  },
  "required": [
    "url"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Końcowy adres URL po przekierowaniach"
    },
    "status": {
      "type": "integer",
      "description": "Status HTTP końcowej odpowiedzi"
    },
    "truncated": {
      "type": "boolean",
      "description": "True, gdy strona miała ponad 1 MB i przeskanowano tylko pierwszy 1 MB"
    },
    "cookies": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Pliki cookie ustawione przez odpowiedź HTTP: { name, domain, path, expires, secure, http_only, same_site }. Wartości nigdy nie są zwracane"
    },
    "trackers": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Znane narzędzia wskazane przez stronę: { name, category, match, evidence }"
    },
    "third_party_hosts": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Inne domeny, z których strona ładuje zasoby"
    }
  }
}
GET /tools/utm-builder.json Zbuduj adres URL kampanii z parametrami UTM tools_utm_builder

Uprawnienie: public

Przykład
curl https://privatusanalytics.com/tools/utm-builder.json
Dane wejściowe
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Adres URL strony docelowej",
      "examples": [
        "https://example.com/pricing"
      ]
    },
    "source": {
      "type": "string",
      "description": "utm_source: skąd pochodzi ruch",
      "examples": [
        "newsletter"
      ]
    },
    "medium": {
      "type": "string",
      "description": "utm_medium: kanał, np. email, cpc, social",
      "examples": [
        "email"
      ]
    },
    "campaign": {
      "type": "string",
      "description": "utm_campaign: nazwa kampanii",
      "examples": [
        "fall_launch"
      ]
    },
    "term": {
      "type": "string",
      "description": "utm_term: słowo kluczowe płatnego wyszukiwania (opcjonalnie)"
    },
    "content": {
      "type": "string",
      "description": "utm_content: który link lub kreacja (opcjonalnie)"
    }
  },
  "required": [
    "url",
    "source",
    "medium",
    "campaign"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Adres URL strony docelowej z parametrami UTM"
    },
    "params": {
      "type": "object",
      "description": "Dodane parametry UTM"
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Problemy warte poprawienia (wielkość liter, spacje, dane osobowe)"
    }
  }
}
POST /waitlist.json Dołącz do listy oczekujących (hosting w UE) waitlist_join

Klienci przeglądarkowi wysyłają token Cloudflare Turnstile jako `cf-turnstile-response`. Żądania z tokenem API nie wymagają go.

Uprawnienie: public · Tylko HTTP (nie jest narzędziem MCP)

Przykład
curl -X POST https://privatusanalytics.com/waitlist.json \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "description": "Adres e-mail do powiadomienia",
      "examples": [
        "[email protected]"
      ]
    },
    "list": {
      "type": "string",
      "description": "Do której listy oczekujących dołączyć",
      "enum": [
        "eu_hosting"
      ],
      "default": "eu_hosting"
    },
    "website": {
      "type": "string",
      "description": "Pozostaw puste. Pułapka na boty. Wypełnione zgłoszenia są odrzucane"
    }
  },
  "required": [
    "email"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "received": {
      "type": "boolean",
      "description": "Zawsze true, gdy zgłoszenie zostało przyjęte"
    },
    "message": {
      "type": "string",
      "description": "Co dzieje się dalej"
    }
  }
}

Strony statusu

GET /status/:slug/confirm/:token.json Potwierdź subskrypcję z linku w e-mailu public_status_pages_confirm

Uprawnienie: public · Tylko HTTP (nie jest narzędziem MCP)

Przykład
curl https://privatusanalytics.com/status/:slug/confirm/:token.json
Dane wejściowe
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Token zasobu"
    },
    "slug": {
      "type": "string",
      "description": "Slug zasobu"
    }
  },
  "required": [
    "token",
    "slug"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}
GET /status/:slug.json Publiczna strona statusu: aktualny status, 90-dniowe paski uptime, incydenty i wpisy public_status_pages_get

Uprawnienie: public · Tylko HTTP (nie jest narzędziem MCP)

Przykład
curl https://privatusanalytics.com/status/:slug.json
Dane wejściowe
{
  "type": "object",
  "properties": {
    "slug": {
      "type": "string",
      "description": "Slug zasobu"
    }
  },
  "required": [
    "slug"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string"
    },
    "description": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "logo_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "brand_color": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "status": {
      "type": "string",
      "description": "operational, degraded lub outage"
    },
    "checks": {
      "type": "array",
      "description": "Każda: {name, status, uptime_90d, days: [{date, uptime, downtime_seconds}]}"
    },
    "posts": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Identyfikator wpisu (spp_…)"
          },
          "title": {
            "type": "string"
          },
          "body": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "description": "investigating, identified, monitoring lub resolved"
          },
          "posted_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
    },
    "incidents": {
      "type": "array",
      "description": "Ostatnie incydenty: {check, started_at, resolved_at, duration_seconds}"
    }
  }
}
POST /status/:slug/subscribers.json Zapisz adres e-mail (podwójne potwierdzenie) public_status_pages_subscribe

Klienci przeglądarkowi wysyłają token Cloudflare Turnstile jako `cf-turnstile-response`. Żądania z tokenem API nie wymagają go.

Uprawnienie: public · Tylko HTTP (nie jest narzędziem MCP)

Przykład
curl -X POST https://privatusanalytics.com/status/:slug/subscribers.json \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "description": "Adres e-mail do powiadomienia",
      "examples": [
        "[email protected]"
      ]
    },
    "slug": {
      "type": "string",
      "description": "Slug zasobu"
    }
  },
  "required": [
    "email",
    "slug"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}
POST /status/:slug/unsubscribe/:token.json Wypisz się za pomocą tokena z e-maila public_status_pages_unsubscribe

Uprawnienie: public · Tylko HTTP (nie jest narzędziem MCP)

Przykład
curl -X POST https://privatusanalytics.com/status/:slug/unsubscribe/:token.json \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Token zasobu"
    },
    "slug": {
      "type": "string",
      "description": "Slug zasobu"
    }
  },
  "required": [
    "token",
    "slug"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}
POST /status_pages/:status_page_id/posts.json Opublikuj aktualizację incydentu (wysyła e-mail do subskrybentów) status_page_posts_create

Uprawnienie: uptime.manage

Przykład
curl -X POST https://privatusanalytics.com/status_pages/:status_page_id/posts.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "description": "Nagłówek, np. \"Podwyższony poziom błędów\""
    },
    "body": {
      "type": "string",
      "description": "Tekst aktualizacji (zwykły tekst)"
    },
    "status": {
      "type": "string",
      "description": "investigating, identified, monitoring lub resolved",
      "enum": [
        "investigating",
        "identified",
        "monitoring",
        "resolved"
      ],
      "default": "investigating"
    },
    "posted_at": {
      "type": "string",
      "format": "date-time",
      "description": "Kiedy to się stało (domyślnie teraz)"
    },
    "notify": {
      "type": "boolean",
      "description": "Wyślij e-mail do potwierdzonych subskrybentów",
      "default": true
    },
    "status_page_id": {
      "type": "string",
      "description": "Status page zasobu"
    }
  },
  "required": [
    "title",
    "status_page_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator wpisu (spp_…)"
    },
    "title": {
      "type": "string"
    },
    "body": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "status": {
      "type": "string",
      "description": "investigating, identified, monitoring lub resolved"
    },
    "posted_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /status_pages/:status_page_id/posts/:id.json Usuń wpis strony statusu status_page_posts_delete

Uprawnienie: uptime.manage

Przykład
curl -X DELETE https://privatusanalytics.com/status_pages/:status_page_id/posts/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "status_page_id": {
      "type": "string",
      "description": "Status page zasobu"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "status_page_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator wpisu (spp_…)"
    },
    "title": {
      "type": "string"
    },
    "body": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "status": {
      "type": "string",
      "description": "investigating, identified, monitoring lub resolved"
    },
    "posted_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /status_pages/:status_page_id/posts.json Wyświetl wpisy strony statusu status_page_posts_list

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/status_pages/:status_page_id/posts.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Tylko wpisy o tym statusie",
      "enum": [
        "investigating",
        "identified",
        "monitoring",
        "resolved"
      ]
    },
    "status_page_id": {
      "type": "string",
      "description": "Status page zasobu"
    },
    "page": {
      "type": "integer",
      "description": "Strona (od 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Wyników na stronę (maks. 100)"
    }
  },
  "required": [
    "status_page_id"
  ]
}
Dane odpowiedzi
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Identyfikator wpisu (spp_…)"
      },
      "title": {
        "type": "string"
      },
      "body": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "status": {
        "type": "string",
        "description": "investigating, identified, monitoring lub resolved"
      },
      "posted_at": {
        "type": "string",
        "format": "date-time"
      },
      "updated_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
PATCH /status_pages/:status_page_id/posts/:id.json Edytuj wpis strony statusu status_page_posts_update

Uprawnienie: uptime.manage

Przykład
curl -X PATCH https://privatusanalytics.com/status_pages/:status_page_id/posts/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "description": "Nagłówek"
    },
    "body": {
      "type": "string",
      "description": "Tekst aktualizacji (zwykły tekst)"
    },
    "status": {
      "type": "string",
      "description": "investigating, identified, monitoring lub resolved",
      "enum": [
        "investigating",
        "identified",
        "monitoring",
        "resolved"
      ]
    },
    "notify": {
      "type": "boolean",
      "description": "Wyślij e-mail do potwierdzonych subskrybentów, jeśli status się zmieni",
      "default": true
    },
    "status_page_id": {
      "type": "string",
      "description": "Status page zasobu"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "status_page_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator wpisu (spp_…)"
    },
    "title": {
      "type": "string"
    },
    "body": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "status": {
      "type": "string",
      "description": "investigating, identified, monitoring lub resolved"
    },
    "posted_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /status_pages/:status_page_id/subscribers/:id.json Usuń subskrybenta status_page_subscribers_delete

Uprawnienie: uptime.manage

Przykład
curl -X DELETE https://privatusanalytics.com/status_pages/:status_page_id/subscribers/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "status_page_id": {
      "type": "string",
      "description": "Status page zasobu"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "status_page_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "email": {
      "type": "string"
    },
    "confirmed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /status_pages/:status_page_id/subscribers.json Wyświetl subskrybentów strony statusu status_page_subscribers_list

Uprawnienie: uptime.manage

Przykład
curl https://privatusanalytics.com/status_pages/:status_page_id/subscribers.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "confirmed": {
      "type": "boolean",
      "description": "true: tylko potwierdzeni, false: tylko oczekujący"
    },
    "status_page_id": {
      "type": "string",
      "description": "Status page zasobu"
    },
    "page": {
      "type": "integer",
      "description": "Strona (od 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Wyników na stronę (maks. 100)"
    }
  },
  "required": [
    "status_page_id"
  ]
}
Dane odpowiedzi
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "format": "uuid"
      },
      "email": {
        "type": "string"
      },
      "confirmed_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
POST /workspaces/:workspace_id/status_pages.json Utwórz stronę statusu status_pages_create

Uprawnienie: uptime.manage

Przykład
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/status_pages.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Tytuł strony, np. \"Status Acme\""
    },
    "slug": {
      "type": "string",
      "description": "Slug publicznego adresu URL: /status/<slug> (domyślnie z nazwy)"
    },
    "description": {
      "type": "string",
      "description": "Tekst wstępny pod tytułem"
    },
    "logo_url": {
      "type": "string",
      "description": "Adres URL HTTPS obrazu logo"
    },
    "brand_color": {
      "type": "string",
      "description": "Kolor akcentu, np. #06755b"
    },
    "custom_domain": {
      "type": "string",
      "description": "Domena własna (CNAME do naszego hosta), np. status.example.com. Puste, aby usunąć"
    },
    "check_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Identyfikatory kontroli uptime (upc_…) do pokazania"
    },
    "published": {
      "type": "boolean",
      "description": "Widoczna publicznie",
      "default": true
    },
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator strony statusu (sp_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "slug": {
      "type": "string",
      "description": "Publiczny adres URL: /status/<slug>"
    },
    "custom_domain": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "description": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "logo_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "brand_color": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "published": {
      "type": "boolean"
    },
    "check_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Pokazywane identyfikatory kontroli uptime"
    },
    "subscribers": {
      "type": "integer",
      "description": "Potwierdzeni subskrybenci"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /status_pages/:id.json Usuń stronę statusu status_pages_delete

Uprawnienie: uptime.manage

Przykład
curl -X DELETE https://privatusanalytics.com/status_pages/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator strony statusu (sp_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "slug": {
      "type": "string",
      "description": "Publiczny adres URL: /status/<slug>"
    },
    "custom_domain": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "description": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "logo_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "brand_color": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "published": {
      "type": "boolean"
    },
    "check_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Pokazywane identyfikatory kontroli uptime"
    },
    "subscribers": {
      "type": "integer",
      "description": "Potwierdzeni subskrybenci"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /workspaces/:workspace_id/status_pages.json Wyświetl strony statusu status_pages_list

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/workspaces/:workspace_id/status_pages.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "description": "Filtruj według nazwy lub sluga"
    },
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Strona (od 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Wyników na stronę (maks. 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Identyfikator strony statusu (sp_…)"
      },
      "workspace_id": {
        "type": "string"
      },
      "name": {
        "type": "string"
      },
      "slug": {
        "type": "string",
        "description": "Publiczny adres URL: /status/<slug>"
      },
      "custom_domain": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "description": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "logo_url": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "brand_color": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "published": {
        "type": "boolean"
      },
      "check_ids": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Pokazywane identyfikatory kontroli uptime"
      },
      "subscribers": {
        "type": "integer",
        "description": "Potwierdzeni subskrybenci"
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
GET /status_pages/:id.json Pobierz stronę statusu status_pages_get

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/status_pages/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator strony statusu (sp_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "slug": {
      "type": "string",
      "description": "Publiczny adres URL: /status/<slug>"
    },
    "custom_domain": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "description": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "logo_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "brand_color": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "published": {
      "type": "boolean"
    },
    "check_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Pokazywane identyfikatory kontroli uptime"
    },
    "subscribers": {
      "type": "integer",
      "description": "Potwierdzeni subskrybenci"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
PATCH /status_pages/:id.json Zmień stronę statusu status_pages_update

Uprawnienie: uptime.manage

Przykład
curl -X PATCH https://privatusanalytics.com/status_pages/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Tytuł strony, np. \"Status Acme\""
    },
    "slug": {
      "type": "string",
      "description": "Slug publicznego adresu URL: /status/<slug> (domyślnie z nazwy)"
    },
    "description": {
      "type": "string",
      "description": "Tekst wstępny pod tytułem"
    },
    "logo_url": {
      "type": "string",
      "description": "Adres URL HTTPS obrazu logo"
    },
    "brand_color": {
      "type": "string",
      "description": "Kolor akcentu, np. #06755b"
    },
    "custom_domain": {
      "type": "string",
      "description": "Domena własna (CNAME do naszego hosta), np. status.example.com. Puste, aby usunąć"
    },
    "check_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Identyfikatory kontroli uptime (upc_…) do pokazania"
    },
    "published": {
      "type": "boolean",
      "description": "Widoczna publicznie"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator strony statusu (sp_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "slug": {
      "type": "string",
      "description": "Publiczny adres URL: /status/<slug>"
    },
    "custom_domain": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "description": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "logo_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "brand_color": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "published": {
      "type": "boolean"
    },
    "check_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Pokazywane identyfikatory kontroli uptime"
    },
    "subscribers": {
      "type": "integer",
      "description": "Potwierdzeni subskrybenci"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Synchronizacja z hurtownią

POST /workspaces/:workspace_id/warehouses.json Dodaj cel hurtowni danych warehouse_destinations_create

Uprawnienie: workspace.manage

Przykład
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/warehouses.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nazwa wyświetlana, np. Data lake"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Witryny do wysyłania (pa_…). Puste wysyła wszystkie witryny"
    },
    "bucket": {
      "type": "string",
      "description": "s3: nazwa bucketu"
    },
    "region": {
      "type": "string",
      "description": "s3: region, np. us-east-1 (auto dla R2)"
    },
    "prefix": {
      "type": "string",
      "description": "s3/azure: prefiks ścieżki, np. privatus/events"
    },
    "endpoint": {
      "type": "string",
      "description": "s3: endpoint https dla magazynu zgodnego z S3 (interoperacyjność GCS, R2, MinIO)"
    },
    "access_key_id": {
      "type": "string",
      "description": "s3: identyfikator klucza dostępu"
    },
    "secret_access_key": {
      "type": "string",
      "description": "s3: tajny klucz dostępu (tylko do zapisu)"
    },
    "service_account_json": {
      "type": "string",
      "description": "bigquery: klucz JSON konta usługi z rolą BigQuery Data Editor (tylko do zapisu)"
    },
    "project_id": {
      "type": "string",
      "description": "bigquery: identyfikator projektu (domyślnie z klucza)"
    },
    "dataset": {
      "type": "string",
      "description": "bigquery: identyfikator zbioru danych"
    },
    "table": {
      "type": "string",
      "description": "bigquery/snowflake: nazwa tabeli (kolumny: schemat v1)"
    },
    "account": {
      "type": "string",
      "description": "snowflake: identyfikator konta, np. xy12345.us-east-1 lub myorg-myaccount"
    },
    "user": {
      "type": "string",
      "description": "snowflake: użytkownik z uwierzytelnianiem parą kluczy"
    },
    "private_key": {
      "type": "string",
      "description": "snowflake: klucz prywatny RSA PEM (tylko do zapisu)"
    },
    "database": {
      "type": "string",
      "description": "snowflake: baza danych"
    },
    "schema": {
      "type": "string",
      "description": "snowflake: schemat"
    },
    "warehouse": {
      "type": "string",
      "description": "snowflake: wirtualna hurtownia"
    },
    "role": {
      "type": "string",
      "description": "snowflake: rola (opcjonalnie)"
    },
    "sas_url": {
      "type": "string",
      "description": "azure: URL SAS kontenera z uprawnieniem create/write (tylko do zapisu)"
    },
    "kind": {
      "type": "string",
      "description": "s3 (także GCS/R2/MinIO), bigquery, snowflake lub azure",
      "enum": [
        "s3",
        "bigquery",
        "snowflake",
        "azure"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "kind",
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator celu, np. whd_7Q2K9XH3AB"
    },
    "kind": {
      "type": "string",
      "description": "s3, bigquery, snowflake lub azure"
    },
    "name": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "Dokąd trafiają dane: s3://bucket/prefix, project.dataset.table, account/database.schema.table lub kontener Azure"
    },
    "configured": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Nazwy ustawień, które są wypełnione (wartości nigdy nie są zwracane)"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Wysyłane witryny (pa_…). Puste oznacza wszystkie witryny"
    },
    "schedule": {
      "type": "string",
      "description": "daily: 02:00 UTC, wysyła poprzedni dzień UTC"
    },
    "schema_version": {
      "type": "string",
      "description": "Wysyłany schemat wierszy"
    },
    "last_run_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "next_run_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /warehouses/:id.json Usuń cel hurtowni danych warehouse_destinations_delete

Uprawnienie: workspace.manage

Przykład
curl -X DELETE https://privatusanalytics.com/warehouses/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator celu, np. whd_7Q2K9XH3AB"
    },
    "kind": {
      "type": "string",
      "description": "s3, bigquery, snowflake lub azure"
    },
    "name": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "Dokąd trafiają dane: s3://bucket/prefix, project.dataset.table, account/database.schema.table lub kontener Azure"
    },
    "configured": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Nazwy ustawień, które są wypełnione (wartości nigdy nie są zwracane)"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Wysyłane witryny (pa_…). Puste oznacza wszystkie witryny"
    },
    "schedule": {
      "type": "string",
      "description": "daily: 02:00 UTC, wysyła poprzedni dzień UTC"
    },
    "schema_version": {
      "type": "string",
      "description": "Wysyłany schemat wierszy"
    },
    "last_run_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "next_run_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /workspaces/:workspace_id/warehouses.json Wyświetl cele hurtowni danych warehouse_destinations_list

Uprawnienie: workspace.manage

Przykład
curl https://privatusanalytics.com/workspaces/:workspace_id/warehouses.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "description": "Tylko cele tego rodzaju",
      "enum": [
        "s3",
        "bigquery",
        "snowflake",
        "azure"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Strona (od 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Wyników na stronę (maks. 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Identyfikator celu, np. whd_7Q2K9XH3AB"
      },
      "kind": {
        "type": "string",
        "description": "s3, bigquery, snowflake lub azure"
      },
      "name": {
        "type": "string"
      },
      "target": {
        "type": "string",
        "description": "Dokąd trafiają dane: s3://bucket/prefix, project.dataset.table, account/database.schema.table lub kontener Azure"
      },
      "configured": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Nazwy ustawień, które są wypełnione (wartości nigdy nie są zwracane)"
      },
      "site_ids": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Wysyłane witryny (pa_…). Puste oznacza wszystkie witryny"
      },
      "schedule": {
        "type": "string",
        "description": "daily: 02:00 UTC, wysyła poprzedni dzień UTC"
      },
      "schema_version": {
        "type": "string",
        "description": "Wysyłany schemat wierszy"
      },
      "last_run_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "next_run_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "last_error": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
GET /warehouses/:id.json Pobierz cel hurtowni danych (bez sekretów) warehouse_destinations_get

Uprawnienie: workspace.manage

Przykład
curl https://privatusanalytics.com/warehouses/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator celu, np. whd_7Q2K9XH3AB"
    },
    "kind": {
      "type": "string",
      "description": "s3, bigquery, snowflake lub azure"
    },
    "name": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "Dokąd trafiają dane: s3://bucket/prefix, project.dataset.table, account/database.schema.table lub kontener Azure"
    },
    "configured": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Nazwy ustawień, które są wypełnione (wartości nigdy nie są zwracane)"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Wysyłane witryny (pa_…). Puste oznacza wszystkie witryny"
    },
    "schedule": {
      "type": "string",
      "description": "daily: 02:00 UTC, wysyła poprzedni dzień UTC"
    },
    "schema_version": {
      "type": "string",
      "description": "Wysyłany schemat wierszy"
    },
    "last_run_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "next_run_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /warehouses/:id/sync.json Dodaj do kolejki synchronizację jednego dnia teraz warehouse_destinations_sync

Uprawnienie: workspace.manage

Przykład
curl -X POST https://privatusanalytics.com/warehouses/:id/sync.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "date": {
      "type": "string",
      "format": "date",
      "description": "Dzień UTC do wysłania, np. 2026-09-28 (domyślnie: wczoraj)"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator celu, np. whd_7Q2K9XH3AB"
    },
    "kind": {
      "type": "string",
      "description": "s3, bigquery, snowflake lub azure"
    },
    "name": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "Dokąd trafiają dane: s3://bucket/prefix, project.dataset.table, account/database.schema.table lub kontener Azure"
    },
    "configured": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Nazwy ustawień, które są wypełnione (wartości nigdy nie są zwracane)"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Wysyłane witryny (pa_…). Puste oznacza wszystkie witryny"
    },
    "schedule": {
      "type": "string",
      "description": "daily: 02:00 UTC, wysyła poprzedni dzień UTC"
    },
    "schema_version": {
      "type": "string",
      "description": "Wysyłany schemat wierszy"
    },
    "last_run_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "next_run_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
PATCH /warehouses/:id.json Zaktualizuj cel hurtowni danych (puste sekrety są zachowywane) warehouse_destinations_update

Uprawnienie: workspace.manage

Przykład
curl -X PATCH https://privatusanalytics.com/warehouses/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nazwa wyświetlana, np. Data lake"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Witryny do wysyłania (pa_…). Puste wysyła wszystkie witryny"
    },
    "bucket": {
      "type": "string",
      "description": "s3: nazwa bucketu"
    },
    "region": {
      "type": "string",
      "description": "s3: region, np. us-east-1 (auto dla R2)"
    },
    "prefix": {
      "type": "string",
      "description": "s3/azure: prefiks ścieżki, np. privatus/events"
    },
    "endpoint": {
      "type": "string",
      "description": "s3: endpoint https dla magazynu zgodnego z S3 (interoperacyjność GCS, R2, MinIO)"
    },
    "access_key_id": {
      "type": "string",
      "description": "s3: identyfikator klucza dostępu"
    },
    "secret_access_key": {
      "type": "string",
      "description": "s3: tajny klucz dostępu (tylko do zapisu)"
    },
    "service_account_json": {
      "type": "string",
      "description": "bigquery: klucz JSON konta usługi z rolą BigQuery Data Editor (tylko do zapisu)"
    },
    "project_id": {
      "type": "string",
      "description": "bigquery: identyfikator projektu (domyślnie z klucza)"
    },
    "dataset": {
      "type": "string",
      "description": "bigquery: identyfikator zbioru danych"
    },
    "table": {
      "type": "string",
      "description": "bigquery/snowflake: nazwa tabeli (kolumny: schemat v1)"
    },
    "account": {
      "type": "string",
      "description": "snowflake: identyfikator konta, np. xy12345.us-east-1 lub myorg-myaccount"
    },
    "user": {
      "type": "string",
      "description": "snowflake: użytkownik z uwierzytelnianiem parą kluczy"
    },
    "private_key": {
      "type": "string",
      "description": "snowflake: klucz prywatny RSA PEM (tylko do zapisu)"
    },
    "database": {
      "type": "string",
      "description": "snowflake: baza danych"
    },
    "schema": {
      "type": "string",
      "description": "snowflake: schemat"
    },
    "warehouse": {
      "type": "string",
      "description": "snowflake: wirtualna hurtownia"
    },
    "role": {
      "type": "string",
      "description": "snowflake: rola (opcjonalnie)"
    },
    "sas_url": {
      "type": "string",
      "description": "azure: URL SAS kontenera z uprawnieniem create/write (tylko do zapisu)"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator celu, np. whd_7Q2K9XH3AB"
    },
    "kind": {
      "type": "string",
      "description": "s3, bigquery, snowflake lub azure"
    },
    "name": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "Dokąd trafiają dane: s3://bucket/prefix, project.dataset.table, account/database.schema.table lub kontener Azure"
    },
    "configured": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Nazwy ustawień, które są wypełnione (wartości nigdy nie są zwracane)"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Wysyłane witryny (pa_…). Puste oznacza wszystkie witryny"
    },
    "schedule": {
      "type": "string",
      "description": "daily: 02:00 UTC, wysyła poprzedni dzień UTC"
    },
    "schema_version": {
      "type": "string",
      "description": "Wysyłany schemat wierszy"
    },
    "last_run_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "next_run_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Tokeny API

POST /workspaces/:workspace_id/api_tokens.json Utwórz token API (token jest zwracany tylko raz) api_tokens_create

Uprawnienie: member

Przykład
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/api_tokens.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nazwa, po której rozpoznasz token",
      "examples": [
        "CI deploys"
      ]
    },
    "permissions": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "analytics.read",
          "analytics.export",
          "content.write",
          "sites.manage",
          "uptime.manage",
          "members.manage",
          "tokens.manage",
          "billing.manage",
          "workspace.manage"
        ]
      },
      "description": "Uprawnienia (pomiń dla wszystkich swoich, pusta lista jest odrzucana)"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Ogranicz do tych identyfikatorów witryn (pa_…). Puste = wszystkie",
      "default": []
    },
    "expires_at": {
      "type": "string",
      "format": "date-time",
      "description": "Czas wygaśnięcia (ISO 8601). Puste = nigdy"
    },
    "allowed_ips": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Akceptuj żądania tylko z tych adresów IP/CIDR",
      "default": []
    },
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "name": {
      "type": "string"
    },
    "token": {
      "anyOf": [
        {
          "type": "string",
          "description": "Sam token: zwracany tylko przy utworzeniu"
        },
        {
          "type": "null"
        }
      ]
    },
    "token_prefix": {
      "type": "string",
      "description": "Pierwsze znaki, po których można rozpoznać token"
    },
    "owner": {
      "type": "string",
      "description": "E-mail członka, który jest jego właścicielem"
    },
    "permissions": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Ograniczony do tych witryn (puste = wszystkie)"
    },
    "allowed_ips": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "oauth_client": {
      "anyOf": [
        {
          "type": "string",
          "description": "Klient MCP, który go otrzymał"
        },
        {
          "type": "null"
        }
      ]
    },
    "status": {
      "type": "string",
      "description": "active, expired lub revoked"
    },
    "expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_used_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "revoked_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /workspaces/:workspace_id/api_tokens/:id.json Unieważnij token API api_tokens_delete

Uprawnienie: member

Przykład
curl -X DELETE https://privatusanalytics.com/workspaces/:workspace_id/api_tokens/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "name": {
      "type": "string"
    },
    "token": {
      "anyOf": [
        {
          "type": "string",
          "description": "Sam token: zwracany tylko przy utworzeniu"
        },
        {
          "type": "null"
        }
      ]
    },
    "token_prefix": {
      "type": "string",
      "description": "Pierwsze znaki, po których można rozpoznać token"
    },
    "owner": {
      "type": "string",
      "description": "E-mail członka, który jest jego właścicielem"
    },
    "permissions": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Ograniczony do tych witryn (puste = wszystkie)"
    },
    "allowed_ips": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "oauth_client": {
      "anyOf": [
        {
          "type": "string",
          "description": "Klient MCP, który go otrzymał"
        },
        {
          "type": "null"
        }
      ]
    },
    "status": {
      "type": "string",
      "description": "active, expired lub revoked"
    },
    "expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_used_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "revoked_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /workspaces/:workspace_id/api_tokens.json Wyświetl tokeny API api_tokens_list

Uprawnienie: member

Przykład
curl https://privatusanalytics.com/workspaces/:workspace_id/api_tokens.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "include_revoked": {
      "type": "boolean",
      "description": "Wyświetl także unieważnione i wygasłe tokeny",
      "default": false
    },
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Strona (od 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Wyników na stronę (maks. 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "format": "uuid"
      },
      "name": {
        "type": "string"
      },
      "token": {
        "anyOf": [
          {
            "type": "string",
            "description": "Sam token: zwracany tylko przy utworzeniu"
          },
          {
            "type": "null"
          }
        ]
      },
      "token_prefix": {
        "type": "string",
        "description": "Pierwsze znaki, po których można rozpoznać token"
      },
      "owner": {
        "type": "string",
        "description": "E-mail członka, który jest jego właścicielem"
      },
      "permissions": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "site_ids": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Ograniczony do tych witryn (puste = wszystkie)"
      },
      "allowed_ips": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "oauth_client": {
        "anyOf": [
          {
            "type": "string",
            "description": "Klient MCP, który go otrzymał"
          },
          {
            "type": "null"
          }
        ]
      },
      "status": {
        "type": "string",
        "description": "active, expired lub revoked"
      },
      "expires_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "last_used_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "revoked_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}

Udostępnianie

GET /badge/:site_id.json Odznaka licznika odwiedzających (SVG) dla publicznej witryny badges_get

Uprawnienie: public · Tylko HTTP (nie jest narzędziem MCP)

Przykład
curl https://privatusanalytics.com/badge/:site_id.json
Dane wejściowe
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}
GET /share/:token/breakdown/:dimension.json Najczęstsze wartości udostępnionego wymiaru shares_breakdown

Uprawnienie: public

Przykład
curl https://privatusanalytics.com/share/:token/breakdown/:dimension.json
Dane wejściowe
{
  "type": "object",
  "properties": {
    "dimension": {
      "type": "string",
      "description": "Dimension zasobu"
    },
    "period": {
      "type": "string",
      "description": "Gotowy zakres dat (ignorowany, jeśli link go blokuje)",
      "enum": [
        "today",
        "yesterday",
        "24h",
        "7d",
        "14d",
        "28d",
        "30d",
        "90d",
        "mtd",
        "last_month",
        "qtd",
        "last_quarter",
        "ytd",
        "12mo",
        "last_year",
        "all",
        "custom"
      ],
      "default": "30d"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Początek własnego zakresu"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Koniec własnego zakresu, włącznie"
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Dodatkowe filtry, jeśli link na nie pozwala",
      "default": []
    },
    "limit": {
      "type": "integer",
      "description": "Wiersze (maks. 100)",
      "default": 10
    },
    "token": {
      "type": "string",
      "description": "Token zasobu"
    }
  },
  "required": [
    "dimension",
    "token"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}
GET /share/:token.json Przegląd udostępnionego pulpitu dla tokena udostępniania shares_overview

Uprawnienie: public

Przykład
curl https://privatusanalytics.com/share/:token.json
Dane wejściowe
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Gotowy zakres dat (ignorowany, jeśli link go blokuje)",
      "enum": [
        "today",
        "yesterday",
        "24h",
        "7d",
        "14d",
        "28d",
        "30d",
        "90d",
        "mtd",
        "last_month",
        "qtd",
        "last_quarter",
        "ytd",
        "12mo",
        "last_year",
        "all",
        "custom"
      ],
      "default": "30d"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Początek własnego zakresu"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Koniec własnego zakresu, włącznie"
    },
    "compare": {
      "type": "string",
      "description": "Okres porównawczy",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Dodatkowe filtry, jeśli link na nie pozwala: [[\"dimension\",\"operator\",\"value\"], …]",
      "default": []
    },
    "interval": {
      "type": "string",
      "description": "Rozmiar przedziału wykresu",
      "enum": [
        "auto",
        "minute",
        "hour",
        "day",
        "week",
        "month",
        "quarter",
        "year"
      ],
      "default": "auto"
    },
    "token": {
      "type": "string",
      "description": "Token zasobu"
    }
  },
  "required": [
    "token"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}

Uptime

POST /sites/:site_id/uptime.json Dodaj kontrolę uptime dla witryny uptime_checks_create

Uprawnienie: uptime.manage

Przykład
curl -X POST https://privatusanalytics.com/sites/:site_id/uptime.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nazwa wyświetlana (domyślnie cel)"
    },
    "kind": {
      "type": "string",
      "description": "http (kod statusu), keyword (treść zawiera), tcp (host:port) lub dns (nazwa się rozwiązuje)",
      "enum": [
        "http",
        "keyword",
        "tcp",
        "dns"
      ],
      "default": "http"
    },
    "url": {
      "type": "string",
      "description": "Adres URL dla kontroli http/keyword",
      "examples": [
        "https://example.com/health"
      ]
    },
    "host": {
      "type": "string",
      "description": "Nazwa hosta dla kontroli tcp/dns"
    },
    "port": {
      "type": "integer",
      "description": "Port TCP dla kontroli tcp"
    },
    "keyword": {
      "type": "string",
      "description": "Tekst, który musi zawierać treść odpowiedzi (keyword)"
    },
    "expected_status": {
      "type": "integer",
      "description": "Oczekiwany kod statusu HTTP",
      "default": 200
    },
    "http_method": {
      "type": "string",
      "description": "Metoda HTTP",
      "enum": [
        "GET",
        "HEAD"
      ],
      "default": "GET"
    },
    "interval_seconds": {
      "type": "integer",
      "description": "Sekundy między kontrolami (obowiązuje minimum planu, domyślnie 300 lub minimum)"
    },
    "timeout_seconds": {
      "type": "integer",
      "description": "Sekundy do przekroczenia limitu czasu sondy (1-30)",
      "default": 20
    },
    "public": {
      "type": "boolean",
      "description": "Może pojawiać się na publicznych stronach statusu",
      "default": false
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator kontroli (upc_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Witryna, do której należy kontrola"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "http, keyword, tcp lub dns"
    },
    "url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "host": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "port": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "keyword": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "expected_status": {
      "type": "integer"
    },
    "http_method": {
      "type": "string"
    },
    "interval_seconds": {
      "type": "integer"
    },
    "timeout_seconds": {
      "type": "integer"
    },
    "status": {
      "type": "string",
      "description": "up, down, pending lub paused"
    },
    "enabled": {
      "type": "boolean"
    },
    "public": {
      "type": "boolean",
      "description": "Może pojawiać się na stronach statusu"
    },
    "last_checked_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "next_check_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_response_ms": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "ssl_expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "ssl_issuer": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "domain_expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /uptime/checks/:id.json Usuń kontrolę uptime i jej historię uptime_checks_delete

Uprawnienie: uptime.manage

Przykład
curl -X DELETE https://privatusanalytics.com/uptime/checks/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator kontroli (upc_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Witryna, do której należy kontrola"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "http, keyword, tcp lub dns"
    },
    "url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "host": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "port": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "keyword": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "expected_status": {
      "type": "integer"
    },
    "http_method": {
      "type": "string"
    },
    "interval_seconds": {
      "type": "integer"
    },
    "timeout_seconds": {
      "type": "integer"
    },
    "status": {
      "type": "string",
      "description": "up, down, pending lub paused"
    },
    "enabled": {
      "type": "boolean"
    },
    "public": {
      "type": "boolean",
      "description": "Może pojawiać się na stronach statusu"
    },
    "last_checked_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "next_check_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_response_ms": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "ssl_expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "ssl_issuer": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "domain_expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/uptime.json Wyświetl kontrole uptime witryny uptime_checks_list

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/sites/:site_id/uptime.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Tylko kontrole w tym stanie",
      "enum": [
        "up",
        "down",
        "pending",
        "paused"
      ]
    },
    "query": {
      "type": "string",
      "description": "Filtruj według nazwy lub celu"
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Strona (od 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Wyników na stronę (maks. 100)"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Identyfikator kontroli (upc_…)"
      },
      "workspace_id": {
        "type": "string"
      },
      "site_id": {
        "anyOf": [
          {
            "type": "string",
            "description": "Witryna, do której należy kontrola"
          },
          {
            "type": "null"
          }
        ]
      },
      "name": {
        "type": "string"
      },
      "kind": {
        "type": "string",
        "description": "http, keyword, tcp lub dns"
      },
      "url": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "host": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "port": {
        "anyOf": [
          {
            "type": "integer"
          },
          {
            "type": "null"
          }
        ]
      },
      "keyword": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "expected_status": {
        "type": "integer"
      },
      "http_method": {
        "type": "string"
      },
      "interval_seconds": {
        "type": "integer"
      },
      "timeout_seconds": {
        "type": "integer"
      },
      "status": {
        "type": "string",
        "description": "up, down, pending lub paused"
      },
      "enabled": {
        "type": "boolean"
      },
      "public": {
        "type": "boolean",
        "description": "Może pojawiać się na stronach statusu"
      },
      "last_checked_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "next_check_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "last_response_ms": {
        "anyOf": [
          {
            "type": "integer"
          },
          {
            "type": "null"
          }
        ]
      },
      "ssl_expires_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "ssl_issuer": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "domain_expires_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
POST /uptime/checks/:id/pause.json Wstrzymaj kontrolę uptime uptime_checks_pause

Uprawnienie: uptime.manage

Przykład
curl -X POST https://privatusanalytics.com/uptime/checks/:id/pause.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator kontroli (upc_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Witryna, do której należy kontrola"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "http, keyword, tcp lub dns"
    },
    "url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "host": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "port": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "keyword": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "expected_status": {
      "type": "integer"
    },
    "http_method": {
      "type": "string"
    },
    "interval_seconds": {
      "type": "integer"
    },
    "timeout_seconds": {
      "type": "integer"
    },
    "status": {
      "type": "string",
      "description": "up, down, pending lub paused"
    },
    "enabled": {
      "type": "boolean"
    },
    "public": {
      "type": "boolean",
      "description": "Może pojawiać się na stronach statusu"
    },
    "last_checked_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "next_check_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_response_ms": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "ssl_expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "ssl_issuer": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "domain_expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /uptime/checks/:id/resume.json Wznów wstrzymaną kontrolę uptime uptime_checks_resume

Uprawnienie: uptime.manage

Przykład
curl -X POST https://privatusanalytics.com/uptime/checks/:id/resume.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator kontroli (upc_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Witryna, do której należy kontrola"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "http, keyword, tcp lub dns"
    },
    "url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "host": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "port": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "keyword": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "expected_status": {
      "type": "integer"
    },
    "http_method": {
      "type": "string"
    },
    "interval_seconds": {
      "type": "integer"
    },
    "timeout_seconds": {
      "type": "integer"
    },
    "status": {
      "type": "string",
      "description": "up, down, pending lub paused"
    },
    "enabled": {
      "type": "boolean"
    },
    "public": {
      "type": "boolean",
      "description": "Może pojawiać się na stronach statusu"
    },
    "last_checked_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "next_check_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_response_ms": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "ssl_expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "ssl_issuer": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "domain_expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /uptime/checks/:id.json Pobierz kontrolę uptime: uptime 24 h/7 d/30 d, czasy odpowiedzi i incydenty uptime_checks_get

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/uptime/checks/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "range": {
      "type": "string",
      "description": "Okno dla wykresu czasu odpowiedzi",
      "enum": [
        "24h",
        "7d",
        "30d"
      ],
      "default": "24h"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "check": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Identyfikator kontroli (upc_…)"
        },
        "workspace_id": {
          "type": "string"
        },
        "site_id": {
          "anyOf": [
            {
              "type": "string",
              "description": "Witryna, do której należy kontrola"
            },
            {
              "type": "null"
            }
          ]
        },
        "name": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "description": "http, keyword, tcp lub dns"
        },
        "url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "host": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "port": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "keyword": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "expected_status": {
          "type": "integer"
        },
        "http_method": {
          "type": "string"
        },
        "interval_seconds": {
          "type": "integer"
        },
        "timeout_seconds": {
          "type": "integer"
        },
        "status": {
          "type": "string",
          "description": "up, down, pending lub paused"
        },
        "enabled": {
          "type": "boolean"
        },
        "public": {
          "type": "boolean",
          "description": "Może pojawiać się na stronach statusu"
        },
        "last_checked_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "next_check_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "last_response_ms": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "ssl_expires_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "ssl_issuer": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "domain_expires_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "uptime": {
      "type": "object",
      "description": "Uptime w % dla 24h, 7d i 30d"
    },
    "range": {
      "type": "string",
      "description": "Okno dla response_times"
    },
    "response_times": {
      "type": "object",
      "description": "Średni czas odpowiedzi w ms na przedział: {unit, labels, series: {location: [ms…]}}"
    },
    "incidents": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "resolved_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "duration_seconds": {
            "type": "integer",
            "description": "Do tej pory, jeśli nadal otwarty"
          },
          "cause": {
            "anyOf": [
              {
                "type": "string",
                "description": "Najczęstszy błąd, np. timeout lub status_503"
              },
              {
                "type": "null"
              }
            ]
          },
          "failed_locations": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    }
  }
}
PATCH /uptime/checks/:id.json Zmień kontrolę uptime uptime_checks_update

Uprawnienie: uptime.manage

Przykład
curl -X PATCH https://privatusanalytics.com/uptime/checks/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nazwa wyświetlana (domyślnie cel)"
    },
    "kind": {
      "type": "string",
      "description": "http (kod statusu), keyword (treść zawiera), tcp (host:port) lub dns (nazwa się rozwiązuje)",
      "enum": [
        "http",
        "keyword",
        "tcp",
        "dns"
      ]
    },
    "url": {
      "type": "string",
      "description": "Adres URL dla kontroli http/keyword",
      "examples": [
        "https://example.com/health"
      ]
    },
    "host": {
      "type": "string",
      "description": "Nazwa hosta dla kontroli tcp/dns"
    },
    "port": {
      "type": "integer",
      "description": "Port TCP dla kontroli tcp"
    },
    "keyword": {
      "type": "string",
      "description": "Tekst, który musi zawierać treść odpowiedzi (keyword)"
    },
    "expected_status": {
      "type": "integer",
      "description": "Oczekiwany kod statusu HTTP"
    },
    "http_method": {
      "type": "string",
      "description": "Metoda HTTP",
      "enum": [
        "GET",
        "HEAD"
      ]
    },
    "interval_seconds": {
      "type": "integer",
      "description": "Sekundy między kontrolami (obowiązuje minimum planu, domyślnie 300 lub minimum)"
    },
    "timeout_seconds": {
      "type": "integer",
      "description": "Sekundy do przekroczenia limitu czasu sondy (1-30)"
    },
    "public": {
      "type": "boolean",
      "description": "Może pojawiać się na publicznych stronach statusu"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator kontroli (upc_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Witryna, do której należy kontrola"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "http, keyword, tcp lub dns"
    },
    "url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "host": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "port": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "keyword": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "expected_status": {
      "type": "integer"
    },
    "http_method": {
      "type": "string"
    },
    "interval_seconds": {
      "type": "integer"
    },
    "timeout_seconds": {
      "type": "integer"
    },
    "status": {
      "type": "string",
      "description": "up, down, pending lub paused"
    },
    "enabled": {
      "type": "boolean"
    },
    "public": {
      "type": "boolean",
      "description": "Może pojawiać się na stronach statusu"
    },
    "last_checked_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "next_check_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_response_ms": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "ssl_expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "ssl_issuer": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "domain_expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /uptime/probes.json Centrum danych sond, User-Agent i zakresy IP ruchu wychodzącego (do dodania naszych sond uptime na listę dozwolonych) uptime_probes_list

Uprawnienie: public · Tylko HTTP (nie jest narzędziem MCP)

Przykład
curl https://privatusanalytics.com/uptime/probes.json
Dane wejściowe
{
  "type": "object",
  "properties": {},
  "required": []
}
Dane odpowiedzi
{
  "type": "object"
}
POST /uptime/probes/results.json Prześlij wyniki z zewnętrznego agenta sondy (token sondy uptime typu Bearer) uptime_probes_results

Uprawnienie: public · Tylko HTTP (nie jest narzędziem MCP)

Przykład
curl -X POST https://privatusanalytics.com/uptime/probes/results.json \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "results": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "check_id": {
            "type": "string"
          },
          "location": {
            "type": "string"
          },
          "ok": {
            "type": "boolean"
          },
          "status_code": {
            "type": "integer"
          },
          "response_ms": {
            "type": "integer"
          },
          "error": {
            "type": "string"
          },
          "checked_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "description": "Wyniki sondy: [{check_id, location, ok, status_code, response_ms, error, checked_at}]"
    }
  },
  "required": [
    "results"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}
POST /workspaces/:workspace_id/uptime.json Dodaj kontrolę uptime przestrzeni roboczej (niezwiązaną z witryną) workspace_uptime_checks_create

Uprawnienie: uptime.manage

Przykład
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/uptime.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nazwa wyświetlana (domyślnie cel)"
    },
    "kind": {
      "type": "string",
      "description": "http (kod statusu), keyword (treść zawiera), tcp (host:port) lub dns (nazwa się rozwiązuje)",
      "enum": [
        "http",
        "keyword",
        "tcp",
        "dns"
      ],
      "default": "http"
    },
    "url": {
      "type": "string",
      "description": "Adres URL dla kontroli http/keyword",
      "examples": [
        "https://example.com/health"
      ]
    },
    "host": {
      "type": "string",
      "description": "Nazwa hosta dla kontroli tcp/dns"
    },
    "port": {
      "type": "integer",
      "description": "Port TCP dla kontroli tcp"
    },
    "keyword": {
      "type": "string",
      "description": "Tekst, który musi zawierać treść odpowiedzi (keyword)"
    },
    "expected_status": {
      "type": "integer",
      "description": "Oczekiwany kod statusu HTTP",
      "default": 200
    },
    "http_method": {
      "type": "string",
      "description": "Metoda HTTP",
      "enum": [
        "GET",
        "HEAD"
      ],
      "default": "GET"
    },
    "interval_seconds": {
      "type": "integer",
      "description": "Sekundy między kontrolami (obowiązuje minimum planu, domyślnie 300 lub minimum)"
    },
    "timeout_seconds": {
      "type": "integer",
      "description": "Sekundy do przekroczenia limitu czasu sondy (1-30)",
      "default": 20
    },
    "public": {
      "type": "boolean",
      "description": "Może pojawiać się na publicznych stronach statusu",
      "default": false
    },
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator kontroli (upc_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Witryna, do której należy kontrola"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "http, keyword, tcp lub dns"
    },
    "url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "host": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "port": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "keyword": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "expected_status": {
      "type": "integer"
    },
    "http_method": {
      "type": "string"
    },
    "interval_seconds": {
      "type": "integer"
    },
    "timeout_seconds": {
      "type": "integer"
    },
    "status": {
      "type": "string",
      "description": "up, down, pending lub paused"
    },
    "enabled": {
      "type": "boolean"
    },
    "public": {
      "type": "boolean",
      "description": "Może pojawiać się na stronach statusu"
    },
    "last_checked_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "next_check_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_response_ms": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "ssl_expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "ssl_issuer": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "domain_expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /workspaces/:workspace_id/uptime.json Wyświetl wszystkie kontrole uptime w przestrzeni roboczej workspace_uptime_checks_list

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/workspaces/:workspace_id/uptime.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Tylko kontrole w tym stanie",
      "enum": [
        "up",
        "down",
        "pending",
        "paused"
      ]
    },
    "query": {
      "type": "string",
      "description": "Filtruj według nazwy lub celu"
    },
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Strona (od 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Wyników na stronę (maks. 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Identyfikator kontroli (upc_…)"
      },
      "workspace_id": {
        "type": "string"
      },
      "site_id": {
        "anyOf": [
          {
            "type": "string",
            "description": "Witryna, do której należy kontrola"
          },
          {
            "type": "null"
          }
        ]
      },
      "name": {
        "type": "string"
      },
      "kind": {
        "type": "string",
        "description": "http, keyword, tcp lub dns"
      },
      "url": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "host": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "port": {
        "anyOf": [
          {
            "type": "integer"
          },
          {
            "type": "null"
          }
        ]
      },
      "keyword": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "expected_status": {
        "type": "integer"
      },
      "http_method": {
        "type": "string"
      },
      "interval_seconds": {
        "type": "integer"
      },
      "timeout_seconds": {
        "type": "integer"
      },
      "status": {
        "type": "string",
        "description": "up, down, pending lub paused"
      },
      "enabled": {
        "type": "boolean"
      },
      "public": {
        "type": "boolean",
        "description": "Może pojawiać się na stronach statusu"
      },
      "last_checked_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "next_check_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "last_response_ms": {
        "anyOf": [
          {
            "type": "integer"
          },
          {
            "type": "null"
          }
        ]
      },
      "ssl_expires_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "ssl_issuer": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "domain_expires_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}

Webhooki

GET /workspaces/:workspace_id/webhooks/:webhook_id/deliveries.json Wyświetl dostarczenia webhooka webhook_deliveries_list

Uprawnienie: workspace.manage

Przykład
curl https://privatusanalytics.com/workspaces/:workspace_id/webhooks/:webhook_id/deliveries.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Tylko udane lub nieudane dostarczenia",
      "enum": [
        "succeeded",
        "failed"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    },
    "webhook_id": {
      "type": "string",
      "description": "Webhook zasobu"
    },
    "page": {
      "type": "integer",
      "description": "Strona (od 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Wyników na stronę (maks. 100)"
    }
  },
  "required": [
    "workspace_id",
    "webhook_id"
  ]
}
Dane odpowiedzi
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Identyfikator dostarczenia, np. whd_123"
      },
      "event": {
        "type": "string"
      },
      "status": {
        "type": "string",
        "description": "pending, succeeded lub failed"
      },
      "status_code": {
        "anyOf": [
          {
            "type": "integer",
            "description": "Status HTTP ostatniej próby"
          },
          {
            "type": "null"
          }
        ]
      },
      "error": {
        "anyOf": [
          {
            "type": "string",
            "description": "Błąd połączenia ostatniej próby"
          },
          {
            "type": "null"
          }
        ]
      },
      "attempt": {
        "type": "integer"
      },
      "duration_ms": {
        "anyOf": [
          {
            "type": "integer"
          },
          {
            "type": "null"
          }
        ]
      },
      "payload": {
        "type": "object"
      },
      "response_body": {
        "anyOf": [
          {
            "type": "string",
            "description": "Pierwsze 2000 znaków"
          },
          {
            "type": "null"
          }
        ]
      },
      "delivered_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
POST /workspaces/:workspace_id/webhooks/:webhook_id/deliveries/:id/redeliver.json Wyślij dostarczenie ponownie webhook_deliveries_redeliver

Uprawnienie: workspace.manage

Przykład
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/webhooks/:webhook_id/deliveries/:id/redeliver.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    },
    "webhook_id": {
      "type": "string",
      "description": "Webhook zasobu"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "workspace_id",
    "webhook_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator dostarczenia, np. whd_123"
    },
    "event": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "description": "pending, succeeded lub failed"
    },
    "status_code": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Status HTTP ostatniej próby"
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "anyOf": [
        {
          "type": "string",
          "description": "Błąd połączenia ostatniej próby"
        },
        {
          "type": "null"
        }
      ]
    },
    "attempt": {
      "type": "integer"
    },
    "duration_ms": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "payload": {
      "type": "object"
    },
    "response_body": {
      "anyOf": [
        {
          "type": "string",
          "description": "Pierwsze 2000 znaków"
        },
        {
          "type": "null"
        }
      ]
    },
    "delivered_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /workspaces/:workspace_id/webhooks.json Dodaj endpoint webhooka webhooks_create

Uprawnienie: workspace.manage

Przykład
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/webhooks.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Endpoint HTTPS, który odbiera wysyłany metodą POST JSON",
      "examples": [
        "https://example.com/hooks/privatus"
      ]
    },
    "events": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "alert.triggered",
          "alert.resolved",
          "goal.completed_threshold",
          "uptime.down",
          "uptime.up",
          "export.ready",
          "import.completed",
          "import.failed",
          "site.created",
          "site.deleted",
          "member.added",
          "usage.threshold"
        ]
      },
      "description": "Zdarzenia do wysyłania"
    },
    "enabled": {
      "type": "boolean",
      "description": "Wysyłaj dostarczenia",
      "default": true
    },
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "url",
    "events",
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator webhooka, np. wh_7Q2K9XH3AB"
    },
    "url": {
      "type": "string"
    },
    "events": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "enabled": {
      "type": "boolean"
    },
    "status": {
      "type": "string",
      "description": "active, failing lub disabled"
    },
    "secret": {
      "type": "string",
      "description": "Sekret podpisujący dla Privatus-Signature"
    },
    "consecutive_failures": {
      "type": "integer"
    },
    "last_success_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_failure_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /workspaces/:workspace_id/webhooks/:id.json Usuń webhook webhooks_delete

Uprawnienie: workspace.manage

Przykład
curl -X DELETE https://privatusanalytics.com/workspaces/:workspace_id/webhooks/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator webhooka, np. wh_7Q2K9XH3AB"
    },
    "url": {
      "type": "string"
    },
    "events": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "enabled": {
      "type": "boolean"
    },
    "status": {
      "type": "string",
      "description": "active, failing lub disabled"
    },
    "secret": {
      "type": "string",
      "description": "Sekret podpisujący dla Privatus-Signature"
    },
    "consecutive_failures": {
      "type": "integer"
    },
    "last_success_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_failure_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /workspaces/:workspace_id/webhooks.json Wyświetl webhooki webhooks_list

Uprawnienie: workspace.manage

Przykład
curl https://privatusanalytics.com/workspaces/:workspace_id/webhooks.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Strona (od 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Wyników na stronę (maks. 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Identyfikator webhooka, np. wh_7Q2K9XH3AB"
      },
      "url": {
        "type": "string"
      },
      "events": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "enabled": {
        "type": "boolean"
      },
      "status": {
        "type": "string",
        "description": "active, failing lub disabled"
      },
      "secret": {
        "type": "string",
        "description": "Sekret podpisujący dla Privatus-Signature"
      },
      "consecutive_failures": {
        "type": "integer"
      },
      "last_success_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "last_failure_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
GET /workspaces/:workspace_id/webhooks/:id.json Pobierz webhook webhooks_get

Uprawnienie: workspace.manage

Przykład
curl https://privatusanalytics.com/workspaces/:workspace_id/webhooks/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator webhooka, np. wh_7Q2K9XH3AB"
    },
    "url": {
      "type": "string"
    },
    "events": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "enabled": {
      "type": "boolean"
    },
    "status": {
      "type": "string",
      "description": "active, failing lub disabled"
    },
    "secret": {
      "type": "string",
      "description": "Sekret podpisujący dla Privatus-Signature"
    },
    "consecutive_failures": {
      "type": "integer"
    },
    "last_success_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_failure_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /workspaces/:workspace_id/webhooks/:id/test.json Wyślij testowe dostarczenie webhooks_test

Uprawnienie: workspace.manage

Przykład
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/webhooks/:id/test.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator dostarczenia, np. whd_123"
    },
    "event": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "description": "pending, succeeded lub failed"
    },
    "status_code": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Status HTTP ostatniej próby"
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "anyOf": [
        {
          "type": "string",
          "description": "Błąd połączenia ostatniej próby"
        },
        {
          "type": "null"
        }
      ]
    },
    "attempt": {
      "type": "integer"
    },
    "duration_ms": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "payload": {
      "type": "object"
    },
    "response_body": {
      "anyOf": [
        {
          "type": "string",
          "description": "Pierwsze 2000 znaków"
        },
        {
          "type": "null"
        }
      ]
    },
    "delivered_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
PATCH /workspaces/:workspace_id/webhooks/:id.json Zaktualizuj webhook (zdarzenia, URL, włączenie, zmiana sekretu) webhooks_update

Uprawnienie: workspace.manage

Przykład
curl -X PATCH https://privatusanalytics.com/workspaces/:workspace_id/webhooks/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Endpoint HTTPS"
    },
    "events": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "alert.triggered",
          "alert.resolved",
          "goal.completed_threshold",
          "uptime.down",
          "uptime.up",
          "export.ready",
          "import.completed",
          "import.failed",
          "site.created",
          "site.deleted",
          "member.added",
          "usage.threshold"
        ]
      },
      "description": "Zdarzenia do wysyłania"
    },
    "enabled": {
      "type": "boolean",
      "description": "Wysyłaj dostarczenia"
    },
    "rotate_secret": {
      "type": "boolean",
      "description": "Zastąp sekret podpisujący",
      "default": false
    },
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator webhooka, np. wh_7Q2K9XH3AB"
    },
    "url": {
      "type": "string"
    },
    "events": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "enabled": {
      "type": "boolean"
    },
    "status": {
      "type": "string",
      "description": "active, failing lub disabled"
    },
    "secret": {
      "type": "string",
      "description": "Sekret podpisujący dla Privatus-Signature"
    },
    "consecutive_failures": {
      "type": "integer"
    },
    "last_success_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_failure_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Witryny

POST /sites/:site_id/data_reset.json Usuń wszystkie zdarzenia i wizyty w zakresie dat (działa w tle, nie można cofnąć) sites_reset_data

Uprawnienie: sites.manage

Przykład
curl -X POST https://privatusanalytics.com/sites/:site_id/data_reset.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "from": {
      "type": "string",
      "format": "date",
      "description": "Pierwszy dzień do usunięcia (strefa czasowa witryny)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Ostatni dzień do usunięcia, włącznie"
    },
    "confirm": {
      "type": "string",
      "description": "Wpisz domenę, aby potwierdzić"
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "from",
    "to",
    "confirm",
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}
GET /sites/:site_id/filter_stats.json Podsumowanie odfiltrowanego ruchu: boty, reguły ruchu lub redakcje danych osobowych według powodu i kraju (tylko liczby) sites_filter_stats

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/sites/:site_id/filter_stats.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "description": "bot (odfiltrowane boty), rule (reguły ruchu) lub redaction (czyszczenie danych osobowych)",
      "enum": [
        "bot",
        "rule",
        "redaction"
      ],
      "default": "bot"
    },
    "days": {
      "type": "integer",
      "description": "Ile dni wstecz (1-395)",
      "default": 30
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}
GET /sites/:site_id/access.json Wyświetl członków i informację, czy widzą tę witrynę sites_access_list

Uprawnienie: members.manage

Przykład
curl https://privatusanalytics.com/sites/:site_id/access.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "membership_id": {
      "type": "string",
      "format": "uuid",
      "description": "Identyfikator członkostwa"
    },
    "email": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "role": {
      "type": "string"
    },
    "access": {
      "type": "boolean",
      "description": "Może widzieć tę witrynę"
    },
    "locked": {
      "type": "boolean",
      "description": "Właściciele i administratorzy zawsze mają dostęp"
    }
  }
}
PATCH /sites/:site_id/access.json Przyznaj lub odbierz jednemu członkowi dostęp do tej witryny sites_access_update

Uprawnienie: members.manage

Przykład
curl -X PATCH https://privatusanalytics.com/sites/:site_id/access.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "membership_id": {
      "type": "string",
      "description": "Identyfikator członkostwa z sites_access_list"
    },
    "access": {
      "type": "boolean",
      "description": "true, aby przyznać dostęp, false, aby go odebrać"
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "membership_id",
    "access",
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "membership_id": {
      "type": "string",
      "format": "uuid",
      "description": "Identyfikator członkostwa"
    },
    "email": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "role": {
      "type": "string"
    },
    "access": {
      "type": "boolean",
      "description": "Może widzieć tę witrynę"
    },
    "locked": {
      "type": "boolean",
      "description": "Właściciele i administratorzy zawsze mają dostęp"
    }
  }
}
POST /sites/:site_id/favorite.json Oznacz witrynę gwiazdką (przypięta na początku w widoku Wszystkie witryny) sites_favorite

Uprawnienie: analytics.read

Przykład
curl -X POST https://privatusanalytics.com/sites/:site_id/favorite.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator witryny używany we fragmencie kodu śledzenia"
    },
    "workspace_id": {
      "type": "string"
    },
    "domain": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "extra_domains": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "multi_domain_mode": {
      "type": "string"
    },
    "timezone": {
      "type": "string"
    },
    "currency": {
      "type": "string"
    },
    "week_start": {
      "type": "integer"
    },
    "labels": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "honor_dnt": {
      "type": "boolean"
    },
    "honor_gpc": {
      "type": "boolean"
    },
    "pii_scrubber": {
      "type": "boolean"
    },
    "redaction_rules": {
      "type": "array"
    },
    "allowed_params": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "path_masks": {
      "type": "array"
    },
    "retention_months": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "bot_filtering": {
      "type": "boolean"
    },
    "traffic_rule_modes": {
      "type": "object"
    },
    "vitals_sample_rate": {
      "type": "integer"
    },
    "conversion_denominator": {
      "type": "string"
    },
    "public_dashboard": {
      "type": "boolean"
    },
    "public_indexable": {
      "type": "boolean"
    },
    "ingest_key_prefix": {
      "anyOf": [
        {
          "type": "string",
          "description": "Początek klucza ingest serwera"
        },
        {
          "type": "null"
        }
      ]
    },
    "verified_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "first_event_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_event_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "snippet": {
      "type": "string",
      "description": "Fragment kodu śledzenia HTML"
    },
    "favorite": {
      "type": "boolean",
      "description": "Oznaczona przez Ciebie gwiazdką"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:site_id/favorite.json Usuń gwiazdkę z witryny sites_unfavorite

Uprawnienie: analytics.read

Przykład
curl -X DELETE https://privatusanalytics.com/sites/:site_id/favorite.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator witryny używany we fragmencie kodu śledzenia"
    },
    "workspace_id": {
      "type": "string"
    },
    "domain": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "extra_domains": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "multi_domain_mode": {
      "type": "string"
    },
    "timezone": {
      "type": "string"
    },
    "currency": {
      "type": "string"
    },
    "week_start": {
      "type": "integer"
    },
    "labels": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "honor_dnt": {
      "type": "boolean"
    },
    "honor_gpc": {
      "type": "boolean"
    },
    "pii_scrubber": {
      "type": "boolean"
    },
    "redaction_rules": {
      "type": "array"
    },
    "allowed_params": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "path_masks": {
      "type": "array"
    },
    "retention_months": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "bot_filtering": {
      "type": "boolean"
    },
    "traffic_rule_modes": {
      "type": "object"
    },
    "vitals_sample_rate": {
      "type": "integer"
    },
    "conversion_denominator": {
      "type": "string"
    },
    "public_dashboard": {
      "type": "boolean"
    },
    "public_indexable": {
      "type": "boolean"
    },
    "ingest_key_prefix": {
      "anyOf": [
        {
          "type": "string",
          "description": "Początek klucza ingest serwera"
        },
        {
          "type": "null"
        }
      ]
    },
    "verified_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "first_event_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_event_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "snippet": {
      "type": "string",
      "description": "Fragment kodu śledzenia HTML"
    },
    "favorite": {
      "type": "boolean",
      "description": "Oznaczona przez Ciebie gwiazdką"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/setup.json Stan instalacji i fragment kodu witryny sites_setup_get

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/sites/:site_id/setup.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}
POST /transfers/:token/accept.json Zaakceptuj przeniesienie witryny do jednej z Twoich przestrzeni roboczych site_transfers_accept

Uprawnienie: public

Przykład
curl -X POST https://privatusanalytics.com/transfers/:token/accept.json \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Przestrzeń robocza, do której przenieść witrynę (ws_…)"
    },
    "token": {
      "type": "string",
      "description": "Token zasobu"
    }
  },
  "required": [
    "workspace_id",
    "token"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Przenoszona witryna"
    },
    "site_domain": {
      "type": "string"
    },
    "from_workspace": {
      "type": "string",
      "description": "Nazwa obecnej przestrzeni roboczej"
    },
    "to_workspace_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Przestrzeń robocza docelowa"
        },
        {
          "type": "null"
        }
      ]
    },
    "to_email": {
      "type": "string",
      "description": "E-mail odbiorcy"
    },
    "status": {
      "type": "string",
      "description": "pending, accepted lub canceled"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /sites/:site_id/transfer.json Rozpocznij przenoszenie witryny do innej przestrzeni roboczej (wysyła e-mail do odbiorcy) sites_transfer_start

Uprawnienie: sites.manage

Przykład
curl -X POST https://privatusanalytics.com/sites/:site_id/transfer.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "description": "E-mail osoby, która otrzyma witrynę (wybierze jedną ze swoich przestrzeni roboczych)"
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "email",
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Przenoszona witryna"
    },
    "site_domain": {
      "type": "string"
    },
    "from_workspace": {
      "type": "string",
      "description": "Nazwa obecnej przestrzeni roboczej"
    },
    "to_workspace_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Przestrzeń robocza docelowa"
        },
        {
          "type": "null"
        }
      ]
    },
    "to_email": {
      "type": "string",
      "description": "E-mail odbiorcy"
    },
    "status": {
      "type": "string",
      "description": "pending, accepted lub canceled"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:site_id/transfer.json Anuluj oczekujące przeniesienie witryny sites_transfer_cancel

Uprawnienie: sites.manage

Przykład
curl -X DELETE https://privatusanalytics.com/sites/:site_id/transfer.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Przenoszona witryna"
    },
    "site_domain": {
      "type": "string"
    },
    "from_workspace": {
      "type": "string",
      "description": "Nazwa obecnej przestrzeni roboczej"
    },
    "to_workspace_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Przestrzeń robocza docelowa"
        },
        {
          "type": "null"
        }
      ]
    },
    "to_email": {
      "type": "string",
      "description": "E-mail odbiorcy"
    },
    "status": {
      "type": "string",
      "description": "pending, accepted lub canceled"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /transfers/:token.json Pobierz oczekujące przeniesienie na podstawie tokena z e-maila site_transfers_get

Uprawnienie: public

Przykład
curl https://privatusanalytics.com/transfers/:token.json
Dane wejściowe
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Token zasobu"
    }
  },
  "required": [
    "token"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Przenoszona witryna"
    },
    "site_domain": {
      "type": "string"
    },
    "from_workspace": {
      "type": "string",
      "description": "Nazwa obecnej przestrzeni roboczej"
    },
    "to_workspace_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Przestrzeń robocza docelowa"
        },
        {
          "type": "null"
        }
      ]
    },
    "to_email": {
      "type": "string",
      "description": "E-mail odbiorcy"
    },
    "status": {
      "type": "string",
      "description": "pending, accepted lub canceled"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /workspaces/:workspace_id/sites.json Dodaj witrynę sites_create

Uprawnienie: sites.manage

Przykład
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/sites.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "domain": {
      "type": "string",
      "description": "Domena główna, np. example.com",
      "examples": [
        "example.com"
      ]
    },
    "name": {
      "type": "string",
      "description": "Nazwa wyświetlana (domyślnie domena)"
    },
    "timezone": {
      "type": "string",
      "description": "Strefa czasowa raportowania"
    },
    "currency": {
      "type": "string",
      "description": "Waluta przychodu (ISO 4217)"
    },
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "domain",
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator witryny używany we fragmencie kodu śledzenia"
    },
    "workspace_id": {
      "type": "string"
    },
    "domain": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "extra_domains": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "multi_domain_mode": {
      "type": "string"
    },
    "timezone": {
      "type": "string"
    },
    "currency": {
      "type": "string"
    },
    "week_start": {
      "type": "integer"
    },
    "labels": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "honor_dnt": {
      "type": "boolean"
    },
    "honor_gpc": {
      "type": "boolean"
    },
    "pii_scrubber": {
      "type": "boolean"
    },
    "redaction_rules": {
      "type": "array"
    },
    "allowed_params": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "path_masks": {
      "type": "array"
    },
    "retention_months": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "bot_filtering": {
      "type": "boolean"
    },
    "traffic_rule_modes": {
      "type": "object"
    },
    "vitals_sample_rate": {
      "type": "integer"
    },
    "conversion_denominator": {
      "type": "string"
    },
    "public_dashboard": {
      "type": "boolean"
    },
    "public_indexable": {
      "type": "boolean"
    },
    "ingest_key_prefix": {
      "anyOf": [
        {
          "type": "string",
          "description": "Początek klucza ingest serwera"
        },
        {
          "type": "null"
        }
      ]
    },
    "verified_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "first_event_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_event_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "snippet": {
      "type": "string",
      "description": "Fragment kodu śledzenia HTML"
    },
    "favorite": {
      "type": "boolean",
      "description": "Oznaczona przez Ciebie gwiazdką"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:id.json Usuń witrynę (trwale czyszczona po 7 dniach) sites_delete

Uprawnienie: sites.manage

Przykład
curl -X DELETE https://privatusanalytics.com/sites/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "confirm": {
      "type": "string",
      "description": "Wpisz domenę, aby potwierdzić"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "confirm",
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator witryny używany we fragmencie kodu śledzenia"
    },
    "workspace_id": {
      "type": "string"
    },
    "domain": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "extra_domains": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "multi_domain_mode": {
      "type": "string"
    },
    "timezone": {
      "type": "string"
    },
    "currency": {
      "type": "string"
    },
    "week_start": {
      "type": "integer"
    },
    "labels": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "honor_dnt": {
      "type": "boolean"
    },
    "honor_gpc": {
      "type": "boolean"
    },
    "pii_scrubber": {
      "type": "boolean"
    },
    "redaction_rules": {
      "type": "array"
    },
    "allowed_params": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "path_masks": {
      "type": "array"
    },
    "retention_months": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "bot_filtering": {
      "type": "boolean"
    },
    "traffic_rule_modes": {
      "type": "object"
    },
    "vitals_sample_rate": {
      "type": "integer"
    },
    "conversion_denominator": {
      "type": "string"
    },
    "public_dashboard": {
      "type": "boolean"
    },
    "public_indexable": {
      "type": "boolean"
    },
    "ingest_key_prefix": {
      "anyOf": [
        {
          "type": "string",
          "description": "Początek klucza ingest serwera"
        },
        {
          "type": "null"
        }
      ]
    },
    "verified_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "first_event_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_event_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "snippet": {
      "type": "string",
      "description": "Fragment kodu śledzenia HTML"
    },
    "favorite": {
      "type": "boolean",
      "description": "Oznaczona przez Ciebie gwiazdką"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /workspaces/:workspace_id/sites.json Wyświetl witryny w przestrzeni roboczej sites_list

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/workspaces/:workspace_id/sites.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "description": "Filtruj według domeny lub nazwy"
    },
    "label": {
      "type": "string",
      "description": "Tylko witryny z tą etykietą"
    },
    "sort": {
      "type": "string",
      "description": "position (Twoja kolejność), name lub visitors w ostatnich 30 dniach (najpierw najwięcej)",
      "enum": [
        "position",
        "name",
        "visitors"
      ],
      "default": "position"
    },
    "workspace_id": {
      "type": "string",
      "description": "Identyfikator przestrzeni roboczej, np. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Strona (od 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Wyników na stronę (maks. 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dane odpowiedzi
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Identyfikator witryny używany we fragmencie kodu śledzenia"
      },
      "workspace_id": {
        "type": "string"
      },
      "domain": {
        "type": "string"
      },
      "name": {
        "type": "string"
      },
      "extra_domains": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "multi_domain_mode": {
        "type": "string"
      },
      "timezone": {
        "type": "string"
      },
      "currency": {
        "type": "string"
      },
      "week_start": {
        "type": "integer"
      },
      "labels": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "honor_dnt": {
        "type": "boolean"
      },
      "honor_gpc": {
        "type": "boolean"
      },
      "pii_scrubber": {
        "type": "boolean"
      },
      "redaction_rules": {
        "type": "array"
      },
      "allowed_params": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "path_masks": {
        "type": "array"
      },
      "retention_months": {
        "anyOf": [
          {
            "type": "integer"
          },
          {
            "type": "null"
          }
        ]
      },
      "bot_filtering": {
        "type": "boolean"
      },
      "traffic_rule_modes": {
        "type": "object"
      },
      "vitals_sample_rate": {
        "type": "integer"
      },
      "conversion_denominator": {
        "type": "string"
      },
      "public_dashboard": {
        "type": "boolean"
      },
      "public_indexable": {
        "type": "boolean"
      },
      "ingest_key_prefix": {
        "anyOf": [
          {
            "type": "string",
            "description": "Początek klucza ingest serwera"
          },
          {
            "type": "null"
          }
        ]
      },
      "verified_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "first_event_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "last_event_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "snippet": {
        "type": "string",
        "description": "Fragment kodu śledzenia HTML"
      },
      "favorite": {
        "type": "boolean",
        "description": "Oznaczona przez Ciebie gwiazdką"
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
GET /sites/:id.json Pobierz witrynę i wszystkie jej ustawienia sites_get

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/sites/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator witryny używany we fragmencie kodu śledzenia"
    },
    "workspace_id": {
      "type": "string"
    },
    "domain": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "extra_domains": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "multi_domain_mode": {
      "type": "string"
    },
    "timezone": {
      "type": "string"
    },
    "currency": {
      "type": "string"
    },
    "week_start": {
      "type": "integer"
    },
    "labels": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "honor_dnt": {
      "type": "boolean"
    },
    "honor_gpc": {
      "type": "boolean"
    },
    "pii_scrubber": {
      "type": "boolean"
    },
    "redaction_rules": {
      "type": "array"
    },
    "allowed_params": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "path_masks": {
      "type": "array"
    },
    "retention_months": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "bot_filtering": {
      "type": "boolean"
    },
    "traffic_rule_modes": {
      "type": "object"
    },
    "vitals_sample_rate": {
      "type": "integer"
    },
    "conversion_denominator": {
      "type": "string"
    },
    "public_dashboard": {
      "type": "boolean"
    },
    "public_indexable": {
      "type": "boolean"
    },
    "ingest_key_prefix": {
      "anyOf": [
        {
          "type": "string",
          "description": "Początek klucza ingest serwera"
        },
        {
          "type": "null"
        }
      ]
    },
    "verified_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "first_event_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_event_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "snippet": {
      "type": "string",
      "description": "Fragment kodu śledzenia HTML"
    },
    "favorite": {
      "type": "boolean",
      "description": "Oznaczona przez Ciebie gwiazdką"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
PATCH /sites/:id.json Zaktualizuj ustawienia witryny sites_update

Uprawnienie: sites.manage

Przykład
curl -X PATCH https://privatusanalytics.com/sites/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nazwa wyświetlana"
    },
    "domain": {
      "type": "string",
      "description": "Domena główna"
    },
    "extra_domains": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Dodatkowe nazwy hostów"
    },
    "multi_domain_mode": {
      "type": "string",
      "description": "combined: jeden odwiedzający we wszystkich domenach",
      "enum": [
        "combined",
        "separate"
      ]
    },
    "timezone": {
      "type": "string",
      "description": "Strefa czasowa raportowania"
    },
    "currency": {
      "type": "string",
      "description": "Waluta przychodu (ISO 4217)"
    },
    "week_start": {
      "type": "integer",
      "description": "0 = niedziela, 1 = poniedziałek"
    },
    "labels": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Etykiety do grupowania witryn"
    },
    "honor_dnt": {
      "type": "boolean",
      "description": "Pomijaj odwiedzających wysyłających DNT"
    },
    "honor_gpc": {
      "type": "boolean",
      "description": "Pomijaj odwiedzających wysyłających GPC"
    },
    "pii_scrubber": {
      "type": "boolean",
      "description": "Ukrywaj adresy e-mail, tokeny, identyfikatory"
    },
    "redaction_rules": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "pattern": {
            "type": "string"
          }
        }
      },
      "description": "Własne wyrażenia regularne do ukrywania danych"
    },
    "allowed_params": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Parametry zapytania do zachowania w ścieżkach"
    },
    "path_masks": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "pattern": {
            "type": "string"
          },
          "replacement": {
            "type": "string"
          }
        }
      },
      "description": "Reguły maskowania ścieżek, np. /u/* -> /u/:id"
    },
    "retention_months": {
      "type": "integer",
      "description": "Usuwaj dane starsze niż to"
    },
    "bot_filtering": {
      "type": "boolean",
      "description": "Filtruj ruch botów"
    },
    "traffic_rule_modes": {
      "type": "object",
      "additionalProperties": true,
      "description": "block lub allow dla każdej listy reguł ruchu"
    },
    "vitals_sample_rate": {
      "type": "integer",
      "description": "Próbkowanie Web Vitals w %"
    },
    "conversion_denominator": {
      "type": "string",
      "description": "Współczynnik konwersji względem wizyt lub odwiedzających",
      "enum": [
        "visits",
        "visitors"
      ]
    },
    "public_dashboard": {
      "type": "boolean",
      "description": "Każdy z linkiem może zobaczyć statystyki"
    },
    "public_indexable": {
      "type": "boolean",
      "description": "Pozwól wyszukiwarkom indeksować stronę publiczną"
    },
    "id": {
      "type": "string",
      "description": "Id zasobu"
    }
  },
  "required": [
    "id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator witryny używany we fragmencie kodu śledzenia"
    },
    "workspace_id": {
      "type": "string"
    },
    "domain": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "extra_domains": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "multi_domain_mode": {
      "type": "string"
    },
    "timezone": {
      "type": "string"
    },
    "currency": {
      "type": "string"
    },
    "week_start": {
      "type": "integer"
    },
    "labels": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "honor_dnt": {
      "type": "boolean"
    },
    "honor_gpc": {
      "type": "boolean"
    },
    "pii_scrubber": {
      "type": "boolean"
    },
    "redaction_rules": {
      "type": "array"
    },
    "allowed_params": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "path_masks": {
      "type": "array"
    },
    "retention_months": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "bot_filtering": {
      "type": "boolean"
    },
    "traffic_rule_modes": {
      "type": "object"
    },
    "vitals_sample_rate": {
      "type": "integer"
    },
    "conversion_denominator": {
      "type": "string"
    },
    "public_dashboard": {
      "type": "boolean"
    },
    "public_indexable": {
      "type": "boolean"
    },
    "ingest_key_prefix": {
      "anyOf": [
        {
          "type": "string",
          "description": "Początek klucza ingest serwera"
        },
        {
          "type": "null"
        }
      ]
    },
    "verified_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "first_event_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_event_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "snippet": {
      "type": "string",
      "description": "Fragment kodu śledzenia HTML"
    },
    "favorite": {
      "type": "boolean",
      "description": "Oznaczona przez Ciebie gwiazdką"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Wydajność

GET /sites/:site_id/performance.json Web Vitals: karta wyników p75, trend dzienny i podziały według strony, urządzenia, przeglądarki i kraju performance_report

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/sites/:site_id/performance.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Gotowy zakres dat. Użyj custom z from/to",
      "enum": [
        "today",
        "yesterday",
        "24h",
        "7d",
        "14d",
        "28d",
        "30d",
        "90d",
        "mtd",
        "last_month",
        "qtd",
        "last_quarter",
        "ytd",
        "12mo",
        "last_year",
        "all",
        "custom"
      ],
      "default": "30d"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Początek własnego zakresu (strefa czasowa witryny)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Koniec własnego zakresu, włącznie"
    },
    "compare": {
      "type": "string",
      "description": "Okres porównawczy",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Początek własnego okresu porównawczego"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Koniec własnego okresu porównawczego"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Dopasuj dni tygodnia w porównaniu",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtry: [[\"dimension\",\"operator\",\"value\"], …]. Operatory: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Opakuj warunki w {\"any\": [...]}, aby uzyskać OR.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Zastosuj zapisany segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Dodaj zaimportowane dane historyczne (daty przed pierwszym natywnym zdarzeniem, ignorowane przy filtrach lub segmencie)",
      "default": false
    },
    "metric": {
      "type": "string",
      "description": "Metryka dla trendu i podziałów",
      "enum": [
        "LCP",
        "INP",
        "CLS",
        "FCP",
        "TTFB"
      ],
      "default": "LCP"
    },
    "limit": {
      "type": "integer",
      "description": "Wierszy na podział (maks. 100)",
      "default": 10
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}

Wyszukiwanie

GET /sites/:site_id/search.json Raport wyszukiwania: kliknięcia, wyświetlenia, CTR, pozycja, najlepsze zapytania i strony, strony docelowe i szanse search_report

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/sites/:site_id/search.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Gotowy zakres dat. Użyj custom z from/to",
      "enum": [
        "today",
        "yesterday",
        "24h",
        "7d",
        "14d",
        "28d",
        "30d",
        "90d",
        "mtd",
        "last_month",
        "qtd",
        "last_quarter",
        "ytd",
        "12mo",
        "last_year",
        "all",
        "custom"
      ],
      "default": "30d"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Początek własnego zakresu (strefa czasowa witryny)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Koniec własnego zakresu, włącznie"
    },
    "compare": {
      "type": "string",
      "description": "Okres porównawczy",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Początek własnego okresu porównawczego"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Koniec własnego okresu porównawczego"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Dopasuj dni tygodnia w porównaniu",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtry: [[\"dimension\",\"operator\",\"value\"], …]. Operatory: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Opakuj warunki w {\"any\": [...]}, aby uzyskać OR.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Zastosuj zapisany segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Dodaj zaimportowane dane historyczne (daty przed pierwszym natywnym zdarzeniem, ignorowane przy filtrach lub segmencie)",
      "default": false
    },
    "provider": {
      "type": "string",
      "description": "google (Search Console) lub bing",
      "enum": [
        "google",
        "bing"
      ],
      "default": "google"
    },
    "limit": {
      "type": "integer",
      "description": "Wierszy na tabelę (maks. 100)",
      "default": 25
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}
POST /sites/:site_id/search/connections.json Połącz usługę Search Console lub witrynę Bing search_connect

Uprawnienie: sites.manage

Przykład
curl -X POST https://privatusanalytics.com/sites/:site_id/search/connections.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "provider": {
      "type": "string",
      "description": "google lub bing",
      "enum": [
        "google",
        "bing"
      ],
      "default": "google"
    },
    "property": {
      "type": "string",
      "description": "Usługa Search Console (np. sc-domain:example.com) lub adres URL witryny Bing",
      "examples": [
        "sc-domain:example.com"
      ]
    },
    "bing_api_key": {
      "type": "string",
      "description": "Twój własny klucz API Bing Webmaster Tools (Settings > API access). Wymagany, gdy provider to bing. Przechowywany w postaci zaszyfrowanej i nigdy nie jest zwracany."
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "property",
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "provider": {
      "type": "string",
      "description": "google lub bing"
    },
    "property": {
      "type": "string",
      "description": "Usługa Search Console lub adres URL witryny Bing"
    },
    "status": {
      "type": "string",
      "description": "active lub error"
    },
    "last_synced_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:site_id/search/connections/:provider.json Odłącz Search Console lub Bing i usuń ich dane search_disconnect

Uprawnienie: sites.manage

Przykład
curl -X DELETE https://privatusanalytics.com/sites/:site_id/search/connections/:provider.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    },
    "provider": {
      "type": "string",
      "description": "Provider zasobu"
    }
  },
  "required": [
    "site_id",
    "provider"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "provider": {
      "type": "string",
      "description": "google lub bing"
    },
    "property": {
      "type": "string",
      "description": "Usługa Search Console lub adres URL witryny Bing"
    },
    "status": {
      "type": "string",
      "description": "active lub error"
    },
    "last_synced_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /sites/:site_id/search/properties.json Wyświetl usługi, które możesz połączyć (Search Console wymaga zgody Google z przeglądarki) search_properties

Uprawnienie: sites.manage

Przykład
curl -X POST https://privatusanalytics.com/sites/:site_id/search/properties.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "provider": {
      "type": "string",
      "description": "google lub bing",
      "enum": [
        "google",
        "bing"
      ],
      "default": "google"
    },
    "bing_api_key": {
      "type": "string",
      "description": "Twój własny klucz API Bing Webmaster Tools (Settings > API access). Wymagany, gdy provider to bing. Używany tylko do wyświetlenia witryn, które widzi."
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}
POST /sites/:site_id/search/sync.json Zaimportuj dane wyszukiwania teraz search_sync

Uprawnienie: sites.manage

Przykład
curl -X POST https://privatusanalytics.com/sites/:site_id/search/sync.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "provider": {
      "type": "string",
      "description": "google lub bing",
      "enum": [
        "google",
        "bing"
      ],
      "default": "google"
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "provider": {
      "type": "string",
      "description": "google lub bing"
    },
    "property": {
      "type": "string",
      "description": "Usługa Search Console lub adres URL witryny Bing"
    },
    "status": {
      "type": "string",
      "description": "active lub error"
    },
    "last_synced_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Zbieranie danych

POST /api/logs.json Wyślij logi dostępu serwera do raportowania robotów AI (JSON {lines: [...]} lub tekst logu w formacie combined, z kluczem ingest witryny jako tokenem Bearer) crawler_logs_create

Uprawnienie: public · Tylko HTTP (nie jest narzędziem MCP)

Przykład
curl -X POST https://privatusanalytics.com/api/logs.json \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "lines": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "ts": {
            "type": "string"
          },
          "path": {
            "type": "string",
            "default": "/"
          },
          "status": {
            "type": "integer"
          },
          "user_agent": {
            "type": "string",
            "default": ""
          }
        }
      },
      "description": "Wiersze logu: [{ts, path, status, user_agent}] (maks. 1000)"
    }
  },
  "required": [
    "lines"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}
POST /api/event.json Zbierz trafienie z przeglądarki (używane przez /js/pa.js) ingest_event

Uprawnienie: public · Tylko HTTP (nie jest narzędziem MCP)

Przykład
curl -X POST https://privatusanalytics.com/api/event.json \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "site": {
      "type": "string",
      "description": "Identyfikator witryny (pa_…)"
    },
    "type": {
      "type": "string",
      "description": "Typ trafienia",
      "enum": [
        "pageview",
        "event",
        "engagement",
        "vital",
        "click"
      ]
    },
    "url": {
      "type": "string",
      "description": "Pełny adres URL strony"
    },
    "referrer": {
      "type": "string",
      "description": "document.referrer"
    },
    "name": {
      "type": "string",
      "description": "Nazwa zdarzenia (type=event) lub nazwa vital"
    },
    "props": {
      "type": "object",
      "additionalProperties": true,
      "description": "Właściwości zdarzenia: do 30 wartości typu string/number/boolean",
      "default": {}
    },
    "screen_width": {
      "type": "integer",
      "description": "Szerokość ekranu w pikselach"
    },
    "language": {
      "type": "string",
      "description": "navigator.language"
    },
    "engaged_ms": {
      "type": "integer",
      "description": "Widoczny czas na stronie (zaangażowanie)"
    },
    "scroll_depth": {
      "type": "integer",
      "description": "Maks. głębokość przewinięcia w % (zaangażowanie)"
    },
    "value": {
      "type": "number",
      "description": "Wartość Web Vital (type=vital)"
    },
    "selector": {
      "type": "string",
      "description": "Selektor klikniętego elementu (type=click)"
    },
    "hash_mode": {
      "type": "boolean",
      "description": "Zachowaj #fragment (witryny z routingiem po haszu)",
      "default": false
    },
    "dnt": {
      "type": "boolean",
      "description": "Włączone Do Not Track",
      "default": false
    },
    "gpc": {
      "type": "boolean",
      "description": "Włączone Global Privacy Control",
      "default": false
    },
    "interacted": {
      "type": "boolean",
      "description": "1, gdy na stronie zaobserwowano zaufane działanie (wskaźnik, klawisz, dotyk lub kółko myszy), 0 w przeciwnym razie. Bez współrzędnych i czasu"
    },
    "revenue": {
      "type": "number",
      "description": "Przychód w głównych jednostkach, np. 49.99"
    },
    "currency": {
      "type": "string",
      "description": "Waluta przychodu w ISO 4217"
    }
  },
  "required": [
    "site",
    "type",
    "url"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}
POST /api/events.json Zbieraj zdarzenia po stronie serwera z kluczem ingest witryny ingest_events

Uprawnienie: public · Tylko HTTP (nie jest narzędziem MCP)

Przykład
curl -X POST https://privatusanalytics.com/api/events.json \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "events": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      },
      "description": "Do 100 zdarzeń"
    }
  },
  "required": [
    "events"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}
GET /api/pixel.json Zbierz odsłonę bez JavaScript (GIF 1×1) ingest_pixel

Uprawnienie: public · Tylko HTTP (nie jest narzędziem MCP)

Przykład
curl https://privatusanalytics.com/api/pixel.json
Dane wejściowe
{
  "type": "object",
  "properties": {},
  "required": []
}
Dane odpowiedzi
{
  "type": "object"
}

Zdarzenia

GET /sites/:site_id/events/properties.json Wyświetl klucze właściwości zdarzeń widziane w ostatnich 30 dniach event_properties_list

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/sites/:site_id/events/properties.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "event": {
      "type": "string",
      "description": "Tylko klucze widziane przy tej surowej nazwie zdarzenia"
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}
PATCH /sites/:site_id/events/properties.json Zmień nazwę lub ukryj klucz właściwości zdarzenia event_properties_update

Uprawnienie: sites.manage

Przykład
curl -X PATCH https://privatusanalytics.com/sites/:site_id/events/properties.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "key": {
      "type": "string",
      "description": "Klucz właściwości w formie zapisanej, np. plan"
    },
    "display_name": {
      "type": "string",
      "description": "Etykieta do wyświetlania zamiast klucza (puste ją usuwa)"
    },
    "hidden": {
      "type": "boolean",
      "description": "Ukryj ten klucz w raportach"
    },
    "export_safe": {
      "type": "boolean",
      "description": "Klucz nie zawiera danych osobowych, więc jest uwzględniany w surowych eksportach i synchronizacjach z hurtownią"
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "key",
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}
DELETE /sites/:site_id/events.json Usuń zdarzenie i jego historię (działa w tle, potwierdź wpisując nazwę) events_delete

Uprawnienie: sites.manage

Przykład
curl -X DELETE https://privatusanalytics.com/sites/:site_id/events.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Surowa nazwa zdarzenia do usunięcia"
    },
    "confirm": {
      "type": "string",
      "description": "Wpisz nazwę zdarzenia ponownie, aby potwierdzić"
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "confirm",
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}
GET /sites/:site_id/events.json Wyświetl zdarzenia z liczbą wykonań, wizytami, współczynnikiem konwersji oraz datą pierwszego i ostatniego wystąpienia events_list

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/sites/:site_id/events.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Gotowy zakres dat. Użyj custom z from/to",
      "enum": [
        "today",
        "yesterday",
        "24h",
        "7d",
        "14d",
        "28d",
        "30d",
        "90d",
        "mtd",
        "last_month",
        "qtd",
        "last_quarter",
        "ytd",
        "12mo",
        "last_year",
        "all",
        "custom"
      ],
      "default": "30d"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Początek własnego zakresu (strefa czasowa witryny)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Koniec własnego zakresu, włącznie"
    },
    "compare": {
      "type": "string",
      "description": "Okres porównawczy",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Początek własnego okresu porównawczego"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Koniec własnego okresu porównawczego"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Dopasuj dni tygodnia w porównaniu",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtry: [[\"dimension\",\"operator\",\"value\"], …]. Operatory: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Opakuj warunki w {\"any\": [...]}, aby uzyskać OR.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Zastosuj zapisany segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Dodaj zaimportowane dane historyczne (daty przed pierwszym natywnym zdarzeniem, ignorowane przy filtrach lub segmencie)",
      "default": false
    },
    "search": {
      "type": "string",
      "description": "Tylko zdarzenia, których nazwa zawiera to"
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}
POST /sites/:site_id/events/merge.json Scal kilka zdarzeń w jedną wyświetlaną nazwę events_merge

Uprawnienie: sites.manage

Przykład
curl -X POST https://privatusanalytics.com/sites/:site_id/events/merge.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "names": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Surowe nazwy zdarzeń do scalenia"
    },
    "into": {
      "type": "string",
      "description": "Wyświetlana nazwa scalonego zdarzenia",
      "examples": [
        "Signup"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "names",
    "into",
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Surowa nazwa zdarzenia wysłana przez tracker"
    },
    "display_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nazwa pokazywana w raportach"
        },
        {
          "type": "null"
        }
      ]
    },
    "hidden": {
      "type": "boolean",
      "description": "Ukryte w raportach"
    },
    "currency": {
      "anyOf": [
        {
          "type": "string",
          "description": "Waluta przychodu"
        },
        {
          "type": "null"
        }
      ]
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/events/detail.json Jedno zdarzenie: wykres, tabela przestawna właściwości, agregaty właściwości liczbowych, strony i źródła events_get

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/sites/:site_id/events/detail.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Gotowy zakres dat. Użyj custom z from/to",
      "enum": [
        "today",
        "yesterday",
        "24h",
        "7d",
        "14d",
        "28d",
        "30d",
        "90d",
        "mtd",
        "last_month",
        "qtd",
        "last_quarter",
        "ytd",
        "12mo",
        "last_year",
        "all",
        "custom"
      ],
      "default": "30d"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Początek własnego zakresu (strefa czasowa witryny)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Koniec własnego zakresu, włącznie"
    },
    "compare": {
      "type": "string",
      "description": "Okres porównawczy",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Początek własnego okresu porównawczego"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Koniec własnego okresu porównawczego"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Dopasuj dni tygodnia w porównaniu",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtry: [[\"dimension\",\"operator\",\"value\"], …]. Operatory: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Opakuj warunki w {\"any\": [...]}, aby uzyskać OR.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Zastosuj zapisany segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Dodaj zaimportowane dane historyczne (daty przed pierwszym natywnym zdarzeniem, ignorowane przy filtrach lub segmencie)",
      "default": false
    },
    "name": {
      "type": "string",
      "description": "Nazwa zdarzenia w formie wyświetlanej (po zmianach nazw)",
      "examples": [
        "Signup"
      ]
    },
    "properties": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Do 3 kluczy właściwości do przestawienia",
      "default": []
    },
    "interval": {
      "type": "string",
      "description": "Rozmiar przedziału wykresu",
      "enum": [
        "auto",
        "minute",
        "hour",
        "day",
        "week",
        "month",
        "quarter",
        "year"
      ],
      "default": "auto"
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}
PATCH /sites/:site_id/events/settings.json Zmień nazwę, ukryj lub odkryj zdarzenie albo ustaw jego walutę events_update

Uprawnienie: sites.manage

Przykład
curl -X PATCH https://privatusanalytics.com/sites/:site_id/events/settings.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Surowa nazwa zdarzenia wysłana przez tracker",
      "examples": [
        "signup_click"
      ]
    },
    "display_name": {
      "type": "string",
      "description": "Nazwa do wyświetlania zamiast surowej (puste usuwa zmianę nazwy)"
    },
    "hidden": {
      "type": "boolean",
      "description": "Ukryj w raportach (dane zostają zachowane)"
    },
    "currency": {
      "type": "string",
      "description": "Waluta przychodu dla tego zdarzenia (ISO 4217)"
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Surowa nazwa zdarzenia wysłana przez tracker"
    },
    "display_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nazwa pokazywana w raportach"
        },
        {
          "type": "null"
        }
      ]
    },
    "hidden": {
      "type": "boolean",
      "description": "Ukryte w raportach"
    },
    "currency": {
      "anyOf": [
        {
          "type": "string",
          "description": "Waluta przychodu"
        },
        {
          "type": "null"
        }
      ]
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Śledzenie

POST /sites/:site_id/tracking/ingest_key.json Utwórz lub zmień klucz ingest serwera (pokazywany raz) tracking_ingest_key_rotate

Uprawnienie: sites.manage

Przykład
curl -X POST https://privatusanalytics.com/sites/:site_id/tracking/ingest_key.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny"
    },
    "key": {
      "type": "string",
      "description": "Klucz ingest. Pokazywany raz: zapisz go teraz. Wyślij go jako token Bearer do POST /api/events"
    },
    "prefix": {
      "type": "string",
      "description": "Prefiks klucza pokazywany w ustawieniach"
    }
  }
}
DELETE /sites/:site_id/tracking/ingest_key.json Unieważnij klucz ingest serwera tracking_ingest_key_revoke

Uprawnienie: sites.manage

Przykład
curl -X DELETE https://privatusanalytics.com/sites/:site_id/tracking/ingest_key.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Identyfikator witryny używany we fragmencie kodu śledzenia"
    },
    "workspace_id": {
      "type": "string"
    },
    "domain": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "extra_domains": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "multi_domain_mode": {
      "type": "string"
    },
    "timezone": {
      "type": "string"
    },
    "currency": {
      "type": "string"
    },
    "week_start": {
      "type": "integer"
    },
    "labels": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "honor_dnt": {
      "type": "boolean"
    },
    "honor_gpc": {
      "type": "boolean"
    },
    "pii_scrubber": {
      "type": "boolean"
    },
    "redaction_rules": {
      "type": "array"
    },
    "allowed_params": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "path_masks": {
      "type": "array"
    },
    "retention_months": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "bot_filtering": {
      "type": "boolean"
    },
    "traffic_rule_modes": {
      "type": "object"
    },
    "vitals_sample_rate": {
      "type": "integer"
    },
    "conversion_denominator": {
      "type": "string"
    },
    "public_dashboard": {
      "type": "boolean"
    },
    "public_indexable": {
      "type": "boolean"
    },
    "ingest_key_prefix": {
      "anyOf": [
        {
          "type": "string",
          "description": "Początek klucza ingest serwera"
        },
        {
          "type": "null"
        }
      ]
    },
    "verified_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "first_event_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_event_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "snippet": {
      "type": "string",
      "description": "Fragment kodu śledzenia HTML"
    },
    "favorite": {
      "type": "boolean",
      "description": "Oznaczona przez Ciebie gwiazdką"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /sites/:site_id/tracking/verify.json Sprawdź, czy tracker jest zainstalowany w witrynie (tag script, identyfikator witryny, CSP i polityka referrera) tracking_verify

Uprawnienie: sites.manage

Przykład
curl -X POST https://privatusanalytics.com/sites/:site_id/tracking/verify.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Dane wejściowe
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Strona do sprawdzenia (domyślnie https://<domain>/)"
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}
GET /sites/:site_id/tracking/snippet.json Zbuduj fragment kodu śledzenia dla wybranych opcji tracking_snippet

Uprawnienie: analytics.read

Przykład
curl https://privatusanalytics.com/sites/:site_id/tracking/snippet.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Dane wejściowe
{
  "type": "object",
  "properties": {
    "modules": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Opcjonalne moduły: auto (linki wychodzące, pobrania, formularze, błędy 404), engage (czas i przewijanie), vitals (Web Vitals), clicks",
      "default": [
        "engage"
      ]
    },
    "manual": {
      "type": "boolean",
      "description": "Wyłącz automatyczną odsłonę",
      "default": false
    },
    "spa": {
      "type": "string",
      "description": "Śledzenie nawigacji aplikacji jednostronicowej",
      "enum": [
        "auto",
        "history",
        "hash",
        "off"
      ],
      "default": "auto"
    },
    "domains": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Śledź tylko w tych nazwach hostów",
      "default": []
    },
    "exclude": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Wzorce glob ścieżek do niezliczania, np. /admin/*",
      "default": []
    },
    "query_params": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Dodatkowe parametry zapytania do zachowania, np. page",
      "default": []
    },
    "mask": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Maski ścieżek po stronie klienta, np. /u/*->/u/:id",
      "default": []
    },
    "site_id": {
      "type": "string",
      "description": "Identyfikator witryny, np. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dane odpowiedzi
{
  "type": "object"
}