Dokumentaatio
Selaa dokumentaatiota

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.

Näytä Markdown-muodossa

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.

Kaikki toiminnot

Todennus

Lähetä Authorization: Bearer pat_…. Luo tunnisteet kohdassa Työtilan asetukset, API-tunnisteet. Todennusopas.

JSON kaikkialla

Lisää .json mihin tahansa polkuun. Vastaukset ovat muotoa { "data": … } ja virheet muotoa { "error": { "code", "message" } }. Virheet.

MCP

Lähetä JSON-RPC POST-pyyntönä osoitteeseen https://privatusanalytics.com/mcp samalla tunnisteella. Jokainen alla oleva toiminto on työkalu. MCP-opas.

Lataa openapi.json · 285 toimintoa

API-tunnisteet

POST /workspaces/:workspace_id/api_tokens.json Luo API-tunniste (tunniste palautetaan vain kerran) api_tokens_create

Oikeus: member

Esimerkki
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/api_tokens.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nimi, josta tunniste tunnistetaan",
      "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": "Oikeudet (jätä pois, jos haluat kaikki omat oikeutesi, tyhjä lista hylätään)"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Rajaa näihin sivustotunnisteisiin (pa_…). Tyhjä = kaikki",
      "default": []
    },
    "expires_at": {
      "type": "string",
      "format": "date-time",
      "description": "Vanhenemisaika (ISO 8601). Tyhjä = ei koskaan"
    },
    "allowed_ips": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Hyväksy pyyntöjä vain näistä IP-osoitteista/CIDR-alueista",
      "default": []
    },
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "name": {
      "type": "string"
    },
    "token": {
      "anyOf": [
        {
          "type": "string",
          "description": "Itse tunniste: palautetaan vain luotaessa"
        },
        {
          "type": "null"
        }
      ]
    },
    "token_prefix": {
      "type": "string",
      "description": "Ensimmäiset merkit tunnisteen tunnistamiseksi"
    },
    "owner": {
      "type": "string",
      "description": "Omistavan jäsenen sähköpostiosoite"
    },
    "permissions": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Rajattu näihin sivustoihin (tyhjä = kaikki)"
    },
    "allowed_ips": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "oauth_client": {
      "anyOf": [
        {
          "type": "string",
          "description": "MCP-asiakas, joka sen sai"
        },
        {
          "type": "null"
        }
      ]
    },
    "status": {
      "type": "string",
      "description": "active, expired tai 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 Peruuta API-tunniste api_tokens_delete

Oikeus: member

Esimerkki
curl -X DELETE https://privatusanalytics.com/workspaces/:workspace_id/api_tokens/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "name": {
      "type": "string"
    },
    "token": {
      "anyOf": [
        {
          "type": "string",
          "description": "Itse tunniste: palautetaan vain luotaessa"
        },
        {
          "type": "null"
        }
      ]
    },
    "token_prefix": {
      "type": "string",
      "description": "Ensimmäiset merkit tunnisteen tunnistamiseksi"
    },
    "owner": {
      "type": "string",
      "description": "Omistavan jäsenen sähköpostiosoite"
    },
    "permissions": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Rajattu näihin sivustoihin (tyhjä = kaikki)"
    },
    "allowed_ips": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "oauth_client": {
      "anyOf": [
        {
          "type": "string",
          "description": "MCP-asiakas, joka sen sai"
        },
        {
          "type": "null"
        }
      ]
    },
    "status": {
      "type": "string",
      "description": "active, expired tai 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 Listaa API-tunnisteet api_tokens_list

Oikeus: member

Esimerkki
curl https://privatusanalytics.com/workspaces/:workspace_id/api_tokens.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "include_revoked": {
      "type": "boolean",
      "description": "Listaa myös peruutetut ja vanhentuneet tunnisteet",
      "default": false
    },
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Sivu (alkaen 1:stä)"
    },
    "per_page": {
      "type": "integer",
      "description": "Tuloksia sivulla (enintään 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "format": "uuid"
      },
      "name": {
        "type": "string"
      },
      "token": {
        "anyOf": [
          {
            "type": "string",
            "description": "Itse tunniste: palautetaan vain luotaessa"
          },
          {
            "type": "null"
          }
        ]
      },
      "token_prefix": {
        "type": "string",
        "description": "Ensimmäiset merkit tunnisteen tunnistamiseksi"
      },
      "owner": {
        "type": "string",
        "description": "Omistavan jäsenen sähköpostiosoite"
      },
      "permissions": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "site_ids": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Rajattu näihin sivustoihin (tyhjä = kaikki)"
      },
      "allowed_ips": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "oauth_client": {
        "anyOf": [
          {
            "type": "string",
            "description": "MCP-asiakas, joka sen sai"
          },
          {
            "type": "null"
          }
        ]
      },
      "status": {
        "type": "string",
        "description": "active, expired tai 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"
      }
    }
  }
}

Analytiikka

GET /sites/:site_id/overview.json Sivuston yleiskatsaus: mittarit, kaaviosarjat, kärkipaneelit, live-kävijät ja muistiinpanot stats_overview

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/sites/:site_id/overview.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Aikavälin esiasetus. Käytä custom-arvoa yhdessä from/to-parametrien kanssa",
      "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": "Mukautetun aikavälin alku (sivuston aikavyöhyke)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun aikavälin loppu, mukaan lukien"
    },
    "compare": {
      "type": "string",
      "description": "Vertailujakso",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun vertailun alku"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun vertailun loppu"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Kohdista vertailun viikonpäivät",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Suodattimet: [[\"dimension\",\"operator\",\"value\"], …]. Operaattorit: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Kääri ehdot muotoon {\"any\": [...]} TAI-ehtoa varten.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Ota käyttöön tallennettu segmentti (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Lisää tuodut historiatiedot (päivät ennen ensimmäistä natiivia tapahtumaa, ohitetaan kun suodattimia tai segmenttiä käytetään)",
      "default": false
    },
    "interval": {
      "type": "string",
      "description": "Kaavion aikavälin koko",
      "enum": [
        "auto",
        "minute",
        "hour",
        "day",
        "week",
        "month",
        "quarter",
        "year"
      ],
      "default": "auto"
    },
    "panels": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Dimensiot, joiden kärkiarvot sisällytetään",
      "default": [
        "channel",
        "referrer",
        "page",
        "entry_page",
        "country",
        "device",
        "browser",
        "os",
        "utm_campaign",
        "event",
        "goal"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}
GET /sites/:site_id/experiments.json Kokeiluraportti: konversioaste variantteittain, nousu kontrolliin verrattuna ja merkitsevyys (kahden osuuden z-testi) experiments_report

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/sites/:site_id/experiments.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Aikavälin esiasetus. Käytä custom-arvoa yhdessä from/to-parametrien kanssa",
      "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": "Mukautetun aikavälin alku (sivuston aikavyöhyke)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun aikavälin loppu, mukaan lukien"
    },
    "compare": {
      "type": "string",
      "description": "Vertailujakso",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun vertailun alku"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun vertailun loppu"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Kohdista vertailun viikonpäivät",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Suodattimet: [[\"dimension\",\"operator\",\"value\"], …]. Operaattorit: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Kääri ehdot muotoon {\"any\": [...]} TAI-ehtoa varten.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Ota käyttöön tallennettu segmentti (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Lisää tuodut historiatiedot (päivät ennen ensimmäistä natiivia tapahtumaa, ohitetaan kun suodattimia tai segmenttiä käytetään)",
      "default": false
    },
    "property": {
      "type": "string",
      "description": "Variantin sisältävä tapahtuman ominaisuus, esim. variant",
      "examples": [
        "variant"
      ]
    },
    "goal_id": {
      "type": "string",
      "description": "Konversioksi laskettava tavoite (goal_…)"
    },
    "control": {
      "type": "string",
      "description": "Kontrollivariantti (oletus \"control\", jos olemassa, muuten variantti, jolla on eniten käyntejä)"
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "property",
    "goal_id",
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}
GET /sites/:site_id/insights.json Huomionarvoiset muutokset edelliseen jaksoon verrattuna selkokielellä (suurimmat muutokset, tavoitekonversioiden muutokset) insights_get

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/sites/:site_id/insights.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Kokonaiset päivät eiliseen asti, verrattuna samaan määrään päiviä sitä ennen",
      "enum": [
        "7d",
        "14d",
        "28d",
        "30d"
      ],
      "default": "7d"
    },
    "limit": {
      "type": "integer",
      "description": "Havaintojen enimmäismäärä (1-20)",
      "default": 8
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}
GET /sites/:site_id/journeys.json Polut: yleisimmät 3-vaiheiset polut sivun (tai minkä tahansa sisääntulon) jälkeen tai ennen sivua tai tavoitetta journeys_explore

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/sites/:site_id/journeys.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Aikavälin esiasetus. Käytä custom-arvoa yhdessä from/to-parametrien kanssa",
      "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": "Mukautetun aikavälin alku (sivuston aikavyöhyke)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun aikavälin loppu, mukaan lukien"
    },
    "compare": {
      "type": "string",
      "description": "Vertailujakso",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun vertailun alku"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun vertailun loppu"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Kohdista vertailun viikonpäivät",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Suodattimet: [[\"dimension\",\"operator\",\"value\"], …]. Operaattorit: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Kääri ehdot muotoon {\"any\": [...]} TAI-ehtoa varten.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Ota käyttöön tallennettu segmentti (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Lisää tuodut historiatiedot (päivät ennen ensimmäistä natiivia tapahtumaa, ohitetaan kun suodattimia tai segmenttiä käytetään)",
      "default": false
    },
    "mode": {
      "type": "string",
      "description": "forward: aloitussivun jälkeiset sivut, reverse: loppusivulle tai tavoitteeseen johtavat sivut",
      "enum": [
        "forward",
        "reverse"
      ],
      "default": "forward"
    },
    "path": {
      "type": "string",
      "description": "Aloitussivu (forward) tai loppusivu (reverse). Tyhjä tarkoittaa mitä tahansa sisääntuloa (vain forward)"
    },
    "goal_id": {
      "type": "string",
      "description": "Reverse-tila: päätä tähän tavoitteeseen (goal_…) sivun sijaan"
    },
    "limit": {
      "type": "integer",
      "description": "Vaihetta kohden näytettävät sivut (enintään 12)",
      "default": 6
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}
GET /sites/:site_id/pages/detail.json Sivun tiedot: mittarit, edelliset ja seuraavat sivut, lähteet, Web Vitals, tapahtumat ja klikkauskartta yhdelle polulle pages_detail

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/sites/:site_id/pages/detail.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Aikavälin esiasetus. Käytä custom-arvoa yhdessä from/to-parametrien kanssa",
      "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": "Mukautetun aikavälin alku (sivuston aikavyöhyke)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun aikavälin loppu, mukaan lukien"
    },
    "compare": {
      "type": "string",
      "description": "Vertailujakso",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun vertailun alku"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun vertailun loppu"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Kohdista vertailun viikonpäivät",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Suodattimet: [[\"dimension\",\"operator\",\"value\"], …]. Operaattorit: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Kääri ehdot muotoon {\"any\": [...]} TAI-ehtoa varten.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Ota käyttöön tallennettu segmentti (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Lisää tuodut historiatiedot (päivät ennen ensimmäistä natiivia tapahtumaa, ohitetaan kun suodattimia tai segmenttiä käytetään)",
      "default": false
    },
    "path": {
      "type": "string",
      "description": "Sivun polku, esim. /pricing",
      "examples": [
        "/pricing"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "path",
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}
GET /sites/:site_id/stats/aggregate.json Jakson pääasialliset mittarit (vertailun kanssa) stats_aggregate

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/sites/:site_id/stats/aggregate.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Aikavälin esiasetus. Käytä custom-arvoa yhdessä from/to-parametrien kanssa",
      "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": "Mukautetun aikavälin alku (sivuston aikavyöhyke)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun aikavälin loppu, mukaan lukien"
    },
    "compare": {
      "type": "string",
      "description": "Vertailujakso",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun vertailun alku"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun vertailun loppu"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Kohdista vertailun viikonpäivät",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Suodattimet: [[\"dimension\",\"operator\",\"value\"], …]. Operaattorit: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Kääri ehdot muotoon {\"any\": [...]} TAI-ehtoa varten.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Ota käyttöön tallennettu segmentti (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Lisää tuodut historiatiedot (päivät ennen ensimmäistä natiivia tapahtumaa, ohitetaan kun suodattimia tai segmenttiä käytetään)",
      "default": false
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}
GET /sites/:site_id/breakdown/:dimension.json Dimension yleisimmät arvot (sivut, lähteet, maat…) stats_breakdown

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/sites/:site_id/breakdown/:dimension.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Aikavälin esiasetus. Käytä custom-arvoa yhdessä from/to-parametrien kanssa",
      "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": "Mukautetun aikavälin alku (sivuston aikavyöhyke)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun aikavälin loppu, mukaan lukien"
    },
    "compare": {
      "type": "string",
      "description": "Vertailujakso",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun vertailun alku"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun vertailun loppu"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Kohdista vertailun viikonpäivät",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Suodattimet: [[\"dimension\",\"operator\",\"value\"], …]. Operaattorit: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Kääri ehdot muotoon {\"any\": [...]} TAI-ehtoa varten.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Ota käyttöön tallennettu segmentti (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Lisää tuodut historiatiedot (päivät ennen ensimmäistä natiivia tapahtumaa, ohitetaan kun suodattimia tai segmenttiä käytetään)",
      "default": false
    },
    "dimension": {
      "type": "string",
      "description": "Resurssin Dimension"
    },
    "limit": {
      "type": "integer",
      "description": "Rivejä sivulla (enintään 1000)",
      "default": 10
    },
    "page": {
      "type": "integer",
      "description": "Sivunumero",
      "default": 1
    },
    "sort": {
      "type": "string",
      "description": "Lajittelumittari",
      "enum": [
        "visitors",
        "visits",
        "pageviews",
        "revenue"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "dimension",
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}
GET /sites/:site_id/stats/timeseries.json Mittarit aikavälin mukaan kaavioita varten stats_timeseries

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/sites/:site_id/stats/timeseries.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Aikavälin esiasetus. Käytä custom-arvoa yhdessä from/to-parametrien kanssa",
      "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": "Mukautetun aikavälin alku (sivuston aikavyöhyke)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun aikavälin loppu, mukaan lukien"
    },
    "compare": {
      "type": "string",
      "description": "Vertailujakso",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun vertailun alku"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun vertailun loppu"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Kohdista vertailun viikonpäivät",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Suodattimet: [[\"dimension\",\"operator\",\"value\"], …]. Operaattorit: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Kääri ehdot muotoon {\"any\": [...]} TAI-ehtoa varten.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Ota käyttöön tallennettu segmentti (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Lisää tuodut historiatiedot (päivät ennen ensimmäistä natiivia tapahtumaa, ohitetaan kun suodattimia tai segmenttiä käytetään)",
      "default": false
    },
    "interval": {
      "type": "string",
      "description": "Aikavälin koko. auto valitsee sopivan jaksolle",
      "enum": [
        "auto",
        "minute",
        "hour",
        "day",
        "week",
        "month",
        "quarter",
        "year"
      ],
      "default": "auto"
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}

Avustaja

POST /sites/:site_id/ask.json Esitä kysymys uudessa keskustelussa (lasketaan kuukauden tekoälykysymysten rajaan) assistant_ask

Oikeus: analytics.read

Esimerkki
curl -X POST https://privatusanalytics.com/sites/:site_id/ask.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "question": {
      "type": "string",
      "description": "Ensimmäinen kysymyksesi selkokielellä",
      "examples": [
        "How many visitors did we have last week?"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "question",
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Keskustelun tunniste, esim. ask_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Sivuston tunniste"
        },
        {
          "type": "null"
        }
      ]
    },
    "title": {
      "anyOf": [
        {
          "type": "string",
          "description": "Ensimmäinen kysymys, lyhennettynä"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Viimeisen viestin aika"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time",
      "description": "Poistetaan automaattisesti tämän ajan jälkeen (30 päivää viimeisen viestin jälkeen)"
    },
    "messages": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Viestin tunniste keskustelun sisällä"
        },
        "role": {
          "type": "string",
          "description": "user (kysymys) tai assistant (vastaus)"
        },
        "content": {
          "type": "string",
          "description": "Kysymys tai vastaus Markdown-muodossa"
        },
        "queries": {
          "type": "array",
          "items": {
            "type": "object"
          },
          "description": "Miten tähän päädyttiin: vastauksen taustalla olevat tarkat API-kyselyt muodossa [{tool, input, status, error}]"
        },
        "chart": {
          "anyOf": [
            {
              "type": "object",
              "description": "Vastauksen kaavio: {type: line, labels, series, comparison, metric, format} tai {type: table, columns, rows}"
            },
            {
              "type": "null"
            }
          ]
        },
        "goal_draft": {
          "anyOf": [
            {
              "type": "object",
              "description": "Avustajan ehdottama tavoite, vahvistettavaksi goals_create-toiminnolla"
            },
            {
              "type": "null"
            }
          ]
        },
        "input_tokens": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Käytetyt mallin syötetokenit"
            },
            {
              "type": "null"
            }
          ]
        },
        "output_tokens": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Käytetyt mallin tulostetokenit"
            },
            {
              "type": "null"
            }
          ]
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        }
      },
      "description": "Kysymykset ja vastaukset, vanhin ensin"
    }
  }
}
DELETE /sites/:site_id/ask/:id.json Poista Kysy-keskustelu ja sen viestit assistant_conversations_delete

Oikeus: analytics.read

Esimerkki
curl -X DELETE https://privatusanalytics.com/sites/:site_id/ask/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Keskustelun tunniste, esim. ask_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Sivuston tunniste"
        },
        {
          "type": "null"
        }
      ]
    },
    "title": {
      "anyOf": [
        {
          "type": "string",
          "description": "Ensimmäinen kysymys, lyhennettynä"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Viimeisen viestin aika"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time",
      "description": "Poistetaan automaattisesti tämän ajan jälkeen (30 päivää viimeisen viestin jälkeen)"
    }
  }
}
GET /sites/:site_id/ask.json Listaa Kysy-keskustelusi sivustolle assistant_conversations_list

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/sites/:site_id/ask.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Sivu (alkaen 1:stä)"
    },
    "per_page": {
      "type": "integer",
      "description": "Tuloksia sivulla (enintään 100)"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Keskustelun tunniste, esim. ask_7Q2K9XH3AB"
      },
      "site_id": {
        "anyOf": [
          {
            "type": "string",
            "description": "Sivuston tunniste"
          },
          {
            "type": "null"
          }
        ]
      },
      "title": {
        "anyOf": [
          {
            "type": "string",
            "description": "Ensimmäinen kysymys, lyhennettynä"
          },
          {
            "type": "null"
          }
        ]
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      },
      "updated_at": {
        "type": "string",
        "format": "date-time",
        "description": "Viimeisen viestin aika"
      },
      "expires_at": {
        "type": "string",
        "format": "date-time",
        "description": "Poistetaan automaattisesti tämän ajan jälkeen (30 päivää viimeisen viestin jälkeen)"
      }
    }
  }
}
GET /sites/:site_id/ask/:id.json Kysy-keskustelu: kysymykset, vastaukset, niiden taustalla olevat kyselyt ja kaaviot assistant_conversations_get

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/sites/:site_id/ask/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Keskustelun tunniste, esim. ask_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Sivuston tunniste"
        },
        {
          "type": "null"
        }
      ]
    },
    "title": {
      "anyOf": [
        {
          "type": "string",
          "description": "Ensimmäinen kysymys, lyhennettynä"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Viimeisen viestin aika"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time",
      "description": "Poistetaan automaattisesti tämän ajan jälkeen (30 päivää viimeisen viestin jälkeen)"
    },
    "messages": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Viestin tunniste keskustelun sisällä"
        },
        "role": {
          "type": "string",
          "description": "user (kysymys) tai assistant (vastaus)"
        },
        "content": {
          "type": "string",
          "description": "Kysymys tai vastaus Markdown-muodossa"
        },
        "queries": {
          "type": "array",
          "items": {
            "type": "object"
          },
          "description": "Miten tähän päädyttiin: vastauksen taustalla olevat tarkat API-kyselyt muodossa [{tool, input, status, error}]"
        },
        "chart": {
          "anyOf": [
            {
              "type": "object",
              "description": "Vastauksen kaavio: {type: line, labels, series, comparison, metric, format} tai {type: table, columns, rows}"
            },
            {
              "type": "null"
            }
          ]
        },
        "goal_draft": {
          "anyOf": [
            {
              "type": "object",
              "description": "Avustajan ehdottama tavoite, vahvistettavaksi goals_create-toiminnolla"
            },
            {
              "type": "null"
            }
          ]
        },
        "input_tokens": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Käytetyt mallin syötetokenit"
            },
            {
              "type": "null"
            }
          ]
        },
        "output_tokens": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Käytetyt mallin tulostetokenit"
            },
            {
              "type": "null"
            }
          ]
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        }
      },
      "description": "Kysymykset ja vastaukset, vanhin ensin"
    }
  }
}
POST /sites/:site_id/ask/:ask_conversation_id/messages.json Esitä jatkokysymys keskustelussa (lasketaan kuukauden tekoälykysymysten rajaan). Palauttaa vastauksen. assistant_ask_followup

Oikeus: analytics.read

Esimerkki
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 '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "question": {
      "type": "string",
      "description": "Kysymyksesi selkokielellä",
      "examples": [
        "Which pages had the most visitors last week?"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    },
    "ask_conversation_id": {
      "type": "string",
      "description": "Resurssin Ask conversation"
    }
  },
  "required": [
    "question",
    "site_id",
    "ask_conversation_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Viestin tunniste keskustelun sisällä"
    },
    "role": {
      "type": "string",
      "description": "user (kysymys) tai assistant (vastaus)"
    },
    "content": {
      "type": "string",
      "description": "Kysymys tai vastaus Markdown-muodossa"
    },
    "queries": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Miten tähän päädyttiin: vastauksen taustalla olevat tarkat API-kyselyt muodossa [{tool, input, status, error}]"
    },
    "chart": {
      "anyOf": [
        {
          "type": "object",
          "description": "Vastauksen kaavio: {type: line, labels, series, comparison, metric, format} tai {type: table, columns, rows}"
        },
        {
          "type": "null"
        }
      ]
    },
    "goal_draft": {
      "anyOf": [
        {
          "type": "object",
          "description": "Avustajan ehdottama tavoite, vahvistettavaksi goals_create-toiminnolla"
        },
        {
          "type": "null"
        }
      ]
    },
    "input_tokens": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Käytetyt mallin syötetokenit"
        },
        {
          "type": "null"
        }
      ]
    },
    "output_tokens": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Käytetyt mallin tulostetokenit"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Dokumentaatio

GET /docs/api.json Listaa kaikki API-toiminnot ja MCP-työkalut docs_api

Oikeus: public

Esimerkki
curl https://privatusanalytics.com/docs/api.json
Syötteet
{
  "type": "object",
  "properties": {
    "page": {
      "type": "integer",
      "description": "Sivu (alkaen 1:stä)"
    },
    "per_page": {
      "type": "integer",
      "description": "Tuloksia sivulla (enintään 100)"
    }
  },
  "required": []
}
Vastauksen tiedot
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "tool_name": {
        "type": "string",
        "description": "MCP-työkalun nimi ja OpenAPI operationId"
      },
      "summary": {
        "type": "string"
      },
      "description": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "group": {
        "type": "string"
      },
      "verb": {
        "type": "string",
        "description": "HTTP-metodi"
      },
      "path": {
        "type": "string",
        "description": "Polkumalli. Lisää .json JSONille"
      },
      "permission": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "input_schema": {
        "type": "object",
        "description": "Syötteiden JSON-skeema"
      },
      "response_schema": {
        "type": "object",
        "description": "Kentän `data` JSON-skeema"
      }
    }
  }
}
GET /docs.json Listaa dokumentaatiosivut docs_list

Oikeus: public

Esimerkki
curl https://privatusanalytics.com/docs.json
Syötteet
{
  "type": "object",
  "properties": {
    "page": {
      "type": "integer",
      "description": "Sivu (alkaen 1:stä)"
    },
    "per_page": {
      "type": "integer",
      "description": "Tuloksia sivulla (enintään 100)"
    }
  },
  "required": []
}
Vastauksen tiedot
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "title": {
        "type": "string",
        "description": "Sivun otsikko"
      },
      "description": {
        "type": "string",
        "description": "Yhden rivin yhteenveto"
      },
      "path": {
        "type": "string",
        "description": "Sivun polku. Lisää .md Markdownille tai .json JSONille"
      },
      "section": {
        "type": "string",
        "description": "Osion slug, esim. tracker"
      }
    }
  }
}
GET /openapi.json OpenAPI 3.1 -dokumentti koko API:lle docs_openapi

Oikeus: public

Esimerkki
curl https://privatusanalytics.com/openapi.json
Syötteet
{
  "type": "object",
  "properties": {},
  "required": []
}
Vastauksen tiedot
{
  "type": "object"
}
GET /docs/:section/:page.json Lue dokumentaatiosivu (Markdown ja HTML) docs_get

section ja page tulevat sivun polusta /docs/<section>/<page>. Käytä sivuna "index" osion yleiskatsaukselle.

Oikeus: public

Esimerkki
curl https://privatusanalytics.com/docs/:section/:page.json
Syötteet
{
  "type": "object",
  "properties": {
    "section": {
      "type": "string",
      "description": "Resurssin Section"
    },
    "page": {
      "type": "string",
      "description": "Resurssin Page"
    }
  },
  "required": [
    "section",
    "page"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "description": "Sivun otsikko"
    },
    "description": {
      "type": "string",
      "description": "Yhden rivin yhteenveto"
    },
    "path": {
      "type": "string",
      "description": "Sivun polku. Lisää .md Markdownille tai .json JSONille"
    },
    "section": {
      "type": "string",
      "description": "Osion slug, esim. tracker"
    },
    "headings": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Sivun osiot (id ja teksti)"
    },
    "full_markdown": {
      "type": "string",
      "description": "Sivu Markdown-muodossa (otsikko mukaan lukien)"
    },
    "html": {
      "type": "string",
      "description": "Sivun sisältö HTML-muodossa"
    }
  }
}

Haku

GET /sites/:site_id/search.json Hakuraportti: klikkaukset, näyttökerrat, CTR, sijainti, kärkikyselyt ja -sivut, laskeutumissivut ja mahdollisuudet search_report

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/sites/:site_id/search.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Aikavälin esiasetus. Käytä custom-arvoa yhdessä from/to-parametrien kanssa",
      "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": "Mukautetun aikavälin alku (sivuston aikavyöhyke)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun aikavälin loppu, mukaan lukien"
    },
    "compare": {
      "type": "string",
      "description": "Vertailujakso",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun vertailun alku"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun vertailun loppu"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Kohdista vertailun viikonpäivät",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Suodattimet: [[\"dimension\",\"operator\",\"value\"], …]. Operaattorit: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Kääri ehdot muotoon {\"any\": [...]} TAI-ehtoa varten.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Ota käyttöön tallennettu segmentti (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Lisää tuodut historiatiedot (päivät ennen ensimmäistä natiivia tapahtumaa, ohitetaan kun suodattimia tai segmenttiä käytetään)",
      "default": false
    },
    "provider": {
      "type": "string",
      "description": "google (Search Console) tai bing",
      "enum": [
        "google",
        "bing"
      ],
      "default": "google"
    },
    "limit": {
      "type": "integer",
      "description": "Rivejä taulukkoa kohden (enintään 100)",
      "default": 25
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}
POST /sites/:site_id/search/connections.json Yhdistä Search Console -ominaisuus tai Bing-sivusto search_connect

Oikeus: sites.manage

Esimerkki
curl -X POST https://privatusanalytics.com/sites/:site_id/search/connections.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "provider": {
      "type": "string",
      "description": "google tai bing",
      "enum": [
        "google",
        "bing"
      ],
      "default": "google"
    },
    "property": {
      "type": "string",
      "description": "Search Console -ominaisuus (esim. sc-domain:example.com) tai Bing-sivuston URL",
      "examples": [
        "sc-domain:example.com"
      ]
    },
    "bing_api_key": {
      "type": "string",
      "description": "Oma Bing Webmaster Tools -API-avaimesi (Settings > API access). Pakollinen, kun provider on bing. Tallennetaan salattuna eikä koskaan palauteta."
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "property",
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "provider": {
      "type": "string",
      "description": "google tai bing"
    },
    "property": {
      "type": "string",
      "description": "Search Console -ominaisuus tai Bing-sivuston URL"
    },
    "status": {
      "type": "string",
      "description": "active tai 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 Katkaise Search Console- tai Bing-yhteys ja poista sen tiedot search_disconnect

Oikeus: sites.manage

Esimerkki
curl -X DELETE https://privatusanalytics.com/sites/:site_id/search/connections/:provider.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    },
    "provider": {
      "type": "string",
      "description": "Resurssin Provider"
    }
  },
  "required": [
    "site_id",
    "provider"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "provider": {
      "type": "string",
      "description": "google tai bing"
    },
    "property": {
      "type": "string",
      "description": "Search Console -ominaisuus tai Bing-sivuston URL"
    },
    "status": {
      "type": "string",
      "description": "active tai 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 Listaa yhdistettävät ominaisuudet (Search Console vaatii Google-luvan selaimessa) search_properties

Oikeus: sites.manage

Esimerkki
curl -X POST https://privatusanalytics.com/sites/:site_id/search/properties.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "provider": {
      "type": "string",
      "description": "google tai bing",
      "enum": [
        "google",
        "bing"
      ],
      "default": "google"
    },
    "bing_api_key": {
      "type": "string",
      "description": "Oma Bing Webmaster Tools -API-avaimesi (Settings > API access). Pakollinen, kun provider on bing. Käytetään vain avaimen näkemien sivustojen listaamiseen."
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}
POST /sites/:site_id/search/sync.json Tuo hakutiedot nyt search_sync

Oikeus: sites.manage

Esimerkki
curl -X POST https://privatusanalytics.com/sites/:site_id/search/sync.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "provider": {
      "type": "string",
      "description": "google tai bing",
      "enum": [
        "google",
        "bing"
      ],
      "default": "google"
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "provider": {
      "type": "string",
      "description": "google tai bing"
    },
    "property": {
      "type": "string",
      "description": "Search Console -ominaisuus tai Bing-sivuston URL"
    },
    "status": {
      "type": "string",
      "description": "active tai error"
    },
    "last_synced_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Hälytykset

POST /alerts/:id/acknowledge.json Kuittaa viimeisin häiriö alerts_acknowledge

Oikeus: analytics.read

Esimerkki
curl -X POST https://privatusanalytics.com/alerts/:id/acknowledge.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Hälytyksen tunniste, esim. alr_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Sivuston tunniste (null käyttöhälytyksille)"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "threshold, anomaly, goal, no_data, usage, uptime, ssl tai vitals"
    },
    "metric": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "operator": {
      "anyOf": [
        {
          "type": "string",
          "description": "gt, gte, lt tai lte"
        },
        {
          "type": "null"
        }
      ]
    },
    "threshold": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "window_minutes": {
      "type": "integer"
    },
    "sensitivity": {
      "type": "string",
      "description": "anomaly-herkkyys"
    },
    "goal_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "channel_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Ilmoituskanavien tunnisteet"
    },
    "state": {
      "type": "string",
      "description": "ok tai 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 Luo hälytys alerts_create

Oikeus: content.write

Esimerkki
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/alerts.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste (pa_…). Pakollinen paitsi käyttöhälytyksille"
    },
    "metric": {
      "type": "string",
      "description": "threshold/anomaly: visitors, visits, pageviews, bounce_rate tai conversion. vitals: lcp, inp, cls, fcp tai ttfb"
    },
    "operator": {
      "type": "string",
      "description": "Vertailu (gt, gte, lt, lte). anomaly: lt vain laskut, gt vain piikit, tyhjä molemmat",
      "enum": [
        "gt",
        "gte",
        "lt",
        "lte"
      ]
    },
    "threshold": {
      "type": "number",
      "description": "threshold: mittarin arvo, goal: suoritukset, no_data: tunnit, usage: prosentti, ssl: päivät, vitals: ms (CLS: pisteet)"
    },
    "window_minutes": {
      "type": "integer",
      "description": "Arviointi-ikkuna minuutteina (5-10080)"
    },
    "sensitivity": {
      "type": "string",
      "description": "anomaly: low, medium tai high",
      "enum": [
        "low",
        "medium",
        "high"
      ]
    },
    "goal_id": {
      "type": "string",
      "description": "goal- ja conversion-hälytykset: tavoitteen tunniste (goal_…)"
    },
    "uptime_check_id": {
      "type": "string",
      "description": "uptime/ssl: tarkistuksen tunniste (oletus: kaikki sivuston tarkistukset)"
    },
    "channel_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Ilmoituskanavien tunnisteet (nch_…)"
    },
    "enabled": {
      "type": "boolean",
      "description": "Arvioi tämä hälytys"
    },
    "name": {
      "type": "string",
      "description": "Hälytyksen nimi",
      "examples": [
        "Traffic dropped"
      ]
    },
    "kind": {
      "type": "string",
      "description": "threshold, anomaly, goal, no_data, usage, uptime, ssl tai vitals",
      "enum": [
        "threshold",
        "anomaly",
        "goal",
        "no_data",
        "usage",
        "uptime",
        "ssl",
        "vitals"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "kind",
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Hälytyksen tunniste, esim. alr_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Sivuston tunniste (null käyttöhälytyksille)"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "threshold, anomaly, goal, no_data, usage, uptime, ssl tai vitals"
    },
    "metric": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "operator": {
      "anyOf": [
        {
          "type": "string",
          "description": "gt, gte, lt tai lte"
        },
        {
          "type": "null"
        }
      ]
    },
    "threshold": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "window_minutes": {
      "type": "integer"
    },
    "sensitivity": {
      "type": "string",
      "description": "anomaly-herkkyys"
    },
    "goal_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "channel_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Ilmoituskanavien tunnisteet"
    },
    "state": {
      "type": "string",
      "description": "ok tai 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 Poista hälytys alerts_delete

Oikeus: content.write

Esimerkki
curl -X DELETE https://privatusanalytics.com/alerts/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Hälytyksen tunniste, esim. alr_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Sivuston tunniste (null käyttöhälytyksille)"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "threshold, anomaly, goal, no_data, usage, uptime, ssl tai vitals"
    },
    "metric": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "operator": {
      "anyOf": [
        {
          "type": "string",
          "description": "gt, gte, lt tai lte"
        },
        {
          "type": "null"
        }
      ]
    },
    "threshold": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "window_minutes": {
      "type": "integer"
    },
    "sensitivity": {
      "type": "string",
      "description": "anomaly-herkkyys"
    },
    "goal_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "channel_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Ilmoituskanavien tunnisteet"
    },
    "state": {
      "type": "string",
      "description": "ok tai 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 Hälytyksen häiriöhistoria alerts_history

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/alerts/:id/history.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "open": {
      "type": "boolean",
      "description": "Vain ratkaisemattomat häiriöt",
      "default": false
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    },
    "page": {
      "type": "integer",
      "description": "Sivu (alkaen 1:stä)"
    },
    "per_page": {
      "type": "integer",
      "description": "Tuloksia sivulla (enintään 100)"
    }
  },
  "required": [
    "id"
  ]
}
Vastauksen tiedot
{
  "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": "Mitattu arvo laukaisuhetkellä"
          },
          {
            "type": "null"
          }
        ]
      },
      "message": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "acknowledged_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "acknowledged_by": {
        "anyOf": [
          {
            "type": "string",
            "description": "Kuittaajan nimi"
          },
          {
            "type": "null"
          }
        ]
      }
    }
  }
}
GET /workspaces/:workspace_id/alerts.json Listaa hälytykset alerts_list

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/workspaces/:workspace_id/alerts.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Vain tämän sivuston hälytykset (pa_…)"
    },
    "state": {
      "type": "string",
      "description": "Vain ok- tai triggered-tilassa olevat hälytykset",
      "enum": [
        "ok",
        "triggered"
      ]
    },
    "kind": {
      "type": "string",
      "description": "Vain tämä laji",
      "enum": [
        "threshold",
        "anomaly",
        "goal",
        "no_data",
        "usage",
        "uptime",
        "ssl",
        "vitals"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Sivu (alkaen 1:stä)"
    },
    "per_page": {
      "type": "integer",
      "description": "Tuloksia sivulla (enintään 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Hälytyksen tunniste, esim. alr_7Q2K9XH3AB"
      },
      "site_id": {
        "anyOf": [
          {
            "type": "string",
            "description": "Sivuston tunniste (null käyttöhälytyksille)"
          },
          {
            "type": "null"
          }
        ]
      },
      "name": {
        "type": "string"
      },
      "kind": {
        "type": "string",
        "description": "threshold, anomaly, goal, no_data, usage, uptime, ssl tai vitals"
      },
      "metric": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "operator": {
        "anyOf": [
          {
            "type": "string",
            "description": "gt, gte, lt tai lte"
          },
          {
            "type": "null"
          }
        ]
      },
      "threshold": {
        "anyOf": [
          {
            "type": "number"
          },
          {
            "type": "null"
          }
        ]
      },
      "window_minutes": {
        "type": "integer"
      },
      "sensitivity": {
        "type": "string",
        "description": "anomaly-herkkyys"
      },
      "goal_id": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "channel_ids": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Ilmoituskanavien tunnisteet"
      },
      "state": {
        "type": "string",
        "description": "ok tai 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 Mykistä hälytyksen ilmoitukset (tai poista mykistys) alerts_mute

Oikeus: content.write

Esimerkki
curl -X POST https://privatusanalytics.com/alerts/:id/mute.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "minutes": {
      "type": "integer",
      "description": "Mykistä näin monta minuuttia (0 poistaa mykistyksen, enintään 30 päivää)",
      "default": 60
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Hälytyksen tunniste, esim. alr_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Sivuston tunniste (null käyttöhälytyksille)"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "threshold, anomaly, goal, no_data, usage, uptime, ssl tai vitals"
    },
    "metric": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "operator": {
      "anyOf": [
        {
          "type": "string",
          "description": "gt, gte, lt tai lte"
        },
        {
          "type": "null"
        }
      ]
    },
    "threshold": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "window_minutes": {
      "type": "integer"
    },
    "sensitivity": {
      "type": "string",
      "description": "anomaly-herkkyys"
    },
    "goal_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "channel_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Ilmoituskanavien tunnisteet"
    },
    "state": {
      "type": "string",
      "description": "ok tai 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 Hae hälytys alerts_get

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/alerts/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Hälytyksen tunniste, esim. alr_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Sivuston tunniste (null käyttöhälytyksille)"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "threshold, anomaly, goal, no_data, usage, uptime, ssl tai vitals"
    },
    "metric": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "operator": {
      "anyOf": [
        {
          "type": "string",
          "description": "gt, gte, lt tai lte"
        },
        {
          "type": "null"
        }
      ]
    },
    "threshold": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "window_minutes": {
      "type": "integer"
    },
    "sensitivity": {
      "type": "string",
      "description": "anomaly-herkkyys"
    },
    "goal_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "channel_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Ilmoituskanavien tunnisteet"
    },
    "state": {
      "type": "string",
      "description": "ok tai 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 Päivitä hälytys alerts_update

Oikeus: content.write

Esimerkki
curl -X PATCH https://privatusanalytics.com/alerts/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste (pa_…). Pakollinen paitsi käyttöhälytyksille"
    },
    "metric": {
      "type": "string",
      "description": "threshold/anomaly: visitors, visits, pageviews, bounce_rate tai conversion. vitals: lcp, inp, cls, fcp tai ttfb"
    },
    "operator": {
      "type": "string",
      "description": "Vertailu (gt, gte, lt, lte). anomaly: lt vain laskut, gt vain piikit, tyhjä molemmat",
      "enum": [
        "gt",
        "gte",
        "lt",
        "lte"
      ]
    },
    "threshold": {
      "type": "number",
      "description": "threshold: mittarin arvo, goal: suoritukset, no_data: tunnit, usage: prosentti, ssl: päivät, vitals: ms (CLS: pisteet)"
    },
    "window_minutes": {
      "type": "integer",
      "description": "Arviointi-ikkuna minuutteina (5-10080)"
    },
    "sensitivity": {
      "type": "string",
      "description": "anomaly: low, medium tai high",
      "enum": [
        "low",
        "medium",
        "high"
      ]
    },
    "goal_id": {
      "type": "string",
      "description": "goal- ja conversion-hälytykset: tavoitteen tunniste (goal_…)"
    },
    "uptime_check_id": {
      "type": "string",
      "description": "uptime/ssl: tarkistuksen tunniste (oletus: kaikki sivuston tarkistukset)"
    },
    "channel_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Ilmoituskanavien tunnisteet (nch_…)"
    },
    "enabled": {
      "type": "boolean",
      "description": "Arvioi tämä hälytys"
    },
    "name": {
      "type": "string",
      "description": "Hälytyksen nimi"
    },
    "kind": {
      "type": "string",
      "description": "Hälytyksen laji",
      "enum": [
        "threshold",
        "anomaly",
        "goal",
        "no_data",
        "usage",
        "uptime",
        "ssl",
        "vitals"
      ]
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Hälytyksen tunniste, esim. alr_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Sivuston tunniste (null käyttöhälytyksille)"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "threshold, anomaly, goal, no_data, usage, uptime, ssl tai vitals"
    },
    "metric": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "operator": {
      "anyOf": [
        {
          "type": "string",
          "description": "gt, gte, lt tai lte"
        },
        {
          "type": "null"
        }
      ]
    },
    "threshold": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "window_minutes": {
      "type": "integer"
    },
    "sensitivity": {
      "type": "string",
      "description": "anomaly-herkkyys"
    },
    "goal_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "channel_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Ilmoituskanavien tunnisteet"
    },
    "state": {
      "type": "string",
      "description": "ok tai 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 Listaa sivuston hälytykset site_alerts_list

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/sites/:site_id/alerts.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "state": {
      "type": "string",
      "description": "Vain ok- tai triggered-tilassa olevat hälytykset",
      "enum": [
        "ok",
        "triggered"
      ]
    },
    "kind": {
      "type": "string",
      "description": "Vain tämä laji",
      "enum": [
        "threshold",
        "anomaly",
        "goal",
        "no_data",
        "usage",
        "uptime",
        "ssl",
        "vitals"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Sivu (alkaen 1:stä)"
    },
    "per_page": {
      "type": "integer",
      "description": "Tuloksia sivulla (enintään 100)"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Hälytyksen tunniste, esim. alr_7Q2K9XH3AB"
      },
      "site_id": {
        "anyOf": [
          {
            "type": "string",
            "description": "Sivuston tunniste (null käyttöhälytyksille)"
          },
          {
            "type": "null"
          }
        ]
      },
      "name": {
        "type": "string"
      },
      "kind": {
        "type": "string",
        "description": "threshold, anomaly, goal, no_data, usage, uptime, ssl tai vitals"
      },
      "metric": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "operator": {
        "anyOf": [
          {
            "type": "string",
            "description": "gt, gte, lt tai lte"
          },
          {
            "type": "null"
          }
        ]
      },
      "threshold": {
        "anyOf": [
          {
            "type": "number"
          },
          {
            "type": "null"
          }
        ]
      },
      "window_minutes": {
        "type": "integer"
      },
      "sensitivity": {
        "type": "string",
        "description": "anomaly-herkkyys"
      },
      "goal_id": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "channel_ids": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Ilmoituskanavien tunnisteet"
      },
      "state": {
        "type": "string",
        "description": "ok tai 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"
      }
    }
  }
}

Ilmoituskanavat

POST /workspaces/:workspace_id/channels.json Lisää ilmoituskanava notification_channels_create

Oikeus: content.write

Esimerkki
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/channels.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Webhook-URL (slack, teams, discord, webhook), HTTPS"
    },
    "secret": {
      "type": "string",
      "description": "webhook: HMAC-salaisuus X-Privatus-Signature-otsakkeelle"
    },
    "emails": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "email: vastaanottajien osoitteet (enintään 20)"
    },
    "routing_key": {
      "type": "string",
      "description": "pagerduty: Events API v2 -integraatioavain"
    },
    "api_key": {
      "type": "string",
      "description": "opsgenie: API-integraatioavain"
    },
    "region": {
      "type": "string",
      "description": "opsgenie: tilin alue",
      "enum": [
        "us",
        "eu"
      ]
    },
    "kind": {
      "type": "string",
      "description": "email, slack, teams, discord, webhook, pagerduty, opsgenie tai push",
      "enum": [
        "email",
        "slack",
        "teams",
        "discord",
        "webhook",
        "pagerduty",
        "opsgenie",
        "push"
      ]
    },
    "name": {
      "type": "string",
      "description": "Näyttönimi",
      "examples": [
        "#alerts"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "kind",
    "name",
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Kanavan tunniste, esim. nch_7Q2K9XH3AB"
    },
    "kind": {
      "type": "string",
      "description": "email, slack, teams, discord, webhook, pagerduty, opsgenie tai push"
    },
    "name": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "Peitetty kohde"
    },
    "last_used_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /channels/:id.json Poista ilmoituskanava notification_channels_delete

Oikeus: content.write

Esimerkki
curl -X DELETE https://privatusanalytics.com/channels/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Kanavan tunniste, esim. nch_7Q2K9XH3AB"
    },
    "kind": {
      "type": "string",
      "description": "email, slack, teams, discord, webhook, pagerduty, opsgenie tai push"
    },
    "name": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "Peitetty kohde"
    },
    "last_used_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /workspaces/:workspace_id/channels.json Listaa ilmoituskanavat notification_channels_list

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/workspaces/:workspace_id/channels.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "description": "Vain tämän lajin kanavat",
      "enum": [
        "email",
        "slack",
        "teams",
        "discord",
        "webhook",
        "pagerduty",
        "opsgenie",
        "push"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Sivu (alkaen 1:stä)"
    },
    "per_page": {
      "type": "integer",
      "description": "Tuloksia sivulla (enintään 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Kanavan tunniste, esim. nch_7Q2K9XH3AB"
      },
      "kind": {
        "type": "string",
        "description": "email, slack, teams, discord, webhook, pagerduty, opsgenie tai push"
      },
      "name": {
        "type": "string"
      },
      "target": {
        "type": "string",
        "description": "Peitetty kohde"
      },
      "last_used_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
POST /channels/:id/send_test.json Lähetä testiviesti kanavan kautta notification_channels_send_test

Oikeus: content.write

Esimerkki
curl -X POST https://privatusanalytics.com/channels/:id/send_test.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Kanavan tunniste, esim. nch_7Q2K9XH3AB"
    },
    "kind": {
      "type": "string",
      "description": "email, slack, teams, discord, webhook, pagerduty, opsgenie tai push"
    },
    "name": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "Peitetty kohde"
    },
    "last_used_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /channels/:id.json Hae ilmoituskanava notification_channels_get

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/channels/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Kanavan tunniste, esim. nch_7Q2K9XH3AB"
    },
    "kind": {
      "type": "string",
      "description": "email, slack, teams, discord, webhook, pagerduty, opsgenie tai push"
    },
    "name": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "Peitetty kohde"
    },
    "last_used_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
PATCH /channels/:id.json Päivitä ilmoituskanava notification_channels_update

Oikeus: content.write

Esimerkki
curl -X PATCH https://privatusanalytics.com/channels/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Webhook-URL (slack, teams, discord, webhook), HTTPS"
    },
    "secret": {
      "type": "string",
      "description": "webhook: HMAC-salaisuus X-Privatus-Signature-otsakkeelle"
    },
    "emails": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "email: vastaanottajien osoitteet (enintään 20)"
    },
    "routing_key": {
      "type": "string",
      "description": "pagerduty: Events API v2 -integraatioavain"
    },
    "api_key": {
      "type": "string",
      "description": "opsgenie: API-integraatioavain"
    },
    "region": {
      "type": "string",
      "description": "opsgenie: tilin alue",
      "enum": [
        "us",
        "eu"
      ]
    },
    "name": {
      "type": "string",
      "description": "Näyttönimi"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Kanavan tunniste, esim. nch_7Q2K9XH3AB"
    },
    "kind": {
      "type": "string",
      "description": "email, slack, teams, discord, webhook, pagerduty, opsgenie tai push"
    },
    "name": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "Peitetty kohde"
    },
    "last_used_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /push_subscription.json Rekisteröi selain push-ilmoituksille push_subscriptions_create

Oikeus: member

Esimerkki
curl -X POST https://privatusanalytics.com/push_subscription.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "endpoint": {
      "type": "string",
      "description": "PushSubscription.endpoint selaimesta"
    },
    "p256dh": {
      "type": "string",
      "description": "PushSubscription keys.p256dh (base64url)"
    },
    "auth": {
      "type": "string",
      "description": "PushSubscription keys.auth (base64url)"
    }
  },
  "required": [
    "endpoint",
    "p256dh",
    "auth"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "endpoint_host": {
      "type": "string",
      "description": "Push-palvelun isäntä"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /push_subscription.json Poista selaimen push-rekisteröinti push_subscriptions_delete

Oikeus: member

Esimerkki
curl -X DELETE https://privatusanalytics.com/push_subscription.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "endpoint": {
      "type": "string",
      "description": "Poistettava PushSubscription.endpoint"
    }
  },
  "required": [
    "endpoint"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "endpoint_host": {
      "type": "string",
      "description": "Push-palvelun isäntä"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Indeksoijat

POST /sites/:site_id/crawlers/connection.json Synkronoi tekoälyindeksoijien osumat Cloudflare-vyöhykkeeltä (vaatii Cloudflare-valtuutuksen selaimesta) crawlers_cloudflare_connect

Oikeus: sites.manage

Esimerkki
curl -X POST https://privatusanalytics.com/sites/:site_id/crawlers/connection.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "zone_id": {
      "type": "string",
      "description": "Cloudflare-vyöhykkeen tunniste, crawlers_cloudflare_zones-työkalusta",
      "examples": [
        "023e105f4ecef8ad9ca31a8372d0c353"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "zone_id",
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "zone_id": {
      "type": "string",
      "description": "Cloudflare-vyöhykkeen tunniste"
    },
    "zone_name": {
      "type": "string",
      "description": "Cloudflare-vyöhykkeen nimi, esim. example.com"
    },
    "status": {
      "type": "string",
      "description": "active tai error"
    },
    "last_synced_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Milloin indeksoijien osumat tuotiin viimeksi, tai null ennen ensimmäistä tuontia"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:site_id/crawlers/connection.json Katkaise Cloudflare-yhteys ja poista sen tuomat indeksoijien osumat crawlers_cloudflare_disconnect

Oikeus: sites.manage

Esimerkki
curl -X DELETE https://privatusanalytics.com/sites/:site_id/crawlers/connection.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "zone_id": {
      "type": "string",
      "description": "Cloudflare-vyöhykkeen tunniste"
    },
    "zone_name": {
      "type": "string",
      "description": "Cloudflare-vyöhykkeen nimi, esim. example.com"
    },
    "status": {
      "type": "string",
      "description": "active tai error"
    },
    "last_synced_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Milloin indeksoijien osumat tuotiin viimeksi, tai null ennen ensimmäistä tuontia"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /sites/:site_id/crawlers/sync.json Tuo indeksoijien osumat Cloudflaresta nyt crawlers_cloudflare_sync

Oikeus: sites.manage

Esimerkki
curl -X POST https://privatusanalytics.com/sites/:site_id/crawlers/sync.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "zone_id": {
      "type": "string",
      "description": "Cloudflare-vyöhykkeen tunniste"
    },
    "zone_name": {
      "type": "string",
      "description": "Cloudflare-vyöhykkeen nimi, esim. example.com"
    },
    "status": {
      "type": "string",
      "description": "active tai error"
    },
    "last_synced_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Milloin indeksoijien osumat tuotiin viimeksi, tai null ennen ensimmäistä tuontia"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/crawlers/zones.json Listaa Cloudflare-vyöhykkeet, joihin voit yhdistää (vaatii Cloudflare-valtuutuksen selaimesta) crawlers_cloudflare_zones

Oikeus: sites.manage

Esimerkki
curl https://privatusanalytics.com/sites/:site_id/crawlers/zones.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}
GET /sites/:site_id/crawlers.json Tekoälyindeksoijien raportti: kutsut indeksoijittain ajan mukaan, kärkipolut indeksoijaa kohden, luokittain crawlers_report

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/sites/:site_id/crawlers.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Aikavälin esiasetus. Käytä custom-arvoa yhdessä from/to-parametrien kanssa",
      "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": "Mukautetun aikavälin alku (sivuston aikavyöhyke)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun aikavälin loppu, mukaan lukien"
    },
    "category": {
      "type": "string",
      "description": "ai, search, seo, other tai all",
      "enum": [
        "all",
        "ai",
        "search",
        "seo",
        "other"
      ],
      "default": "ai"
    },
    "crawler": {
      "type": "string",
      "description": "Vain tämä indeksoija, esim. GPTBot"
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}

Jakaminen

GET /badge/:site_id.json Kävijälaskurin merkki (SVG) julkiselle sivustolle badges_get

Oikeus: public · Vain HTTP (ei MCP-työkalu)

Esimerkki
curl https://privatusanalytics.com/badge/:site_id.json
Syötteet
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}
GET /share/:token/breakdown/:dimension.json Jaetun dimension yleisimmät arvot shares_breakdown

Oikeus: public

Esimerkki
curl https://privatusanalytics.com/share/:token/breakdown/:dimension.json
Syötteet
{
  "type": "object",
  "properties": {
    "dimension": {
      "type": "string",
      "description": "Resurssin Dimension"
    },
    "period": {
      "type": "string",
      "description": "Aikavälin esiasetus (ohitetaan, jos linkki lukitsee sen)",
      "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": "Mukautetun aikavälin alku"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun aikavälin loppu, mukaan lukien"
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Lisäsuodattimet, jos linkki sallii ne",
      "default": []
    },
    "limit": {
      "type": "integer",
      "description": "Rivit (enintään 100)",
      "default": 10
    },
    "token": {
      "type": "string",
      "description": "Resurssin Token"
    }
  },
  "required": [
    "dimension",
    "token"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}
GET /share/:token.json Jaetun koontinäkymän yleiskatsaus jakotunnisteella shares_overview

Oikeus: public

Esimerkki
curl https://privatusanalytics.com/share/:token.json
Syötteet
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Aikavälin esiasetus (ohitetaan, jos linkki lukitsee sen)",
      "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": "Mukautetun aikavälin alku"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun aikavälin loppu, mukaan lukien"
    },
    "compare": {
      "type": "string",
      "description": "Vertailujakso",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Lisäsuodattimet, jos linkki sallii ne: [[\"dimension\",\"operator\",\"value\"], …]",
      "default": []
    },
    "interval": {
      "type": "string",
      "description": "Kaavion aikavälin koko",
      "enum": [
        "auto",
        "minute",
        "hour",
        "day",
        "week",
        "month",
        "quarter",
        "year"
      ],
      "default": "auto"
    },
    "token": {
      "type": "string",
      "description": "Resurssin Token"
    }
  },
  "required": [
    "token"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}

Jäsenet

POST /workspaces/:workspace_id/invitations.json Kutsu henkilöitä sähköpostilla invitations_create

Oikeus: members.manage

Esimerkki
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/invitations.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "emails": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Kutsuttavien sähköpostiosoitteet"
    },
    "role": {
      "type": "string",
      "description": "Uusien jäsenten rooli (custom vaatii custom_role_id:n)",
      "enum": [
        "admin",
        "editor",
        "analyst",
        "viewer",
        "billing",
        "custom"
      ],
      "default": "viewer"
    },
    "custom_role_id": {
      "type": "string",
      "description": "Oman roolin tunniste (Business)"
    },
    "all_sites": {
      "type": "boolean",
      "description": "Pääsy kaikkiin sivustoihin, myös tuleviin",
      "default": true
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Sivustotunnisteet (pa_…), kun all_sites on false",
      "default": []
    },
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "emails",
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "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 Peruuta odottava kutsu invitations_delete

Oikeus: members.manage

Esimerkki
curl -X DELETE https://privatusanalytics.com/workspaces/:workspace_id/invitations/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "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 Listaa odottavat kutsut invitations_list

Oikeus: members.manage

Esimerkki
curl https://privatusanalytics.com/workspaces/:workspace_id/invitations.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Sivu (alkaen 1:stä)"
    },
    "per_page": {
      "type": "integer",
      "description": "Tuloksia sivulla (enintään 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "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 Poista jäsen (tai poistu työtilasta) members_delete

Oikeus: member

Esimerkki
curl -X DELETE https://privatusanalytics.com/workspaces/:workspace_id/members/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Jäsenen tunniste (käytä sitä jäsenen päivittämiseen tai poistamiseen)"
    },
    "email": {
      "type": "string"
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "role": {
      "type": "string",
      "description": "owner, admin, editor, analyst, viewer, billing tai custom"
    },
    "custom_role": {
      "anyOf": [
        {
          "type": "string",
          "description": "Oman roolin nimi"
        },
        {
          "type": "null"
        }
      ]
    },
    "custom_role_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ]
    },
    "all_sites": {
      "type": "boolean",
      "description": "Pääsy kaikkiin sivustoihin"
    },
    "include_future_sites": {
      "type": "boolean"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Sivustotunnisteet, kun all_sites on false"
    },
    "two_factor": {
      "type": "boolean",
      "description": "Onko 2FA tai pääsyavain"
    },
    "last_active_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Liittymisaika"
    }
  }
}
GET /workspaces/:workspace_id/members.json Listaa työtilan jäsenet members_list

Oikeus: member

Esimerkki
curl https://privatusanalytics.com/workspaces/:workspace_id/members.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "description": "Suodata nimen tai sähköpostin mukaan"
    },
    "role": {
      "type": "string",
      "description": "Vain jäsenet, joilla on tämä rooli",
      "enum": [
        "owner",
        "admin",
        "editor",
        "analyst",
        "viewer",
        "billing",
        "custom"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Sivu (alkaen 1:stä)"
    },
    "per_page": {
      "type": "integer",
      "description": "Tuloksia sivulla (enintään 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "format": "uuid",
        "description": "Jäsenen tunniste (käytä sitä jäsenen päivittämiseen tai poistamiseen)"
      },
      "email": {
        "type": "string"
      },
      "name": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "role": {
        "type": "string",
        "description": "owner, admin, editor, analyst, viewer, billing tai custom"
      },
      "custom_role": {
        "anyOf": [
          {
            "type": "string",
            "description": "Oman roolin nimi"
          },
          {
            "type": "null"
          }
        ]
      },
      "custom_role_id": {
        "anyOf": [
          {
            "type": "string",
            "format": "uuid"
          },
          {
            "type": "null"
          }
        ]
      },
      "all_sites": {
        "type": "boolean",
        "description": "Pääsy kaikkiin sivustoihin"
      },
      "include_future_sites": {
        "type": "boolean"
      },
      "site_ids": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Sivustotunnisteet, kun all_sites on false"
      },
      "two_factor": {
        "type": "boolean",
        "description": "Onko 2FA tai pääsyavain"
      },
      "last_active_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "created_at": {
        "type": "string",
        "format": "date-time",
        "description": "Liittymisaika"
      }
    }
  }
}
PATCH /workspaces/:workspace_id/members/:id.json Muuta jäsenen roolia tai sivustojen käyttöoikeutta members_update

Oikeus: members.manage

Esimerkki
curl -X PATCH https://privatusanalytics.com/workspaces/:workspace_id/members/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "role": {
      "type": "string",
      "description": "Uusi rooli (custom vaatii custom_role_id:n)",
      "enum": [
        "admin",
        "editor",
        "analyst",
        "viewer",
        "billing",
        "custom"
      ]
    },
    "custom_role_id": {
      "type": "string",
      "description": "Oman roolin tunniste (Business)"
    },
    "all_sites": {
      "type": "boolean",
      "description": "Pääsy kaikkiin sivustoihin, myös tuleviin"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Sivustotunnisteet (pa_…), kun all_sites on false"
    },
    "include_future_sites": {
      "type": "boolean",
      "description": "Myönnä pääsy myös myöhemmin lisättäviin sivustoihin"
    },
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Jäsenen tunniste (käytä sitä jäsenen päivittämiseen tai poistamiseen)"
    },
    "email": {
      "type": "string"
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "role": {
      "type": "string",
      "description": "owner, admin, editor, analyst, viewer, billing tai custom"
    },
    "custom_role": {
      "anyOf": [
        {
          "type": "string",
          "description": "Oman roolin nimi"
        },
        {
          "type": "null"
        }
      ]
    },
    "custom_role_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ]
    },
    "all_sites": {
      "type": "boolean",
      "description": "Pääsy kaikkiin sivustoihin"
    },
    "include_future_sites": {
      "type": "boolean"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Sivustotunnisteet, kun all_sites on false"
    },
    "two_factor": {
      "type": "boolean",
      "description": "Onko 2FA tai pääsyavain"
    },
    "last_active_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Liittymisaika"
    }
  }
}
POST /workspaces/:workspace_id/ownership_transfer.json Siirrä työtilan omistajuus toiselle jäsenelle (vain omistaja, sinusta tulee ylläpitäjä) ownership_transfers_create

Oikeus: member

Esimerkki
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/ownership_transfer.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "membership_id": {
      "type": "string",
      "description": "Uuden omistajan jäsentunniste"
    },
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "membership_id",
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Jäsenen tunniste (käytä sitä jäsenen päivittämiseen tai poistamiseen)"
    },
    "email": {
      "type": "string"
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "role": {
      "type": "string",
      "description": "owner, admin, editor, analyst, viewer, billing tai custom"
    },
    "custom_role": {
      "anyOf": [
        {
          "type": "string",
          "description": "Oman roolin nimi"
        },
        {
          "type": "null"
        }
      ]
    },
    "custom_role_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ]
    },
    "all_sites": {
      "type": "boolean",
      "description": "Pääsy kaikkiin sivustoihin"
    },
    "include_future_sites": {
      "type": "boolean"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Sivustotunnisteet, kun all_sites on false"
    },
    "two_factor": {
      "type": "boolean",
      "description": "Onko 2FA tai pääsyavain"
    },
    "last_active_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Liittymisaika"
    }
  }
}

Kampanjat

POST /sites/:site_id/campaigns/costs.json Aseta kampanjan kulut kuukaudelle campaign_costs_create

Oikeus: content.write

Esimerkki
curl -X POST https://privatusanalytics.com/sites/:site_id/campaigns/costs.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "campaign": {
      "type": "string",
      "description": "utm_campaign-arvo, jolle kulu kuuluu",
      "examples": [
        "spring_sale"
      ]
    },
    "month": {
      "type": "string",
      "description": "Kuukausi, VVVV-KK",
      "examples": [
        "2026-09"
      ]
    },
    "amount": {
      "type": "number",
      "description": "Kulu pääyksikköinä, esim. 1250.50"
    },
    "currency": {
      "type": "string",
      "description": "ISO 4217 -valuutta (oletuksena sivuston valuutta)"
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "campaign",
    "month",
    "amount",
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Kulumerkinnän tunniste"
    },
    "campaign": {
      "type": "string",
      "description": "utm_campaign-arvo"
    },
    "month": {
      "type": "string",
      "description": "Kuukausi, VVVV-KK"
    },
    "amount_minor": {
      "type": "integer",
      "description": "Kulu pienimmissä yksiköissä"
    },
    "currency": {
      "type": "string",
      "description": "Summan ISO 4217 -valuutta"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:site_id/campaigns/costs/:id.json Poista kampanjan kulumerkintä campaign_costs_delete

Oikeus: content.write

Esimerkki
curl -X DELETE https://privatusanalytics.com/sites/:site_id/campaigns/costs/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Kulumerkinnän tunniste"
    },
    "campaign": {
      "type": "string",
      "description": "utm_campaign-arvo"
    },
    "month": {
      "type": "string",
      "description": "Kuukausi, VVVV-KK"
    },
    "amount_minor": {
      "type": "integer",
      "description": "Kulu pienimmissä yksiköissä"
    },
    "currency": {
      "type": "string",
      "description": "Summan ISO 4217 -valuutta"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /sites/:site_id/campaigns/costs/import.json Tuo kampanjakulut CSV:stä (campaign,month,amount[,currency]) campaign_costs_import

Oikeus: content.write

Esimerkki
curl -X POST https://privatusanalytics.com/sites/:site_id/campaigns/costs/import.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "file": {
      "type": "string",
      "format": "binary",
      "description": "CSV-tiedoston lataus (multipart-lomakkeet)"
    },
    "csv": {
      "type": "string",
      "description": "CSV-teksti: campaign,month,amount[,currency]"
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "imported": {
      "type": "integer",
      "description": "Tallennetut rivit"
    },
    "failed": {
      "type": "integer",
      "description": "Ohitetut rivit"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Miksi rivit ohitettiin (ensimmäiset 50)"
    }
  }
}
GET /sites/:site_id/campaigns/costs.json Listaa kampanjakulumerkinnät campaign_costs_list

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/sites/:site_id/campaigns/costs.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "campaign": {
      "type": "string",
      "description": "Vain tämä kampanja"
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Sivu (alkaen 1:stä)"
    },
    "per_page": {
      "type": "integer",
      "description": "Tuloksia sivulla (enintään 100)"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "format": "uuid",
        "description": "Kulumerkinnän tunniste"
      },
      "campaign": {
        "type": "string",
        "description": "utm_campaign-arvo"
      },
      "month": {
        "type": "string",
        "description": "Kuukausi, VVVV-KK"
      },
      "amount_minor": {
        "type": "integer",
        "description": "Kulu pienimmissä yksiköissä"
      },
      "currency": {
        "type": "string",
        "description": "Summan ISO 4217 -valuutta"
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      },
      "updated_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
PATCH /sites/:site_id/campaigns/costs/:id.json Muuta kampanjan kulumerkintää campaign_costs_update

Oikeus: content.write

Esimerkki
curl -X PATCH https://privatusanalytics.com/sites/:site_id/campaigns/costs/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "campaign": {
      "type": "string",
      "description": "utm_campaign-arvo"
    },
    "month": {
      "type": "string",
      "description": "Kuukausi, VVVV-KK"
    },
    "amount": {
      "type": "number",
      "description": "Kulu pääyksikköinä"
    },
    "currency": {
      "type": "string",
      "description": "ISO 4217 -valuutta"
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Kulumerkinnän tunniste"
    },
    "campaign": {
      "type": "string",
      "description": "utm_campaign-arvo"
    },
    "month": {
      "type": "string",
      "description": "Kuukausi, VVVV-KK"
    },
    "amount_minor": {
      "type": "integer",
      "description": "Kulu pienimmissä yksiköissä"
    },
    "currency": {
      "type": "string",
      "description": "Summan ISO 4217 -valuutta"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/campaigns/builder.json Rakenna ja tarkista UTM-tunnisteilla varustettu URL campaigns_builder

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/sites/:site_id/campaigns/builder.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "destination": {
      "type": "string",
      "description": "Laskeutumissivun URL (https://…)",
      "examples": [
        "https://example.com/pricing"
      ]
    },
    "preset": {
      "type": "string",
      "description": "Täytä utm_source/utm_medium kanavalle, kun tyhjä",
      "enum": [
        "newsletter",
        "social",
        "paid_search",
        "paid_social",
        "print",
        "partner"
      ]
    },
    "utm_source": {
      "type": "string",
      "description": "Mistä liikenne tulee"
    },
    "utm_medium": {
      "type": "string",
      "description": "Markkinointimedia, esim. email, cpc"
    },
    "utm_campaign": {
      "type": "string",
      "description": "Kampanjan nimi, esim. spring_sale"
    },
    "utm_content": {
      "type": "string",
      "description": "Variantti, esim. header_button"
    },
    "utm_term": {
      "type": "string",
      "description": "Maksetun haun avainsana"
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "url": {
      "anyOf": [
        {
          "type": "string",
          "description": "Tunnisteilla varustettu URL (null virheiden aikana)"
        },
        {
          "type": "null"
        }
      ]
    },
    "valid": {
      "type": "boolean",
      "description": "True, kun virheitä ei ole"
    },
    "destination": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "preset": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "utm_source": {
      "anyOf": [
        {
          "type": "string",
          "description": "Normalisoitu utm_source"
        },
        {
          "type": "null"
        }
      ]
    },
    "utm_medium": {
      "anyOf": [
        {
          "type": "string",
          "description": "Normalisoitu utm_medium"
        },
        {
          "type": "null"
        }
      ]
    },
    "utm_campaign": {
      "anyOf": [
        {
          "type": "string",
          "description": "Normalisoitu utm_campaign"
        },
        {
          "type": "null"
        }
      ]
    },
    "utm_content": {
      "anyOf": [
        {
          "type": "string",
          "description": "Normalisoitu utm_content"
        },
        {
          "type": "null"
        }
      ]
    },
    "utm_term": {
      "anyOf": [
        {
          "type": "string",
          "description": "Normalisoitu utm_term"
        },
        {
          "type": "null"
        }
      ]
    },
    "issues": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "field, level (error tai warning) ja message"
    },
    "presets": {
      "type": "object",
      "description": "Kanavien esiasetukset: utm_source/utm_medium esiasetusta kohden"
    }
  }
}
GET /sites/:site_id/campaigns/hygiene.json UTM-hygienia: lähes päällekkäiset arvot, tyylivirheet ja tuntemattomat lähteet campaigns_hygiene

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/sites/:site_id/campaigns/hygiene.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Aikavälin esiasetus. Käytä custom-arvoa yhdessä from/to-parametrien kanssa",
      "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": "Mukautetun aikavälin alku (sivuston aikavyöhyke)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun aikavälin loppu, mukaan lukien"
    },
    "compare": {
      "type": "string",
      "description": "Vertailujakso",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun vertailun alku"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun vertailun loppu"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Kohdista vertailun viikonpäivät",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Suodattimet: [[\"dimension\",\"operator\",\"value\"], …]. Operaattorit: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Kääri ehdot muotoon {\"any\": [...]} TAI-ehtoa varten.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Ota käyttöön tallennettu segmentti (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Lisää tuodut historiatiedot (päivät ennen ensimmäistä natiivia tapahtumaa, ohitetaan kun suodattimia tai segmenttiä käytetään)",
      "default": false
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "period": {
      "type": "object",
      "description": "Jakson from/to (UTC)"
    },
    "duplicates": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Lähes päällekkäiset arvot: field, suggestion ja variantit [{value, visits}]"
    },
    "style_issues": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Arvot, jotka eivät ole pienaakkosia alaviivoilla: field, value, visits, suggestion"
    },
    "unknown_sources": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "utm_source-arvot, joita emme tunnista: value, visits"
    }
  }
}
GET /sites/:site_id/campaigns.json Kampanjayhteenveto konversioineen, tuloineen, kuluineen, CPA:ineen ja ROAS:ineen campaigns_list

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/sites/:site_id/campaigns.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Aikavälin esiasetus. Käytä custom-arvoa yhdessä from/to-parametrien kanssa",
      "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": "Mukautetun aikavälin alku (sivuston aikavyöhyke)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun aikavälin loppu, mukaan lukien"
    },
    "compare": {
      "type": "string",
      "description": "Vertailujakso",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun vertailun alku"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun vertailun loppu"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Kohdista vertailun viikonpäivät",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Suodattimet: [[\"dimension\",\"operator\",\"value\"], …]. Operaattorit: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Kääri ehdot muotoon {\"any\": [...]} TAI-ehtoa varten.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Ota käyttöön tallennettu segmentti (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Lisää tuodut historiatiedot (päivät ennen ensimmäistä natiivia tapahtumaa, ohitetaan kun suodattimia tai segmenttiä käytetään)",
      "default": false
    },
    "goal_id": {
      "type": "string",
      "description": "Tavoite (goal_…), jonka konversiot lasketaan. Oletuksena ensimmäinen aktiivinen tavoite"
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "period": {
      "type": "object",
      "description": "Jakson from/to (UTC)"
    },
    "currency": {
      "type": "string",
      "description": "Sivuston valuutta tulolle ja kulle"
    },
    "goal_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Konversioksi laskettu tavoite"
        },
        {
          "type": "null"
        }
      ]
    },
    "goal_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "campaigns": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Per utm_campaign: visitors, visits, conversions, conversion_rate, revenue, cost, cpa (pienimmissä yksiköissä), roas (revenue ÷ cost) ja sources [{source, medium, visitors, visits, conversions, conversion_rate, revenue}]"
    },
    "totals": {
      "type": "object",
      "description": "Kaikkien listattujen kampanjoiden summat"
    }
  }
}

Kanavasäännöt

POST /sites/:site_id/channel_rules.json Lisää kanavasääntö channel_rules_create

Oikeus: sites.manage

Esimerkki
curl -X POST https://privatusanalytics.com/sites/:site_id/channel_rules.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "channel": {
      "type": "string",
      "description": "Määritettävän kanavan nimi, esim. Partners"
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "operator": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        }
      },
      "description": "Ehdot, joiden kaikkien on täsmättävä: [{\"field\": \"utm_source\", \"operator\": \"is\", \"value\": \"newsletter\"}]. Kentät: referrer_host, utm_source, utm_medium, utm_campaign, ref, path. Operaattorit: is, contains, starts_with, regex."
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "channel",
    "conditions",
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Säännön tunniste"
    },
    "channel": {
      "type": "string",
      "description": "Määritetty kanava, kun kaikki ehdot täsmäävät"
    },
    "position": {
      "type": "integer",
      "description": "Arviointijärjestys (ensimmäinen osuma voittaa)"
    },
    "conditions": {
      "type": "array",
      "description": "Ehdot: field, operator, value"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:site_id/channel_rules/:id.json Poista kanavasääntö channel_rules_delete

Oikeus: sites.manage

Esimerkki
curl -X DELETE https://privatusanalytics.com/sites/:site_id/channel_rules/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Säännön tunniste"
    },
    "channel": {
      "type": "string",
      "description": "Määritetty kanava, kun kaikki ehdot täsmäävät"
    },
    "position": {
      "type": "integer",
      "description": "Arviointijärjestys (ensimmäinen osuma voittaa)"
    },
    "conditions": {
      "type": "array",
      "description": "Ehdot: field, operator, value"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/channel_rules.json Listaa kanavasäännöt järjestyksessä channel_rules_list

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/sites/:site_id/channel_rules.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Säännön tunniste"
    },
    "channel": {
      "type": "string",
      "description": "Määritetty kanava, kun kaikki ehdot täsmäävät"
    },
    "position": {
      "type": "integer",
      "description": "Arviointijärjestys (ensimmäinen osuma voittaa)"
    },
    "conditions": {
      "type": "array",
      "description": "Ehdot: field, operator, value"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
PATCH /sites/:site_id/channel_rules/:id/move.json Siirrä kanavasääntöä ylös tai alas channel_rules_move

Oikeus: sites.manage

Esimerkki
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 '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "direction": {
      "type": "string",
      "description": "Minne sääntö siirretään",
      "enum": [
        "up",
        "down",
        "top",
        "bottom"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "direction",
    "site_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Säännön tunniste"
    },
    "channel": {
      "type": "string",
      "description": "Määritetty kanava, kun kaikki ehdot täsmäävät"
    },
    "position": {
      "type": "integer",
      "description": "Arviointijärjestys (ensimmäinen osuma voittaa)"
    },
    "conditions": {
      "type": "array",
      "description": "Ehdot: field, operator, value"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /sites/:site_id/channel_rules/preview.json Esikatsele esimerkkiviittaajan ja UTM-tunnisteiden kanava channel_rules_preview

Oikeus: analytics.read

Esimerkki
curl -X POST https://privatusanalytics.com/sites/:site_id/channel_rules/preview.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "referrer": {
      "type": "string",
      "description": "Viittaajan URL tai isäntänimi"
    },
    "utm_source": {
      "type": "string",
      "description": "utm_source-arvo"
    },
    "utm_medium": {
      "type": "string",
      "description": "utm_medium-arvo"
    },
    "utm_campaign": {
      "type": "string",
      "description": "utm_campaign-arvo"
    },
    "ref": {
      "type": "string",
      "description": "ref / via / source -parametri"
    },
    "path": {
      "type": "string",
      "description": "Laskeutumissivun polku, esim. /pricing"
    },
    "paid_click": {
      "type": "boolean",
      "description": "URL:ssä oli klikkaustunniste, kuten gclid",
      "default": false
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}
PATCH /sites/:site_id/channel_rules/:id.json Muuta kanavasääntöä channel_rules_update

Oikeus: sites.manage

Esimerkki
curl -X PATCH https://privatusanalytics.com/sites/:site_id/channel_rules/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "channel": {
      "type": "string",
      "description": "Määritettävän kanavan nimi"
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "operator": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        }
      },
      "description": "Ehdot, joiden kaikkien on täsmättävä: [{\"field\": \"utm_source\", \"operator\": \"is\", \"value\": \"newsletter\"}]. Kentät: referrer_host, utm_source, utm_medium, utm_campaign, ref, path. Operaattorit: is, contains, starts_with, regex."
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Säännön tunniste"
    },
    "channel": {
      "type": "string",
      "description": "Määritetty kanava, kun kaikki ehdot täsmäävät"
    },
    "position": {
      "type": "integer",
      "description": "Arviointijärjestys (ensimmäinen osuma voittaa)"
    },
    "conditions": {
      "type": "array",
      "description": "Ehdot: field, operator, value"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Keräys

POST /api/logs.json Lähetä palvelimen käyttölokit tekoälyindeksoijien raportointia varten (JSON {lines: [...]} tai yhdistetty lokiteksti, sivuston keruuavain Bearer-tunnisteena) crawler_logs_create

Oikeus: public · Vain HTTP (ei MCP-työkalu)

Esimerkki
curl -X POST https://privatusanalytics.com/api/logs.json \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "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": "Lokirivit: [{ts, path, status, user_agent}] (enintään 1000)"
    }
  },
  "required": [
    "lines"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}
POST /api/event.json Kerää selainkutsu (käyttää /js/pa.js) ingest_event

Oikeus: public · Vain HTTP (ei MCP-työkalu)

Esimerkki
curl -X POST https://privatusanalytics.com/api/event.json \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "site": {
      "type": "string",
      "description": "Sivuston tunniste (pa_…)"
    },
    "type": {
      "type": "string",
      "description": "Kutsun tyyppi",
      "enum": [
        "pageview",
        "event",
        "engagement",
        "vital",
        "click"
      ]
    },
    "url": {
      "type": "string",
      "description": "Sivun koko URL"
    },
    "referrer": {
      "type": "string",
      "description": "document.referrer"
    },
    "name": {
      "type": "string",
      "description": "Tapahtuman nimi (type=event) tai vitalin nimi"
    },
    "props": {
      "type": "object",
      "additionalProperties": true,
      "description": "Tapahtuman ominaisuudet: enintään 30 merkkijono-/luku-/totuusarvoa",
      "default": {}
    },
    "screen_width": {
      "type": "integer",
      "description": "Näytön leveys pikseleinä"
    },
    "language": {
      "type": "string",
      "description": "navigator.language"
    },
    "engaged_ms": {
      "type": "integer",
      "description": "Näkyvä aika sivulla (sitoutuminen)"
    },
    "scroll_depth": {
      "type": "integer",
      "description": "Suurin vierityssyvyys % (sitoutuminen)"
    },
    "value": {
      "type": "number",
      "description": "Web Vital -arvo (type=vital)"
    },
    "selector": {
      "type": "string",
      "description": "Klikatun elementin valitsin (type=click)"
    },
    "hash_mode": {
      "type": "boolean",
      "description": "Säilytä #fragmentti (hash-reititetyt sivustot)",
      "default": false
    },
    "dnt": {
      "type": "boolean",
      "description": "Do Not Track on päällä",
      "default": false
    },
    "gpc": {
      "type": "boolean",
      "description": "Global Privacy Control on päällä",
      "default": false
    },
    "interacted": {
      "type": "boolean",
      "description": "1, kun sivulla havaittiin luotettava syöte (osoitin, näppäin, kosketus tai rulla), muuten 0. Ei koordinaatteja eikä ajoitusta"
    },
    "revenue": {
      "type": "number",
      "description": "Tulo pääyksikköinä, esim. 49.99"
    },
    "currency": {
      "type": "string",
      "description": "Tulon ISO 4217 -valuutta"
    }
  },
  "required": [
    "site",
    "type",
    "url"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}
POST /api/events.json Kerää palvelinpuolen tapahtumia sivuston keruuavaimella ingest_events

Oikeus: public · Vain HTTP (ei MCP-työkalu)

Esimerkki
curl -X POST https://privatusanalytics.com/api/events.json \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "events": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      },
      "description": "Enintään 100 tapahtumaa"
    }
  },
  "required": [
    "events"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}
GET /api/pixel.json Kerää sivunäyttö ilman JavaScriptiä (1×1 GIF) ingest_pixel

Oikeus: public · Vain HTTP (ei MCP-työkalu)

Esimerkki
curl https://privatusanalytics.com/api/pixel.json
Syötteet
{
  "type": "object",
  "properties": {},
  "required": []
}
Vastauksen tiedot
{
  "type": "object"
}

Koontinäkymät

GET /workspaces/:workspace_id/dashboards/:id/cards/:index.json Oman koontinäkymän yhden kortin tiedot dashboards_card

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/workspaces/:workspace_id/dashboards/:id/cards/:index.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    },
    "index": {
      "type": "string",
      "description": "Resurssin Index"
    }
  },
  "required": [
    "workspace_id",
    "id",
    "index"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}
POST /workspaces/:workspace_id/dashboards.json Luo oma koontinäkymä dashboards_create

Oikeus: content.write

Esimerkki
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/dashboards.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Koontinäkymän nimi",
      "examples": [
        "Client: Acme"
      ]
    },
    "cards": {
      "type": "array",
      "items": {},
      "description": "Kortit järjestyksessä (enintään 40): [{\"type\": \"metric|chart|breakdown|goal|live|funnel|uptime|vitals\", \"site_id\": \"pa_…\", \"title\": \"valinnainen\", \"params\": {\"period\": \"30d\", \"metric\": \"visitors\", \"dimension\": \"page\", \"funnel_id\": \"fun_…\"}}]. Parametrit, joita tyyppi ei käytä, ohitetaan",
      "default": []
    },
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Koontinäkymän tunniste, esim. dash_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "cards": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Kortit järjestyksessä: [{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 Poista oma koontinäkymä dashboards_delete

Oikeus: content.write

Esimerkki
curl -X DELETE https://privatusanalytics.com/workspaces/:workspace_id/dashboards/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Koontinäkymän tunniste, esim. dash_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "cards": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Kortit järjestyksessä: [{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 Listaa omat koontinäkymät dashboards_list

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/workspaces/:workspace_id/dashboards.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Sivu (alkaen 1:stä)"
    },
    "per_page": {
      "type": "integer",
      "description": "Tuloksia sivulla (enintään 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Koontinäkymän tunniste, esim. dash_7Q2K9XH3AB"
      },
      "name": {
        "type": "string"
      },
      "cards": {
        "type": "array",
        "items": {
          "type": "object"
        },
        "description": "Kortit järjestyksessä: [{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 Hae oma koontinäkymä ja sen kortit dashboards_get

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/workspaces/:workspace_id/dashboards/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Koontinäkymän tunniste, esim. dash_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "cards": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Kortit järjestyksessä: [{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 Nimeä oma koontinäkymä uudelleen tai korvaa sen kortit dashboards_update

Oikeus: content.write

Esimerkki
curl -X PATCH https://privatusanalytics.com/workspaces/:workspace_id/dashboards/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Uusi nimi (ei muutu, jos tyhjä)"
    },
    "cards": {
      "type": "array",
      "items": {},
      "description": "Korvaa kaikki kortit. Kortit järjestyksessä (enintään 40): [{\"type\": \"metric|chart|breakdown|goal|live|funnel|uptime|vitals\", \"site_id\": \"pa_…\", \"title\": \"valinnainen\", \"params\": {\"period\": \"30d\", \"metric\": \"visitors\", \"dimension\": \"page\", \"funnel_id\": \"fun_…\"}}]. Parametrit, joita tyyppi ei käytä, ohitetaan"
    },
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Koontinäkymän tunniste, esim. dash_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "cards": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Kortit järjestyksessä: [{type, site_id, title, params}]"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Kumppanuusohjelma

GET /account/affiliate/commissions.json Listaa kumppanuusprovisiosi affiliate_commissions_list

Provisiot, rahanpalautuksista ja takaisinveloituksista johtuvat takaisinperinnät sekä niiden peruutukset, uusimmat ensin. Summat ovat sentteinä.

Oikeus: member

Esimerkki
curl https://privatusanalytics.com/account/affiliate/commissions.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Vain tässä tilassa olevat provisiot",
      "enum": [
        "pending",
        "approved",
        "paid",
        "void"
      ]
    },
    "page": {
      "type": "integer",
      "description": "Sivu (alkaen 1:stä)"
    },
    "per_page": {
      "type": "integer",
      "description": "Tuloksia sivulla (enintään 100)"
    }
  },
  "required": []
}
Vastauksen tiedot
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "format": "uuid",
        "description": "Provision tunniste"
      },
      "kind": {
        "type": "string",
        "description": "commission, clawback (rahanpalautus tai takaisinveloitus) tai reversal"
      },
      "status": {
        "type": "string",
        "description": "pending (pidossa), approved (maksettavissa), paid tai void"
      },
      "amount_cents": {
        "type": "integer",
        "description": "Osuutesi sentteinä (negatiivinen takaisinperinnässä)"
      },
      "basis_cents": {
        "type": "integer",
        "description": "Nettomaksu (ilman veroja), josta se laskettiin, sentteinä"
      },
      "currency": {
        "type": "string",
        "description": "ISO-valuuttakoodi"
      },
      "earned_at": {
        "type": "string",
        "format": "date-time",
        "description": "Milloin maksu (tai rahanpalautus) tapahtui"
      },
      "approved_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time",
            "description": "Milloin se tuli maksettavaksi"
          },
          {
            "type": "null"
          }
        ]
      },
      "paid_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time",
            "description": "Milloin se maksettiin"
          },
          {
            "type": "null"
          }
        ]
      }
    }
  }
}
GET /account/affiliate/signup-box.json Hae kumppanin rekisteröitymislaatikon koodi ja tulokset affiliate_signup_box_get

Rekisteröitymislaatikon upotuskoodi (skripti ja pelkkä iframe) valitulle teemalle, lomakkeen esitäyttävät attribuutit, skriptin sivullesi lähettämät tapahtumat sekä laatikon luvut: vahvistusta odottavat rekisteröitymiset, vahvistetut rekisteröitymiset ja maksavat asiakkaat. available on false, kunnes kumppanihakemuksesi on hyväksytty.

Oikeus: member

Esimerkki
curl https://privatusanalytics.com/account/affiliate/signup-box.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "theme": {
      "type": "string",
      "description": "Laatikon teema: auto (mukautuu kävijän laitteeseen), light tai dark",
      "enum": [
        "auto",
        "light",
        "dark"
      ],
      "examples": [
        "auto"
      ],
      "default": "auto"
    }
  },
  "required": []
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "available": {
      "type": "boolean",
      "description": "Onko sinulla rekisteröitymislaatikko (vain hyväksytyt kumppanit)"
    },
    "theme": {
      "type": "string",
      "description": "Teema, jolle koodi on tehty"
    },
    "frame_url": {
      "anyOf": [
        {
          "type": "string",
          "description": "Laatikon osoite pelkkää iframea varten"
        },
        {
          "type": "null"
        }
      ]
    },
    "script": {
      "anyOf": [
        {
          "type": "string",
          "description": "Skriptin upotuskoodi: elementti ja latausskripti"
        },
        {
          "type": "null"
        }
      ]
    },
    "iframe": {
      "anyOf": [
        {
          "type": "string",
          "description": "Pelkän iframen upotuskoodi"
        },
        {
          "type": "null"
        }
      ]
    },
    "prefill_attributes": {
      "type": "array",
      "description": "Elementin attribuutit, jotka esitäyttävät lomakkeen kirjautuneille kävijöille"
    },
    "events": {
      "type": "array",
      "description": "DOM-tapahtumat, jotka skripti lähettää elementille"
    },
    "waiting": {
      "type": "integer",
      "description": "Rekisteröitymiset, joiden sähköpostilinkkiä ei ole vielä avattu"
    },
    "signups": {
      "type": "integer",
      "description": "Laatikon kautta tulleet vahvistetut rekisteröitymiset"
    },
    "customers": {
      "type": "integer",
      "description": "Ne, joista tuli maksavia asiakkaita"
    }
  }
}
GET /account/affiliate.json Hae kumppanuustilasi, suosittelulinkkisi ja tilastosi affiliate_get

Kumppanuushakemuksesi tila, suosittelulinkki, suosittelemasi rekisteröitymiset ja maksavat asiakkaat sekä saldot valuutoittain (pidossa, maksettavissa, maksettu). status on none, jos et ole hakenut.

Oikeus: member

Esimerkki
curl https://privatusanalytics.com/account/affiliate.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {},
  "required": []
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "none (ei haettu), pending, approved, rejected tai suspended"
    },
    "code": {
      "anyOf": [
        {
          "type": "string",
          "description": "Suosittelukoodisi"
        },
        {
          "type": "null"
        }
      ]
    },
    "referral_url": {
      "anyOf": [
        {
          "type": "string",
          "description": "Jaettava linkki (vain hyväksytyille kumppaneille)"
        },
        {
          "type": "null"
        }
      ]
    },
    "payout_method": {
      "anyOf": [
        {
          "type": "string",
          "description": "wise tai credit"
        },
        {
          "type": "null"
        }
      ]
    },
    "rejection_reason": {
      "anyOf": [
        {
          "type": "string",
          "description": "Miksi viimeisin hakemus hylättiin"
        },
        {
          "type": "null"
        }
      ]
    },
    "applied_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Milloin hait"
        },
        {
          "type": "null"
        }
      ]
    },
    "approved_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Milloin hakemus hyväksyttiin"
        },
        {
          "type": "null"
        }
      ]
    },
    "credit_blocked": {
      "anyOf": [
        {
          "type": "string",
          "description": "Miksi tilihyvitys odottaa: program (työtila on alennusohjelmassa), no_subscription tai no_workspace. null, kun mikään ei estä sitä"
        },
        {
          "type": "null"
        }
      ]
    },
    "signups": {
      "type": "integer",
      "description": "Linkkisi tai koodisi kautta luodut tilit"
    },
    "customers": {
      "type": "integer",
      "description": "Suositellut työtilat, jotka ovat maksaneet"
    },
    "balances": {
      "type": "array",
      "description": "Valuutoittain: pending_cents (pidossa), approved_cents (maksettavissa) ja paid_cents"
    },
    "payouts": {
      "type": "array",
      "description": "Viimeisimmät maksut kentillä amount_cents, currency, payout_method, status (applied: tilihyvitys odottaa seuraavaa uusimistasi, tai paid), applied_at ja paid_at"
    },
    "terms": {
      "type": "object",
      "description": "Provisioprosentti, kuukaudet, pitopäivät ja Wise-maksun kynnys sentteinä"
    }
  }
}

Käytettävyys

POST /sites/:site_id/uptime.json Lisää sivuston käytettävyystarkistus uptime_checks_create

Oikeus: uptime.manage

Esimerkki
curl -X POST https://privatusanalytics.com/sites/:site_id/uptime.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Näyttönimi (oletuksena kohde)"
    },
    "kind": {
      "type": "string",
      "description": "http (tilakoodi), keyword (sisältö sisältää), tcp (host:port) tai dns (nimi ratkeaa)",
      "enum": [
        "http",
        "keyword",
        "tcp",
        "dns"
      ],
      "default": "http"
    },
    "url": {
      "type": "string",
      "description": "URL http-/keyword-tarkistuksille",
      "examples": [
        "https://example.com/health"
      ]
    },
    "host": {
      "type": "string",
      "description": "Isäntänimi tcp-/dns-tarkistuksille"
    },
    "port": {
      "type": "integer",
      "description": "TCP-portti tcp-tarkistuksille"
    },
    "keyword": {
      "type": "string",
      "description": "Teksti, jonka vastauksen sisällön on sisällettävä (keyword)"
    },
    "expected_status": {
      "type": "integer",
      "description": "Odotettu HTTP-tilakoodi",
      "default": 200
    },
    "http_method": {
      "type": "string",
      "description": "HTTP-metodi",
      "enum": [
        "GET",
        "HEAD"
      ],
      "default": "GET"
    },
    "interval_seconds": {
      "type": "integer",
      "description": "Sekuntia tarkistusten välillä (paketin vähimmäisarvo pätee, oletus 300 tai vähimmäisarvo)"
    },
    "timeout_seconds": {
      "type": "integer",
      "description": "Sekuntia ennen kuin koetin aikakatkaistaan (1-30)",
      "default": 20
    },
    "public": {
      "type": "boolean",
      "description": "Saa näkyä julkisilla tilasivuilla",
      "default": false
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Tarkistuksen tunniste (upc_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Sivusto, jolle tarkistus kuuluu"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "http, keyword, tcp tai 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 tai paused"
    },
    "enabled": {
      "type": "boolean"
    },
    "public": {
      "type": "boolean",
      "description": "Saa näkyä tilasivuilla"
    },
    "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 Poista käytettävyystarkistus ja sen historia uptime_checks_delete

Oikeus: uptime.manage

Esimerkki
curl -X DELETE https://privatusanalytics.com/uptime/checks/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Tarkistuksen tunniste (upc_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Sivusto, jolle tarkistus kuuluu"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "http, keyword, tcp tai 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 tai paused"
    },
    "enabled": {
      "type": "boolean"
    },
    "public": {
      "type": "boolean",
      "description": "Saa näkyä tilasivuilla"
    },
    "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 Listaa sivuston käytettävyystarkistukset uptime_checks_list

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/sites/:site_id/uptime.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Vain tässä tilassa olevat tarkistukset",
      "enum": [
        "up",
        "down",
        "pending",
        "paused"
      ]
    },
    "query": {
      "type": "string",
      "description": "Suodata nimen tai kohteen mukaan"
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Sivu (alkaen 1:stä)"
    },
    "per_page": {
      "type": "integer",
      "description": "Tuloksia sivulla (enintään 100)"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Tarkistuksen tunniste (upc_…)"
      },
      "workspace_id": {
        "type": "string"
      },
      "site_id": {
        "anyOf": [
          {
            "type": "string",
            "description": "Sivusto, jolle tarkistus kuuluu"
          },
          {
            "type": "null"
          }
        ]
      },
      "name": {
        "type": "string"
      },
      "kind": {
        "type": "string",
        "description": "http, keyword, tcp tai 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 tai paused"
      },
      "enabled": {
        "type": "boolean"
      },
      "public": {
        "type": "boolean",
        "description": "Saa näkyä tilasivuilla"
      },
      "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 Keskeytä käytettävyystarkistus uptime_checks_pause

Oikeus: uptime.manage

Esimerkki
curl -X POST https://privatusanalytics.com/uptime/checks/:id/pause.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Tarkistuksen tunniste (upc_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Sivusto, jolle tarkistus kuuluu"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "http, keyword, tcp tai 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 tai paused"
    },
    "enabled": {
      "type": "boolean"
    },
    "public": {
      "type": "boolean",
      "description": "Saa näkyä tilasivuilla"
    },
    "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 Jatka keskeytettyä käytettävyystarkistusta uptime_checks_resume

Oikeus: uptime.manage

Esimerkki
curl -X POST https://privatusanalytics.com/uptime/checks/:id/resume.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Tarkistuksen tunniste (upc_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Sivusto, jolle tarkistus kuuluu"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "http, keyword, tcp tai 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 tai paused"
    },
    "enabled": {
      "type": "boolean"
    },
    "public": {
      "type": "boolean",
      "description": "Saa näkyä tilasivuilla"
    },
    "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 Hae käytettävyystarkistus: käytettävyys 24 h/7 pv/30 pv, vasteajat ja häiriöt uptime_checks_get

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/uptime/checks/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "range": {
      "type": "string",
      "description": "Vasteaikakaavion aikaväli",
      "enum": [
        "24h",
        "7d",
        "30d"
      ],
      "default": "24h"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "check": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Tarkistuksen tunniste (upc_…)"
        },
        "workspace_id": {
          "type": "string"
        },
        "site_id": {
          "anyOf": [
            {
              "type": "string",
              "description": "Sivusto, jolle tarkistus kuuluu"
            },
            {
              "type": "null"
            }
          ]
        },
        "name": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "description": "http, keyword, tcp tai 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 tai paused"
        },
        "enabled": {
          "type": "boolean"
        },
        "public": {
          "type": "boolean",
          "description": "Saa näkyä tilasivuilla"
        },
        "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": "Käytettävyys-% ajalta 24 h, 7 pv ja 30 pv"
    },
    "range": {
      "type": "string",
      "description": "Kentän response_times aikaväli"
    },
    "response_times": {
      "type": "object",
      "description": "Keskimääräinen vasteaika ms aikaväliä kohden: {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": "Tähän mennessä, jos yhä avoin"
          },
          "cause": {
            "anyOf": [
              {
                "type": "string",
                "description": "Yleisin virhe, esim. timeout tai status_503"
              },
              {
                "type": "null"
              }
            ]
          },
          "failed_locations": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    }
  }
}
PATCH /uptime/checks/:id.json Muuta käytettävyystarkistusta uptime_checks_update

Oikeus: uptime.manage

Esimerkki
curl -X PATCH https://privatusanalytics.com/uptime/checks/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Näyttönimi (oletuksena kohde)"
    },
    "kind": {
      "type": "string",
      "description": "http (tilakoodi), keyword (sisältö sisältää), tcp (host:port) tai dns (nimi ratkeaa)",
      "enum": [
        "http",
        "keyword",
        "tcp",
        "dns"
      ]
    },
    "url": {
      "type": "string",
      "description": "URL http-/keyword-tarkistuksille",
      "examples": [
        "https://example.com/health"
      ]
    },
    "host": {
      "type": "string",
      "description": "Isäntänimi tcp-/dns-tarkistuksille"
    },
    "port": {
      "type": "integer",
      "description": "TCP-portti tcp-tarkistuksille"
    },
    "keyword": {
      "type": "string",
      "description": "Teksti, jonka vastauksen sisällön on sisällettävä (keyword)"
    },
    "expected_status": {
      "type": "integer",
      "description": "Odotettu HTTP-tilakoodi"
    },
    "http_method": {
      "type": "string",
      "description": "HTTP-metodi",
      "enum": [
        "GET",
        "HEAD"
      ]
    },
    "interval_seconds": {
      "type": "integer",
      "description": "Sekuntia tarkistusten välillä (paketin vähimmäisarvo pätee, oletus 300 tai vähimmäisarvo)"
    },
    "timeout_seconds": {
      "type": "integer",
      "description": "Sekuntia ennen kuin koetin aikakatkaistaan (1-30)"
    },
    "public": {
      "type": "boolean",
      "description": "Saa näkyä julkisilla tilasivuilla"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Tarkistuksen tunniste (upc_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Sivusto, jolle tarkistus kuuluu"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "http, keyword, tcp tai 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 tai paused"
    },
    "enabled": {
      "type": "boolean"
    },
    "public": {
      "type": "boolean",
      "description": "Saa näkyä tilasivuilla"
    },
    "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 Koettimien konesali, User-Agent ja lähtevän liikenteen IP-alueet (käytettävyyskoettimiemme sallintaa varten) uptime_probes_list

Oikeus: public · Vain HTTP (ei MCP-työkalu)

Esimerkki
curl https://privatusanalytics.com/uptime/probes.json
Syötteet
{
  "type": "object",
  "properties": {},
  "required": []
}
Vastauksen tiedot
{
  "type": "object"
}
POST /uptime/probes/results.json Lähetä ulkoisen koetinagentin tulokset (Bearer-käytettävyyskoetintunniste) uptime_probes_results

Oikeus: public · Vain HTTP (ei MCP-työkalu)

Esimerkki
curl -X POST https://privatusanalytics.com/uptime/probes/results.json \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "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": "Koettimen tulokset: [{check_id, location, ok, status_code, response_ms, error, checked_at}]"
    }
  },
  "required": [
    "results"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}
POST /workspaces/:workspace_id/uptime.json Lisää työtilan käytettävyystarkistus (ei sidottu sivustoon) workspace_uptime_checks_create

Oikeus: uptime.manage

Esimerkki
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/uptime.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Näyttönimi (oletuksena kohde)"
    },
    "kind": {
      "type": "string",
      "description": "http (tilakoodi), keyword (sisältö sisältää), tcp (host:port) tai dns (nimi ratkeaa)",
      "enum": [
        "http",
        "keyword",
        "tcp",
        "dns"
      ],
      "default": "http"
    },
    "url": {
      "type": "string",
      "description": "URL http-/keyword-tarkistuksille",
      "examples": [
        "https://example.com/health"
      ]
    },
    "host": {
      "type": "string",
      "description": "Isäntänimi tcp-/dns-tarkistuksille"
    },
    "port": {
      "type": "integer",
      "description": "TCP-portti tcp-tarkistuksille"
    },
    "keyword": {
      "type": "string",
      "description": "Teksti, jonka vastauksen sisällön on sisällettävä (keyword)"
    },
    "expected_status": {
      "type": "integer",
      "description": "Odotettu HTTP-tilakoodi",
      "default": 200
    },
    "http_method": {
      "type": "string",
      "description": "HTTP-metodi",
      "enum": [
        "GET",
        "HEAD"
      ],
      "default": "GET"
    },
    "interval_seconds": {
      "type": "integer",
      "description": "Sekuntia tarkistusten välillä (paketin vähimmäisarvo pätee, oletus 300 tai vähimmäisarvo)"
    },
    "timeout_seconds": {
      "type": "integer",
      "description": "Sekuntia ennen kuin koetin aikakatkaistaan (1-30)",
      "default": 20
    },
    "public": {
      "type": "boolean",
      "description": "Saa näkyä julkisilla tilasivuilla",
      "default": false
    },
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Tarkistuksen tunniste (upc_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Sivusto, jolle tarkistus kuuluu"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "http, keyword, tcp tai 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 tai paused"
    },
    "enabled": {
      "type": "boolean"
    },
    "public": {
      "type": "boolean",
      "description": "Saa näkyä tilasivuilla"
    },
    "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 Listaa kaikki työtilan käytettävyystarkistukset workspace_uptime_checks_list

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/workspaces/:workspace_id/uptime.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Vain tässä tilassa olevat tarkistukset",
      "enum": [
        "up",
        "down",
        "pending",
        "paused"
      ]
    },
    "query": {
      "type": "string",
      "description": "Suodata nimen tai kohteen mukaan"
    },
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Sivu (alkaen 1:stä)"
    },
    "per_page": {
      "type": "integer",
      "description": "Tuloksia sivulla (enintään 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Tarkistuksen tunniste (upc_…)"
      },
      "workspace_id": {
        "type": "string"
      },
      "site_id": {
        "anyOf": [
          {
            "type": "string",
            "description": "Sivusto, jolle tarkistus kuuluu"
          },
          {
            "type": "null"
          }
        ]
      },
      "name": {
        "type": "string"
      },
      "kind": {
        "type": "string",
        "description": "http, keyword, tcp tai 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 tai paused"
      },
      "enabled": {
        "type": "boolean"
      },
      "public": {
        "type": "boolean",
        "description": "Saa näkyä tilasivuilla"
      },
      "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"
      }
    }
  }
}

Laskutus

POST /workspaces/:workspace_id/billing/badge.json Ota merkkibonus käyttöön tai pois käytöstä (ilmainen paketti) billing_badge

Oikeus: billing.manage

Esimerkki
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/billing/badge.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "enabled": {
      "type": "boolean",
      "description": "true vahvistaa merkin ja ansaitsee bonuksen"
    },
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "enabled",
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string"
    },
    "plan": {
      "type": "string",
      "description": "free, pro, business tai enterprise"
    },
    "plan_events": {
      "type": "integer",
      "description": "Maksullisen tason tapahtumat kuukaudessa"
    },
    "allowance": {
      "type": "integer",
      "description": "Tapahtumat kuukaudessa merkkibonus mukaan lukien"
    },
    "billing_interval": {
      "anyOf": [
        {
          "type": "string",
          "description": "month tai year"
        },
        {
          "type": "null"
        }
      ]
    },
    "price": {
      "anyOf": [
        {
          "type": "integer",
          "description": "USD laskutusjaksoa kohden"
        },
        {
          "type": "null"
        }
      ]
    },
    "subscription_status": {
      "type": "string",
      "description": "none, trialing, active, past_due, paused tai canceled"
    },
    "current_period_ends_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Uusiutuu tai päättyy"
        },
        {
          "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 tai agency"
            },
            "status": {
              "type": "string",
              "description": "pending, approved (ei vielä tilauksessa), active, rejected tai revoked"
            },
            "percent": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Alennusprosentti Pro- ja Business-paketeista (null ilmaisessa avoimen lähdekoodin ohjelmassa)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "comp_events": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Ilmaiset tapahtumat kuukaudessa (vain ilmainen avoimen lähdekoodin ohjelma)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "organization_name": {
              "type": "string",
              "description": "Organisaation, oppilaitoksen, projektin tai toimiston nimi"
            },
            "website": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Verkkosivusto"
                },
                {
                  "type": "null"
                }
              ]
            },
            "proof_url": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Todistelinkki tai koodivaraston URL"
                },
                {
                  "type": "null"
                }
              ]
            },
            "license": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "OSI-lisenssi (avoin lähdekoodi)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "note": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Huomautus käsittelyä varten"
                },
                {
                  "type": "null"
                }
              ]
            },
            "rejection_reason": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Miksi hakemusta ei hyväksytty"
                },
                {
                  "type": "null"
                }
              ]
            },
            "created_at": {
              "type": "string",
              "format": "date-time",
              "description": "Haettu"
            },
            "reviewed_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Käsitelty"
                },
                {
                  "type": "null"
                }
              ]
            },
            "applied_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Alennus voimassa alkaen"
                },
                {
                  "type": "null"
                }
              ]
            },
            "revoked_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Ohjelma päättyi"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Viimeisin alennusohjelmahakemus tai null"
        },
        {
          "type": "null"
        }
      ]
    },
    "discount_percent": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Hyväksytyn ohjelman alennusprosentti Pro- ja Business-paketeista tai null"
        },
        {
          "type": "null"
        }
      ]
    },
    "billing_emails": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "tax_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "badge": {
      "type": "object",
      "description": "Merkkibonus (ilmainen paketti)"
    },
    "usage": {
      "type": "object",
      "properties": {
        "month": {
          "type": "string",
          "format": "date",
          "description": "Raportoidun kuukauden ensimmäinen päivä"
        },
        "events": {
          "type": "integer",
          "description": "Laskutettavat tapahtumat (sivunäytöt ja omat tapahtumat)"
        },
        "bots": {
          "type": "integer",
          "description": "Suodatetut bottiosumat (ei laskuteta)"
        },
        "allowance": {
          "type": "integer",
          "description": "Sisältyvät tapahtumat mahdollisine merkkibonuksineen"
        },
        "percent": {
          "type": "number",
          "description": "Tapahtumat prosentteina kiintiöstä"
        },
        "forecast": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Ennustetut tapahtumat kuun lopussa"
            },
            {
              "type": "null"
            }
          ]
        },
        "forecast_percent": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "days_left": {
          "type": "integer",
          "description": "Kuukaudessa jäljellä olevat päivät"
        },
        "status": {
          "type": "string",
          "description": "ok, warning (80 %+), over (mennyt kuukausi, jossa kiintiö täyttyi tai ylittyi), locked tai paused"
        },
        "sites": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "site_id": {
                "type": "string"
              },
              "domain": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "events": {
                "type": "integer",
                "description": "Sivunäytöt ja omat tapahtumat tässä kuussa"
              },
              "share": {
                "type": "number",
                "description": "Prosenttiosuus työtilan kokonaismäärästä"
              }
            }
          },
          "description": "Tapahtumat sivustoittain"
        },
        "history": {
          "type": "array",
          "description": "Aiemmat kuukaudet, uusimmat ensin"
        },
        "access_locked_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Privatus Analyticsin henkilökunta lukitsi koontinäkymät tästä alkaen"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused": {
          "type": "boolean",
          "description": "True, kun uudet tapahtumat hylätään (kuukausiraja on täynnä tai henkilökunta keskeytti keruun)"
        },
        "pause_reason": {
          "anyOf": [
            {
              "type": "string",
              "description": "Miksi keruu on keskeytetty: limit (kuukausikiintiö on täynnä) tai staff. null, kun keruu on käynnissä"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Milloin henkilökunta keskeytti keruun"
            },
            {
              "type": "null"
            }
          ]
        },
        "resumes_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Milloin rajasta johtuva keskeytys päättyy: seuraavan kuukauden alussa (UTC) tai aiemmin päivityksen yhteydessä. Muuten null"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "description": "Tämä kuukausi tähän mennessä"
    }
  }
}
POST /workspaces/:workspace_id/billing/cancel.json Peruuta laskutusjakson lopussa billing_cancel

Oikeus: billing.manage

Esimerkki
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/billing/cancel.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "reason": {
      "type": "string",
      "description": "Peruutuksen pääsyy (valinnainen kysely)",
      "enum": [
        "too_expensive",
        "missing_features",
        "switching_tool",
        "not_using",
        "temporary",
        "other"
      ]
    },
    "comment": {
      "type": "string",
      "description": "Mitä voisimme tehdä paremmin"
    },
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string"
    },
    "plan": {
      "type": "string",
      "description": "free, pro, business tai enterprise"
    },
    "plan_events": {
      "type": "integer",
      "description": "Maksullisen tason tapahtumat kuukaudessa"
    },
    "allowance": {
      "type": "integer",
      "description": "Tapahtumat kuukaudessa merkkibonus mukaan lukien"
    },
    "billing_interval": {
      "anyOf": [
        {
          "type": "string",
          "description": "month tai year"
        },
        {
          "type": "null"
        }
      ]
    },
    "price": {
      "anyOf": [
        {
          "type": "integer",
          "description": "USD laskutusjaksoa kohden"
        },
        {
          "type": "null"
        }
      ]
    },
    "subscription_status": {
      "type": "string",
      "description": "none, trialing, active, past_due, paused tai canceled"
    },
    "current_period_ends_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Uusiutuu tai päättyy"
        },
        {
          "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 tai agency"
            },
            "status": {
              "type": "string",
              "description": "pending, approved (ei vielä tilauksessa), active, rejected tai revoked"
            },
            "percent": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Alennusprosentti Pro- ja Business-paketeista (null ilmaisessa avoimen lähdekoodin ohjelmassa)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "comp_events": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Ilmaiset tapahtumat kuukaudessa (vain ilmainen avoimen lähdekoodin ohjelma)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "organization_name": {
              "type": "string",
              "description": "Organisaation, oppilaitoksen, projektin tai toimiston nimi"
            },
            "website": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Verkkosivusto"
                },
                {
                  "type": "null"
                }
              ]
            },
            "proof_url": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Todistelinkki tai koodivaraston URL"
                },
                {
                  "type": "null"
                }
              ]
            },
            "license": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "OSI-lisenssi (avoin lähdekoodi)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "note": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Huomautus käsittelyä varten"
                },
                {
                  "type": "null"
                }
              ]
            },
            "rejection_reason": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Miksi hakemusta ei hyväksytty"
                },
                {
                  "type": "null"
                }
              ]
            },
            "created_at": {
              "type": "string",
              "format": "date-time",
              "description": "Haettu"
            },
            "reviewed_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Käsitelty"
                },
                {
                  "type": "null"
                }
              ]
            },
            "applied_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Alennus voimassa alkaen"
                },
                {
                  "type": "null"
                }
              ]
            },
            "revoked_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Ohjelma päättyi"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Viimeisin alennusohjelmahakemus tai null"
        },
        {
          "type": "null"
        }
      ]
    },
    "discount_percent": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Hyväksytyn ohjelman alennusprosentti Pro- ja Business-paketeista tai null"
        },
        {
          "type": "null"
        }
      ]
    },
    "billing_emails": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "tax_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "badge": {
      "type": "object",
      "description": "Merkkibonus (ilmainen paketti)"
    },
    "usage": {
      "type": "object",
      "properties": {
        "month": {
          "type": "string",
          "format": "date",
          "description": "Raportoidun kuukauden ensimmäinen päivä"
        },
        "events": {
          "type": "integer",
          "description": "Laskutettavat tapahtumat (sivunäytöt ja omat tapahtumat)"
        },
        "bots": {
          "type": "integer",
          "description": "Suodatetut bottiosumat (ei laskuteta)"
        },
        "allowance": {
          "type": "integer",
          "description": "Sisältyvät tapahtumat mahdollisine merkkibonuksineen"
        },
        "percent": {
          "type": "number",
          "description": "Tapahtumat prosentteina kiintiöstä"
        },
        "forecast": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Ennustetut tapahtumat kuun lopussa"
            },
            {
              "type": "null"
            }
          ]
        },
        "forecast_percent": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "days_left": {
          "type": "integer",
          "description": "Kuukaudessa jäljellä olevat päivät"
        },
        "status": {
          "type": "string",
          "description": "ok, warning (80 %+), over (mennyt kuukausi, jossa kiintiö täyttyi tai ylittyi), locked tai paused"
        },
        "sites": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "site_id": {
                "type": "string"
              },
              "domain": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "events": {
                "type": "integer",
                "description": "Sivunäytöt ja omat tapahtumat tässä kuussa"
              },
              "share": {
                "type": "number",
                "description": "Prosenttiosuus työtilan kokonaismäärästä"
              }
            }
          },
          "description": "Tapahtumat sivustoittain"
        },
        "history": {
          "type": "array",
          "description": "Aiemmat kuukaudet, uusimmat ensin"
        },
        "access_locked_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Privatus Analyticsin henkilökunta lukitsi koontinäkymät tästä alkaen"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused": {
          "type": "boolean",
          "description": "True, kun uudet tapahtumat hylätään (kuukausiraja on täynnä tai henkilökunta keskeytti keruun)"
        },
        "pause_reason": {
          "anyOf": [
            {
              "type": "string",
              "description": "Miksi keruu on keskeytetty: limit (kuukausikiintiö on täynnä) tai staff. null, kun keruu on käynnissä"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Milloin henkilökunta keskeytti keruun"
            },
            {
              "type": "null"
            }
          ]
        },
        "resumes_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Milloin rajasta johtuva keskeytys päättyy: seuraavan kuukauden alussa (UTC) tai aiemmin päivityksen yhteydessä. Muuten null"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "description": "Tämä kuukausi tähän mennessä"
    }
  }
}
POST /workspaces/:workspace_id/billing/change_plan.json Vaihda pakettia, tasoa tai jaksoa (suhteutettuna) billing_change_plan

Oikeus: billing.manage

Esimerkki
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/billing/change_plan.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "plan": {
      "type": "string",
      "description": "Paketti, johon vaihdetaan: pro tai business",
      "enum": [
        "pro",
        "business"
      ]
    },
    "events": {
      "type": "integer",
      "description": "Tason kuukausittaiset tapahtumat, osoitteesta GET /plans",
      "examples": [
        1000000
      ]
    },
    "interval": {
      "type": "string",
      "description": "Laskutusjakso. Vuosilaskutuksessa 2 kuukautta on ilmaista",
      "enum": [
        "month",
        "year"
      ],
      "default": "month"
    },
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "plan",
    "events",
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string"
    },
    "plan": {
      "type": "string",
      "description": "free, pro, business tai enterprise"
    },
    "plan_events": {
      "type": "integer",
      "description": "Maksullisen tason tapahtumat kuukaudessa"
    },
    "allowance": {
      "type": "integer",
      "description": "Tapahtumat kuukaudessa merkkibonus mukaan lukien"
    },
    "billing_interval": {
      "anyOf": [
        {
          "type": "string",
          "description": "month tai year"
        },
        {
          "type": "null"
        }
      ]
    },
    "price": {
      "anyOf": [
        {
          "type": "integer",
          "description": "USD laskutusjaksoa kohden"
        },
        {
          "type": "null"
        }
      ]
    },
    "subscription_status": {
      "type": "string",
      "description": "none, trialing, active, past_due, paused tai canceled"
    },
    "current_period_ends_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Uusiutuu tai päättyy"
        },
        {
          "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 tai agency"
            },
            "status": {
              "type": "string",
              "description": "pending, approved (ei vielä tilauksessa), active, rejected tai revoked"
            },
            "percent": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Alennusprosentti Pro- ja Business-paketeista (null ilmaisessa avoimen lähdekoodin ohjelmassa)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "comp_events": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Ilmaiset tapahtumat kuukaudessa (vain ilmainen avoimen lähdekoodin ohjelma)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "organization_name": {
              "type": "string",
              "description": "Organisaation, oppilaitoksen, projektin tai toimiston nimi"
            },
            "website": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Verkkosivusto"
                },
                {
                  "type": "null"
                }
              ]
            },
            "proof_url": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Todistelinkki tai koodivaraston URL"
                },
                {
                  "type": "null"
                }
              ]
            },
            "license": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "OSI-lisenssi (avoin lähdekoodi)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "note": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Huomautus käsittelyä varten"
                },
                {
                  "type": "null"
                }
              ]
            },
            "rejection_reason": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Miksi hakemusta ei hyväksytty"
                },
                {
                  "type": "null"
                }
              ]
            },
            "created_at": {
              "type": "string",
              "format": "date-time",
              "description": "Haettu"
            },
            "reviewed_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Käsitelty"
                },
                {
                  "type": "null"
                }
              ]
            },
            "applied_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Alennus voimassa alkaen"
                },
                {
                  "type": "null"
                }
              ]
            },
            "revoked_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Ohjelma päättyi"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Viimeisin alennusohjelmahakemus tai null"
        },
        {
          "type": "null"
        }
      ]
    },
    "discount_percent": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Hyväksytyn ohjelman alennusprosentti Pro- ja Business-paketeista tai null"
        },
        {
          "type": "null"
        }
      ]
    },
    "billing_emails": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "tax_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "badge": {
      "type": "object",
      "description": "Merkkibonus (ilmainen paketti)"
    },
    "usage": {
      "type": "object",
      "properties": {
        "month": {
          "type": "string",
          "format": "date",
          "description": "Raportoidun kuukauden ensimmäinen päivä"
        },
        "events": {
          "type": "integer",
          "description": "Laskutettavat tapahtumat (sivunäytöt ja omat tapahtumat)"
        },
        "bots": {
          "type": "integer",
          "description": "Suodatetut bottiosumat (ei laskuteta)"
        },
        "allowance": {
          "type": "integer",
          "description": "Sisältyvät tapahtumat mahdollisine merkkibonuksineen"
        },
        "percent": {
          "type": "number",
          "description": "Tapahtumat prosentteina kiintiöstä"
        },
        "forecast": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Ennustetut tapahtumat kuun lopussa"
            },
            {
              "type": "null"
            }
          ]
        },
        "forecast_percent": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "days_left": {
          "type": "integer",
          "description": "Kuukaudessa jäljellä olevat päivät"
        },
        "status": {
          "type": "string",
          "description": "ok, warning (80 %+), over (mennyt kuukausi, jossa kiintiö täyttyi tai ylittyi), locked tai paused"
        },
        "sites": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "site_id": {
                "type": "string"
              },
              "domain": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "events": {
                "type": "integer",
                "description": "Sivunäytöt ja omat tapahtumat tässä kuussa"
              },
              "share": {
                "type": "number",
                "description": "Prosenttiosuus työtilan kokonaismäärästä"
              }
            }
          },
          "description": "Tapahtumat sivustoittain"
        },
        "history": {
          "type": "array",
          "description": "Aiemmat kuukaudet, uusimmat ensin"
        },
        "access_locked_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Privatus Analyticsin henkilökunta lukitsi koontinäkymät tästä alkaen"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused": {
          "type": "boolean",
          "description": "True, kun uudet tapahtumat hylätään (kuukausiraja on täynnä tai henkilökunta keskeytti keruun)"
        },
        "pause_reason": {
          "anyOf": [
            {
              "type": "string",
              "description": "Miksi keruu on keskeytetty: limit (kuukausikiintiö on täynnä) tai staff. null, kun keruu on käynnissä"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Milloin henkilökunta keskeytti keruun"
            },
            {
              "type": "null"
            }
          ]
        },
        "resumes_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Milloin rajasta johtuva keskeytys päättyy: seuraavan kuukauden alussa (UTC) tai aiemmin päivityksen yhteydessä. Muuten null"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "description": "Tämä kuukausi tähän mennessä"
    }
  }
}
POST /workspaces/:workspace_id/billing/checkout.json Aloita Paddle-kassa maksulliselle paketille billing_checkout

Oikeus: billing.manage

Esimerkki
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/billing/checkout.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "plan": {
      "type": "string",
      "description": "Paketti, johon vaihdetaan: pro tai business",
      "enum": [
        "pro",
        "business"
      ]
    },
    "events": {
      "type": "integer",
      "description": "Tason kuukausittaiset tapahtumat, osoitteesta GET /plans",
      "examples": [
        1000000
      ]
    },
    "interval": {
      "type": "string",
      "description": "Laskutusjakso. Vuosilaskutuksessa 2 kuukautta on ilmaista",
      "enum": [
        "month",
        "year"
      ],
      "default": "month"
    },
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "plan",
    "events",
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "transaction_id": {
      "type": "string",
      "description": "Paddlen tapahtumatunniste (txn_...)"
    },
    "url": {
      "anyOf": [
        {
          "type": "string",
          "description": "Isännöity kassan URL"
        },
        {
          "type": "null"
        }
      ]
    },
    "price_id": {
      "type": "string"
    },
    "plan": {
      "type": "string"
    },
    "events": {
      "type": "integer"
    },
    "interval": {
      "type": "string"
    },
    "amount": {
      "type": "integer",
      "description": "USD jaksoa kohden"
    },
    "client_token": {
      "anyOf": [
        {
          "type": "string",
          "description": "Paddle.js:n asiakaspuolen tunniste"
        },
        {
          "type": "null"
        }
      ]
    },
    "environment": {
      "type": "string",
      "description": "sandbox tai production"
    },
    "custom_data": {
      "type": "object",
      "description": "Välitetään Paddlelle tilauksen yhdistämiseksi"
    },
    "discount_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Hyväksytyn ohjelman Paddle-alennustunniste, jota käytetään tässä kassassa"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
POST /workspaces/:workspace_id/billing/discount.json Hae voittoa tavoittelemattoman, koulutuksen tai avoimen lähdekoodin alennusta billing_discount

Oikeus: billing.manage

Esimerkki
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/billing/discount.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "program": {
      "type": "string",
      "description": "nonprofit, education, open_source (50 % alennus), open_source_free (ilmainen Pro 1M tapahtumaan asti kuukaudessa) tai agency (20 % alennus jokaisesta omistamastasi työtilasta)",
      "enum": [
        "nonprofit",
        "education",
        "open_source",
        "open_source_free",
        "agency"
      ]
    },
    "organization_name": {
      "type": "string",
      "description": "Organisaation, oppilaitoksen, projektin tai toimiston nimi"
    },
    "website": {
      "type": "string",
      "description": "Sen verkkosivusto"
    },
    "proof_url": {
      "type": "string",
      "description": "Todistelinkki. Avoimessa lähdekoodissa koodivaraston URL"
    },
    "license": {
      "type": "string",
      "description": "Projektin OSI-lisenssi (vain avoin lähdekoodi)"
    },
    "note": {
      "type": "string",
      "description": "Mitä tahansa käsittelyä auttavaa, enintään 1 000 merkkiä"
    },
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "program",
    "organization_name",
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "program": {
      "type": "string",
      "description": "nonprofit, education, open_source, open_source_free tai agency"
    },
    "status": {
      "type": "string",
      "description": "pending, approved (ei vielä tilauksessa), active, rejected tai revoked"
    },
    "percent": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Alennusprosentti Pro- ja Business-paketeista (null ilmaisessa avoimen lähdekoodin ohjelmassa)"
        },
        {
          "type": "null"
        }
      ]
    },
    "comp_events": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Ilmaiset tapahtumat kuukaudessa (vain ilmainen avoimen lähdekoodin ohjelma)"
        },
        {
          "type": "null"
        }
      ]
    },
    "organization_name": {
      "type": "string",
      "description": "Organisaation, oppilaitoksen, projektin tai toimiston nimi"
    },
    "website": {
      "anyOf": [
        {
          "type": "string",
          "description": "Verkkosivusto"
        },
        {
          "type": "null"
        }
      ]
    },
    "proof_url": {
      "anyOf": [
        {
          "type": "string",
          "description": "Todistelinkki tai koodivaraston URL"
        },
        {
          "type": "null"
        }
      ]
    },
    "license": {
      "anyOf": [
        {
          "type": "string",
          "description": "OSI-lisenssi (avoin lähdekoodi)"
        },
        {
          "type": "null"
        }
      ]
    },
    "note": {
      "anyOf": [
        {
          "type": "string",
          "description": "Huomautus käsittelyä varten"
        },
        {
          "type": "null"
        }
      ]
    },
    "rejection_reason": {
      "anyOf": [
        {
          "type": "string",
          "description": "Miksi hakemusta ei hyväksytty"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Haettu"
    },
    "reviewed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Käsitelty"
        },
        {
          "type": "null"
        }
      ]
    },
    "applied_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Alennus voimassa alkaen"
        },
        {
          "type": "null"
        }
      ]
    },
    "revoked_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Ohjelma päättyi"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
POST /workspaces/:workspace_id/billing/payment_method.json Hae linkki maksutavan päivittämiseen billing_payment_method

Oikeus: billing.manage

Esimerkki
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/billing/payment_method.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "description": "portal, payment_method tai invoice"
    },
    "url": {
      "anyOf": [
        {
          "type": "string",
          "description": "Lyhytikäinen Paddle-URL"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
POST /workspaces/:workspace_id/billing/portal.json Hae Paddlen asiakasportaalin linkki billing_portal

Oikeus: billing.manage

Esimerkki
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/billing/portal.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "description": "portal, payment_method tai invoice"
    },
    "url": {
      "anyOf": [
        {
          "type": "string",
          "description": "Lyhytikäinen Paddle-URL"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
GET /workspaces/:workspace_id/billing/preview.json Esikatsele paketin vaihtoa suhteutuksella billing_preview

Oikeus: billing.manage

Esimerkki
curl https://privatusanalytics.com/workspaces/:workspace_id/billing/preview.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "plan": {
      "type": "string",
      "description": "Paketti, johon vaihdetaan: pro tai business",
      "enum": [
        "pro",
        "business"
      ]
    },
    "events": {
      "type": "integer",
      "description": "Tason kuukausittaiset tapahtumat, osoitteesta GET /plans",
      "examples": [
        1000000
      ]
    },
    "interval": {
      "type": "string",
      "description": "Laskutusjakso. Vuosilaskutuksessa 2 kuukautta on ilmaista",
      "enum": [
        "month",
        "year"
      ],
      "default": "month"
    },
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "plan",
    "events",
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "plan": {
      "type": "string"
    },
    "events": {
      "type": "integer"
    },
    "interval": {
      "type": "string"
    },
    "price_id": {
      "type": "string"
    },
    "amount": {
      "type": "integer",
      "description": "Uusi hinta USD jaksoa kohden"
    },
    "currency": {
      "type": "string"
    },
    "charge_minor": {
      "type": "integer",
      "description": "Veloitetaan nyt, pienimmissä yksiköissä"
    },
    "credit_minor": {
      "type": "integer",
      "description": "Käyttämättömän ajan hyvitys, pienimmissä yksiköissä"
    },
    "result_action": {
      "anyOf": [
        {
          "type": "string",
          "description": "charge tai credit"
        },
        {
          "type": "null"
        }
      ]
    },
    "result_minor": {
      "type": "integer",
      "description": "Nettoveloitus tai -hyvitys, pienimmissä yksiköissä"
    },
    "next_billed_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Käyttö tai rajat, joita uusi paketti ei kattaisi"
    }
  }
}
POST /workspaces/:workspace_id/billing/resume.json Peru ajastettu peruutus tai jatka tauolla ollutta tilausta billing_resume

Oikeus: billing.manage

Esimerkki
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/billing/resume.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string"
    },
    "plan": {
      "type": "string",
      "description": "free, pro, business tai enterprise"
    },
    "plan_events": {
      "type": "integer",
      "description": "Maksullisen tason tapahtumat kuukaudessa"
    },
    "allowance": {
      "type": "integer",
      "description": "Tapahtumat kuukaudessa merkkibonus mukaan lukien"
    },
    "billing_interval": {
      "anyOf": [
        {
          "type": "string",
          "description": "month tai year"
        },
        {
          "type": "null"
        }
      ]
    },
    "price": {
      "anyOf": [
        {
          "type": "integer",
          "description": "USD laskutusjaksoa kohden"
        },
        {
          "type": "null"
        }
      ]
    },
    "subscription_status": {
      "type": "string",
      "description": "none, trialing, active, past_due, paused tai canceled"
    },
    "current_period_ends_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Uusiutuu tai päättyy"
        },
        {
          "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 tai agency"
            },
            "status": {
              "type": "string",
              "description": "pending, approved (ei vielä tilauksessa), active, rejected tai revoked"
            },
            "percent": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Alennusprosentti Pro- ja Business-paketeista (null ilmaisessa avoimen lähdekoodin ohjelmassa)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "comp_events": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Ilmaiset tapahtumat kuukaudessa (vain ilmainen avoimen lähdekoodin ohjelma)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "organization_name": {
              "type": "string",
              "description": "Organisaation, oppilaitoksen, projektin tai toimiston nimi"
            },
            "website": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Verkkosivusto"
                },
                {
                  "type": "null"
                }
              ]
            },
            "proof_url": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Todistelinkki tai koodivaraston URL"
                },
                {
                  "type": "null"
                }
              ]
            },
            "license": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "OSI-lisenssi (avoin lähdekoodi)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "note": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Huomautus käsittelyä varten"
                },
                {
                  "type": "null"
                }
              ]
            },
            "rejection_reason": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Miksi hakemusta ei hyväksytty"
                },
                {
                  "type": "null"
                }
              ]
            },
            "created_at": {
              "type": "string",
              "format": "date-time",
              "description": "Haettu"
            },
            "reviewed_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Käsitelty"
                },
                {
                  "type": "null"
                }
              ]
            },
            "applied_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Alennus voimassa alkaen"
                },
                {
                  "type": "null"
                }
              ]
            },
            "revoked_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Ohjelma päättyi"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Viimeisin alennusohjelmahakemus tai null"
        },
        {
          "type": "null"
        }
      ]
    },
    "discount_percent": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Hyväksytyn ohjelman alennusprosentti Pro- ja Business-paketeista tai null"
        },
        {
          "type": "null"
        }
      ]
    },
    "billing_emails": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "tax_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "badge": {
      "type": "object",
      "description": "Merkkibonus (ilmainen paketti)"
    },
    "usage": {
      "type": "object",
      "properties": {
        "month": {
          "type": "string",
          "format": "date",
          "description": "Raportoidun kuukauden ensimmäinen päivä"
        },
        "events": {
          "type": "integer",
          "description": "Laskutettavat tapahtumat (sivunäytöt ja omat tapahtumat)"
        },
        "bots": {
          "type": "integer",
          "description": "Suodatetut bottiosumat (ei laskuteta)"
        },
        "allowance": {
          "type": "integer",
          "description": "Sisältyvät tapahtumat mahdollisine merkkibonuksineen"
        },
        "percent": {
          "type": "number",
          "description": "Tapahtumat prosentteina kiintiöstä"
        },
        "forecast": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Ennustetut tapahtumat kuun lopussa"
            },
            {
              "type": "null"
            }
          ]
        },
        "forecast_percent": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "days_left": {
          "type": "integer",
          "description": "Kuukaudessa jäljellä olevat päivät"
        },
        "status": {
          "type": "string",
          "description": "ok, warning (80 %+), over (mennyt kuukausi, jossa kiintiö täyttyi tai ylittyi), locked tai paused"
        },
        "sites": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "site_id": {
                "type": "string"
              },
              "domain": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "events": {
                "type": "integer",
                "description": "Sivunäytöt ja omat tapahtumat tässä kuussa"
              },
              "share": {
                "type": "number",
                "description": "Prosenttiosuus työtilan kokonaismäärästä"
              }
            }
          },
          "description": "Tapahtumat sivustoittain"
        },
        "history": {
          "type": "array",
          "description": "Aiemmat kuukaudet, uusimmat ensin"
        },
        "access_locked_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Privatus Analyticsin henkilökunta lukitsi koontinäkymät tästä alkaen"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused": {
          "type": "boolean",
          "description": "True, kun uudet tapahtumat hylätään (kuukausiraja on täynnä tai henkilökunta keskeytti keruun)"
        },
        "pause_reason": {
          "anyOf": [
            {
              "type": "string",
              "description": "Miksi keruu on keskeytetty: limit (kuukausikiintiö on täynnä) tai staff. null, kun keruu on käynnissä"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Milloin henkilökunta keskeytti keruun"
            },
            {
              "type": "null"
            }
          ]
        },
        "resumes_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Milloin rajasta johtuva keskeytys päättyy: seuraavan kuukauden alussa (UTC) tai aiemmin päivityksen yhteydessä. Muuten null"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "description": "Tämä kuukausi tähän mennessä"
    }
  }
}
GET /workspaces/:workspace_id/billing.json Hae paketti, tilaus ja käyttö billing_get

Oikeus: billing.manage

Esimerkki
curl https://privatusanalytics.com/workspaces/:workspace_id/billing.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string"
    },
    "plan": {
      "type": "string",
      "description": "free, pro, business tai enterprise"
    },
    "plan_events": {
      "type": "integer",
      "description": "Maksullisen tason tapahtumat kuukaudessa"
    },
    "allowance": {
      "type": "integer",
      "description": "Tapahtumat kuukaudessa merkkibonus mukaan lukien"
    },
    "billing_interval": {
      "anyOf": [
        {
          "type": "string",
          "description": "month tai year"
        },
        {
          "type": "null"
        }
      ]
    },
    "price": {
      "anyOf": [
        {
          "type": "integer",
          "description": "USD laskutusjaksoa kohden"
        },
        {
          "type": "null"
        }
      ]
    },
    "subscription_status": {
      "type": "string",
      "description": "none, trialing, active, past_due, paused tai canceled"
    },
    "current_period_ends_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Uusiutuu tai päättyy"
        },
        {
          "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 tai agency"
            },
            "status": {
              "type": "string",
              "description": "pending, approved (ei vielä tilauksessa), active, rejected tai revoked"
            },
            "percent": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Alennusprosentti Pro- ja Business-paketeista (null ilmaisessa avoimen lähdekoodin ohjelmassa)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "comp_events": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Ilmaiset tapahtumat kuukaudessa (vain ilmainen avoimen lähdekoodin ohjelma)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "organization_name": {
              "type": "string",
              "description": "Organisaation, oppilaitoksen, projektin tai toimiston nimi"
            },
            "website": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Verkkosivusto"
                },
                {
                  "type": "null"
                }
              ]
            },
            "proof_url": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Todistelinkki tai koodivaraston URL"
                },
                {
                  "type": "null"
                }
              ]
            },
            "license": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "OSI-lisenssi (avoin lähdekoodi)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "note": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Huomautus käsittelyä varten"
                },
                {
                  "type": "null"
                }
              ]
            },
            "rejection_reason": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Miksi hakemusta ei hyväksytty"
                },
                {
                  "type": "null"
                }
              ]
            },
            "created_at": {
              "type": "string",
              "format": "date-time",
              "description": "Haettu"
            },
            "reviewed_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Käsitelty"
                },
                {
                  "type": "null"
                }
              ]
            },
            "applied_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Alennus voimassa alkaen"
                },
                {
                  "type": "null"
                }
              ]
            },
            "revoked_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Ohjelma päättyi"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Viimeisin alennusohjelmahakemus tai null"
        },
        {
          "type": "null"
        }
      ]
    },
    "discount_percent": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Hyväksytyn ohjelman alennusprosentti Pro- ja Business-paketeista tai null"
        },
        {
          "type": "null"
        }
      ]
    },
    "billing_emails": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "tax_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "badge": {
      "type": "object",
      "description": "Merkkibonus (ilmainen paketti)"
    },
    "usage": {
      "type": "object",
      "properties": {
        "month": {
          "type": "string",
          "format": "date",
          "description": "Raportoidun kuukauden ensimmäinen päivä"
        },
        "events": {
          "type": "integer",
          "description": "Laskutettavat tapahtumat (sivunäytöt ja omat tapahtumat)"
        },
        "bots": {
          "type": "integer",
          "description": "Suodatetut bottiosumat (ei laskuteta)"
        },
        "allowance": {
          "type": "integer",
          "description": "Sisältyvät tapahtumat mahdollisine merkkibonuksineen"
        },
        "percent": {
          "type": "number",
          "description": "Tapahtumat prosentteina kiintiöstä"
        },
        "forecast": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Ennustetut tapahtumat kuun lopussa"
            },
            {
              "type": "null"
            }
          ]
        },
        "forecast_percent": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "days_left": {
          "type": "integer",
          "description": "Kuukaudessa jäljellä olevat päivät"
        },
        "status": {
          "type": "string",
          "description": "ok, warning (80 %+), over (mennyt kuukausi, jossa kiintiö täyttyi tai ylittyi), locked tai paused"
        },
        "sites": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "site_id": {
                "type": "string"
              },
              "domain": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "events": {
                "type": "integer",
                "description": "Sivunäytöt ja omat tapahtumat tässä kuussa"
              },
              "share": {
                "type": "number",
                "description": "Prosenttiosuus työtilan kokonaismäärästä"
              }
            }
          },
          "description": "Tapahtumat sivustoittain"
        },
        "history": {
          "type": "array",
          "description": "Aiemmat kuukaudet, uusimmat ensin"
        },
        "access_locked_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Privatus Analyticsin henkilökunta lukitsi koontinäkymät tästä alkaen"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused": {
          "type": "boolean",
          "description": "True, kun uudet tapahtumat hylätään (kuukausiraja on täynnä tai henkilökunta keskeytti keruun)"
        },
        "pause_reason": {
          "anyOf": [
            {
              "type": "string",
              "description": "Miksi keruu on keskeytetty: limit (kuukausikiintiö on täynnä) tai staff. null, kun keruu on käynnissä"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Milloin henkilökunta keskeytti keruun"
            },
            {
              "type": "null"
            }
          ]
        },
        "resumes_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Milloin rajasta johtuva keskeytys päättyy: seuraavan kuukauden alussa (UTC) tai aiemmin päivityksen yhteydessä. Muuten null"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "description": "Tämä kuukausi tähän mennessä"
    }
  }
}
PATCH /workspaces/:workspace_id/billing.json Päivitä laskutussähköpostit, verotunnus ja automaattinen päivitys billing_update

Oikeus: billing.manage

Esimerkki
curl -X PATCH https://privatusanalytics.com/workspaces/:workspace_id/billing.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "billing_emails": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Lisäosoitteet laskuille ja laskutusilmoituksille (enintään 5)"
    },
    "tax_id": {
      "type": "string",
      "description": "Laskuilla näytettävä ALV-/vero-tunnus"
    },
    "auto_upgrade": {
      "type": "boolean",
      "description": "true siirtää seuraavalle tasolle ja veloittaa erotuksen, kun kuukausiraja täyttyy, keruun keskeyttämisen sijaan. Oletuksena pois päältä"
    },
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string"
    },
    "plan": {
      "type": "string",
      "description": "free, pro, business tai enterprise"
    },
    "plan_events": {
      "type": "integer",
      "description": "Maksullisen tason tapahtumat kuukaudessa"
    },
    "allowance": {
      "type": "integer",
      "description": "Tapahtumat kuukaudessa merkkibonus mukaan lukien"
    },
    "billing_interval": {
      "anyOf": [
        {
          "type": "string",
          "description": "month tai year"
        },
        {
          "type": "null"
        }
      ]
    },
    "price": {
      "anyOf": [
        {
          "type": "integer",
          "description": "USD laskutusjaksoa kohden"
        },
        {
          "type": "null"
        }
      ]
    },
    "subscription_status": {
      "type": "string",
      "description": "none, trialing, active, past_due, paused tai canceled"
    },
    "current_period_ends_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Uusiutuu tai päättyy"
        },
        {
          "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 tai agency"
            },
            "status": {
              "type": "string",
              "description": "pending, approved (ei vielä tilauksessa), active, rejected tai revoked"
            },
            "percent": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Alennusprosentti Pro- ja Business-paketeista (null ilmaisessa avoimen lähdekoodin ohjelmassa)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "comp_events": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Ilmaiset tapahtumat kuukaudessa (vain ilmainen avoimen lähdekoodin ohjelma)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "organization_name": {
              "type": "string",
              "description": "Organisaation, oppilaitoksen, projektin tai toimiston nimi"
            },
            "website": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Verkkosivusto"
                },
                {
                  "type": "null"
                }
              ]
            },
            "proof_url": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Todistelinkki tai koodivaraston URL"
                },
                {
                  "type": "null"
                }
              ]
            },
            "license": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "OSI-lisenssi (avoin lähdekoodi)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "note": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Huomautus käsittelyä varten"
                },
                {
                  "type": "null"
                }
              ]
            },
            "rejection_reason": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Miksi hakemusta ei hyväksytty"
                },
                {
                  "type": "null"
                }
              ]
            },
            "created_at": {
              "type": "string",
              "format": "date-time",
              "description": "Haettu"
            },
            "reviewed_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Käsitelty"
                },
                {
                  "type": "null"
                }
              ]
            },
            "applied_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Alennus voimassa alkaen"
                },
                {
                  "type": "null"
                }
              ]
            },
            "revoked_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Ohjelma päättyi"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Viimeisin alennusohjelmahakemus tai null"
        },
        {
          "type": "null"
        }
      ]
    },
    "discount_percent": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Hyväksytyn ohjelman alennusprosentti Pro- ja Business-paketeista tai null"
        },
        {
          "type": "null"
        }
      ]
    },
    "billing_emails": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "tax_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "badge": {
      "type": "object",
      "description": "Merkkibonus (ilmainen paketti)"
    },
    "usage": {
      "type": "object",
      "properties": {
        "month": {
          "type": "string",
          "format": "date",
          "description": "Raportoidun kuukauden ensimmäinen päivä"
        },
        "events": {
          "type": "integer",
          "description": "Laskutettavat tapahtumat (sivunäytöt ja omat tapahtumat)"
        },
        "bots": {
          "type": "integer",
          "description": "Suodatetut bottiosumat (ei laskuteta)"
        },
        "allowance": {
          "type": "integer",
          "description": "Sisältyvät tapahtumat mahdollisine merkkibonuksineen"
        },
        "percent": {
          "type": "number",
          "description": "Tapahtumat prosentteina kiintiöstä"
        },
        "forecast": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Ennustetut tapahtumat kuun lopussa"
            },
            {
              "type": "null"
            }
          ]
        },
        "forecast_percent": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "days_left": {
          "type": "integer",
          "description": "Kuukaudessa jäljellä olevat päivät"
        },
        "status": {
          "type": "string",
          "description": "ok, warning (80 %+), over (mennyt kuukausi, jossa kiintiö täyttyi tai ylittyi), locked tai paused"
        },
        "sites": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "site_id": {
                "type": "string"
              },
              "domain": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "events": {
                "type": "integer",
                "description": "Sivunäytöt ja omat tapahtumat tässä kuussa"
              },
              "share": {
                "type": "number",
                "description": "Prosenttiosuus työtilan kokonaismäärästä"
              }
            }
          },
          "description": "Tapahtumat sivustoittain"
        },
        "history": {
          "type": "array",
          "description": "Aiemmat kuukaudet, uusimmat ensin"
        },
        "access_locked_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Privatus Analyticsin henkilökunta lukitsi koontinäkymät tästä alkaen"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused": {
          "type": "boolean",
          "description": "True, kun uudet tapahtumat hylätään (kuukausiraja on täynnä tai henkilökunta keskeytti keruun)"
        },
        "pause_reason": {
          "anyOf": [
            {
              "type": "string",
              "description": "Miksi keruu on keskeytetty: limit (kuukausikiintiö on täynnä) tai staff. null, kun keruu on käynnissä"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Milloin henkilökunta keskeytti keruun"
            },
            {
              "type": "null"
            }
          ]
        },
        "resumes_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Milloin rajasta johtuva keskeytys päättyy: seuraavan kuukauden alussa (UTC) tai aiemmin päivityksen yhteydessä. Muuten null"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "description": "Tämä kuukausi tähän mennessä"
    }
  }
}
GET /workspaces/:workspace_id/billing/usage.json Hae tämän kuun käyttö, ennuste ja sivustokohtainen jakauma billing_usage

Oikeus: billing.manage

Esimerkki
curl https://privatusanalytics.com/workspaces/:workspace_id/billing/usage.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "month": {
      "type": "string",
      "format": "date",
      "description": "Mikä tahansa raportoitavan kuukauden päivä (oletuksena tämä kuukausi)",
      "examples": [
        "2026-09-01"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "month": {
      "type": "string",
      "format": "date",
      "description": "Raportoidun kuukauden ensimmäinen päivä"
    },
    "events": {
      "type": "integer",
      "description": "Laskutettavat tapahtumat (sivunäytöt ja omat tapahtumat)"
    },
    "bots": {
      "type": "integer",
      "description": "Suodatetut bottiosumat (ei laskuteta)"
    },
    "allowance": {
      "type": "integer",
      "description": "Sisältyvät tapahtumat mahdollisine merkkibonuksineen"
    },
    "percent": {
      "type": "number",
      "description": "Tapahtumat prosentteina kiintiöstä"
    },
    "forecast": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Ennustetut tapahtumat kuun lopussa"
        },
        {
          "type": "null"
        }
      ]
    },
    "forecast_percent": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "days_left": {
      "type": "integer",
      "description": "Kuukaudessa jäljellä olevat päivät"
    },
    "status": {
      "type": "string",
      "description": "ok, warning (80 %+), over (mennyt kuukausi, jossa kiintiö täyttyi tai ylittyi), locked tai paused"
    },
    "sites": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "site_id": {
            "type": "string"
          },
          "domain": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "events": {
            "type": "integer",
            "description": "Sivunäytöt ja omat tapahtumat tässä kuussa"
          },
          "share": {
            "type": "number",
            "description": "Prosenttiosuus työtilan kokonaismäärästä"
          }
        }
      },
      "description": "Tapahtumat sivustoittain"
    },
    "history": {
      "type": "array",
      "description": "Aiemmat kuukaudet, uusimmat ensin"
    },
    "access_locked_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Privatus Analyticsin henkilökunta lukitsi koontinäkymät tästä alkaen"
        },
        {
          "type": "null"
        }
      ]
    },
    "collection_paused": {
      "type": "boolean",
      "description": "True, kun uudet tapahtumat hylätään (kuukausiraja on täynnä tai henkilökunta keskeytti keruun)"
    },
    "pause_reason": {
      "anyOf": [
        {
          "type": "string",
          "description": "Miksi keruu on keskeytetty: limit (kuukausikiintiö on täynnä) tai staff. null, kun keruu on käynnissä"
        },
        {
          "type": "null"
        }
      ]
    },
    "collection_paused_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Milloin henkilökunta keskeytti keruun"
        },
        {
          "type": "null"
        }
      ]
    },
    "resumes_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Milloin rajasta johtuva keskeytys päättyy: seuraavan kuukauden alussa (UTC) tai aiemmin päivityksen yhteydessä. Muuten null"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
GET /workspaces/:workspace_id/billing/invoices.json Listaa laskut billing_invoices_list

Oikeus: billing.manage

Esimerkki
curl https://privatusanalytics.com/workspaces/:workspace_id/billing/invoices.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Sivu (alkaen 1:stä)"
    },
    "per_page": {
      "type": "integer",
      "description": "Tuloksia sivulla (enintään 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Paddlen tapahtumatunniste"
      },
      "invoice_number": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "status": {
        "type": "string",
        "description": "paid, completed, payment_failed, ..."
      },
      "amount_minor": {
        "type": "integer",
        "description": "Yhteensä pienimmissä yksiköissä (sentteinä)"
      },
      "currency": {
        "type": "string"
      },
      "billed_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      }
    }
  }
}
GET /workspaces/:workspace_id/billing/invoices/:id.json Hae laskun PDF-linkki billing_invoices_get

Oikeus: billing.manage

Esimerkki
curl https://privatusanalytics.com/workspaces/:workspace_id/billing/invoices/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "description": "portal, payment_method tai invoice"
    },
    "url": {
      "anyOf": [
        {
          "type": "string",
          "description": "Lyhytikäinen Paddle-URL"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}

Liikennesäännöt

POST /sites/:site_id/traffic_rules.json Lisää liikennesääntö traffic_rules_create

Oikeus: sites.manage

Esimerkki
curl -X POST https://privatusanalytics.com/sites/:site_id/traffic_rules.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "list": {
      "type": "string",
      "description": "hostnames, paths, referrers, countries, ip_ranges, user_agents tai events",
      "enum": [
        "hostnames",
        "paths",
        "referrers",
        "countries",
        "ip_ranges",
        "user_agents",
        "events"
      ]
    },
    "pattern": {
      "type": "string",
      "description": "Vastaava arvo. * on jokerimerkki. ip_ranges hyväksyy IP-osoitteen tai CIDR-alueen (v4/v6), countries ISO-koodin",
      "examples": [
        "/admin/*"
      ]
    },
    "label": {
      "type": "string",
      "description": "Valinnainen huomautus, esim. \"Toimisto\""
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "list",
    "pattern",
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Säännön tunniste"
    },
    "list": {
      "type": "string",
      "description": "hostnames, paths, referrers, countries, ip_ranges, user_agents tai events"
    },
    "pattern": {
      "type": "string",
      "description": "Malli (* jokerimerkit, CIDR ip_ranges-listalle)"
    },
    "label": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "mode": {
      "type": "string",
      "description": "block tai allow (listansa tila)"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:site_id/traffic_rules/:id.json Poista liikennesääntö traffic_rules_delete

Oikeus: sites.manage

Esimerkki
curl -X DELETE https://privatusanalytics.com/sites/:site_id/traffic_rules/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Säännön tunniste"
    },
    "list": {
      "type": "string",
      "description": "hostnames, paths, referrers, countries, ip_ranges, user_agents tai events"
    },
    "pattern": {
      "type": "string",
      "description": "Malli (* jokerimerkit, CIDR ip_ranges-listalle)"
    },
    "label": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "mode": {
      "type": "string",
      "description": "block tai allow (listansa tila)"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/traffic_rules.json Listaa liikennesäännöt traffic_rules_list

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/sites/:site_id/traffic_rules.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "list": {
      "type": "string",
      "description": "Vain tämän listan säännöt",
      "enum": [
        "hostnames",
        "paths",
        "referrers",
        "countries",
        "ip_ranges",
        "user_agents",
        "events"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Säännön tunniste"
    },
    "list": {
      "type": "string",
      "description": "hostnames, paths, referrers, countries, ip_ranges, user_agents tai events"
    },
    "pattern": {
      "type": "string",
      "description": "Malli (* jokerimerkit, CIDR ip_ranges-listalle)"
    },
    "label": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "mode": {
      "type": "string",
      "description": "block tai allow (listansa tila)"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /sites/:site_id/traffic_rules/test.json Testaa, laskettaisiinko kutsu sivuston nykyisillä säännöillä traffic_rules_test

Oikeus: analytics.read

Esimerkki
curl -X POST https://privatusanalytics.com/sites/:site_id/traffic_rules/test.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Sivun URL, esim. https://example.com/a"
    },
    "referrer": {
      "type": "string",
      "description": "Viittaajan URL tai isäntänimi"
    },
    "country": {
      "type": "string",
      "description": "ISO-maakoodi, esim. US"
    },
    "ip": {
      "type": "string",
      "description": "ip_ranges-sääntöjä vasten testattava IP-osoite (ei tallenneta)"
    },
    "user_agent": {
      "type": "string",
      "description": "User-Agent-merkkijono (typistetään selaimeksi ja pääversioksi, kuten keruussa)"
    },
    "event": {
      "type": "string",
      "description": "Oman tapahtuman nimi"
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}
PATCH /sites/:site_id/traffic_rules/:id.json Muuta liikennesääntöä traffic_rules_update

Oikeus: sites.manage

Esimerkki
curl -X PATCH https://privatusanalytics.com/sites/:site_id/traffic_rules/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "pattern": {
      "type": "string",
      "description": "Uusi malli"
    },
    "label": {
      "type": "string",
      "description": "Uusi nimike"
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Säännön tunniste"
    },
    "list": {
      "type": "string",
      "description": "hostnames, paths, referrers, countries, ip_ranges, user_agents tai events"
    },
    "pattern": {
      "type": "string",
      "description": "Malli (* jokerimerkit, CIDR ip_ranges-listalle)"
    },
    "label": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "mode": {
      "type": "string",
      "description": "block tai allow (listansa tila)"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Live

GET /sites/:site_id/live.json Live-kävijät, aktiviteettivirta ja juuri nyt suosittu (viimeiset 30 minuuttia) live_get

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/sites/:site_id/live.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "feed": {
      "type": "string",
      "description": "Aktiviteettivirta: kaikki kutsut, sivunäytöt tai omat tapahtumat",
      "enum": [
        "all",
        "pageviews",
        "events"
      ],
      "default": "all"
    },
    "limit": {
      "type": "integer",
      "description": "Aktiviteettivirran merkinnät (enintään 100)",
      "default": 50
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}
GET /sites/:site_id/live/wallboard.json Seinänäytön kortit (live ja tänään) yhdelle tai useammalle sivustolle live_wallboard

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/sites/:site_id/live/wallboard.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Sivustotunnisteet, joiden välillä kierretään (oletuksena tämä sivusto)",
      "default": []
    },
    "rotate_seconds": {
      "type": "integer",
      "description": "Sekuntia, jonka kukin sivusto pysyy näytöllä (5-300)",
      "default": 20
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}
GET /wallboard/:token.json Seinänäyttö seinänäyttötunnisteella (ei kirjautumista) live_public_wallboard

Oikeus: public · Vain HTTP (ei MCP-työkalu)

Esimerkki
curl https://privatusanalytics.com/wallboard/:token.json
Syötteet
{
  "type": "object",
  "properties": {
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Sivustotunnisteet, joiden välillä kierretään (oletuksena tämä sivusto)",
      "default": []
    },
    "rotate_seconds": {
      "type": "integer",
      "description": "Sekuntia, jonka kukin sivusto pysyy näytöllä (5-300)",
      "default": 20
    },
    "token": {
      "type": "string",
      "description": "Resurssin Token"
    }
  },
  "required": [
    "token"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}

Muistiinpanot

POST /sites/:site_id/notes.json Lisää muistiinpano sivustolle (käytä lähdettä "deploy" julkaisuwebhookeille) notes_create

Oikeus: content.write

Esimerkki
curl -X POST https://privatusanalytics.com/sites/:site_id/notes.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "date": {
      "type": "string",
      "format": "date",
      "description": "Muistiinpanon päivä (sivuston aikavyöhyke). Oletuksena tänään"
    },
    "end_date": {
      "type": "string",
      "format": "date",
      "description": "Viimeinen päivä aikavälille"
    },
    "title": {
      "type": "string",
      "description": "Kaavioissa näytettävä lyhyt otsikko",
      "examples": [
        "Launched new pricing"
      ]
    },
    "body": {
      "type": "string",
      "description": "Tiedot (Markdown)"
    },
    "url": {
      "type": "string",
      "description": "Linkki, esim. PR tai muutoslokia"
    },
    "color": {
      "type": "string",
      "description": "Nastan väri",
      "enum": [
        "neutral",
        "brand",
        "blue",
        "amber",
        "red",
        "violet"
      ]
    },
    "source": {
      "type": "string",
      "description": "manual tai deploy julkaisuwebhookeille",
      "enum": [
        "manual",
        "deploy",
        "system",
        "import",
        "incident"
      ],
      "default": "manual"
    },
    "version": {
      "type": "string",
      "description": "Julkaisut: julkaisun versio tai commit, käytetään oletusotsikkona"
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Muistiinpanon tunniste, esim. note_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Sivusto tai null koko työtilan muistiinpanoille"
        },
        {
          "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 Poista muistiinpano notes_delete

Oikeus: content.write

Esimerkki
curl -X DELETE https://privatusanalytics.com/sites/:site_id/notes/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Muistiinpanon tunniste, esim. note_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Sivusto tai null koko työtilan muistiinpanoille"
        },
        {
          "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 Listaa sivuston muistiinpanot (myös koko työtilan muistiinpanot) notes_list

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/sites/:site_id/notes.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "from": {
      "type": "string",
      "format": "date",
      "description": "Vain tämän päivän tai sen jälkeiset muistiinpanot"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Vain tämän päivän tai sitä edeltävät muistiinpanot"
    },
    "source": {
      "type": "string",
      "description": "Vain tämän lähteen muistiinpanot",
      "enum": [
        "manual",
        "deploy",
        "system",
        "import",
        "incident"
      ]
    },
    "query": {
      "type": "string",
      "description": "Hae otsikkoa, sisältöä ja linkkiä"
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Sivu (alkaen 1:stä)"
    },
    "per_page": {
      "type": "integer",
      "description": "Tuloksia sivulla (enintään 100)"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Muistiinpanon tunniste, esim. note_7Q2K9XH3AB"
      },
      "site_id": {
        "anyOf": [
          {
            "type": "string",
            "description": "Sivusto tai null koko työtilan muistiinpanoille"
          },
          {
            "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 Hae muistiinpano notes_get

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/sites/:site_id/notes/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Muistiinpanon tunniste, esim. note_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Sivusto tai null koko työtilan muistiinpanoille"
        },
        {
          "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 Muokkaa muistiinpanoa notes_update

Oikeus: content.write

Esimerkki
curl -X PATCH https://privatusanalytics.com/sites/:site_id/notes/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "date": {
      "type": "string",
      "format": "date",
      "description": "Muistiinpanon päivä"
    },
    "end_date": {
      "type": "string",
      "format": "date",
      "description": "Viimeinen päivä aikavälille"
    },
    "title": {
      "type": "string",
      "description": "Kaavioissa näytettävä lyhyt otsikko"
    },
    "body": {
      "type": "string",
      "description": "Tiedot (Markdown)"
    },
    "url": {
      "type": "string",
      "description": "Linkki"
    },
    "color": {
      "type": "string",
      "description": "Nastan väri",
      "enum": [
        "neutral",
        "brand",
        "blue",
        "amber",
        "red",
        "violet"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Muistiinpanon tunniste, esim. note_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Sivusto tai null koko työtilan muistiinpanoille"
        },
        {
          "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 Lisää koko työtilan muistiinpano (näytetään jokaisella sivustolla) workspace_notes_create

Oikeus: content.write

Esimerkki
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/notes.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "date": {
      "type": "string",
      "format": "date",
      "description": "Muistiinpanon päivä (sivuston aikavyöhyke). Oletuksena tänään"
    },
    "end_date": {
      "type": "string",
      "format": "date",
      "description": "Viimeinen päivä aikavälille"
    },
    "title": {
      "type": "string",
      "description": "Kaavioissa näytettävä lyhyt otsikko",
      "examples": [
        "Launched new pricing"
      ]
    },
    "body": {
      "type": "string",
      "description": "Tiedot (Markdown)"
    },
    "url": {
      "type": "string",
      "description": "Linkki, esim. PR tai muutoslokia"
    },
    "color": {
      "type": "string",
      "description": "Nastan väri",
      "enum": [
        "neutral",
        "brand",
        "blue",
        "amber",
        "red",
        "violet"
      ]
    },
    "source": {
      "type": "string",
      "description": "manual tai deploy julkaisuwebhookeille",
      "enum": [
        "manual",
        "deploy",
        "system",
        "import",
        "incident"
      ],
      "default": "manual"
    },
    "version": {
      "type": "string",
      "description": "Julkaisut: julkaisun versio tai commit, käytetään oletusotsikkona"
    },
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Muistiinpanon tunniste, esim. note_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Sivusto tai null koko työtilan muistiinpanoille"
        },
        {
          "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 Poista työtilan muistiinpano workspace_notes_delete

Oikeus: content.write

Esimerkki
curl -X DELETE https://privatusanalytics.com/workspaces/:workspace_id/notes/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Muistiinpanon tunniste, esim. note_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Sivusto tai null koko työtilan muistiinpanoille"
        },
        {
          "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 Listaa työtilan muistiinpanot workspace_notes_list

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/workspaces/:workspace_id/notes.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "from": {
      "type": "string",
      "format": "date",
      "description": "Vain tämän päivän tai sen jälkeiset muistiinpanot"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Vain tämän päivän tai sitä edeltävät muistiinpanot"
    },
    "source": {
      "type": "string",
      "description": "Vain tämän lähteen muistiinpanot",
      "enum": [
        "manual",
        "deploy",
        "system",
        "import",
        "incident"
      ]
    },
    "query": {
      "type": "string",
      "description": "Hae otsikkoa, sisältöä ja linkkiä"
    },
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Sivu (alkaen 1:stä)"
    },
    "per_page": {
      "type": "integer",
      "description": "Tuloksia sivulla (enintään 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Muistiinpanon tunniste, esim. note_7Q2K9XH3AB"
      },
      "site_id": {
        "anyOf": [
          {
            "type": "string",
            "description": "Sivusto tai null koko työtilan muistiinpanoille"
          },
          {
            "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 Muokkaa työtilan muistiinpanoa workspace_notes_update

Oikeus: content.write

Esimerkki
curl -X PATCH https://privatusanalytics.com/workspaces/:workspace_id/notes/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "date": {
      "type": "string",
      "format": "date",
      "description": "Muistiinpanon päivä"
    },
    "end_date": {
      "type": "string",
      "format": "date",
      "description": "Viimeinen päivä aikavälille"
    },
    "title": {
      "type": "string",
      "description": "Kaavioissa näytettävä lyhyt otsikko"
    },
    "body": {
      "type": "string",
      "description": "Tiedot (Markdown)"
    },
    "url": {
      "type": "string",
      "description": "Linkki"
    },
    "color": {
      "type": "string",
      "description": "Nastan väri",
      "enum": [
        "neutral",
        "brand",
        "blue",
        "amber",
        "red",
        "violet"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Muistiinpanon tunniste, esim. note_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Sivusto tai null koko työtilan muistiinpanoille"
        },
        {
          "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"
    }
  }
}

Ohje ja palaute

POST /help.json Lähetä kysymys tai palaute Privatus Analytics -tiimille support_message_send

Viesti lähetetään tiimille sähköpostilla, ja mukaan liitetään tilisi, työtilasi ja tilauksesi tiedot. Vastaus ja kuittaus lähetetään tilisi sähköpostiosoitteeseen. Enintään 10 viestiä päivässä.

Oikeus: member

Esimerkki
curl -X POST https://privatusanalytics.com/help.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "subject": {
      "type": "string",
      "description": "Mistä viesti kertoo (enintään 150 merkkiä)",
      "examples": [
        "Funnel shows no data"
      ]
    },
    "message": {
      "type": "string",
      "description": "Kysymyksesi tai palautteesi (10-5 000 merkkiä)"
    }
  },
  "required": [
    "subject",
    "message"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "received": {
      "type": "boolean",
      "description": "Aina true, kun lähetys hyväksyttiin"
    },
    "message": {
      "type": "string",
      "description": "Mitä seuraavaksi tapahtuu"
    }
  }
}

Paketit

GET /plans.json Listaa paketit, hinnat ja rajat plans_list

Oikeus: public

Esimerkki
curl https://privatusanalytics.com/plans.json
Syötteet
{
  "type": "object",
  "properties": {
    "page": {
      "type": "integer",
      "description": "Sivu (alkaen 1:stä)"
    },
    "per_page": {
      "type": "integer",
      "description": "Tuloksia sivulla (enintään 100)"
    }
  },
  "required": []
}
Vastauksen tiedot
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "name": {
        "type": "string",
        "description": "free, pro, business tai enterprise"
      },
      "events": {
        "anyOf": [
          {
            "type": "integer",
            "description": "Sisältyvät tapahtumat kuukaudessa (vain ilmainen paketti)"
          },
          {
            "type": "null"
          }
        ]
      },
      "badge_bonus": {
        "anyOf": [
          {
            "type": "integer",
            "description": "Lisätapahtumat kuukaudessa merkin näyttämisestä (ilmainen paketti)"
          },
          {
            "type": "null"
          }
        ]
      },
      "limits": {
        "type": "object",
        "description": "Paketin rajat. Null tarkoittaa rajatonta"
      },
      "tiers": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "events": {
              "type": "integer",
              "description": "Sisältyvät tapahtumat kuukaudessa"
            },
            "monthly": {
              "type": "integer",
              "description": "USD kuukaudessa, laskutetaan kuukausittain"
            },
            "yearly": {
              "type": "integer",
              "description": "USD vuodessa, laskutetaan vuosittain (2 kuukautta ilmaiseksi)"
            },
            "monthly_price_id": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Paddlen hintatunniste (kuukausi)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "yearly_price_id": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Paddlen hintatunniste (vuosi)"
                },
                {
                  "type": "null"
                }
              ]
            }
          }
        },
        "description": "Hintaportaat tapahtumien kuukausimäärän mukaan"
      },
      "contact_sales": {
        "type": "boolean",
        "description": "Hinnoitellaan sopimuskohtaisesti"
      }
    }
  }
}

Roolit

POST /workspaces/:workspace_id/roles.json Luo oma rooli roles_create

Oikeus: members.manage

Esimerkki
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/roles.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Roolin nimi",
      "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": "Roolin myöntämät oikeudet"
    },
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "permissions",
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Oman roolin tunniste (custom_role_id jäsenillä)"
    },
    "name": {
      "type": "string"
    },
    "permissions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Myönnetyt oikeudet"
    },
    "members": {
      "type": "integer",
      "description": "Jäsenet, joilla on tämä rooli"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /workspaces/:workspace_id/roles/:id.json Poista oma rooli (ei saa olla käytössä) roles_delete

Oikeus: members.manage

Esimerkki
curl -X DELETE https://privatusanalytics.com/workspaces/:workspace_id/roles/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Oman roolin tunniste (custom_role_id jäsenillä)"
    },
    "name": {
      "type": "string"
    },
    "permissions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Myönnetyt oikeudet"
    },
    "members": {
      "type": "integer",
      "description": "Jäsenet, joilla on tämä rooli"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /workspaces/:workspace_id/roles.json Listaa omat roolit roles_list

Oikeus: member

Esimerkki
curl https://privatusanalytics.com/workspaces/:workspace_id/roles.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Sivu (alkaen 1:stä)"
    },
    "per_page": {
      "type": "integer",
      "description": "Tuloksia sivulla (enintään 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "format": "uuid",
        "description": "Oman roolin tunniste (custom_role_id jäsenillä)"
      },
      "name": {
        "type": "string"
      },
      "permissions": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Myönnetyt oikeudet"
      },
      "members": {
        "type": "integer",
        "description": "Jäsenet, joilla on tämä rooli"
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
PATCH /workspaces/:workspace_id/roles/:id.json Päivitä oma rooli roles_update

Oikeus: members.manage

Esimerkki
curl -X PATCH https://privatusanalytics.com/workspaces/:workspace_id/roles/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Roolin nimi"
    },
    "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": "Roolin myöntämät oikeudet"
    },
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Oman roolin tunniste (custom_role_id jäsenillä)"
    },
    "name": {
      "type": "string"
    },
    "permissions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Myönnetyt oikeudet"
    },
    "members": {
      "type": "integer",
      "description": "Jäsenet, joilla on tämä rooli"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

SCIM

POST /scim/v2/Users.json Provisioi käyttäjä scim_users_create

Oikeus: public · Vain HTTP (ei MCP-työkalu)

Esimerkki
curl -X POST https://privatusanalytics.com/scim/v2/Users.json \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "userName": {
      "type": "string",
      "description": "Sähköpostiosoite"
    },
    "name": {
      "type": "object",
      "additionalProperties": true,
      "description": "givenName, familyName, formatted",
      "default": {}
    },
    "active": {
      "type": "boolean",
      "description": "Työtilan jäsen",
      "default": true
    }
  },
  "required": [
    "userName"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}
DELETE /scim/v2/Users/:id.json Poista käyttäjän provisiointi scim_users_delete

Oikeus: public · Vain HTTP (ei MCP-työkalu)

Esimerkki
curl -X DELETE https://privatusanalytics.com/scim/v2/Users/:id.json \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}
GET /scim/v2/Users.json Listaa provisioidut käyttäjät scim_users_list

Oikeus: public · Vain HTTP (ei MCP-työkalu)

Esimerkki
curl https://privatusanalytics.com/scim/v2/Users.json
Syötteet
{
  "type": "object",
  "properties": {
    "scim_filter": {
      "type": "string",
      "description": "SCIM-suodatin (kyselyparametri `filter`), esim. userName eq \"[email protected]\""
    },
    "startIndex": {
      "type": "integer",
      "description": "Ensimmäisen tuloksen indeksi (alkaen 1:stä)",
      "default": 1
    },
    "count": {
      "type": "integer",
      "description": "Sivun koko (enintään 200)",
      "default": 100
    }
  },
  "required": []
}
Vastauksen tiedot
{
  "type": "object"
}
GET /scim/v2/Users/:id.json Hae provisioitu käyttäjä scim_users_get

Oikeus: public · Vain HTTP (ei MCP-työkalu)

Esimerkki
curl https://privatusanalytics.com/scim/v2/Users/:id.json
Syötteet
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}
PATCH /scim/v2/Users/:id.json Päivitä käyttäjä (PATCH active, name) scim_users_update

Oikeus: public · Vain HTTP (ei MCP-työkalu)

Esimerkki
curl -X PATCH https://privatusanalytics.com/scim/v2/Users/:id.json \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "Operations": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      },
      "description": "SCIM PatchOp -operaatiot"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "Operations",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}

SSO

POST /workspaces/:workspace_id/sso/activate.json Ota käyttöön testattu SSO-määritys sso_activate

Oikeus: workspace.manage

Esimerkki
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/sso/activate.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "protocol": {
      "type": "string",
      "description": "saml tai oidc"
    },
    "status": {
      "type": "string",
      "description": "draft, testing, tested tai active"
    },
    "enforced": {
      "type": "boolean",
      "description": "SSO on ainoa tapa sisäänkirjautumiseen (omistajaa lukuun ottamatta)"
    },
    "domains": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Vahvistetut sähköpostiverkkotunnukset"
    },
    "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 Kytke SSO pois päältä (takaisin luonnokseen) sso_deactivate

Oikeus: workspace.manage

Esimerkki
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/sso/deactivate.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "protocol": {
      "type": "string",
      "description": "saml tai oidc"
    },
    "status": {
      "type": "string",
      "description": "draft, testing, tested tai active"
    },
    "enforced": {
      "type": "boolean",
      "description": "SSO on ainoa tapa sisäänkirjautumiseen (omistajaa lukuun ottamatta)"
    },
    "domains": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Vahvistetut sähköpostiverkkotunnukset"
    },
    "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 Luo uusi SCIM-tunniste (näytetään vain kerran) sso_scim_token

Oikeus: workspace.manage · Vain HTTP (ei MCP-työkalu)

Esimerkki
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/sso/scim_token.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}
GET /workspaces/:workspace_id/sso.json Hae SSO-asetukset sso_get

Oikeus: workspace.manage

Esimerkki
curl https://privatusanalytics.com/workspaces/:workspace_id/sso.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "protocol": {
      "type": "string",
      "description": "saml tai oidc"
    },
    "status": {
      "type": "string",
      "description": "draft, testing, tested tai active"
    },
    "enforced": {
      "type": "boolean",
      "description": "SSO on ainoa tapa sisäänkirjautumiseen (omistajaa lukuun ottamatta)"
    },
    "domains": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Vahvistetut sähköpostiverkkotunnukset"
    },
    "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 Luo tai päivitä SSO-asetukset sso_update

Oikeus: workspace.manage

Esimerkki
curl -X PATCH https://privatusanalytics.com/workspaces/:workspace_id/sso.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "protocol": {
      "type": "string",
      "description": "saml tai oidc",
      "enum": [
        "saml",
        "oidc"
      ]
    },
    "idp_sso_url": {
      "type": "string",
      "description": "SAML: IdP:n kertakirjautumis-URL"
    },
    "idp_entity_id": {
      "type": "string",
      "description": "SAML: IdP:n entity id (issuer)"
    },
    "idp_cert": {
      "type": "string",
      "description": "SAML: IdP:n X.509-allekirjoitusvarmenne (PEM)"
    },
    "oidc_issuer": {
      "type": "string",
      "description": "OIDC: issuer-URL (discovery)"
    },
    "oidc_client_id": {
      "type": "string",
      "description": "OIDC: client id"
    },
    "oidc_client_secret": {
      "type": "string",
      "description": "OIDC: client secret (vain kirjoitettavissa)"
    },
    "domains": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Vahvistetut sähköpostiverkkotunnukset, jotka käyttävät tätä SSO:ta"
    },
    "default_role": {
      "type": "string",
      "description": "JIT:llä tai SCIM:llä luotujen jäsenten rooli",
      "enum": [
        "admin",
        "editor",
        "analyst",
        "viewer",
        "billing"
      ]
    },
    "jit_provisioning": {
      "type": "boolean",
      "description": "Luo jäsenet ensimmäisellä SSO-kirjautumisella"
    },
    "enforced": {
      "type": "boolean",
      "description": "Salli vain SSO-kirjautumiset (vaatii aktiivisen määrityksen)"
    },
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "protocol": {
      "type": "string",
      "description": "saml tai oidc"
    },
    "status": {
      "type": "string",
      "description": "draft, testing, tested tai active"
    },
    "enforced": {
      "type": "boolean",
      "description": "SSO on ainoa tapa sisäänkirjautumiseen (omistajaa lukuun ottamatta)"
    },
    "domains": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Vahvistetut sähköpostiverkkotunnukset"
    },
    "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"
    }
  }
}

Segmentit

POST /sites/:site_id/segments.json Tallenna suodattimet segmenttinä segments_create

Oikeus: content.write

Esimerkki
curl -X POST https://privatusanalytics.com/sites/:site_id/segments.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Segmentin nimi, esim. \"Mobiilikävijät mainoksista\"",
      "examples": [
        "Mobile visitors from ads"
      ]
    },
    "description": {
      "type": "string",
      "description": "Valinnainen huomautus segmentin tarkoituksesta (enintään 300 merkkiä)",
      "examples": [
        "People who might buy the Pro plan"
      ]
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Suodattimet, joiden kaikkien on täsmättävä. Jokainen kohta on ehto [\"dimension\", \"operator\", \"value\"] tai {\"any\": [ehdot]}, kun mikä tahansa useista saa täsmätä. Dimensiot: page, entry_page, exit_page, hostname, channel, referrer, referrer_url, ref, utm_source, utm_medium, utm_campaign, utm_content, utm_term, country (ISO-koodi, esim. US), language, device (desktop, mobile, tablet, tv, other), browser, browser_version, os, os_version, screen, goal (tavoitteen tunniste), event (oman tapahtuman nimi) ja prop:<key> (oman tapahtuman ominaisuus). Operaattorit: is, is_not, contains, not_contains, starts_with, regex, not_regex, any_of ja none_of (arvo on lista), gt ja lt (luku), between (kahden luvun lista). Myös segmenttilomakkeen rivit kelpaavat: {\"dimension\", \"operator\", \"value\", \"property\" (dimensiolle prop), \"join\": \"and\" tai \"or\" (or yhdistää rivin sitä edeltävään)}. Esimerkki: [[\"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": "Näkyy kaikille, joilla on pääsy sivustoon (false: vain sinulle)",
      "default": true
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "filters",
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Segmentin tunniste, esim. seg_7Q2K9XH3AB"
    },
    "site_id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "anyOf": [
        {
          "type": "string",
          "description": "Segmentin tarkoitus tai null"
        },
        {
          "type": "null"
        }
      ]
    },
    "filters": {
      "type": "array",
      "description": "Suodattimet tilastojen suodatinmuodossa: ehdot [\"dimension\", \"operator\", \"value\"], joiden kaikkien on täsmättävä, ja {\"any\": [ehdot]} -ryhmät"
    },
    "summary": {
      "type": "string",
      "description": "Suodattimet selkokielellä, esim. \"Kävijät, joiden maa on Yhdysvallat ja joiden laite on mobiili ja jotka katsoivat sivua /pricing\""
    },
    "shared": {
      "type": "boolean",
      "description": "Näkyy kaikille, joilla on pääsy sivustoon"
    },
    "mine": {
      "type": "boolean",
      "description": "Sinun luomasi"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:site_id/segments/:id.json Poista segmentti segments_delete

Oikeus: content.write

Esimerkki
curl -X DELETE https://privatusanalytics.com/sites/:site_id/segments/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Segmentin tunniste, esim. seg_7Q2K9XH3AB"
    },
    "site_id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "anyOf": [
        {
          "type": "string",
          "description": "Segmentin tarkoitus tai null"
        },
        {
          "type": "null"
        }
      ]
    },
    "filters": {
      "type": "array",
      "description": "Suodattimet tilastojen suodatinmuodossa: ehdot [\"dimension\", \"operator\", \"value\"], joiden kaikkien on täsmättävä, ja {\"any\": [ehdot]} -ryhmät"
    },
    "summary": {
      "type": "string",
      "description": "Suodattimet selkokielellä, esim. \"Kävijät, joiden maa on Yhdysvallat ja joiden laite on mobiili ja jotka katsoivat sivua /pricing\""
    },
    "shared": {
      "type": "boolean",
      "description": "Näkyy kaikille, joilla on pääsy sivustoon"
    },
    "mine": {
      "type": "boolean",
      "description": "Sinun luomasi"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/segments.json Listaa sivustolla käytettävissäsi olevat segmentit segments_list

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/sites/:site_id/segments.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Sivu (alkaen 1:stä)"
    },
    "per_page": {
      "type": "integer",
      "description": "Tuloksia sivulla (enintään 100)"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Segmentin tunniste, esim. seg_7Q2K9XH3AB"
      },
      "site_id": {
        "type": "string"
      },
      "name": {
        "type": "string"
      },
      "description": {
        "anyOf": [
          {
            "type": "string",
            "description": "Segmentin tarkoitus tai null"
          },
          {
            "type": "null"
          }
        ]
      },
      "filters": {
        "type": "array",
        "description": "Suodattimet tilastojen suodatinmuodossa: ehdot [\"dimension\", \"operator\", \"value\"], joiden kaikkien on täsmättävä, ja {\"any\": [ehdot]} -ryhmät"
      },
      "summary": {
        "type": "string",
        "description": "Suodattimet selkokielellä, esim. \"Kävijät, joiden maa on Yhdysvallat ja joiden laite on mobiili ja jotka katsoivat sivua /pricing\""
      },
      "shared": {
        "type": "boolean",
        "description": "Näkyy kaikille, joilla on pääsy sivustoon"
      },
      "mine": {
        "type": "boolean",
        "description": "Sinun luomasi"
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      },
      "updated_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
POST /sites/:site_id/segments/preview.json Kuvaa suodattimet selkokielellä ja laske niihin viimeisten 30 päivän aikana osuneet kävijät segments_preview

Oikeus: analytics.read

Esimerkki
curl -X POST https://privatusanalytics.com/sites/:site_id/segments/preview.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "filters": {
      "type": "array",
      "items": {},
      "description": "Suodattimet, joiden kaikkien on täsmättävä. Jokainen kohta on ehto [\"dimension\", \"operator\", \"value\"] tai {\"any\": [ehdot]}, kun mikä tahansa useista saa täsmätä. Dimensiot: page, entry_page, exit_page, hostname, channel, referrer, referrer_url, ref, utm_source, utm_medium, utm_campaign, utm_content, utm_term, country (ISO-koodi, esim. US), language, device (desktop, mobile, tablet, tv, other), browser, browser_version, os, os_version, screen, goal (tavoitteen tunniste), event (oman tapahtuman nimi) ja prop:<key> (oman tapahtuman ominaisuus). Operaattorit: is, is_not, contains, not_contains, starts_with, regex, not_regex, any_of ja none_of (arvo on lista), gt ja lt (luku), between (kahden luvun lista). Myös segmenttilomakkeen rivit kelpaavat: {\"dimension\", \"operator\", \"value\", \"property\" (dimensiolle prop), \"join\": \"and\" tai \"or\" (or yhdistää rivin sitä edeltävään)}. Esimerkki: [[\"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": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}
GET /sites/:site_id/segments/:id.json Hae segmentti segments_get

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/sites/:site_id/segments/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Segmentin tunniste, esim. seg_7Q2K9XH3AB"
    },
    "site_id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "anyOf": [
        {
          "type": "string",
          "description": "Segmentin tarkoitus tai null"
        },
        {
          "type": "null"
        }
      ]
    },
    "filters": {
      "type": "array",
      "description": "Suodattimet tilastojen suodatinmuodossa: ehdot [\"dimension\", \"operator\", \"value\"], joiden kaikkien on täsmättävä, ja {\"any\": [ehdot]} -ryhmät"
    },
    "summary": {
      "type": "string",
      "description": "Suodattimet selkokielellä, esim. \"Kävijät, joiden maa on Yhdysvallat ja joiden laite on mobiili ja jotka katsoivat sivua /pricing\""
    },
    "shared": {
      "type": "boolean",
      "description": "Näkyy kaikille, joilla on pääsy sivustoon"
    },
    "mine": {
      "type": "boolean",
      "description": "Sinun luomasi"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
PATCH /sites/:site_id/segments/:id.json Nimeä segmentti uudelleen tai muuta sen suodattimia tai jakamista segments_update

Oikeus: content.write

Esimerkki
curl -X PATCH https://privatusanalytics.com/sites/:site_id/segments/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Segmentin nimi"
    },
    "description": {
      "type": "string",
      "description": "Valinnainen huomautus segmentin tarkoituksesta (enintään 300 merkkiä, tyhjä poistaa sen)"
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Korvaavat suodattimet samassa muodossa kuin luotaessa. Suodattimet, joiden kaikkien on täsmättävä. Jokainen kohta on ehto [\"dimension\", \"operator\", \"value\"] tai {\"any\": [ehdot]}, kun mikä tahansa useista saa täsmätä. Dimensiot: page, entry_page, exit_page, hostname, channel, referrer, referrer_url, ref, utm_source, utm_medium, utm_campaign, utm_content, utm_term, country (ISO-koodi, esim. US), language, device (desktop, mobile, tablet, tv, other), browser, browser_version, os, os_version, screen, goal (tavoitteen tunniste), event (oman tapahtuman nimi) ja prop:<key> (oman tapahtuman ominaisuus). Operaattorit: is, is_not, contains, not_contains, starts_with, regex, not_regex, any_of ja none_of (arvo on lista), gt ja lt (luku), between (kahden luvun lista). Myös segmenttilomakkeen rivit kelpaavat: {\"dimension\", \"operator\", \"value\", \"property\" (dimensiolle prop), \"join\": \"and\" tai \"or\" (or yhdistää rivin sitä edeltävään)}. Esimerkki: [[\"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": "Näkyy kaikille sivustolla"
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Segmentin tunniste, esim. seg_7Q2K9XH3AB"
    },
    "site_id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "anyOf": [
        {
          "type": "string",
          "description": "Segmentin tarkoitus tai null"
        },
        {
          "type": "null"
        }
      ]
    },
    "filters": {
      "type": "array",
      "description": "Suodattimet tilastojen suodatinmuodossa: ehdot [\"dimension\", \"operator\", \"value\"], joiden kaikkien on täsmättävä, ja {\"any\": [ehdot]} -ryhmät"
    },
    "summary": {
      "type": "string",
      "description": "Suodattimet selkokielellä, esim. \"Kävijät, joiden maa on Yhdysvallat ja joiden laite on mobiili ja jotka katsoivat sivua /pricing\""
    },
    "shared": {
      "type": "boolean",
      "description": "Näkyy kaikille, joilla on pääsy sivustoon"
    },
    "mine": {
      "type": "boolean",
      "description": "Sinun luomasi"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Seuranta

POST /sites/:site_id/tracking/ingest_key.json Luo tai vaihda palvelimen keruuavain (näytetään vain kerran) tracking_ingest_key_rotate

Oikeus: sites.manage

Esimerkki
curl -X POST https://privatusanalytics.com/sites/:site_id/tracking/ingest_key.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste"
    },
    "key": {
      "type": "string",
      "description": "Keruuavain. Näytetään vain kerran: tallenna se nyt. Lähetä se Bearer-tunnisteena osoitteeseen POST /api/events"
    },
    "prefix": {
      "type": "string",
      "description": "Asetuksissa näytettävä avaimen etuliite"
    }
  }
}
DELETE /sites/:site_id/tracking/ingest_key.json Peruuta palvelimen keruuavain tracking_ingest_key_revoke

Oikeus: sites.manage

Esimerkki
curl -X DELETE https://privatusanalytics.com/sites/:site_id/tracking/ingest_key.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Seurantakoodissa käytettävä sivuston tunniste"
    },
    "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": "Palvelimen keruuavaimen alku"
        },
        {
          "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": "HTML-seurantakoodinpätkä"
    },
    "favorite": {
      "type": "boolean",
      "description": "Merkitty tähdellä"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /sites/:site_id/tracking/verify.json Tarkista, että seurantakoodi on asennettu sivustolle (script-tunniste, site id, CSP ja referrer-käytäntö) tracking_verify

Oikeus: sites.manage

Esimerkki
curl -X POST https://privatusanalytics.com/sites/:site_id/tracking/verify.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Tarkistettava sivu (oletus https://<domain>/)"
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}
GET /sites/:site_id/tracking/snippet.json Rakenna seurantakoodinpätkä valituilla asetuksilla tracking_snippet

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/sites/:site_id/tracking/snippet.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "modules": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Valinnaiset moduulit: auto (ulkoiset linkit, lataukset, lomakkeet, 404-sivut), engage (aika ja vieritys), vitals (Web Vitals), clicks",
      "default": [
        "engage"
      ]
    },
    "manual": {
      "type": "boolean",
      "description": "Kytke automaattinen sivunäyttö pois",
      "default": false
    },
    "spa": {
      "type": "string",
      "description": "Yhden sivun sovelluksen navigoinnin seuranta",
      "enum": [
        "auto",
        "history",
        "hash",
        "off"
      ],
      "default": "auto"
    },
    "domains": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Seuraa vain näillä isäntänimillä",
      "default": []
    },
    "exclude": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Polkumallit, joita ei seurata, esim. /admin/*",
      "default": []
    },
    "query_params": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Lisää säilytettäviä kyselyparametreja, esim. page",
      "default": []
    },
    "mask": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Asiakaspuolen polkujen peitot, esim. /u/*->/u/:id",
      "default": []
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}

Sivustot

POST /sites/:site_id/data_reset.json Poista kaikki tapahtumat ja käynnit aikaväliltä (ajetaan taustalla, ei voi perua) sites_reset_data

Oikeus: sites.manage

Esimerkki
curl -X POST https://privatusanalytics.com/sites/:site_id/data_reset.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "from": {
      "type": "string",
      "format": "date",
      "description": "Ensimmäinen poistettava päivä (sivuston aikavyöhyke)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Viimeinen poistettava päivä, mukaan lukien"
    },
    "confirm": {
      "type": "string",
      "description": "Vahvista kirjoittamalla verkkotunnus"
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "from",
    "to",
    "confirm",
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}
GET /sites/:site_id/filter_stats.json Suodatetun liikenteen yhteenveto: botit, liikennesäännöt tai PII-piilotukset syyn ja maan mukaan (vain määrät) sites_filter_stats

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/sites/:site_id/filter_stats.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "description": "bot (suodatetut botit), rule (liikennesäännöt) tai redaction (PII-siivoaja)",
      "enum": [
        "bot",
        "rule",
        "redaction"
      ],
      "default": "bot"
    },
    "days": {
      "type": "integer",
      "description": "Tarkasteltavat päivät taaksepäin (1-395)",
      "default": 30
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}
GET /sites/:site_id/access.json Listaa jäsenet ja se, näkevätkö he tämän sivuston sites_access_list

Oikeus: members.manage

Esimerkki
curl https://privatusanalytics.com/sites/:site_id/access.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "membership_id": {
      "type": "string",
      "format": "uuid",
      "description": "Jäsenyystunniste"
    },
    "email": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "role": {
      "type": "string"
    },
    "access": {
      "type": "boolean",
      "description": "Voi nähdä tämän sivuston"
    },
    "locked": {
      "type": "boolean",
      "description": "Omistajilla ja ylläpitäjillä on aina pääsy"
    }
  }
}
PATCH /sites/:site_id/access.json Myönnä tai poista yhden jäsenen pääsy tähän sivustoon sites_access_update

Oikeus: members.manage

Esimerkki
curl -X PATCH https://privatusanalytics.com/sites/:site_id/access.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "membership_id": {
      "type": "string",
      "description": "Jäsenyystunniste kohteesta sites_access_list"
    },
    "access": {
      "type": "boolean",
      "description": "true myöntää pääsyn, false poistaa sen"
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "membership_id",
    "access",
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "membership_id": {
      "type": "string",
      "format": "uuid",
      "description": "Jäsenyystunniste"
    },
    "email": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "role": {
      "type": "string"
    },
    "access": {
      "type": "boolean",
      "description": "Voi nähdä tämän sivuston"
    },
    "locked": {
      "type": "boolean",
      "description": "Omistajilla ja ylläpitäjillä on aina pääsy"
    }
  }
}
POST /sites/:site_id/favorite.json Merkitse sivusto tähdellä (kiinnitetään ensimmäiseksi kohdassa Kaikki sivustot) sites_favorite

Oikeus: analytics.read

Esimerkki
curl -X POST https://privatusanalytics.com/sites/:site_id/favorite.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Seurantakoodissa käytettävä sivuston tunniste"
    },
    "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": "Palvelimen keruuavaimen alku"
        },
        {
          "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": "HTML-seurantakoodinpätkä"
    },
    "favorite": {
      "type": "boolean",
      "description": "Merkitty tähdellä"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:site_id/favorite.json Poista sivuston tähti sites_unfavorite

Oikeus: analytics.read

Esimerkki
curl -X DELETE https://privatusanalytics.com/sites/:site_id/favorite.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Seurantakoodissa käytettävä sivuston tunniste"
    },
    "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": "Palvelimen keruuavaimen alku"
        },
        {
          "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": "HTML-seurantakoodinpätkä"
    },
    "favorite": {
      "type": "boolean",
      "description": "Merkitty tähdellä"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/setup.json Sivuston asennustila ja koodinpätkä sites_setup_get

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/sites/:site_id/setup.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}
POST /transfers/:token/accept.json Hyväksy sivuston siirto yhteen työtiloistasi site_transfers_accept

Oikeus: public

Esimerkki
curl -X POST https://privatusanalytics.com/transfers/:token/accept.json \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Työtila, johon sivusto siirretään (ws_…)"
    },
    "token": {
      "type": "string",
      "description": "Resurssin Token"
    }
  },
  "required": [
    "workspace_id",
    "token"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Siirrettävä sivusto"
    },
    "site_domain": {
      "type": "string"
    },
    "from_workspace": {
      "type": "string",
      "description": "Nykyisen työtilan nimi"
    },
    "to_workspace_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Vastaanottava työtila"
        },
        {
          "type": "null"
        }
      ]
    },
    "to_email": {
      "type": "string",
      "description": "Vastaanottajan sähköpostiosoite"
    },
    "status": {
      "type": "string",
      "description": "pending, accepted tai canceled"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /sites/:site_id/transfer.json Aloita sivuston siirto toiseen työtilaan (lähettää sähköpostin vastaanottajalle) sites_transfer_start

Oikeus: sites.manage

Esimerkki
curl -X POST https://privatusanalytics.com/sites/:site_id/transfer.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "description": "Sivuston vastaanottavan henkilön sähköpostiosoite (hän valitsee yhden työtiloistaan)"
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "email",
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Siirrettävä sivusto"
    },
    "site_domain": {
      "type": "string"
    },
    "from_workspace": {
      "type": "string",
      "description": "Nykyisen työtilan nimi"
    },
    "to_workspace_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Vastaanottava työtila"
        },
        {
          "type": "null"
        }
      ]
    },
    "to_email": {
      "type": "string",
      "description": "Vastaanottajan sähköpostiosoite"
    },
    "status": {
      "type": "string",
      "description": "pending, accepted tai canceled"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:site_id/transfer.json Peruuta odottava sivuston siirto sites_transfer_cancel

Oikeus: sites.manage

Esimerkki
curl -X DELETE https://privatusanalytics.com/sites/:site_id/transfer.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Siirrettävä sivusto"
    },
    "site_domain": {
      "type": "string"
    },
    "from_workspace": {
      "type": "string",
      "description": "Nykyisen työtilan nimi"
    },
    "to_workspace_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Vastaanottava työtila"
        },
        {
          "type": "null"
        }
      ]
    },
    "to_email": {
      "type": "string",
      "description": "Vastaanottajan sähköpostiosoite"
    },
    "status": {
      "type": "string",
      "description": "pending, accepted tai canceled"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /transfers/:token.json Hae odottava siirto sähköpostitse lähetetyllä tunnisteella site_transfers_get

Oikeus: public

Esimerkki
curl https://privatusanalytics.com/transfers/:token.json
Syötteet
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Resurssin Token"
    }
  },
  "required": [
    "token"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Siirrettävä sivusto"
    },
    "site_domain": {
      "type": "string"
    },
    "from_workspace": {
      "type": "string",
      "description": "Nykyisen työtilan nimi"
    },
    "to_workspace_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Vastaanottava työtila"
        },
        {
          "type": "null"
        }
      ]
    },
    "to_email": {
      "type": "string",
      "description": "Vastaanottajan sähköpostiosoite"
    },
    "status": {
      "type": "string",
      "description": "pending, accepted tai canceled"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /workspaces/:workspace_id/sites.json Lisää sivusto sites_create

Oikeus: sites.manage

Esimerkki
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/sites.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "domain": {
      "type": "string",
      "description": "Pääverkkotunnus, esim. example.com",
      "examples": [
        "example.com"
      ]
    },
    "name": {
      "type": "string",
      "description": "Näyttönimi (oletuksena verkkotunnus)"
    },
    "timezone": {
      "type": "string",
      "description": "Raportoinnin aikavyöhyke"
    },
    "currency": {
      "type": "string",
      "description": "Tulon valuutta (ISO 4217)"
    },
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "domain",
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Seurantakoodissa käytettävä sivuston tunniste"
    },
    "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": "Palvelimen keruuavaimen alku"
        },
        {
          "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": "HTML-seurantakoodinpätkä"
    },
    "favorite": {
      "type": "boolean",
      "description": "Merkitty tähdellä"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:id.json Poista sivusto (tyhjennetään 7 päivän kuluttua) sites_delete

Oikeus: sites.manage

Esimerkki
curl -X DELETE https://privatusanalytics.com/sites/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "confirm": {
      "type": "string",
      "description": "Vahvista kirjoittamalla verkkotunnus"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "confirm",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Seurantakoodissa käytettävä sivuston tunniste"
    },
    "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": "Palvelimen keruuavaimen alku"
        },
        {
          "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": "HTML-seurantakoodinpätkä"
    },
    "favorite": {
      "type": "boolean",
      "description": "Merkitty tähdellä"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /workspaces/:workspace_id/sites.json Listaa työtilan sivustot sites_list

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/workspaces/:workspace_id/sites.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "description": "Suodata verkkotunnuksen tai nimen mukaan"
    },
    "label": {
      "type": "string",
      "description": "Vain sivustot, joilla on tämä nimike"
    },
    "sort": {
      "type": "string",
      "description": "position (oma järjestyksesi), name tai visitors viimeisten 30 päivän ajalta (eniten ensin)",
      "enum": [
        "position",
        "name",
        "visitors"
      ],
      "default": "position"
    },
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Sivu (alkaen 1:stä)"
    },
    "per_page": {
      "type": "integer",
      "description": "Tuloksia sivulla (enintään 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Seurantakoodissa käytettävä sivuston tunniste"
      },
      "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": "Palvelimen keruuavaimen alku"
          },
          {
            "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": "HTML-seurantakoodinpätkä"
      },
      "favorite": {
        "type": "boolean",
        "description": "Merkitty tähdellä"
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
GET /sites/:id.json Hae sivusto ja kaikki sen asetukset sites_get

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/sites/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Seurantakoodissa käytettävä sivuston tunniste"
    },
    "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": "Palvelimen keruuavaimen alku"
        },
        {
          "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": "HTML-seurantakoodinpätkä"
    },
    "favorite": {
      "type": "boolean",
      "description": "Merkitty tähdellä"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
PATCH /sites/:id.json Päivitä sivuston asetukset sites_update

Oikeus: sites.manage

Esimerkki
curl -X PATCH https://privatusanalytics.com/sites/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Näyttönimi"
    },
    "domain": {
      "type": "string",
      "description": "Pääverkkotunnus"
    },
    "extra_domains": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Lisäisäntänimet"
    },
    "multi_domain_mode": {
      "type": "string",
      "description": "combined: yksi kävijä verkkotunnusten yli",
      "enum": [
        "combined",
        "separate"
      ]
    },
    "timezone": {
      "type": "string",
      "description": "Raportoinnin aikavyöhyke"
    },
    "currency": {
      "type": "string",
      "description": "Tulon valuutta (ISO 4217)"
    },
    "week_start": {
      "type": "integer",
      "description": "0 = sunnuntai, 1 = maanantai"
    },
    "labels": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Sivustojen ryhmittelyyn tarkoitetut nimikkeet"
    },
    "honor_dnt": {
      "type": "boolean",
      "description": "Ohita DNT:n lähettävät kävijät"
    },
    "honor_gpc": {
      "type": "boolean",
      "description": "Ohita GPC:n lähettävät kävijät"
    },
    "pii_scrubber": {
      "type": "boolean",
      "description": "Piilota sähköpostit, tunnisteet ja id:t"
    },
    "redaction_rules": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "pattern": {
            "type": "string"
          }
        }
      },
      "description": "Omat piilotuksen säännölliset lausekkeet"
    },
    "allowed_params": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Poluilla säilytettävät kyselyparametrit"
    },
    "path_masks": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "pattern": {
            "type": "string"
          },
          "replacement": {
            "type": "string"
          }
        }
      },
      "description": "Polkujen peittosäännöt, esim. /u/* -> /u/:id"
    },
    "retention_months": {
      "type": "integer",
      "description": "Poista tätä vanhemmat tiedot"
    },
    "bot_filtering": {
      "type": "boolean",
      "description": "Suodata bottiliikenne"
    },
    "traffic_rule_modes": {
      "type": "object",
      "additionalProperties": true,
      "description": "block tai allow liikennesääntölistaa kohden"
    },
    "vitals_sample_rate": {
      "type": "integer",
      "description": "Web Vitalsin otanta-%"
    },
    "conversion_denominator": {
      "type": "string",
      "description": "Konversioaste käyntien tai kävijöiden suhteen",
      "enum": [
        "visits",
        "visitors"
      ]
    },
    "public_dashboard": {
      "type": "boolean",
      "description": "Kaikki, joilla on linkki, voivat nähdä tilastot"
    },
    "public_indexable": {
      "type": "boolean",
      "description": "Salli hakukoneiden indeksoida julkinen sivu"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Seurantakoodissa käytettävä sivuston tunniste"
    },
    "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": "Palvelimen keruuavaimen alku"
        },
        {
          "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": "HTML-seurantakoodinpätkä"
    },
    "favorite": {
      "type": "boolean",
      "description": "Merkitty tähdellä"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Suorituskyky

GET /sites/:site_id/performance.json Web Vitals: p75-tulokortti, päivittäinen trendi ja erittelyt sivun, laitteen, selaimen ja maan mukaan performance_report

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/sites/:site_id/performance.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Aikavälin esiasetus. Käytä custom-arvoa yhdessä from/to-parametrien kanssa",
      "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": "Mukautetun aikavälin alku (sivuston aikavyöhyke)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun aikavälin loppu, mukaan lukien"
    },
    "compare": {
      "type": "string",
      "description": "Vertailujakso",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun vertailun alku"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun vertailun loppu"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Kohdista vertailun viikonpäivät",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Suodattimet: [[\"dimension\",\"operator\",\"value\"], …]. Operaattorit: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Kääri ehdot muotoon {\"any\": [...]} TAI-ehtoa varten.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Ota käyttöön tallennettu segmentti (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Lisää tuodut historiatiedot (päivät ennen ensimmäistä natiivia tapahtumaa, ohitetaan kun suodattimia tai segmenttiä käytetään)",
      "default": false
    },
    "metric": {
      "type": "string",
      "description": "Trendin ja erittelyjen mittari",
      "enum": [
        "LCP",
        "INP",
        "CLS",
        "FCP",
        "TTFB"
      ],
      "default": "LCP"
    },
    "limit": {
      "type": "integer",
      "description": "Rivejä erittelyä kohden (enintään 100)",
      "default": 10
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}

Suppilot

POST /sites/:site_id/funnels.json Luo suppilo funnels_create

Oikeus: content.write

Esimerkki
curl -X POST https://privatusanalytics.com/sites/:site_id/funnels.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Suppilon nimi",
      "examples": [
        "Signup flow"
      ]
    },
    "steps": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      },
      "description": "Järjestetyt vaiheet (2 - pakettisi raja): [{\"type\": \"page|event|goal\", \"value\": \"/pricing | Signup | goal_…\", \"match\": \"exact|prefix|glob|regex\" (sivuvaiheet), \"name\": \"valinnainen nimike\"}]"
    },
    "order_mode": {
      "type": "string",
      "description": "strict: vaiheet tässä järjestyksessä, any: missä järjestyksessä tahansa",
      "enum": [
        "strict",
        "any"
      ],
      "default": "strict"
    },
    "window": {
      "type": "string",
      "description": "Konversioikkuna: visit tai day (mitataan käynnin sisällä, joka ei koskaan ylitä UTC-päivää)",
      "enum": [
        "visit",
        "day"
      ],
      "default": "visit"
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "steps",
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Suppilon tunniste, esim. fun_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "steps": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Vaiheet: {type: page|event|goal, value, match, name}"
    },
    "order_mode": {
      "type": "string",
      "description": "strict tai any"
    },
    "window": {
      "type": "string",
      "description": "visit tai day"
    },
    "stats": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "entered": {
              "type": "integer",
              "description": "Käynnit, jotka saavuttivat vaiheen 1"
            },
            "completed": {
              "type": "integer",
              "description": "Käynnit, jotka saavuttivat viimeisen vaiheen"
            },
            "conversion_rate": {
              "type": "number",
              "description": "Suoritetut ÷ sisään tulleet, %"
            }
          },
          "description": "Jakson tilastot (vain listassa)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:site_id/funnels/:id.json Poista suppilo funnels_delete

Oikeus: content.write

Esimerkki
curl -X DELETE https://privatusanalytics.com/sites/:site_id/funnels/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Suppilon tunniste, esim. fun_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "steps": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Vaiheet: {type: page|event|goal, value, match, name}"
    },
    "order_mode": {
      "type": "string",
      "description": "strict tai any"
    },
    "window": {
      "type": "string",
      "description": "visit tai day"
    },
    "stats": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "entered": {
              "type": "integer",
              "description": "Käynnit, jotka saavuttivat vaiheen 1"
            },
            "completed": {
              "type": "integer",
              "description": "Käynnit, jotka saavuttivat viimeisen vaiheen"
            },
            "conversion_rate": {
              "type": "number",
              "description": "Suoritetut ÷ sisään tulleet, %"
            }
          },
          "description": "Jakson tilastot (vain listassa)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/funnels.json Listaa suppilot sisääntuloineen, suorituksineen ja asteineen funnels_list

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/sites/:site_id/funnels.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Aikavälin esiasetus. Käytä custom-arvoa yhdessä from/to-parametrien kanssa",
      "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": "Mukautetun aikavälin alku (sivuston aikavyöhyke)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun aikavälin loppu, mukaan lukien"
    },
    "compare": {
      "type": "string",
      "description": "Vertailujakso",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun vertailun alku"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun vertailun loppu"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Kohdista vertailun viikonpäivät",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Suodattimet: [[\"dimension\",\"operator\",\"value\"], …]. Operaattorit: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Kääri ehdot muotoon {\"any\": [...]} TAI-ehtoa varten.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Ota käyttöön tallennettu segmentti (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Lisää tuodut historiatiedot (päivät ennen ensimmäistä natiivia tapahtumaa, ohitetaan kun suodattimia tai segmenttiä käytetään)",
      "default": false
    },
    "page": {
      "type": "integer",
      "description": "Sivunumero",
      "default": 1
    },
    "per_page": {
      "type": "integer",
      "description": "Suppiloita sivulla (enintään 100)",
      "default": 25
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Suppilon tunniste, esim. fun_7Q2K9XH3AB"
      },
      "name": {
        "type": "string"
      },
      "steps": {
        "type": "array",
        "items": {
          "type": "object"
        },
        "description": "Vaiheet: {type: page|event|goal, value, match, name}"
      },
      "order_mode": {
        "type": "string",
        "description": "strict tai any"
      },
      "window": {
        "type": "string",
        "description": "visit tai day"
      },
      "stats": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "entered": {
                "type": "integer",
                "description": "Käynnit, jotka saavuttivat vaiheen 1"
              },
              "completed": {
                "type": "integer",
                "description": "Käynnit, jotka saavuttivat viimeisen vaiheen"
              },
              "conversion_rate": {
                "type": "number",
                "description": "Suoritetut ÷ sisään tulleet, %"
              }
            },
            "description": "Jakson tilastot (vain listassa)"
          },
          {
            "type": "null"
          }
        ]
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      },
      "updated_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
GET /sites/:site_id/funnels/:id.json Suppiloraportti: vaiheiden määrät, konversio, pudotus, vaiheiden välinen aika ja minne käynnit menivät sen sijaan funnels_get

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/sites/:site_id/funnels/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Aikavälin esiasetus. Käytä custom-arvoa yhdessä from/to-parametrien kanssa",
      "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": "Mukautetun aikavälin alku (sivuston aikavyöhyke)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun aikavälin loppu, mukaan lukien"
    },
    "compare": {
      "type": "string",
      "description": "Vertailujakso",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun vertailun alku"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun vertailun loppu"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Kohdista vertailun viikonpäivät",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Suodattimet: [[\"dimension\",\"operator\",\"value\"], …]. Operaattorit: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Kääri ehdot muotoon {\"any\": [...]} TAI-ehtoa varten.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Ota käyttöön tallennettu segmentti (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Lisää tuodut historiatiedot (päivät ennen ensimmäistä natiivia tapahtumaa, ohitetaan kun suodattimia tai segmenttiä käytetään)",
      "default": false
    },
    "breakdown": {
      "type": "string",
      "description": "Jaa vaiheiden määrät käyntidimension mukaan",
      "enum": [
        "channel",
        "device",
        "country",
        "utm_campaign",
        "utm_source",
        "browser",
        "os"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "period": {
      "type": "object",
      "description": "Jakson from/to (UTC)"
    },
    "funnel": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Suppilon tunniste, esim. fun_7Q2K9XH3AB"
        },
        "name": {
          "type": "string"
        },
        "steps": {
          "type": "array",
          "items": {
            "type": "object"
          },
          "description": "Vaiheet: {type: page|event|goal, value, match, name}"
        },
        "order_mode": {
          "type": "string",
          "description": "strict tai any"
        },
        "window": {
          "type": "string",
          "description": "visit tai day"
        },
        "stats": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "entered": {
                  "type": "integer",
                  "description": "Käynnit, jotka saavuttivat vaiheen 1"
                },
                "completed": {
                  "type": "integer",
                  "description": "Käynnit, jotka saavuttivat viimeisen vaiheen"
                },
                "conversion_rate": {
                  "type": "number",
                  "description": "Suoritetut ÷ sisään tulleet, %"
                }
              },
              "description": "Jakson tilastot (vain listassa)"
            },
            {
              "type": "null"
            }
          ]
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        }
      },
      "description": "Suppilon määritys"
    },
    "order_mode": {
      "type": "string",
      "description": "strict tai any"
    },
    "window": {
      "type": "string",
      "description": "visit tai day (day mitataan käynnin sisällä)"
    },
    "steps": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Vaihetta kohden: 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": "Viimeinen vaihe ÷ ensimmäinen vaihe, %"
    },
    "breakdown": {
      "anyOf": [
        {
          "type": "object",
          "description": "dimension, label ja rows [{value, counts, overall_conversion_rate}]"
        },
        {
          "type": "null"
        }
      ]
    },
    "comparison": {
      "anyOf": [
        {
          "type": "object",
          "description": "period, vaihekohtaiset määrät, overall_conversion_rate ja change (%)"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
PATCH /sites/:site_id/funnels/:id.json Päivitä suppilo funnels_update

Oikeus: content.write

Esimerkki
curl -X PATCH https://privatusanalytics.com/sites/:site_id/funnels/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Suppilon nimi",
      "examples": [
        "Signup flow"
      ]
    },
    "steps": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      },
      "description": "Järjestetyt vaiheet (2 - pakettisi raja): [{\"type\": \"page|event|goal\", \"value\": \"/pricing | Signup | goal_…\", \"match\": \"exact|prefix|glob|regex\" (sivuvaiheet), \"name\": \"valinnainen nimike\"}]"
    },
    "order_mode": {
      "type": "string",
      "description": "strict: vaiheet tässä järjestyksessä, any: missä järjestyksessä tahansa",
      "enum": [
        "strict",
        "any"
      ]
    },
    "window": {
      "type": "string",
      "description": "Konversioikkuna: visit tai day (mitataan käynnin sisällä, joka ei koskaan ylitä UTC-päivää)",
      "enum": [
        "visit",
        "day"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Suppilon tunniste, esim. fun_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "steps": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Vaiheet: {type: page|event|goal, value, match, name}"
    },
    "order_mode": {
      "type": "string",
      "description": "strict tai any"
    },
    "window": {
      "type": "string",
      "description": "visit tai day"
    },
    "stats": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "entered": {
              "type": "integer",
              "description": "Käynnit, jotka saavuttivat vaiheen 1"
            },
            "completed": {
              "type": "integer",
              "description": "Käynnit, jotka saavuttivat viimeisen vaiheen"
            },
            "conversion_rate": {
              "type": "number",
              "description": "Suoritetut ÷ sisään tulleet, %"
            }
          },
          "description": "Jakson tilastot (vain listassa)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Sähköpostiraportit

DELETE /recipients/:id.json Poista vastaanottaja sähköpostiraportista email_report_recipients_delete

Oikeus: content.write

Esimerkki
curl -X DELETE https://privatusanalytics.com/recipients/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Vastaanottajan tunniste, esim. rcp_7Q2K9XH3AB"
    },
    "email": {
      "type": "string",
      "description": "Osoite"
    },
    "status": {
      "type": "string",
      "description": "active, pending, declined tai unsubscribed"
    },
    "invited_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Milloin viimeisin kutsu lähetettiin"
        },
        {
          "type": "null"
        }
      ]
    },
    "expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Milloin odottava kutsu vanhenee"
        },
        {
          "type": "null"
        }
      ]
    },
    "confirmed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Milloin osoitteesta tuli aktiivinen"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
GET /reports/:report_id/recipients.json Listaa sähköpostiraportin vastaanottajat tiloineen email_report_recipients_list

Tilat: active (saa raportit), pending (kutsuttu, ei vielä hyväksynyt), declined tai unsubscribed. Lisää tai poista osoitteita raportin vastaanottajalistan kautta.

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/reports/:report_id/recipients.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Vain tässä tilassa olevat vastaanottajat",
      "enum": [
        "pending",
        "active",
        "declined",
        "unsubscribed"
      ]
    },
    "report_id": {
      "type": "string",
      "description": "Resurssin Report"
    },
    "page": {
      "type": "integer",
      "description": "Sivu (alkaen 1:stä)"
    },
    "per_page": {
      "type": "integer",
      "description": "Tuloksia sivulla (enintään 100)"
    }
  },
  "required": [
    "report_id"
  ]
}
Vastauksen tiedot
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Vastaanottajan tunniste, esim. rcp_7Q2K9XH3AB"
      },
      "email": {
        "type": "string",
        "description": "Osoite"
      },
      "status": {
        "type": "string",
        "description": "active, pending, declined tai unsubscribed"
      },
      "invited_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time",
            "description": "Milloin viimeisin kutsu lähetettiin"
          },
          {
            "type": "null"
          }
        ]
      },
      "expires_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time",
            "description": "Milloin odottava kutsu vanhenee"
          },
          {
            "type": "null"
          }
        ]
      },
      "confirmed_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time",
            "description": "Milloin osoitteesta tuli aktiivinen"
          },
          {
            "type": "null"
          }
        ]
      }
    }
  }
}
POST /recipients/:id/resend.json Lähetä odottava raporttikutsu uudelleen email_report_recipients_resend

Lähettää kutsun uudelleen uusilla linkeillä. Sallittu kerran 7 päivässä osoitetta ja raporttia kohden.

Oikeus: content.write

Esimerkki
curl -X POST https://privatusanalytics.com/recipients/:id/resend.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Vastaanottajan tunniste, esim. rcp_7Q2K9XH3AB"
    },
    "email": {
      "type": "string",
      "description": "Osoite"
    },
    "status": {
      "type": "string",
      "description": "active, pending, declined tai unsubscribed"
    },
    "invited_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Milloin viimeisin kutsu lähetettiin"
        },
        {
          "type": "null"
        }
      ]
    },
    "expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Milloin odottava kutsu vanhenee"
        },
        {
          "type": "null"
        }
      ]
    },
    "confirmed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Milloin osoitteesta tuli aktiivinen"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
POST /workspaces/:workspace_id/reports.json Luo sähköpostiraportti email_reports_create

Oikeus: content.write

Esimerkki
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/reports.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Raporttiin sisältyvien sivustojen tunnisteet (pa_…)"
    },
    "frequency": {
      "type": "string",
      "description": "daily, weekly (viikonpäivänä) tai monthly (kuun 1. päivänä)",
      "enum": [
        "daily",
        "weekly",
        "monthly"
      ]
    },
    "hour": {
      "type": "integer",
      "description": "Lähetystunti (0-23, työtilan aikavyöhyke)"
    },
    "weekday": {
      "type": "integer",
      "description": "Viikkoraportit: 0 = sunnuntai … 6 = lauantai"
    },
    "recipients": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Sähköpostiosoitteet (tiliä ei tarvita). Osoitteet voi erottaa pilkuilla tai rivinvaihdoilla. Työtilan jäsenet lisätään heti. Muut saavat kutsun ja vastaanottavat raportteja vasta hyväksyttyään sen. Raporteista kieltäytyneet osoitteet hylätään"
    },
    "blocks": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Sisältö: kpis, chart, pages, sources, goals, campaigns, vitals, uptime"
    },
    "attach_pdf": {
      "type": "boolean",
      "description": "Liitä PDF-versio"
    },
    "intro": {
      "type": "string",
      "description": "Oma johdantoteksti (enintään 2000 merkkiä)"
    },
    "enabled": {
      "type": "boolean",
      "description": "Lähetä aikataulun mukaan"
    },
    "name": {
      "type": "string",
      "description": "Raportin nimi",
      "examples": [
        "Weekly traffic"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Raportin tunniste, esim. rep_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Raportin sivustotunnisteet"
    },
    "frequency": {
      "type": "string",
      "description": "daily, weekly tai monthly"
    },
    "hour": {
      "type": "integer",
      "description": "Lähetystunti (työtilan aikavyöhyke)"
    },
    "weekday": {
      "type": "integer",
      "description": "Viikoittain: 0 = sunnuntai … 6 = lauantai"
    },
    "recipients": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Jokainen raportin osoite tilasta riippumatta"
    },
    "recipient_details": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Vastaanottajan tunniste, esim. rcp_7Q2K9XH3AB"
          },
          "email": {
            "type": "string",
            "description": "Osoite"
          },
          "status": {
            "type": "string",
            "description": "active, pending, declined tai unsubscribed"
          },
          "invited_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Milloin viimeisin kutsu lähetettiin"
              },
              {
                "type": "null"
              }
            ]
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Milloin odottava kutsu vanhenee"
              },
              {
                "type": "null"
              }
            ]
          },
          "confirmed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Milloin osoitteesta tuli aktiivinen"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "description": "Jokainen vastaanottaja ja sen tilauksen tila (vain aktiiviset vastaanottajat saavat raportteja)"
    },
    "blocks": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Sisältölohkot"
    },
    "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 Sähköpostiraportin toimituslokit email_reports_deliveries

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/reports/:id/deliveries.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Vain tämän tilan toimitukset",
      "enum": [
        "sent",
        "test",
        "failed",
        "skipped"
      ]
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    },
    "page": {
      "type": "integer",
      "description": "Sivu (alkaen 1:stä)"
    },
    "per_page": {
      "type": "integer",
      "description": "Tuloksia sivulla (enintään 100)"
    }
  },
  "required": [
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "status": {
        "type": "string",
        "description": "sent, test, failed tai skipped"
      },
      "recipients_count": {
        "type": "integer"
      },
      "error": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "sent_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
DELETE /reports/:id.json Poista sähköpostiraportti email_reports_delete

Oikeus: content.write

Esimerkki
curl -X DELETE https://privatusanalytics.com/reports/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Raportin tunniste, esim. rep_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Raportin sivustotunnisteet"
    },
    "frequency": {
      "type": "string",
      "description": "daily, weekly tai monthly"
    },
    "hour": {
      "type": "integer",
      "description": "Lähetystunti (työtilan aikavyöhyke)"
    },
    "weekday": {
      "type": "integer",
      "description": "Viikoittain: 0 = sunnuntai … 6 = lauantai"
    },
    "recipients": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Jokainen raportin osoite tilasta riippumatta"
    },
    "recipient_details": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Vastaanottajan tunniste, esim. rcp_7Q2K9XH3AB"
          },
          "email": {
            "type": "string",
            "description": "Osoite"
          },
          "status": {
            "type": "string",
            "description": "active, pending, declined tai unsubscribed"
          },
          "invited_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Milloin viimeisin kutsu lähetettiin"
              },
              {
                "type": "null"
              }
            ]
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Milloin odottava kutsu vanhenee"
              },
              {
                "type": "null"
              }
            ]
          },
          "confirmed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Milloin osoitteesta tuli aktiivinen"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "description": "Jokainen vastaanottaja ja sen tilauksen tila (vain aktiiviset vastaanottajat saavat raportteja)"
    },
    "blocks": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Sisältölohkot"
    },
    "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 Listaa sähköpostiraportit email_reports_list

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/workspaces/:workspace_id/reports.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "frequency": {
      "type": "string",
      "description": "Vain tämän tiheyden raportit",
      "enum": [
        "daily",
        "weekly",
        "monthly"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Sivu (alkaen 1:stä)"
    },
    "per_page": {
      "type": "integer",
      "description": "Tuloksia sivulla (enintään 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Raportin tunniste, esim. rep_7Q2K9XH3AB"
      },
      "name": {
        "type": "string"
      },
      "site_ids": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Raportin sivustotunnisteet"
      },
      "frequency": {
        "type": "string",
        "description": "daily, weekly tai monthly"
      },
      "hour": {
        "type": "integer",
        "description": "Lähetystunti (työtilan aikavyöhyke)"
      },
      "weekday": {
        "type": "integer",
        "description": "Viikoittain: 0 = sunnuntai … 6 = lauantai"
      },
      "recipients": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Jokainen raportin osoite tilasta riippumatta"
      },
      "recipient_details": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "description": "Vastaanottajan tunniste, esim. rcp_7Q2K9XH3AB"
            },
            "email": {
              "type": "string",
              "description": "Osoite"
            },
            "status": {
              "type": "string",
              "description": "active, pending, declined tai unsubscribed"
            },
            "invited_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Milloin viimeisin kutsu lähetettiin"
                },
                {
                  "type": "null"
                }
              ]
            },
            "expires_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Milloin odottava kutsu vanhenee"
                },
                {
                  "type": "null"
                }
              ]
            },
            "confirmed_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Milloin osoitteesta tuli aktiivinen"
                },
                {
                  "type": "null"
                }
              ]
            }
          }
        },
        "description": "Jokainen vastaanottaja ja sen tilauksen tila (vain aktiiviset vastaanottajat saavat raportteja)"
      },
      "blocks": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Sisältölohkot"
      },
      "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 Lähetä sähköpostiraportti nyt testinä email_reports_send_test

Oikeus: content.write

Esimerkki
curl -X POST https://privatusanalytics.com/reports/:id/send_test.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "recipient": {
      "type": "string",
      "description": "Lähetä testi tänne (oletus: sähköpostisi)"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "sent, test, failed tai skipped"
    },
    "recipients_count": {
      "type": "integer"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "sent_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /reports/:id.json Hae sähköpostiraportti email_reports_get

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/reports/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Raportin tunniste, esim. rep_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Raportin sivustotunnisteet"
    },
    "frequency": {
      "type": "string",
      "description": "daily, weekly tai monthly"
    },
    "hour": {
      "type": "integer",
      "description": "Lähetystunti (työtilan aikavyöhyke)"
    },
    "weekday": {
      "type": "integer",
      "description": "Viikoittain: 0 = sunnuntai … 6 = lauantai"
    },
    "recipients": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Jokainen raportin osoite tilasta riippumatta"
    },
    "recipient_details": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Vastaanottajan tunniste, esim. rcp_7Q2K9XH3AB"
          },
          "email": {
            "type": "string",
            "description": "Osoite"
          },
          "status": {
            "type": "string",
            "description": "active, pending, declined tai unsubscribed"
          },
          "invited_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Milloin viimeisin kutsu lähetettiin"
              },
              {
                "type": "null"
              }
            ]
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Milloin odottava kutsu vanhenee"
              },
              {
                "type": "null"
              }
            ]
          },
          "confirmed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Milloin osoitteesta tuli aktiivinen"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "description": "Jokainen vastaanottaja ja sen tilauksen tila (vain aktiiviset vastaanottajat saavat raportteja)"
    },
    "blocks": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Sisältölohkot"
    },
    "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 Päivitä sähköpostiraportti email_reports_update

Oikeus: content.write

Esimerkki
curl -X PATCH https://privatusanalytics.com/reports/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Raporttiin sisältyvien sivustojen tunnisteet (pa_…)"
    },
    "frequency": {
      "type": "string",
      "description": "daily, weekly (viikonpäivänä) tai monthly (kuun 1. päivänä)",
      "enum": [
        "daily",
        "weekly",
        "monthly"
      ]
    },
    "hour": {
      "type": "integer",
      "description": "Lähetystunti (0-23, työtilan aikavyöhyke)"
    },
    "weekday": {
      "type": "integer",
      "description": "Viikkoraportit: 0 = sunnuntai … 6 = lauantai"
    },
    "recipients": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Sähköpostiosoitteet (tiliä ei tarvita). Osoitteet voi erottaa pilkuilla tai rivinvaihdoilla. Työtilan jäsenet lisätään heti. Muut saavat kutsun ja vastaanottavat raportteja vasta hyväksyttyään sen. Raporteista kieltäytyneet osoitteet hylätään"
    },
    "blocks": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Sisältö: kpis, chart, pages, sources, goals, campaigns, vitals, uptime"
    },
    "attach_pdf": {
      "type": "boolean",
      "description": "Liitä PDF-versio"
    },
    "intro": {
      "type": "string",
      "description": "Oma johdantoteksti (enintään 2000 merkkiä)"
    },
    "enabled": {
      "type": "boolean",
      "description": "Lähetä aikataulun mukaan"
    },
    "name": {
      "type": "string",
      "description": "Raportin nimi"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Raportin tunniste, esim. rep_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Raportin sivustotunnisteet"
    },
    "frequency": {
      "type": "string",
      "description": "daily, weekly tai monthly"
    },
    "hour": {
      "type": "integer",
      "description": "Lähetystunti (työtilan aikavyöhyke)"
    },
    "weekday": {
      "type": "integer",
      "description": "Viikoittain: 0 = sunnuntai … 6 = lauantai"
    },
    "recipients": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Jokainen raportin osoite tilasta riippumatta"
    },
    "recipient_details": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Vastaanottajan tunniste, esim. rcp_7Q2K9XH3AB"
          },
          "email": {
            "type": "string",
            "description": "Osoite"
          },
          "status": {
            "type": "string",
            "description": "active, pending, declined tai unsubscribed"
          },
          "invited_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Milloin viimeisin kutsu lähetettiin"
              },
              {
                "type": "null"
              }
            ]
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Milloin odottava kutsu vanhenee"
              },
              {
                "type": "null"
              }
            ]
          },
          "confirmed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Milloin osoitteesta tuli aktiivinen"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "description": "Jokainen vastaanottaja ja sen tilauksen tila (vain aktiiviset vastaanottajat saavat raportteja)"
    },
    "blocks": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Sisältölohkot"
    },
    "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 Hyväksy raporttikutsu report_invites_accept

Oikeus: public · Vain HTTP (ei MCP-työkalu)

Esimerkki
curl -X POST https://privatusanalytics.com/reports/invites/:token/accept.json \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Resurssin Token"
    }
  },
  "required": [
    "token"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Vastaanottajan tunniste, esim. rcp_7Q2K9XH3AB"
    },
    "email": {
      "type": "string",
      "description": "Osoite"
    },
    "status": {
      "type": "string",
      "description": "active, pending, declined tai unsubscribed"
    },
    "invited_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Milloin viimeisin kutsu lähetettiin"
        },
        {
          "type": "null"
        }
      ]
    },
    "expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Milloin odottava kutsu vanhenee"
        },
        {
          "type": "null"
        }
      ]
    },
    "confirmed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Milloin osoitteesta tuli aktiivinen"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
POST /reports/invites/:token/decline.json Hylkää raporttikutsu report_invites_decline

Oikeus: public · Vain HTTP (ei MCP-työkalu)

Esimerkki
curl -X POST https://privatusanalytics.com/reports/invites/:token/decline.json \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Resurssin Token"
    }
  },
  "required": [
    "token"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Vastaanottajan tunniste, esim. rcp_7Q2K9XH3AB"
    },
    "email": {
      "type": "string",
      "description": "Osoite"
    },
    "status": {
      "type": "string",
      "description": "active, pending, declined tai unsubscribed"
    },
    "invited_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Milloin viimeisin kutsu lähetettiin"
        },
        {
          "type": "null"
        }
      ]
    },
    "expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Milloin odottava kutsu vanhenee"
        },
        {
          "type": "null"
        }
      ]
    },
    "confirmed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Milloin osoitteesta tuli aktiivinen"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
POST /reports/resubscribe/:token.json Vastaanota raportteja uudelleen tilauksen peruuttamisen jälkeen report_resubscribes_confirm

Oikeus: public · Vain HTTP (ei MCP-työkalu)

Esimerkki
curl -X POST https://privatusanalytics.com/reports/resubscribe/:token.json \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Resurssin Token"
    }
  },
  "required": [
    "token"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}
POST /reports/unsubscribe/:token/resubscribe.json Lähetä osoitteeseen linkki raporttien vastaanottamiseen uudelleen report_resubscribes_create

Oikeus: public · Vain HTTP (ei MCP-työkalu)

Esimerkki
curl -X POST https://privatusanalytics.com/reports/unsubscribe/:token/resubscribe.json \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Resurssin Token"
    }
  },
  "required": [
    "token"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}
POST /reports/unsubscribe/:token.json Peruuta osoitteen sähköpostiraportin tilaus report_unsubscribes_create

Oikeus: public · Vain HTTP (ei MCP-työkalu)

Esimerkki
curl -X POST https://privatusanalytics.com/reports/unsubscribe/:token.json \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Resurssin Token"
    }
  },
  "required": [
    "token"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}

Tapahtumat

GET /sites/:site_id/events/properties.json Listaa viimeisen 30 päivän aikana nähdyt tapahtuman ominaisuusavaimet event_properties_list

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/sites/:site_id/events/properties.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "event": {
      "type": "string",
      "description": "Vain tällä raakatapahtuman nimellä nähdyt avaimet"
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}
PATCH /sites/:site_id/events/properties.json Nimeä tapahtuman ominaisuusavain uudelleen tai piilota se event_properties_update

Oikeus: sites.manage

Esimerkki
curl -X PATCH https://privatusanalytics.com/sites/:site_id/events/properties.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "key": {
      "type": "string",
      "description": "Ominaisuusavain sellaisena kuin se on tallennettu, esim. plan"
    },
    "display_name": {
      "type": "string",
      "description": "Sen sijaan näytettävä nimi (tyhjä poistaa sen)"
    },
    "hidden": {
      "type": "boolean",
      "description": "Piilota tämä avain raporteista"
    },
    "export_safe": {
      "type": "boolean",
      "description": "Avain ei sisällä henkilötietoja, joten se sisällytetään raakavienteihin ja tietovarastosynkronointeihin"
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "key",
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}
DELETE /sites/:site_id/events.json Poista tapahtuma ja sen historia (ajetaan taustalla, vahvista kirjoittamalla nimi) events_delete

Oikeus: sites.manage

Esimerkki
curl -X DELETE https://privatusanalytics.com/sites/:site_id/events.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Poistettavan raakatapahtuman nimi"
    },
    "confirm": {
      "type": "string",
      "description": "Vahvista kirjoittamalla tapahtuman nimi uudelleen"
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "confirm",
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}
GET /sites/:site_id/events.json Listaa tapahtumat suorituksineen, käynteineen, konversioasteineen sekä ensimmäisenä ja viimeisenä nähtynä events_list

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/sites/:site_id/events.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Aikavälin esiasetus. Käytä custom-arvoa yhdessä from/to-parametrien kanssa",
      "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": "Mukautetun aikavälin alku (sivuston aikavyöhyke)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun aikavälin loppu, mukaan lukien"
    },
    "compare": {
      "type": "string",
      "description": "Vertailujakso",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun vertailun alku"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun vertailun loppu"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Kohdista vertailun viikonpäivät",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Suodattimet: [[\"dimension\",\"operator\",\"value\"], …]. Operaattorit: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Kääri ehdot muotoon {\"any\": [...]} TAI-ehtoa varten.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Ota käyttöön tallennettu segmentti (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Lisää tuodut historiatiedot (päivät ennen ensimmäistä natiivia tapahtumaa, ohitetaan kun suodattimia tai segmenttiä käytetään)",
      "default": false
    },
    "search": {
      "type": "string",
      "description": "Vain tapahtumat, joiden nimi sisältää tämän"
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}
POST /sites/:site_id/events/merge.json Yhdistä useita tapahtumia yhdeksi näyttönimeksi events_merge

Oikeus: sites.manage

Esimerkki
curl -X POST https://privatusanalytics.com/sites/:site_id/events/merge.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "names": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Yhdistettävien raakatapahtumien nimet"
    },
    "into": {
      "type": "string",
      "description": "Yhdistetyn tapahtuman näyttönimi",
      "examples": [
        "Signup"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "names",
    "into",
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Raakatapahtuman nimi seurantakoodin lähettämänä"
    },
    "display_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Raporteissa näytettävä nimi"
        },
        {
          "type": "null"
        }
      ]
    },
    "hidden": {
      "type": "boolean",
      "description": "Piilotettu raporteista"
    },
    "currency": {
      "anyOf": [
        {
          "type": "string",
          "description": "Tulon valuutta"
        },
        {
          "type": "null"
        }
      ]
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/events/detail.json Yksi tapahtuma: kaavio, ominaisuuksien pivot, numeeristen ominaisuuksien koosteet, sivut ja lähteet events_get

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/sites/:site_id/events/detail.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Aikavälin esiasetus. Käytä custom-arvoa yhdessä from/to-parametrien kanssa",
      "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": "Mukautetun aikavälin alku (sivuston aikavyöhyke)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun aikavälin loppu, mukaan lukien"
    },
    "compare": {
      "type": "string",
      "description": "Vertailujakso",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun vertailun alku"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun vertailun loppu"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Kohdista vertailun viikonpäivät",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Suodattimet: [[\"dimension\",\"operator\",\"value\"], …]. Operaattorit: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Kääri ehdot muotoon {\"any\": [...]} TAI-ehtoa varten.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Ota käyttöön tallennettu segmentti (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Lisää tuodut historiatiedot (päivät ennen ensimmäistä natiivia tapahtumaa, ohitetaan kun suodattimia tai segmenttiä käytetään)",
      "default": false
    },
    "name": {
      "type": "string",
      "description": "Tapahtuman nimi sellaisena kuin se näytetään (uudelleennimeämisten jälkeen)",
      "examples": [
        "Signup"
      ]
    },
    "properties": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Enintään 3 ominaisuusavainta pivotointia varten",
      "default": []
    },
    "interval": {
      "type": "string",
      "description": "Kaavion aikavälin koko",
      "enum": [
        "auto",
        "minute",
        "hour",
        "day",
        "week",
        "month",
        "quarter",
        "year"
      ],
      "default": "auto"
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}
PATCH /sites/:site_id/events/settings.json Nimeä tapahtuma uudelleen, piilota tai palauta se tai aseta sen valuutta events_update

Oikeus: sites.manage

Esimerkki
curl -X PATCH https://privatusanalytics.com/sites/:site_id/events/settings.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Raakatapahtuman nimi seurantakoodin lähettämänä",
      "examples": [
        "signup_click"
      ]
    },
    "display_name": {
      "type": "string",
      "description": "Sen sijaan näytettävä nimi (tyhjä poistaa uudelleennimeämisen)"
    },
    "hidden": {
      "type": "boolean",
      "description": "Piilota raporteista (tiedot säilyvät)"
    },
    "currency": {
      "type": "string",
      "description": "Tämän tapahtuman tulojen valuutta (ISO 4217)"
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Raakatapahtuman nimi seurantakoodin lähettämänä"
    },
    "display_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Raporteissa näytettävä nimi"
        },
        {
          "type": "null"
        }
      ]
    },
    "hidden": {
      "type": "boolean",
      "description": "Piilotettu raporteista"
    },
    "currency": {
      "anyOf": [
        {
          "type": "string",
          "description": "Tulon valuutta"
        },
        {
          "type": "null"
        }
      ]
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Tarkastusloki

GET /workspaces/:workspace_id/audit_log.json Listaa tarkastuslokin merkinnät (lisää .csv viedäksesi) audit_logs_get

Oikeus: workspace.manage

Esimerkki
curl https://privatusanalytics.com/workspaces/:workspace_id/audit_log.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "actor": {
      "type": "string",
      "description": "Vain tämän jäsenen tekemät muutokset (sähköposti)"
    },
    "item_type": {
      "type": "string",
      "description": "Vain tämän tyyppiset tietueet, esim. Site"
    },
    "event": {
      "type": "string",
      "description": "Vain tämä toiminto",
      "enum": [
        "create",
        "update",
        "destroy"
      ]
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Alkupäivä (mukaan lukien)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Loppupäivä (mukaan lukien)"
    },
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Sivu (alkaen 1:stä)"
    },
    "per_page": {
      "type": "integer",
      "description": "Tuloksia sivulla (enintään 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "format": "uuid"
      },
      "created_at": {
        "type": "string",
        "format": "date-time",
        "description": "Milloin"
      },
      "event": {
        "type": "string",
        "description": "create, update tai destroy"
      },
      "item_type": {
        "type": "string",
        "description": "Tietueen laji, esim. Site"
      },
      "item_id": {
        "type": "string",
        "format": "uuid"
      },
      "target": {
        "type": "string",
        "description": "Tietue nimellä, kun se tiedetään"
      },
      "actor_email": {
        "anyOf": [
          {
            "type": "string",
            "description": "Muutoksen tehnyt jäsen"
          },
          {
            "type": "null"
          }
        ]
      },
      "actor_name": {
        "type": "string"
      },
      "token_name": {
        "anyOf": [
          {
            "type": "string",
            "description": "Käytetty API-tunniste, jos on"
          },
          {
            "type": "null"
          }
        ]
      },
      "changes": {
        "type": "object",
        "description": "Muuttuneet kentät: { field: [ennen, jälkeen] }"
      },
      "ip": {
        "anyOf": [
          {
            "type": "string",
            "description": "Jäsenen IP-osoite"
          },
          {
            "type": "null"
          }
        ]
      }
    }
  }
}

Tavoitteet

POST /sites/:site_id/goals/:id/archive.json Arkistoi tavoite (piilotetaan raporteista) goals_archive

Oikeus: content.write

Esimerkki
curl -X POST https://privatusanalytics.com/sites/:site_id/goals/:id/archive.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Tavoitteen tunniste, esim. goal_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "page, event, engagement, outbound tai download"
    },
    "match_type": {
      "type": "string",
      "description": "exact, prefix, glob tai regex"
    },
    "pattern": {
      "anyOf": [
        {
          "type": "string",
          "description": "Polku, verkkotunnus tai tiedostomalli"
        },
        {
          "type": "null"
        }
      ]
    },
    "hostname": {
      "anyOf": [
        {
          "type": "string",
          "description": "Isäntänimirajoitus (sivutavoitteet)"
        },
        {
          "type": "null"
        }
      ]
    },
    "event_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Oman tapahtuman nimi (tapahtumatavoitteet)"
        },
        {
          "type": "null"
        }
      ]
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Tapahtuman ominaisuusehdot"
    },
    "scroll_threshold": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engagement: vieritys %"
        },
        {
          "type": "null"
        }
      ]
    },
    "time_threshold_seconds": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engagement: sekuntia sivulla"
        },
        {
          "type": "null"
        }
      ]
    },
    "value_mode": {
      "type": "string",
      "description": "none, fixed tai revenue"
    },
    "fixed_value_minor": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Kiinteä arvo pienimmissä yksiköissä"
        },
        {
          "type": "null"
        }
      ]
    },
    "count_mode": {
      "type": "string",
      "description": "once_per_visit tai every"
    },
    "archived": {
      "type": "boolean"
    },
    "archived_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "stats": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "completions": {
              "type": "integer",
              "description": "Vastaavat tapahtumat, toistot mukaan lukien"
            },
            "conversions": {
              "type": "integer",
              "description": "Käynnit, joilla on vähintään yksi suoritus"
            },
            "conversion_rate": {
              "type": "number",
              "description": "Konversiot ÷ käynnit (tai ÷ kävijät, sivuston asetuksen mukaan), %"
            },
            "value": {
              "type": "integer",
              "description": "Tavoitteen arvo sivuston valuutan pienimmissä yksiköissä"
            },
            "change": {
              "anyOf": [
                {
                  "type": "number",
                  "description": "Konversioiden muutos edelliseen jaksoon verrattuna, %"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Jakson tilastot (vain listassa)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /sites/:site_id/goals.json Luo tavoite goals_create

Oikeus: content.write

Esimerkki
curl -X POST https://privatusanalytics.com/sites/:site_id/goals.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Tavoitteen nimi",
      "examples": [
        "Signed up"
      ]
    },
    "kind": {
      "type": "string",
      "description": "page (sivun käynti), event (oma tapahtuma), engagement (vieritys tai aika sivulla), outbound (ulkoisen linkin klikkaus) tai download (tiedoston lataus)",
      "enum": [
        "page",
        "event",
        "engagement",
        "outbound",
        "download"
      ]
    },
    "match_type": {
      "type": "string",
      "description": "Miten pattern vastaa polkua (page, engagement), linkin verkkotunnusta (outbound) tai tiedostoa (download): exact, prefix, glob (*) tai regex",
      "enum": [
        "exact",
        "prefix",
        "glob",
        "regex"
      ],
      "default": "exact"
    },
    "pattern": {
      "type": "string",
      "description": "Polku, verkkotunnus tai tiedostomalli, esim. /pricing, /blog/*, stripe.com tai *.pdf"
    },
    "hostname": {
      "type": "string",
      "description": "Laske vain tämän isäntänimen sivut (sivutavoitteet)"
    },
    "event_name": {
      "type": "string",
      "description": "Oman tapahtuman nimi (tapahtumatavoitteet)"
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      },
      "description": "Tapahtuman ominaisuusehdot: [{\"key\": \"plan\", \"operator\": \"is|is_not|contains|gt|lt\", \"value\": \"pro\"}]",
      "default": []
    },
    "scroll_threshold": {
      "type": "integer",
      "description": "Engagement: saavutettava vierityssyvyys %"
    },
    "time_threshold_seconds": {
      "type": "integer",
      "description": "Engagement: sekuntia sivulla"
    },
    "value_mode": {
      "type": "string",
      "description": "none, fixed (fixed_value konversiota kohden) tai revenue (tapahtuman tulo)",
      "enum": [
        "none",
        "fixed",
        "revenue"
      ],
      "default": "none"
    },
    "fixed_value": {
      "type": "number",
      "description": "Kiinteä arvo konversiota kohden sivuston valuutassa, esim. 50.0"
    },
    "count_mode": {
      "type": "string",
      "description": "Arvo lasketaan once_per_visit tai every completion",
      "enum": [
        "once_per_visit",
        "every"
      ],
      "default": "once_per_visit"
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "kind",
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Tavoitteen tunniste, esim. goal_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "page, event, engagement, outbound tai download"
    },
    "match_type": {
      "type": "string",
      "description": "exact, prefix, glob tai regex"
    },
    "pattern": {
      "anyOf": [
        {
          "type": "string",
          "description": "Polku, verkkotunnus tai tiedostomalli"
        },
        {
          "type": "null"
        }
      ]
    },
    "hostname": {
      "anyOf": [
        {
          "type": "string",
          "description": "Isäntänimirajoitus (sivutavoitteet)"
        },
        {
          "type": "null"
        }
      ]
    },
    "event_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Oman tapahtuman nimi (tapahtumatavoitteet)"
        },
        {
          "type": "null"
        }
      ]
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Tapahtuman ominaisuusehdot"
    },
    "scroll_threshold": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engagement: vieritys %"
        },
        {
          "type": "null"
        }
      ]
    },
    "time_threshold_seconds": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engagement: sekuntia sivulla"
        },
        {
          "type": "null"
        }
      ]
    },
    "value_mode": {
      "type": "string",
      "description": "none, fixed tai revenue"
    },
    "fixed_value_minor": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Kiinteä arvo pienimmissä yksiköissä"
        },
        {
          "type": "null"
        }
      ]
    },
    "count_mode": {
      "type": "string",
      "description": "once_per_visit tai every"
    },
    "archived": {
      "type": "boolean"
    },
    "archived_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "stats": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "completions": {
              "type": "integer",
              "description": "Vastaavat tapahtumat, toistot mukaan lukien"
            },
            "conversions": {
              "type": "integer",
              "description": "Käynnit, joilla on vähintään yksi suoritus"
            },
            "conversion_rate": {
              "type": "number",
              "description": "Konversiot ÷ käynnit (tai ÷ kävijät, sivuston asetuksen mukaan), %"
            },
            "value": {
              "type": "integer",
              "description": "Tavoitteen arvo sivuston valuutan pienimmissä yksiköissä"
            },
            "change": {
              "anyOf": [
                {
                  "type": "number",
                  "description": "Konversioiden muutos edelliseen jaksoon verrattuna, %"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Jakson tilastot (vain listassa)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:site_id/goals/:id.json Poista tavoite (tiedot säilyvät) goals_delete

Oikeus: content.write

Esimerkki
curl -X DELETE https://privatusanalytics.com/sites/:site_id/goals/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Tavoitteen tunniste, esim. goal_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "page, event, engagement, outbound tai download"
    },
    "match_type": {
      "type": "string",
      "description": "exact, prefix, glob tai regex"
    },
    "pattern": {
      "anyOf": [
        {
          "type": "string",
          "description": "Polku, verkkotunnus tai tiedostomalli"
        },
        {
          "type": "null"
        }
      ]
    },
    "hostname": {
      "anyOf": [
        {
          "type": "string",
          "description": "Isäntänimirajoitus (sivutavoitteet)"
        },
        {
          "type": "null"
        }
      ]
    },
    "event_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Oman tapahtuman nimi (tapahtumatavoitteet)"
        },
        {
          "type": "null"
        }
      ]
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Tapahtuman ominaisuusehdot"
    },
    "scroll_threshold": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engagement: vieritys %"
        },
        {
          "type": "null"
        }
      ]
    },
    "time_threshold_seconds": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engagement: sekuntia sivulla"
        },
        {
          "type": "null"
        }
      ]
    },
    "value_mode": {
      "type": "string",
      "description": "none, fixed tai revenue"
    },
    "fixed_value_minor": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Kiinteä arvo pienimmissä yksiköissä"
        },
        {
          "type": "null"
        }
      ]
    },
    "count_mode": {
      "type": "string",
      "description": "once_per_visit tai every"
    },
    "archived": {
      "type": "boolean"
    },
    "archived_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "stats": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "completions": {
              "type": "integer",
              "description": "Vastaavat tapahtumat, toistot mukaan lukien"
            },
            "conversions": {
              "type": "integer",
              "description": "Käynnit, joilla on vähintään yksi suoritus"
            },
            "conversion_rate": {
              "type": "number",
              "description": "Konversiot ÷ käynnit (tai ÷ kävijät, sivuston asetuksen mukaan), %"
            },
            "value": {
              "type": "integer",
              "description": "Tavoitteen arvo sivuston valuutan pienimmissä yksiköissä"
            },
            "change": {
              "anyOf": [
                {
                  "type": "number",
                  "description": "Konversioiden muutos edelliseen jaksoon verrattuna, %"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Jakson tilastot (vain listassa)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /sites/:site_id/goals/:id/duplicate.json Kopioi tavoite goals_duplicate

Oikeus: content.write

Esimerkki
curl -X POST https://privatusanalytics.com/sites/:site_id/goals/:id/duplicate.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Kopion nimi"
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Tavoitteen tunniste, esim. goal_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "page, event, engagement, outbound tai download"
    },
    "match_type": {
      "type": "string",
      "description": "exact, prefix, glob tai regex"
    },
    "pattern": {
      "anyOf": [
        {
          "type": "string",
          "description": "Polku, verkkotunnus tai tiedostomalli"
        },
        {
          "type": "null"
        }
      ]
    },
    "hostname": {
      "anyOf": [
        {
          "type": "string",
          "description": "Isäntänimirajoitus (sivutavoitteet)"
        },
        {
          "type": "null"
        }
      ]
    },
    "event_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Oman tapahtuman nimi (tapahtumatavoitteet)"
        },
        {
          "type": "null"
        }
      ]
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Tapahtuman ominaisuusehdot"
    },
    "scroll_threshold": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engagement: vieritys %"
        },
        {
          "type": "null"
        }
      ]
    },
    "time_threshold_seconds": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engagement: sekuntia sivulla"
        },
        {
          "type": "null"
        }
      ]
    },
    "value_mode": {
      "type": "string",
      "description": "none, fixed tai revenue"
    },
    "fixed_value_minor": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Kiinteä arvo pienimmissä yksiköissä"
        },
        {
          "type": "null"
        }
      ]
    },
    "count_mode": {
      "type": "string",
      "description": "once_per_visit tai every"
    },
    "archived": {
      "type": "boolean"
    },
    "archived_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "stats": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "completions": {
              "type": "integer",
              "description": "Vastaavat tapahtumat, toistot mukaan lukien"
            },
            "conversions": {
              "type": "integer",
              "description": "Käynnit, joilla on vähintään yksi suoritus"
            },
            "conversion_rate": {
              "type": "number",
              "description": "Konversiot ÷ käynnit (tai ÷ kävijät, sivuston asetuksen mukaan), %"
            },
            "value": {
              "type": "integer",
              "description": "Tavoitteen arvo sivuston valuutan pienimmissä yksiköissä"
            },
            "change": {
              "anyOf": [
                {
                  "type": "number",
                  "description": "Konversioiden muutos edelliseen jaksoon verrattuna, %"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Jakson tilastot (vain listassa)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/goals.json Listaa tavoitteet suorituksineen, konversioineen, asteineen ja arvoineen jaksolle goals_list

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/sites/:site_id/goals.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Aikavälin esiasetus. Käytä custom-arvoa yhdessä from/to-parametrien kanssa",
      "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": "Mukautetun aikavälin alku (sivuston aikavyöhyke)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun aikavälin loppu, mukaan lukien"
    },
    "compare": {
      "type": "string",
      "description": "Vertailujakso",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun vertailun alku"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun vertailun loppu"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Kohdista vertailun viikonpäivät",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Suodattimet: [[\"dimension\",\"operator\",\"value\"], …]. Operaattorit: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Kääri ehdot muotoon {\"any\": [...]} TAI-ehtoa varten.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Ota käyttöön tallennettu segmentti (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Lisää tuodut historiatiedot (päivät ennen ensimmäistä natiivia tapahtumaa, ohitetaan kun suodattimia tai segmenttiä käytetään)",
      "default": false
    },
    "status": {
      "type": "string",
      "description": "active, archived tai all tavoitteet",
      "enum": [
        "active",
        "archived",
        "all"
      ],
      "default": "active"
    },
    "page": {
      "type": "integer",
      "description": "Sivunumero",
      "default": 1
    },
    "per_page": {
      "type": "integer",
      "description": "Tavoitteita sivulla (enintään 100)",
      "default": 25
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Tavoitteen tunniste, esim. goal_7Q2K9XH3AB"
      },
      "name": {
        "type": "string"
      },
      "kind": {
        "type": "string",
        "description": "page, event, engagement, outbound tai download"
      },
      "match_type": {
        "type": "string",
        "description": "exact, prefix, glob tai regex"
      },
      "pattern": {
        "anyOf": [
          {
            "type": "string",
            "description": "Polku, verkkotunnus tai tiedostomalli"
          },
          {
            "type": "null"
          }
        ]
      },
      "hostname": {
        "anyOf": [
          {
            "type": "string",
            "description": "Isäntänimirajoitus (sivutavoitteet)"
          },
          {
            "type": "null"
          }
        ]
      },
      "event_name": {
        "anyOf": [
          {
            "type": "string",
            "description": "Oman tapahtuman nimi (tapahtumatavoitteet)"
          },
          {
            "type": "null"
          }
        ]
      },
      "conditions": {
        "type": "array",
        "items": {
          "type": "object"
        },
        "description": "Tapahtuman ominaisuusehdot"
      },
      "scroll_threshold": {
        "anyOf": [
          {
            "type": "integer",
            "description": "Engagement: vieritys %"
          },
          {
            "type": "null"
          }
        ]
      },
      "time_threshold_seconds": {
        "anyOf": [
          {
            "type": "integer",
            "description": "Engagement: sekuntia sivulla"
          },
          {
            "type": "null"
          }
        ]
      },
      "value_mode": {
        "type": "string",
        "description": "none, fixed tai revenue"
      },
      "fixed_value_minor": {
        "anyOf": [
          {
            "type": "integer",
            "description": "Kiinteä arvo pienimmissä yksiköissä"
          },
          {
            "type": "null"
          }
        ]
      },
      "count_mode": {
        "type": "string",
        "description": "once_per_visit tai every"
      },
      "archived": {
        "type": "boolean"
      },
      "archived_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "stats": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "completions": {
                "type": "integer",
                "description": "Vastaavat tapahtumat, toistot mukaan lukien"
              },
              "conversions": {
                "type": "integer",
                "description": "Käynnit, joilla on vähintään yksi suoritus"
              },
              "conversion_rate": {
                "type": "number",
                "description": "Konversiot ÷ käynnit (tai ÷ kävijät, sivuston asetuksen mukaan), %"
              },
              "value": {
                "type": "integer",
                "description": "Tavoitteen arvo sivuston valuutan pienimmissä yksiköissä"
              },
              "change": {
                "anyOf": [
                  {
                    "type": "number",
                    "description": "Konversioiden muutos edelliseen jaksoon verrattuna, %"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "description": "Jakson tilastot (vain listassa)"
          },
          {
            "type": "null"
          }
        ]
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      },
      "updated_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
GET /sites/:site_id/goals/:id.json Tavoiteraportti: mittarit, kaavio, erittelyt ja konversioon johtava polku goals_get

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/sites/:site_id/goals/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Aikavälin esiasetus. Käytä custom-arvoa yhdessä from/to-parametrien kanssa",
      "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": "Mukautetun aikavälin alku (sivuston aikavyöhyke)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun aikavälin loppu, mukaan lukien"
    },
    "compare": {
      "type": "string",
      "description": "Vertailujakso",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun vertailun alku"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Mukautetun vertailun loppu"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Kohdista vertailun viikonpäivät",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Suodattimet: [[\"dimension\",\"operator\",\"value\"], …]. Operaattorit: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Kääri ehdot muotoon {\"any\": [...]} TAI-ehtoa varten.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Ota käyttöön tallennettu segmentti (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Lisää tuodut historiatiedot (päivät ennen ensimmäistä natiivia tapahtumaa, ohitetaan kun suodattimia tai segmenttiä käytetään)",
      "default": false
    },
    "interval": {
      "type": "string",
      "description": "Kaavion aikavälin koko",
      "enum": [
        "auto",
        "minute",
        "hour",
        "day",
        "week",
        "month",
        "quarter",
        "year"
      ],
      "default": "auto"
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "period": {
      "type": "object",
      "description": "Jakson from/to (UTC)"
    },
    "goal": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Tavoitteen tunniste, esim. goal_7Q2K9XH3AB"
        },
        "name": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "description": "page, event, engagement, outbound tai download"
        },
        "match_type": {
          "type": "string",
          "description": "exact, prefix, glob tai regex"
        },
        "pattern": {
          "anyOf": [
            {
              "type": "string",
              "description": "Polku, verkkotunnus tai tiedostomalli"
            },
            {
              "type": "null"
            }
          ]
        },
        "hostname": {
          "anyOf": [
            {
              "type": "string",
              "description": "Isäntänimirajoitus (sivutavoitteet)"
            },
            {
              "type": "null"
            }
          ]
        },
        "event_name": {
          "anyOf": [
            {
              "type": "string",
              "description": "Oman tapahtuman nimi (tapahtumatavoitteet)"
            },
            {
              "type": "null"
            }
          ]
        },
        "conditions": {
          "type": "array",
          "items": {
            "type": "object"
          },
          "description": "Tapahtuman ominaisuusehdot"
        },
        "scroll_threshold": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Engagement: vieritys %"
            },
            {
              "type": "null"
            }
          ]
        },
        "time_threshold_seconds": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Engagement: sekuntia sivulla"
            },
            {
              "type": "null"
            }
          ]
        },
        "value_mode": {
          "type": "string",
          "description": "none, fixed tai revenue"
        },
        "fixed_value_minor": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Kiinteä arvo pienimmissä yksiköissä"
            },
            {
              "type": "null"
            }
          ]
        },
        "count_mode": {
          "type": "string",
          "description": "once_per_visit tai every"
        },
        "archived": {
          "type": "boolean"
        },
        "archived_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "stats": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "completions": {
                  "type": "integer",
                  "description": "Vastaavat tapahtumat, toistot mukaan lukien"
                },
                "conversions": {
                  "type": "integer",
                  "description": "Käynnit, joilla on vähintään yksi suoritus"
                },
                "conversion_rate": {
                  "type": "number",
                  "description": "Konversiot ÷ käynnit (tai ÷ kävijät, sivuston asetuksen mukaan), %"
                },
                "value": {
                  "type": "integer",
                  "description": "Tavoitteen arvo sivuston valuutan pienimmissä yksiköissä"
                },
                "change": {
                  "anyOf": [
                    {
                      "type": "number",
                      "description": "Konversioiden muutos edelliseen jaksoon verrattuna, %"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "description": "Jakson tilastot (vain listassa)"
            },
            {
              "type": "null"
            }
          ]
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        }
      },
      "description": "Tavoitteen määritys"
    },
    "metrics": {
      "type": "object",
      "description": "completions, conversions, conversion_rate (%), value (pienimmissä yksiköissä)"
    },
    "comparison_period": {
      "anyOf": [
        {
          "type": "object",
          "description": "Vertailun from/to"
        },
        {
          "type": "null"
        }
      ]
    },
    "comparison": {
      "anyOf": [
        {
          "type": "object",
          "description": "Vertailujakson mittarit"
        },
        {
          "type": "null"
        }
      ]
    },
    "change": {
      "anyOf": [
        {
          "type": "object",
          "description": "Muutos vertailuun nähden, % mittaria kohden"
        },
        {
          "type": "null"
        }
      ]
    },
    "interval": {
      "type": "string",
      "description": "Kaavion aikavälin koko"
    },
    "series": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Aikaväliä kohden: date, completions, conversions, conversion_rate"
    },
    "breakdowns": {
      "type": "object",
      "description": "Kärkiarvot konversioiden mukaan kohteille channel, utm_campaign, entry_page, country ja device: value, completions, conversions, conversion_rate"
    },
    "journey": {
      "anyOf": [
        {
          "type": "object",
          "description": "converting_visits, median_seconds_to_convert, median_pages_before ja pages_before (konvertoineiden käyntien aiemmin käynnin aikana katsomat sivut)"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
POST /sites/:site_id/goals/:id/unarchive.json Palauta arkistoitu tavoite goals_unarchive

Oikeus: content.write

Esimerkki
curl -X POST https://privatusanalytics.com/sites/:site_id/goals/:id/unarchive.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Tavoitteen tunniste, esim. goal_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "page, event, engagement, outbound tai download"
    },
    "match_type": {
      "type": "string",
      "description": "exact, prefix, glob tai regex"
    },
    "pattern": {
      "anyOf": [
        {
          "type": "string",
          "description": "Polku, verkkotunnus tai tiedostomalli"
        },
        {
          "type": "null"
        }
      ]
    },
    "hostname": {
      "anyOf": [
        {
          "type": "string",
          "description": "Isäntänimirajoitus (sivutavoitteet)"
        },
        {
          "type": "null"
        }
      ]
    },
    "event_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Oman tapahtuman nimi (tapahtumatavoitteet)"
        },
        {
          "type": "null"
        }
      ]
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Tapahtuman ominaisuusehdot"
    },
    "scroll_threshold": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engagement: vieritys %"
        },
        {
          "type": "null"
        }
      ]
    },
    "time_threshold_seconds": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engagement: sekuntia sivulla"
        },
        {
          "type": "null"
        }
      ]
    },
    "value_mode": {
      "type": "string",
      "description": "none, fixed tai revenue"
    },
    "fixed_value_minor": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Kiinteä arvo pienimmissä yksiköissä"
        },
        {
          "type": "null"
        }
      ]
    },
    "count_mode": {
      "type": "string",
      "description": "once_per_visit tai every"
    },
    "archived": {
      "type": "boolean"
    },
    "archived_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "stats": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "completions": {
              "type": "integer",
              "description": "Vastaavat tapahtumat, toistot mukaan lukien"
            },
            "conversions": {
              "type": "integer",
              "description": "Käynnit, joilla on vähintään yksi suoritus"
            },
            "conversion_rate": {
              "type": "number",
              "description": "Konversiot ÷ käynnit (tai ÷ kävijät, sivuston asetuksen mukaan), %"
            },
            "value": {
              "type": "integer",
              "description": "Tavoitteen arvo sivuston valuutan pienimmissä yksiköissä"
            },
            "change": {
              "anyOf": [
                {
                  "type": "number",
                  "description": "Konversioiden muutos edelliseen jaksoon verrattuna, %"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Jakson tilastot (vain listassa)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
PATCH /sites/:site_id/goals/:id.json Päivitä tavoite goals_update

Oikeus: content.write

Esimerkki
curl -X PATCH https://privatusanalytics.com/sites/:site_id/goals/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Tavoitteen nimi",
      "examples": [
        "Signed up"
      ]
    },
    "kind": {
      "type": "string",
      "description": "page (sivun käynti), event (oma tapahtuma), engagement (vieritys tai aika sivulla), outbound (ulkoisen linkin klikkaus) tai download (tiedoston lataus)",
      "enum": [
        "page",
        "event",
        "engagement",
        "outbound",
        "download"
      ]
    },
    "match_type": {
      "type": "string",
      "description": "Miten pattern vastaa polkua (page, engagement), linkin verkkotunnusta (outbound) tai tiedostoa (download): exact, prefix, glob (*) tai regex",
      "enum": [
        "exact",
        "prefix",
        "glob",
        "regex"
      ]
    },
    "pattern": {
      "type": "string",
      "description": "Polku, verkkotunnus tai tiedostomalli, esim. /pricing, /blog/*, stripe.com tai *.pdf"
    },
    "hostname": {
      "type": "string",
      "description": "Laske vain tämän isäntänimen sivut (sivutavoitteet)"
    },
    "event_name": {
      "type": "string",
      "description": "Oman tapahtuman nimi (tapahtumatavoitteet)"
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      },
      "description": "Tapahtuman ominaisuusehdot: [{\"key\": \"plan\", \"operator\": \"is|is_not|contains|gt|lt\", \"value\": \"pro\"}]"
    },
    "scroll_threshold": {
      "type": "integer",
      "description": "Engagement: saavutettava vierityssyvyys %"
    },
    "time_threshold_seconds": {
      "type": "integer",
      "description": "Engagement: sekuntia sivulla"
    },
    "value_mode": {
      "type": "string",
      "description": "none, fixed (fixed_value konversiota kohden) tai revenue (tapahtuman tulo)",
      "enum": [
        "none",
        "fixed",
        "revenue"
      ]
    },
    "fixed_value": {
      "type": "number",
      "description": "Kiinteä arvo konversiota kohden sivuston valuutassa, esim. 50.0"
    },
    "count_mode": {
      "type": "string",
      "description": "Arvo lasketaan once_per_visit tai every completion",
      "enum": [
        "once_per_visit",
        "every"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Tavoitteen tunniste, esim. goal_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "page, event, engagement, outbound tai download"
    },
    "match_type": {
      "type": "string",
      "description": "exact, prefix, glob tai regex"
    },
    "pattern": {
      "anyOf": [
        {
          "type": "string",
          "description": "Polku, verkkotunnus tai tiedostomalli"
        },
        {
          "type": "null"
        }
      ]
    },
    "hostname": {
      "anyOf": [
        {
          "type": "string",
          "description": "Isäntänimirajoitus (sivutavoitteet)"
        },
        {
          "type": "null"
        }
      ]
    },
    "event_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Oman tapahtuman nimi (tapahtumatavoitteet)"
        },
        {
          "type": "null"
        }
      ]
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Tapahtuman ominaisuusehdot"
    },
    "scroll_threshold": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engagement: vieritys %"
        },
        {
          "type": "null"
        }
      ]
    },
    "time_threshold_seconds": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engagement: sekuntia sivulla"
        },
        {
          "type": "null"
        }
      ]
    },
    "value_mode": {
      "type": "string",
      "description": "none, fixed tai revenue"
    },
    "fixed_value_minor": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Kiinteä arvo pienimmissä yksiköissä"
        },
        {
          "type": "null"
        }
      ]
    },
    "count_mode": {
      "type": "string",
      "description": "once_per_visit tai every"
    },
    "archived": {
      "type": "boolean"
    },
    "archived_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "stats": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "completions": {
              "type": "integer",
              "description": "Vastaavat tapahtumat, toistot mukaan lukien"
            },
            "conversions": {
              "type": "integer",
              "description": "Käynnit, joilla on vähintään yksi suoritus"
            },
            "conversion_rate": {
              "type": "number",
              "description": "Konversiot ÷ käynnit (tai ÷ kävijät, sivuston asetuksen mukaan), %"
            },
            "value": {
              "type": "integer",
              "description": "Tavoitteen arvo sivuston valuutan pienimmissä yksiköissä"
            },
            "change": {
              "anyOf": [
                {
                  "type": "number",
                  "description": "Konversioiden muutos edelliseen jaksoon verrattuna, %"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Jakson tilastot (vain listassa)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Tietovarastosynkronointi

POST /workspaces/:workspace_id/warehouses.json Lisää tietovarastokohde warehouse_destinations_create

Oikeus: workspace.manage

Esimerkki
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/warehouses.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Näyttönimi, esim. Data lake"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Lähetettävät sivustot (pa_…). Tyhjä lähettää kaikki sivustot"
    },
    "bucket": {
      "type": "string",
      "description": "s3: bucketin nimi"
    },
    "region": {
      "type": "string",
      "description": "s3: alue, esim. us-east-1 (auto R2:lle)"
    },
    "prefix": {
      "type": "string",
      "description": "s3/azure: polun etuliite, esim. privatus/events"
    },
    "endpoint": {
      "type": "string",
      "description": "s3: https-päätepiste S3-yhteensopivalle tallennustilalle (GCS-yhteensopivuus, R2, MinIO)"
    },
    "access_key_id": {
      "type": "string",
      "description": "s3: access key id"
    },
    "secret_access_key": {
      "type": "string",
      "description": "s3: secret access key (vain kirjoitettavissa)"
    },
    "service_account_json": {
      "type": "string",
      "description": "bigquery: palvelutilin JSON-avain BigQuery Data Editor -roolilla (vain kirjoitettavissa)"
    },
    "project_id": {
      "type": "string",
      "description": "bigquery: project id (oletus: avaimesta)"
    },
    "dataset": {
      "type": "string",
      "description": "bigquery: dataset id"
    },
    "table": {
      "type": "string",
      "description": "bigquery/snowflake: taulun nimi (sarakkeet: skeema v1)"
    },
    "account": {
      "type": "string",
      "description": "snowflake: tilin tunniste, esim. xy12345.us-east-1 tai myorg-myaccount"
    },
    "user": {
      "type": "string",
      "description": "snowflake: käyttäjä avainparitodennuksella"
    },
    "private_key": {
      "type": "string",
      "description": "snowflake: PEM RSA -yksityisavain (vain kirjoitettavissa)"
    },
    "database": {
      "type": "string",
      "description": "snowflake: tietokanta"
    },
    "schema": {
      "type": "string",
      "description": "snowflake: skeema"
    },
    "warehouse": {
      "type": "string",
      "description": "snowflake: virtuaalinen tietovarasto"
    },
    "role": {
      "type": "string",
      "description": "snowflake: rooli (valinnainen)"
    },
    "sas_url": {
      "type": "string",
      "description": "azure: säilön SAS-URL luonti-/kirjoitusoikeudella (vain kirjoitettavissa)"
    },
    "kind": {
      "type": "string",
      "description": "s3 (myös GCS/R2/MinIO), bigquery, snowflake tai azure",
      "enum": [
        "s3",
        "bigquery",
        "snowflake",
        "azure"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "kind",
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Kohteen tunniste, esim. whd_7Q2K9XH3AB"
    },
    "kind": {
      "type": "string",
      "description": "s3, bigquery, snowflake tai azure"
    },
    "name": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "Minne tiedot menevät: s3://bucket/prefix, project.dataset.table, account/database.schema.table tai Azure-säiliö"
    },
    "configured": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Asetusten nimet, jotka on täytetty (arvoja ei koskaan palauteta)"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Lähetettävät sivustot (pa_…). Tyhjä tarkoittaa kaikkia sivustoja"
    },
    "schedule": {
      "type": "string",
      "description": "daily: 02:00 UTC, lähettää edellisen UTC-päivän"
    },
    "schema_version": {
      "type": "string",
      "description": "Lähetettävä rivien skeema"
    },
    "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 Poista tietovarastokohde warehouse_destinations_delete

Oikeus: workspace.manage

Esimerkki
curl -X DELETE https://privatusanalytics.com/warehouses/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Kohteen tunniste, esim. whd_7Q2K9XH3AB"
    },
    "kind": {
      "type": "string",
      "description": "s3, bigquery, snowflake tai azure"
    },
    "name": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "Minne tiedot menevät: s3://bucket/prefix, project.dataset.table, account/database.schema.table tai Azure-säiliö"
    },
    "configured": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Asetusten nimet, jotka on täytetty (arvoja ei koskaan palauteta)"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Lähetettävät sivustot (pa_…). Tyhjä tarkoittaa kaikkia sivustoja"
    },
    "schedule": {
      "type": "string",
      "description": "daily: 02:00 UTC, lähettää edellisen UTC-päivän"
    },
    "schema_version": {
      "type": "string",
      "description": "Lähetettävä rivien skeema"
    },
    "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 Listaa tietovarastokohteet warehouse_destinations_list

Oikeus: workspace.manage

Esimerkki
curl https://privatusanalytics.com/workspaces/:workspace_id/warehouses.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "description": "Vain tämän lajin kohteet",
      "enum": [
        "s3",
        "bigquery",
        "snowflake",
        "azure"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Sivu (alkaen 1:stä)"
    },
    "per_page": {
      "type": "integer",
      "description": "Tuloksia sivulla (enintään 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Kohteen tunniste, esim. whd_7Q2K9XH3AB"
      },
      "kind": {
        "type": "string",
        "description": "s3, bigquery, snowflake tai azure"
      },
      "name": {
        "type": "string"
      },
      "target": {
        "type": "string",
        "description": "Minne tiedot menevät: s3://bucket/prefix, project.dataset.table, account/database.schema.table tai Azure-säiliö"
      },
      "configured": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Asetusten nimet, jotka on täytetty (arvoja ei koskaan palauteta)"
      },
      "site_ids": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Lähetettävät sivustot (pa_…). Tyhjä tarkoittaa kaikkia sivustoja"
      },
      "schedule": {
        "type": "string",
        "description": "daily: 02:00 UTC, lähettää edellisen UTC-päivän"
      },
      "schema_version": {
        "type": "string",
        "description": "Lähetettävä rivien skeema"
      },
      "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 Hae tietovarastokohde (ilman salaisuuksia) warehouse_destinations_get

Oikeus: workspace.manage

Esimerkki
curl https://privatusanalytics.com/warehouses/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Kohteen tunniste, esim. whd_7Q2K9XH3AB"
    },
    "kind": {
      "type": "string",
      "description": "s3, bigquery, snowflake tai azure"
    },
    "name": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "Minne tiedot menevät: s3://bucket/prefix, project.dataset.table, account/database.schema.table tai Azure-säiliö"
    },
    "configured": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Asetusten nimet, jotka on täytetty (arvoja ei koskaan palauteta)"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Lähetettävät sivustot (pa_…). Tyhjä tarkoittaa kaikkia sivustoja"
    },
    "schedule": {
      "type": "string",
      "description": "daily: 02:00 UTC, lähettää edellisen UTC-päivän"
    },
    "schema_version": {
      "type": "string",
      "description": "Lähetettävä rivien skeema"
    },
    "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 Lisää yhden päivän synkronointi jonoon nyt warehouse_destinations_sync

Oikeus: workspace.manage

Esimerkki
curl -X POST https://privatusanalytics.com/warehouses/:id/sync.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "date": {
      "type": "string",
      "format": "date",
      "description": "Lähetettävä UTC-päivä, esim. 2026-09-28 (oletus: eilinen)"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Kohteen tunniste, esim. whd_7Q2K9XH3AB"
    },
    "kind": {
      "type": "string",
      "description": "s3, bigquery, snowflake tai azure"
    },
    "name": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "Minne tiedot menevät: s3://bucket/prefix, project.dataset.table, account/database.schema.table tai Azure-säiliö"
    },
    "configured": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Asetusten nimet, jotka on täytetty (arvoja ei koskaan palauteta)"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Lähetettävät sivustot (pa_…). Tyhjä tarkoittaa kaikkia sivustoja"
    },
    "schedule": {
      "type": "string",
      "description": "daily: 02:00 UTC, lähettää edellisen UTC-päivän"
    },
    "schema_version": {
      "type": "string",
      "description": "Lähetettävä rivien skeema"
    },
    "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 Päivitä tietovarastokohde (tyhjät salaisuudet säilytetään) warehouse_destinations_update

Oikeus: workspace.manage

Esimerkki
curl -X PATCH https://privatusanalytics.com/warehouses/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Näyttönimi, esim. Data lake"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Lähetettävät sivustot (pa_…). Tyhjä lähettää kaikki sivustot"
    },
    "bucket": {
      "type": "string",
      "description": "s3: bucketin nimi"
    },
    "region": {
      "type": "string",
      "description": "s3: alue, esim. us-east-1 (auto R2:lle)"
    },
    "prefix": {
      "type": "string",
      "description": "s3/azure: polun etuliite, esim. privatus/events"
    },
    "endpoint": {
      "type": "string",
      "description": "s3: https-päätepiste S3-yhteensopivalle tallennustilalle (GCS-yhteensopivuus, R2, MinIO)"
    },
    "access_key_id": {
      "type": "string",
      "description": "s3: access key id"
    },
    "secret_access_key": {
      "type": "string",
      "description": "s3: secret access key (vain kirjoitettavissa)"
    },
    "service_account_json": {
      "type": "string",
      "description": "bigquery: palvelutilin JSON-avain BigQuery Data Editor -roolilla (vain kirjoitettavissa)"
    },
    "project_id": {
      "type": "string",
      "description": "bigquery: project id (oletus: avaimesta)"
    },
    "dataset": {
      "type": "string",
      "description": "bigquery: dataset id"
    },
    "table": {
      "type": "string",
      "description": "bigquery/snowflake: taulun nimi (sarakkeet: skeema v1)"
    },
    "account": {
      "type": "string",
      "description": "snowflake: tilin tunniste, esim. xy12345.us-east-1 tai myorg-myaccount"
    },
    "user": {
      "type": "string",
      "description": "snowflake: käyttäjä avainparitodennuksella"
    },
    "private_key": {
      "type": "string",
      "description": "snowflake: PEM RSA -yksityisavain (vain kirjoitettavissa)"
    },
    "database": {
      "type": "string",
      "description": "snowflake: tietokanta"
    },
    "schema": {
      "type": "string",
      "description": "snowflake: skeema"
    },
    "warehouse": {
      "type": "string",
      "description": "snowflake: virtuaalinen tietovarasto"
    },
    "role": {
      "type": "string",
      "description": "snowflake: rooli (valinnainen)"
    },
    "sas_url": {
      "type": "string",
      "description": "azure: säilön SAS-URL luonti-/kirjoitusoikeudella (vain kirjoitettavissa)"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Kohteen tunniste, esim. whd_7Q2K9XH3AB"
    },
    "kind": {
      "type": "string",
      "description": "s3, bigquery, snowflake tai azure"
    },
    "name": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "Minne tiedot menevät: s3://bucket/prefix, project.dataset.table, account/database.schema.table tai Azure-säiliö"
    },
    "configured": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Asetusten nimet, jotka on täytetty (arvoja ei koskaan palauteta)"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Lähetettävät sivustot (pa_…). Tyhjä tarkoittaa kaikkia sivustoja"
    },
    "schedule": {
      "type": "string",
      "description": "daily: 02:00 UTC, lähettää edellisen UTC-päivän"
    },
    "schema_version": {
      "type": "string",
      "description": "Lähetettävä rivien skeema"
    },
    "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"
    }
  }
}

Tilasivut

GET /status/:slug/confirm/:token.json Vahvista tilaus sähköpostitse lähetetystä linkistä public_status_pages_confirm

Oikeus: public · Vain HTTP (ei MCP-työkalu)

Esimerkki
curl https://privatusanalytics.com/status/:slug/confirm/:token.json
Syötteet
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Resurssin Token"
    },
    "slug": {
      "type": "string",
      "description": "Resurssin Slug"
    }
  },
  "required": [
    "token",
    "slug"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}
GET /status/:slug.json Julkinen tilasivu: nykyinen tila, 90 päivän käytettävyyspalkit, häiriöt ja viestit public_status_pages_get

Oikeus: public · Vain HTTP (ei MCP-työkalu)

Esimerkki
curl https://privatusanalytics.com/status/:slug.json
Syötteet
{
  "type": "object",
  "properties": {
    "slug": {
      "type": "string",
      "description": "Resurssin Slug"
    }
  },
  "required": [
    "slug"
  ]
}
Vastauksen tiedot
{
  "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 tai outage"
    },
    "checks": {
      "type": "array",
      "description": "Kukin: {name, status, uptime_90d, days: [{date, uptime, downtime_seconds}]}"
    },
    "posts": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Viestin tunniste (spp_…)"
          },
          "title": {
            "type": "string"
          },
          "body": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "description": "investigating, identified, monitoring tai resolved"
          },
          "posted_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
    },
    "incidents": {
      "type": "array",
      "description": "Viimeaikaiset häiriöt: {check, started_at, resolved_at, duration_seconds}"
    }
  }
}
POST /status/:slug/subscribers.json Tilaa sähköpostiosoite (kaksoisvahvistus) public_status_pages_subscribe

Selainasiakkaat lähettävät Cloudflare Turnstile -tunnisteen kentässä `cf-turnstile-response`. API-tunnisteella tehtävät pyynnöt eivät tarvitse sitä.

Oikeus: public · Vain HTTP (ei MCP-työkalu)

Esimerkki
curl -X POST https://privatusanalytics.com/status/:slug/subscribers.json \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "description": "Ilmoitettava sähköpostiosoite",
      "examples": [
        "[email protected]"
      ]
    },
    "slug": {
      "type": "string",
      "description": "Resurssin Slug"
    }
  },
  "required": [
    "email",
    "slug"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}
POST /status/:slug/unsubscribe/:token.json Peruuta tilaus sähköpostitse lähetetyllä tunnisteella public_status_pages_unsubscribe

Oikeus: public · Vain HTTP (ei MCP-työkalu)

Esimerkki
curl -X POST https://privatusanalytics.com/status/:slug/unsubscribe/:token.json \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Resurssin Token"
    },
    "slug": {
      "type": "string",
      "description": "Resurssin Slug"
    }
  },
  "required": [
    "token",
    "slug"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}
POST /status_pages/:status_page_id/posts.json Julkaise häiriöpäivitys (lähettää sähköpostin tilaajille) status_page_posts_create

Oikeus: uptime.manage

Esimerkki
curl -X POST https://privatusanalytics.com/status_pages/:status_page_id/posts.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "description": "Otsikko, esim. \"Kohonneet virhemäärät\""
    },
    "body": {
      "type": "string",
      "description": "Päivityksen teksti (pelkkä teksti)"
    },
    "status": {
      "type": "string",
      "description": "investigating, identified, monitoring tai resolved",
      "enum": [
        "investigating",
        "identified",
        "monitoring",
        "resolved"
      ],
      "default": "investigating"
    },
    "posted_at": {
      "type": "string",
      "format": "date-time",
      "description": "Milloin se tapahtui (oletuksena nyt)"
    },
    "notify": {
      "type": "boolean",
      "description": "Lähetä sähköposti vahvistetuille tilaajille",
      "default": true
    },
    "status_page_id": {
      "type": "string",
      "description": "Resurssin Status page"
    }
  },
  "required": [
    "title",
    "status_page_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Viestin tunniste (spp_…)"
    },
    "title": {
      "type": "string"
    },
    "body": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "status": {
      "type": "string",
      "description": "investigating, identified, monitoring tai resolved"
    },
    "posted_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /status_pages/:status_page_id/posts/:id.json Poista tilasivun viesti status_page_posts_delete

Oikeus: uptime.manage

Esimerkki
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 '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "status_page_id": {
      "type": "string",
      "description": "Resurssin Status page"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "status_page_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Viestin tunniste (spp_…)"
    },
    "title": {
      "type": "string"
    },
    "body": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "status": {
      "type": "string",
      "description": "investigating, identified, monitoring tai resolved"
    },
    "posted_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /status_pages/:status_page_id/posts.json Listaa tilasivun viestit status_page_posts_list

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/status_pages/:status_page_id/posts.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Vain tämän tilan viestit",
      "enum": [
        "investigating",
        "identified",
        "monitoring",
        "resolved"
      ]
    },
    "status_page_id": {
      "type": "string",
      "description": "Resurssin Status page"
    },
    "page": {
      "type": "integer",
      "description": "Sivu (alkaen 1:stä)"
    },
    "per_page": {
      "type": "integer",
      "description": "Tuloksia sivulla (enintään 100)"
    }
  },
  "required": [
    "status_page_id"
  ]
}
Vastauksen tiedot
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Viestin tunniste (spp_…)"
      },
      "title": {
        "type": "string"
      },
      "body": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "status": {
        "type": "string",
        "description": "investigating, identified, monitoring tai resolved"
      },
      "posted_at": {
        "type": "string",
        "format": "date-time"
      },
      "updated_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
PATCH /status_pages/:status_page_id/posts/:id.json Muokkaa tilasivun viestiä status_page_posts_update

Oikeus: uptime.manage

Esimerkki
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 '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "description": "Otsikko"
    },
    "body": {
      "type": "string",
      "description": "Päivityksen teksti (pelkkä teksti)"
    },
    "status": {
      "type": "string",
      "description": "investigating, identified, monitoring tai resolved",
      "enum": [
        "investigating",
        "identified",
        "monitoring",
        "resolved"
      ]
    },
    "notify": {
      "type": "boolean",
      "description": "Lähetä sähköposti vahvistetuille tilaajille, jos tila muuttuu",
      "default": true
    },
    "status_page_id": {
      "type": "string",
      "description": "Resurssin Status page"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "status_page_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Viestin tunniste (spp_…)"
    },
    "title": {
      "type": "string"
    },
    "body": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "status": {
      "type": "string",
      "description": "investigating, identified, monitoring tai resolved"
    },
    "posted_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /status_pages/:status_page_id/subscribers/:id.json Poista tilaaja status_page_subscribers_delete

Oikeus: uptime.manage

Esimerkki
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 '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "status_page_id": {
      "type": "string",
      "description": "Resurssin Status page"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "status_page_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "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 Listaa tilasivun tilaajat status_page_subscribers_list

Oikeus: uptime.manage

Esimerkki
curl https://privatusanalytics.com/status_pages/:status_page_id/subscribers.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "confirmed": {
      "type": "boolean",
      "description": "true: vain vahvistetut, false: vain odottavat"
    },
    "status_page_id": {
      "type": "string",
      "description": "Resurssin Status page"
    },
    "page": {
      "type": "integer",
      "description": "Sivu (alkaen 1:stä)"
    },
    "per_page": {
      "type": "integer",
      "description": "Tuloksia sivulla (enintään 100)"
    }
  },
  "required": [
    "status_page_id"
  ]
}
Vastauksen tiedot
{
  "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 Luo tilasivu status_pages_create

Oikeus: uptime.manage

Esimerkki
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/status_pages.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Sivun otsikko, esim. \"Acme-tila\""
    },
    "slug": {
      "type": "string",
      "description": "Julkinen URL-tunniste: /status/<slug> (oletus nimestä)"
    },
    "description": {
      "type": "string",
      "description": "Otsikon alla oleva johdantoteksti"
    },
    "logo_url": {
      "type": "string",
      "description": "Logokuvan HTTPS-URL"
    },
    "brand_color": {
      "type": "string",
      "description": "Korostusväri, esim. #06755b"
    },
    "custom_domain": {
      "type": "string",
      "description": "Oma verkkotunnus (CNAME palvelimellemme), esim. status.example.com. Tyhjä poistaa"
    },
    "check_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Näytettävien käytettävyystarkistusten tunnisteet (upc_…)"
    },
    "published": {
      "type": "boolean",
      "description": "Näkyy julkisesti",
      "default": true
    },
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Tilasivun tunniste (sp_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "slug": {
      "type": "string",
      "description": "Julkinen 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": "Näytettävien käytettävyystarkistusten tunnisteet"
    },
    "subscribers": {
      "type": "integer",
      "description": "Vahvistetut tilaajat"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /status_pages/:id.json Poista tilasivu status_pages_delete

Oikeus: uptime.manage

Esimerkki
curl -X DELETE https://privatusanalytics.com/status_pages/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Tilasivun tunniste (sp_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "slug": {
      "type": "string",
      "description": "Julkinen 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": "Näytettävien käytettävyystarkistusten tunnisteet"
    },
    "subscribers": {
      "type": "integer",
      "description": "Vahvistetut tilaajat"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /workspaces/:workspace_id/status_pages.json Listaa tilasivut status_pages_list

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/workspaces/:workspace_id/status_pages.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "description": "Suodata nimen tai slugin mukaan"
    },
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Sivu (alkaen 1:stä)"
    },
    "per_page": {
      "type": "integer",
      "description": "Tuloksia sivulla (enintään 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Tilasivun tunniste (sp_…)"
      },
      "workspace_id": {
        "type": "string"
      },
      "name": {
        "type": "string"
      },
      "slug": {
        "type": "string",
        "description": "Julkinen 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": "Näytettävien käytettävyystarkistusten tunnisteet"
      },
      "subscribers": {
        "type": "integer",
        "description": "Vahvistetut tilaajat"
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
GET /status_pages/:id.json Hae tilasivu status_pages_get

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/status_pages/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Tilasivun tunniste (sp_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "slug": {
      "type": "string",
      "description": "Julkinen 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": "Näytettävien käytettävyystarkistusten tunnisteet"
    },
    "subscribers": {
      "type": "integer",
      "description": "Vahvistetut tilaajat"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
PATCH /status_pages/:id.json Muuta tilasivua status_pages_update

Oikeus: uptime.manage

Esimerkki
curl -X PATCH https://privatusanalytics.com/status_pages/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Sivun otsikko, esim. \"Acme-tila\""
    },
    "slug": {
      "type": "string",
      "description": "Julkinen URL-tunniste: /status/<slug> (oletus nimestä)"
    },
    "description": {
      "type": "string",
      "description": "Otsikon alla oleva johdantoteksti"
    },
    "logo_url": {
      "type": "string",
      "description": "Logokuvan HTTPS-URL"
    },
    "brand_color": {
      "type": "string",
      "description": "Korostusväri, esim. #06755b"
    },
    "custom_domain": {
      "type": "string",
      "description": "Oma verkkotunnus (CNAME palvelimellemme), esim. status.example.com. Tyhjä poistaa"
    },
    "check_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Näytettävien käytettävyystarkistusten tunnisteet (upc_…)"
    },
    "published": {
      "type": "boolean",
      "description": "Näkyy julkisesti"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Tilasivun tunniste (sp_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "slug": {
      "type": "string",
      "description": "Julkinen 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": "Näytettävien käytettävyystarkistusten tunnisteet"
    },
    "subscribers": {
      "type": "integer",
      "description": "Vahvistetut tilaajat"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Tili

GET /account.json Hae profiilisi ja asetuksesi account_get

Oikeus: member

Esimerkki
curl https://privatusanalytics.com/account.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {},
  "required": []
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "email": {
      "type": "string"
    },
    "unconfirmed_email": {
      "anyOf": [
        {
          "type": "string",
          "description": "Uusi sähköpostiosoite odottaa vahvistusta"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "theme": {
      "type": "string"
    },
    "default_landing": {
      "type": "string"
    },
    "locale": {
      "type": "string",
      "description": "Tämän tilin sovelluksen kielikoodi (oletuksena en)"
    },
    "timezone": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "shortcuts_enabled": {
      "type": "boolean"
    },
    "reduce_motion": {
      "type": "boolean"
    },
    "product_emails": {
      "type": "boolean"
    },
    "marketing_emails": {
      "type": "boolean",
      "description": "Saako markkinointisähköposteja (tippakampanjat) lähettää. false tilauksen peruutuksen jälkeen"
    },
    "newsletter": {
      "type": "boolean"
    },
    "two_factor": {
      "type": "boolean"
    },
    "passkeys": {
      "type": "integer"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
PATCH /account.json Päivitä profiilisi ja asetuksesi account_update

Oikeus: member

Esimerkki
curl -X PATCH https://privatusanalytics.com/account.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nimesi"
    },
    "email": {
      "type": "string",
      "description": "Uusi sähköpostiosoite (vahvistetaan ensin sähköpostilla)"
    },
    "theme": {
      "type": "string",
      "description": "Väriteema",
      "enum": [
        "system",
        "light",
        "dark"
      ]
    },
    "default_landing": {
      "type": "string",
      "description": "Kirjautumisen jälkeinen sivu: sites tai last_site",
      "enum": [
        "sites",
        "last_site"
      ]
    },
    "locale": {
      "type": "string",
      "description": "Sovelluksen kieli kirjautuneena, kielikoodina (en, de, fr ja niin edelleen). Julkiset sivut ja API pysyvät ennallaan",
      "enum": [
        "en",
        "de",
        "es",
        "fr",
        "it",
        "nl",
        "pt",
        "pl",
        "sv",
        "da",
        "no",
        "fi",
        "ja",
        "ko",
        "zh-CN",
        "zh-TW"
      ]
    },
    "timezone": {
      "type": "string",
      "description": "Aikavyöhykkeesi (IANA-nimi)"
    },
    "shortcuts_enabled": {
      "type": "boolean",
      "description": "Pikanäppäimet"
    },
    "reduce_motion": {
      "type": "boolean",
      "description": "Vähennä animaatioita"
    },
    "product_emails": {
      "type": "boolean",
      "description": "Tuotepäivitys- ja vinkkisähköpostit"
    },
    "marketing_emails": {
      "type": "boolean",
      "description": "Markkinointisähköpostit, kuten aloitusvinkit. Niiden ottaminen takaisin käyttöön tilauksen peruutuksen jälkeen vaatii kirjautuneen selaimen"
    },
    "newsletter": {
      "type": "boolean",
      "description": "Kuukausittainen uutiskirje"
    }
  },
  "required": []
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "email": {
      "type": "string"
    },
    "unconfirmed_email": {
      "anyOf": [
        {
          "type": "string",
          "description": "Uusi sähköpostiosoite odottaa vahvistusta"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "theme": {
      "type": "string"
    },
    "default_landing": {
      "type": "string"
    },
    "locale": {
      "type": "string",
      "description": "Tämän tilin sovelluksen kielikoodi (oletuksena en)"
    },
    "timezone": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "shortcuts_enabled": {
      "type": "boolean"
    },
    "reduce_motion": {
      "type": "boolean"
    },
    "product_emails": {
      "type": "boolean"
    },
    "marketing_emails": {
      "type": "boolean",
      "description": "Saako markkinointisähköposteja (tippakampanjat) lähettää. false tilauksen peruutuksen jälkeen"
    },
    "newsletter": {
      "type": "boolean"
    },
    "two_factor": {
      "type": "boolean"
    },
    "passkeys": {
      "type": "integer"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Tuonnit

GET /sites/:site_id/imports/google/properties.json Listaa tuotavat Google Analytics 4 -ominaisuudet imports_google_properties

Oikeus: sites.manage

Esimerkki
curl https://privatusanalytics.com/sites/:site_id/imports/google/properties.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}
POST /sites/:site_id/imports.json Aloita tuonti (GA4-ominaisuus tai CSV-lataus) imports_create

Oikeus: sites.manage

Esimerkki
curl -X POST https://privatusanalytics.com/sites/:site_id/imports.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "source": {
      "type": "string",
      "description": "ga4 (Google Analytics 4 API) tai työkalu, jonka CSV-viennin lataat",
      "enum": [
        "ga4",
        "universal_analytics",
        "fathom",
        "simple_analytics",
        "plausible",
        "matomo",
        "umami",
        "clicky"
      ]
    },
    "property_id": {
      "type": "string",
      "description": "GA4-ominaisuus, esim. properties/123 (katso imports_google_properties). Pakollinen ga4:lle",
      "examples": [
        "properties/123456789"
      ]
    },
    "date_from": {
      "type": "string",
      "format": "date",
      "description": "Ensimmäinen tuotava päivä. Pakollinen ga4:lle. CSV-tiedostoille ilman päiväsaraketta jokainen rivi saa tämän päivän"
    },
    "date_to": {
      "type": "string",
      "format": "date",
      "description": "Viimeinen tuotava päivä (ga4:n oletus on päivä ennen ensimmäistä seurattua tapahtumaasi tai eilinen)"
    },
    "file": {
      "type": "string",
      "format": "binary",
      "description": "CSV-vienti (multipart-lataus, enintään 50 Mt). Pakollinen CSV-lähteille"
    },
    "dimension": {
      "type": "string",
      "description": "Mitä CSV-rivit erittelevät (ohittaa tunnistuksen, tarvitaan Matomon \"Label\"-vienteihin)",
      "enum": [
        "total",
        "page",
        "source",
        "country",
        "device",
        "browser",
        "os"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "source",
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Tuonnin tunniste"
    },
    "site_id": {
      "type": "string"
    },
    "source": {
      "type": "string",
      "description": "ga4, universal_analytics, fathom, simple_analytics, plausible, matomo, umami tai clicky"
    },
    "status": {
      "type": "string",
      "description": "queued, running, complete tai failed"
    },
    "date_from": {
      "anyOf": [
        {
          "type": "string",
          "format": "date",
          "description": "Ensimmäinen tuotu päivä"
        },
        {
          "type": "null"
        }
      ]
    },
    "date_to": {
      "anyOf": [
        {
          "type": "string",
          "format": "date",
          "description": "Viimeinen tuotu päivä"
        },
        {
          "type": "null"
        }
      ]
    },
    "rows_imported": {
      "type": "integer",
      "description": "Tallennetut päiväkohtaiset rivit"
    },
    "error": {
      "anyOf": [
        {
          "type": "string",
          "description": "Miksi tuonti epäonnistui"
        },
        {
          "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 Poista tuonti ja kaikki sen tuodut tiedot imports_delete

Oikeus: sites.manage

Esimerkki
curl -X DELETE https://privatusanalytics.com/sites/:site_id/imports/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Tuonnin tunniste"
    },
    "site_id": {
      "type": "string"
    },
    "source": {
      "type": "string",
      "description": "ga4, universal_analytics, fathom, simple_analytics, plausible, matomo, umami tai clicky"
    },
    "status": {
      "type": "string",
      "description": "queued, running, complete tai failed"
    },
    "date_from": {
      "anyOf": [
        {
          "type": "string",
          "format": "date",
          "description": "Ensimmäinen tuotu päivä"
        },
        {
          "type": "null"
        }
      ]
    },
    "date_to": {
      "anyOf": [
        {
          "type": "string",
          "format": "date",
          "description": "Viimeinen tuotu päivä"
        },
        {
          "type": "null"
        }
      ]
    },
    "rows_imported": {
      "type": "integer",
      "description": "Tallennetut päiväkohtaiset rivit"
    },
    "error": {
      "anyOf": [
        {
          "type": "string",
          "description": "Miksi tuonti epäonnistui"
        },
        {
          "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 Listaa sivuston tuonnit imports_list

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/sites/:site_id/imports.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Vain tämän tilan tuonnit",
      "enum": [
        "queued",
        "running",
        "complete",
        "failed"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Sivu (alkaen 1:stä)"
    },
    "per_page": {
      "type": "integer",
      "description": "Tuloksia sivulla (enintään 100)"
    }
  },
  "required": [
    "site_id"
  ]
}
Vastauksen tiedot
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Tuonnin tunniste"
      },
      "site_id": {
        "type": "string"
      },
      "source": {
        "type": "string",
        "description": "ga4, universal_analytics, fathom, simple_analytics, plausible, matomo, umami tai clicky"
      },
      "status": {
        "type": "string",
        "description": "queued, running, complete tai failed"
      },
      "date_from": {
        "anyOf": [
          {
            "type": "string",
            "format": "date",
            "description": "Ensimmäinen tuotu päivä"
          },
          {
            "type": "null"
          }
        ]
      },
      "date_to": {
        "anyOf": [
          {
            "type": "string",
            "format": "date",
            "description": "Viimeinen tuotu päivä"
          },
          {
            "type": "null"
          }
        ]
      },
      "rows_imported": {
        "type": "integer",
        "description": "Tallennetut päiväkohtaiset rivit"
      },
      "error": {
        "anyOf": [
          {
            "type": "string",
            "description": "Miksi tuonti epäonnistui"
          },
          {
            "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 Hae tuonti ja sen tila imports_get

Oikeus: analytics.read

Esimerkki
curl https://privatusanalytics.com/sites/:site_id/imports/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Sivuston tunniste, esim. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Tuonnin tunniste"
    },
    "site_id": {
      "type": "string"
    },
    "source": {
      "type": "string",
      "description": "ga4, universal_analytics, fathom, simple_analytics, plausible, matomo, umami tai clicky"
    },
    "status": {
      "type": "string",
      "description": "queued, running, complete tai failed"
    },
    "date_from": {
      "anyOf": [
        {
          "type": "string",
          "format": "date",
          "description": "Ensimmäinen tuotu päivä"
        },
        {
          "type": "null"
        }
      ]
    },
    "date_to": {
      "anyOf": [
        {
          "type": "string",
          "format": "date",
          "description": "Viimeinen tuotu päivä"
        },
        {
          "type": "null"
        }
      ]
    },
    "rows_imported": {
      "type": "integer",
      "description": "Tallennetut päiväkohtaiset rivit"
    },
    "error": {
      "anyOf": [
        {
          "type": "string",
          "description": "Miksi tuonti epäonnistui"
        },
        {
          "type": "null"
        }
      ]
    },
    "completed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Työtilat

GET /workspaces/:workspace_id/white_label.json Hae white label -brändi white_label_get

Oikeus: workspace.manage

Esimerkki
curl https://privatusanalytics.com/workspaces/:workspace_id/white_label.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string"
    },
    "brand_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Privatus Analyticsin sijaan näytettävä nimi"
        },
        {
          "type": "null"
        }
      ]
    },
    "brand_logo_url": {
      "anyOf": [
        {
          "type": "string",
          "description": "Logokuvan URL"
        },
        {
          "type": "null"
        }
      ]
    },
    "brand_color": {
      "anyOf": [
        {
          "type": "string",
          "description": "Korostusväri"
        },
        {
          "type": "null"
        }
      ]
    },
    "hide_branding": {
      "type": "boolean",
      "description": "Privatus Analytics -brändäys on piilotettu"
    },
    "available": {
      "type": "boolean",
      "description": "Paketti sisältää white labelin"
    },
    "active": {
      "type": "boolean",
      "description": "Brändi on parhaillaan käytössä"
    }
  }
}
PATCH /workspaces/:workspace_id/white_label.json Aseta white label -brändi jaetuille koontinäkymille ja sähköpostiraporteille (Business) white_label_update

Oikeus: workspace.manage

Esimerkki
curl -X PATCH https://privatusanalytics.com/workspaces/:workspace_id/white_label.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "brand_name": {
      "type": "string",
      "description": "Privatus Analyticsin sijaan näytettävä nimi (tyhjä poistaa sen)"
    },
    "brand_logo_url": {
      "type": "string",
      "description": "Logokuvan https-URL (tyhjä poistaa sen)"
    },
    "brand_color": {
      "type": "string",
      "description": "Korostusväri, esim. #06755b"
    },
    "hide_branding": {
      "type": "boolean",
      "description": "Piilota \"Privatus Analytics\" jaetuilta koontinäkymiltä ja sähköpostiraporteista"
    },
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string"
    },
    "brand_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Privatus Analyticsin sijaan näytettävä nimi"
        },
        {
          "type": "null"
        }
      ]
    },
    "brand_logo_url": {
      "anyOf": [
        {
          "type": "string",
          "description": "Logokuvan URL"
        },
        {
          "type": "null"
        }
      ]
    },
    "brand_color": {
      "anyOf": [
        {
          "type": "string",
          "description": "Korostusväri"
        },
        {
          "type": "null"
        }
      ]
    },
    "hide_branding": {
      "type": "boolean",
      "description": "Privatus Analytics -brändäys on piilotettu"
    },
    "available": {
      "type": "boolean",
      "description": "Paketti sisältää white labelin"
    },
    "active": {
      "type": "boolean",
      "description": "Brändi on parhaillaan käytössä"
    }
  }
}
GET /workspaces/:workspace_id/security.json Hae työtilan tietoturva-asetukset workspace_security_get

Oikeus: workspace.manage

Esimerkki
curl https://privatusanalytics.com/workspaces/:workspace_id/security.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string"
    },
    "enforce_2fa": {
      "type": "boolean",
      "description": "Jäsenten on otettava 2FA käyttöön"
    },
    "login_methods": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Sallitut kirjautumistavat"
    },
    "session_ttl_hours": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Istunnon kesto (null = ei rajaa)"
        },
        {
          "type": "null"
        }
      ]
    },
    "app_ip_allowlist": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Sallitut IP-osoitteet/CIDR-alueet (tyhjä = mistä tahansa)"
    },
    "support_access_until": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Privatus Analytics -tuki voi tarkastella työtilaa asti"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
PATCH /workspaces/:workspace_id/security.json Päivitä työtilan tietoturva-asetukset (2FA, kirjautumistavat, istunnon kesto, IP-sallintalista, tukipääsy) workspace_security_update

Oikeus: workspace.manage

Esimerkki
curl -X PATCH https://privatusanalytics.com/workspaces/:workspace_id/security.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "enforce_2fa": {
      "type": "boolean",
      "description": "Vaadi jäseniä ottamaan 2FA käyttöön"
    },
    "login_methods": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "password",
          "magic_link",
          "passkey",
          "google",
          "github",
          "sso"
        ]
      },
      "description": "Sallitut kirjautumistavat"
    },
    "session_ttl_hours": {
      "type": "integer",
      "description": "Kirjaa jäsenet ulos tämän tuntimäärän jälkeen (0 = ei rajaa)"
    },
    "app_ip_allowlist": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Salli sovelluksen ja API:n käyttö vain näistä IP-osoitteista/CIDR-alueista (Business). Tyhjä = mistä tahansa"
    },
    "support_access": {
      "type": "boolean",
      "description": "Anna Privatus Analytics -tuen tarkastella työtilaa 7 päivän ajan"
    },
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string"
    },
    "enforce_2fa": {
      "type": "boolean",
      "description": "Jäsenten on otettava 2FA käyttöön"
    },
    "login_methods": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Sallitut kirjautumistavat"
    },
    "session_ttl_hours": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Istunnon kesto (null = ei rajaa)"
        },
        {
          "type": "null"
        }
      ]
    },
    "app_ip_allowlist": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Sallitut IP-osoitteet/CIDR-alueet (tyhjä = mistä tahansa)"
    },
    "support_access_until": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Privatus Analytics -tuki voi tarkastella työtilaa asti"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
POST /workspaces.json Luo työtila (sinusta tulee omistaja) workspaces_create

Oikeus: member · Vain HTTP (ei MCP-työkalu)

Esimerkki
curl -X POST https://privatusanalytics.com/workspaces.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Työtilan nimi",
      "examples": [
        "Acme Inc"
      ]
    },
    "timezone": {
      "type": "string",
      "description": "Oletusaikavyöhyke raportointiin (oletuksena käyttäjän)"
    },
    "currency": {
      "type": "string",
      "description": "Oletusvaluutta (ISO 4217)",
      "default": "USD"
    },
    "how_heard": {
      "type": "string",
      "description": "Mistä kuulit meistä"
    }
  },
  "required": [
    "name"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "timezone": {
      "type": "string",
      "description": "Oletusaikavyöhyke raportointiin"
    },
    "currency": {
      "type": "string",
      "description": "Oletusvaluutta"
    },
    "plan": {
      "type": "string",
      "description": "free, pro, business tai enterprise"
    },
    "plan_events": {
      "type": "integer",
      "description": "Pakettiin sisältyvät tapahtumat kuukaudessa"
    },
    "subscription_status": {
      "type": "string"
    },
    "role": {
      "type": "string",
      "description": "Roolisi tässä työtilassa"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /workspaces/:id.json Poista työtila ja kaikki sen sivustot (vain omistaja, peruu tilauksen) workspaces_delete

Oikeus: workspace.manage

Esimerkki
curl -X DELETE https://privatusanalytics.com/workspaces/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "confirm": {
      "type": "string",
      "description": "Vahvista kirjoittamalla työtilan nimi"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "confirm",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "timezone": {
      "type": "string",
      "description": "Oletusaikavyöhyke raportointiin"
    },
    "currency": {
      "type": "string",
      "description": "Oletusvaluutta"
    },
    "plan": {
      "type": "string",
      "description": "free, pro, business tai enterprise"
    },
    "plan_events": {
      "type": "integer",
      "description": "Pakettiin sisältyvät tapahtumat kuukaudessa"
    },
    "subscription_status": {
      "type": "string"
    },
    "role": {
      "type": "string",
      "description": "Roolisi tässä työtilassa"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /workspaces.json Listaa työtilasi workspaces_list

Oikeus: member

Esimerkki
curl https://privatusanalytics.com/workspaces.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "page": {
      "type": "integer",
      "description": "Sivu (alkaen 1:stä)"
    },
    "per_page": {
      "type": "integer",
      "description": "Tuloksia sivulla (enintään 100)"
    }
  },
  "required": []
}
Vastauksen tiedot
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
      },
      "name": {
        "type": "string"
      },
      "timezone": {
        "type": "string",
        "description": "Oletusaikavyöhyke raportointiin"
      },
      "currency": {
        "type": "string",
        "description": "Oletusvaluutta"
      },
      "plan": {
        "type": "string",
        "description": "free, pro, business tai enterprise"
      },
      "plan_events": {
        "type": "integer",
        "description": "Pakettiin sisältyvät tapahtumat kuukaudessa"
      },
      "subscription_status": {
        "type": "string"
      },
      "role": {
        "type": "string",
        "description": "Roolisi tässä työtilassa"
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
GET /workspaces/:id.json Hae työtila workspaces_get

Oikeus: member

Esimerkki
curl https://privatusanalytics.com/workspaces/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "timezone": {
      "type": "string",
      "description": "Oletusaikavyöhyke raportointiin"
    },
    "currency": {
      "type": "string",
      "description": "Oletusvaluutta"
    },
    "plan": {
      "type": "string",
      "description": "free, pro, business tai enterprise"
    },
    "plan_events": {
      "type": "integer",
      "description": "Pakettiin sisältyvät tapahtumat kuukaudessa"
    },
    "subscription_status": {
      "type": "string"
    },
    "role": {
      "type": "string",
      "description": "Roolisi tässä työtilassa"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
PATCH /workspaces/:id.json Päivitä työtilan asetukset workspaces_update

Oikeus: workspace.manage

Esimerkki
curl -X PATCH https://privatusanalytics.com/workspaces/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Työtilan nimi"
    },
    "timezone": {
      "type": "string",
      "description": "Oletusaikavyöhyke raportointiin"
    },
    "currency": {
      "type": "string",
      "description": "Oletusvaluutta (ISO 4217)"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "timezone": {
      "type": "string",
      "description": "Oletusaikavyöhyke raportointiin"
    },
    "currency": {
      "type": "string",
      "description": "Oletusvaluutta"
    },
    "plan": {
      "type": "string",
      "description": "free, pro, business tai enterprise"
    },
    "plan_events": {
      "type": "integer",
      "description": "Pakettiin sisältyvät tapahtumat kuukaudessa"
    },
    "subscription_status": {
      "type": "string"
    },
    "role": {
      "type": "string",
      "description": "Roolisi tässä työtilassa"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Verkkosivusto

GET /changelog.json Listaa muutoslokin merkinnät changelog_list

Julkaistut tuotepäivitykset, uusin ensin. Saatavilla myös RSS-syötteenä osoitteessa /changelog.rss.

Oikeus: public

Esimerkki
curl https://privatusanalytics.com/changelog.json
Syötteet
{
  "type": "object",
  "properties": {
    "area": {
      "type": "string",
      "description": "Vain tämän tuotealueen merkinnät",
      "enum": [
        "product",
        "dashboard",
        "tracker",
        "privacy",
        "api",
        "integrations",
        "billing",
        "docs"
      ]
    },
    "page": {
      "type": "integer",
      "description": "Sivu (alkaen 1:stä)"
    },
    "per_page": {
      "type": "integer",
      "description": "Tuloksia sivulla (enintään 100)"
    }
  },
  "required": []
}
Vastauksen tiedot
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Merkinnän tunniste, esim. chg_7Q2K9XH3AB"
      },
      "title": {
        "type": "string",
        "description": "Otsikko"
      },
      "area": {
        "type": "string",
        "description": "Tuotealue, esim. dashboard, tracker, api"
      },
      "body": {
        "type": "string",
        "description": "Markdown-sisältö"
      },
      "published_at": {
        "type": "string",
        "format": "date-time",
        "description": "Julkaisuaika"
      },
      "url": {
        "type": "string",
        "description": "Pysyvä linkki"
      }
    }
  }
}
GET /changelog/:id.json Hae muutoslokin merkintä changelog_get

Oikeus: public

Esimerkki
curl https://privatusanalytics.com/changelog/:id.json
Syötteet
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Merkinnän tunniste, esim. chg_7Q2K9XH3AB"
    },
    "title": {
      "type": "string",
      "description": "Otsikko"
    },
    "area": {
      "type": "string",
      "description": "Tuotealue, esim. dashboard, tracker, api"
    },
    "body": {
      "type": "string",
      "description": "Markdown-sisältö"
    },
    "published_at": {
      "type": "string",
      "format": "date-time",
      "description": "Julkaisuaika"
    },
    "url": {
      "type": "string",
      "description": "Pysyvä linkki"
    }
  }
}
POST /contact.json Lähetä viesti Privatus Analytics -tiimille contact_create

Selainasiakkaat lähettävät Cloudflare Turnstile -tunnisteen kentässä `cf-turnstile-response`. API-tunnisteella tehtävät pyynnöt eivät tarvitse sitä.

Oikeus: public · Vain HTTP (ei MCP-työkalu)

Esimerkki
curl -X POST https://privatusanalytics.com/contact.json \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nimesi",
      "examples": [
        "Ada Lovelace"
      ]
    },
    "email": {
      "type": "string",
      "description": "Mihin voimme vastata",
      "examples": [
        "[email protected]"
      ]
    },
    "company": {
      "type": "string",
      "description": "Yritys tai organisaatio (valinnainen)"
    },
    "topic": {
      "type": "string",
      "description": "Mistä viesti kertoo",
      "enum": [
        "general",
        "sales",
        "support",
        "privacy",
        "security",
        "partnerships",
        "press"
      ],
      "default": "general"
    },
    "message": {
      "type": "string",
      "description": "Viestisi (10-5 000 merkkiä)"
    },
    "website": {
      "type": "string",
      "description": "Jätä tyhjäksi. Robottien loukku. Täytetyt lähetykset hylätään"
    }
  },
  "required": [
    "name",
    "email",
    "message"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "received": {
      "type": "boolean",
      "description": "Aina true, kun lähetys hyväksyttiin"
    },
    "message": {
      "type": "string",
      "description": "Mitä seuraavaksi tapahtuu"
    }
  }
}
POST /newsletter/confirm.json Vahvista uutiskirjeen tilaus (allekirjoitettu tunniste) newsletter_confirm

Oikeus: public · Vain HTTP (ei MCP-työkalu)

Esimerkki
curl -X POST https://privatusanalytics.com/newsletter/confirm.json \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Vahvistussähköpostin allekirjoitettu tunniste"
    }
  },
  "required": [
    "token"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "received": {
      "type": "boolean",
      "description": "Aina true, kun lähetys hyväksyttiin"
    },
    "message": {
      "type": "string",
      "description": "Mitä seuraavaksi tapahtuu"
    }
  }
}
POST /newsletter.json Tilaa uutiskirje sähköpostiosoitteella newsletter_subscribe

Selainasiakkaat lähettävät Cloudflare Turnstile -tunnisteen kentässä `cf-turnstile-response`. API-tunnisteella tehtävät pyynnöt eivät tarvitse sitä.

Oikeus: public · Vain HTTP (ei MCP-työkalu)

Esimerkki
curl -X POST https://privatusanalytics.com/newsletter.json \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "description": "Tilattava sähköpostiosoite. Vahvistuslinkki lähetetään siihen",
      "examples": [
        "[email protected]"
      ]
    },
    "website": {
      "type": "string",
      "description": "Jätä tyhjäksi. Robottien loukku. Täytetyt lähetykset hylätään"
    }
  },
  "required": [
    "email"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "received": {
      "type": "boolean",
      "description": "Aina true, kun lähetys hyväksyttiin"
    },
    "message": {
      "type": "string",
      "description": "Mitä seuraavaksi tapahtuu"
    }
  }
}
POST /newsletter/unsubscribe.json Peruuta tilaus allekirjoitetulla linkkitunnisteella newsletter_unsubscribe

Oikeus: public · Vain HTTP (ei MCP-työkalu)

Esimerkki
curl -X POST https://privatusanalytics.com/newsletter/unsubscribe.json \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Tilauksen peruutuslinkin allekirjoitettu tunniste"
    },
    "list": {
      "type": "string",
      "description": "newsletter (oletus: lista, jota linkki koski) tai marketing (kaikki markkinointisähköpostit)",
      "enum": [
        "newsletter",
        "marketing"
      ]
    }
  },
  "required": [
    "token"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "received": {
      "type": "boolean",
      "description": "Aina true, kun lähetys hyväksyttiin"
    },
    "message": {
      "type": "string",
      "description": "Mitä seuraavaksi tapahtuu"
    }
  }
}
GET /pricing.json Hae paketit, hinnat ja pakettien rajat pricing_get

Samat tiedot kuin hinnoittelusivulla: tapahtumaportaat, jokainen pakettiraja ja se, mikä lasketaan tapahtumaksi. Anna events saadaksesi vastaavan tason.

Oikeus: public

Esimerkki
curl https://privatusanalytics.com/pricing.json
Syötteet
{
  "type": "object",
  "properties": {
    "events": {
      "type": "integer",
      "description": "Odotetut sivunäytöt ja omat tapahtumat kuukaudessa. Palauttaa vastaavan tason kenttänä `recommendation`",
      "examples": [
        750000
      ]
    },
    "interval": {
      "type": "string",
      "description": "Näytettävien hintojen laskutusjakso: month tai year (10-kertainen kuukausihinta)",
      "enum": [
        "month",
        "year"
      ],
      "default": "month"
    }
  },
  "required": []
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "currency": {
      "type": "string",
      "description": "Kaikkien hintojen valuutta (USD)"
    },
    "tax_included": {
      "type": "boolean",
      "description": "Aina true. Hinnat sisältävät arvonlisäveron tai myyntiveron, joten näytetty hinta on maksettava hinta"
    },
    "interval": {
      "type": "string",
      "description": "month tai year. Hinnat koskevat tätä jaksoa"
    },
    "annual_multiplier": {
      "type": "integer",
      "description": "Vuosihinta = kuukausihinta x tämä (kaksi kuukautta ilmaiseksi)"
    },
    "free_events": {
      "type": "integer",
      "description": "Ilmaiseen pakettiin sisältyvät tapahtumat kuukaudessa"
    },
    "badge_bonus": {
      "type": "integer",
      "description": "Ilmaiset lisätapahtumat kuukaudessa, kun valinnainen merkki näytetään"
    },
    "tiers": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Tapahtumaportaat: { events, pro, business } jakson hinnat (pro on null, kun tarjolla on vain Business), sekä kuukausihinnat"
    },
    "plans": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Paketit muodossa { id, name, from_price, limits }. Null-rajat tarkoittavat rajatonta"
    },
    "counted": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Mikä lasketaan laskutettavaksi tapahtumaksi"
    },
    "not_counted": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Mikä ei koskaan kuluta käyttökiintiötä"
    },
    "recommendation": {
      "anyOf": [
        {
          "type": "object",
          "description": "{ events, plan, tier_events, price } `events`-syötteelle tai null, kun määrää ei annettu"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
GET /status.json Hae järjestelmän nykyinen tila status_get

Tietokannan, Redisin ja taustatöiden kunto, tarkistetaan enintään 15 sekunnin välein.

Oikeus: public

Esimerkki
curl https://privatusanalytics.com/status.json
Syötteet
{
  "type": "object",
  "properties": {
    "fresh": {
      "type": "boolean",
      "description": "Ohita 15 sekunnin välimuisti ja tarkista uudelleen nyt",
      "default": false
    }
  },
  "required": []
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Kokonaistila: operational, degraded tai outage"
    },
    "checked_at": {
      "type": "string",
      "format": "date-time",
      "description": "Milloin tarkistukset ajettiin (välimuistissa enintään 15 s)"
    },
    "components": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Komponenttia kohden: { id, name, status, detail, latency_ms }, sekä queue_latency_s ja queue_depth jonoille"
    }
  }
}
GET /tools/header-checker.json Tarkista sivun Referrer-Policy ja CSP analytiikkaa varten tools_header_check

Oikeus: public

Esimerkki
curl https://privatusanalytics.com/tools/header-checker.json
Syötteet
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Tarkistettava julkinen sivu (http tai https)",
      "examples": [
        "https://example.com"
      ]
    }
  },
  "required": [
    "url"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Lopullinen URL uudelleenohjausten jälkeen"
    },
    "status": {
      "type": "integer",
      "description": "Lopullisen vastauksen HTTP-tila"
    },
    "findings": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Tarkistukset: { check, value, level (ok, warn, info), note }"
    }
  }
}
GET /tools/privacy-policy-generator.json Luonnostele tietosuojakäytännön kappale Privatus Analyticsille tools_privacy_policy

Oikeus: public

Esimerkki
curl https://privatusanalytics.com/tools/privacy-policy-generator.json
Syötteet
{
  "type": "object",
  "properties": {
    "site_name": {
      "type": "string",
      "description": "Verkkosivustosi tai yrityksesi nimi",
      "examples": [
        "Example Books"
      ]
    },
    "contact_email": {
      "type": "string",
      "description": "Mainittava tietosuojayhteyshenkilö (valinnainen)"
    },
    "honors_gpc": {
      "type": "boolean",
      "description": "Noudatetaanko Do Not Track- ja Global Privacy Control -asetuksia (oletus)",
      "default": true
    }
  },
  "required": [
    "site_name"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "site_name": {
      "type": "string",
      "description": "Syöte: sivuston tai yrityksen nimi"
    },
    "paragraphs": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Käytännön teksti, yksi kappale per kohta"
    },
    "text": {
      "type": "string",
      "description": "Kappaleet yhdistettynä tyhjillä riveillä"
    }
  }
}
GET /tools/qr-code.json Luo QR-koodi SVG-muodossa tools_qr_code

Oikeus: public

Esimerkki
curl https://privatusanalytics.com/tools/qr-code.json
Syötteet
{
  "type": "object",
  "properties": {
    "text": {
      "type": "string",
      "description": "Koodattava URL tai teksti (enintään 1 000 merkkiä)",
      "examples": [
        "https://example.com/?utm_source=poster"
      ]
    },
    "level": {
      "type": "string",
      "description": "Virheenkorjaus: l (7 %), m (15 %), q (25 %), h (30 %)",
      "enum": [
        "l",
        "m",
        "q",
        "h"
      ],
      "default": "m"
    }
  },
  "required": [
    "text"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "text": {
      "type": "string",
      "description": "Koodattu teksti"
    },
    "level": {
      "type": "string",
      "description": "Virheenkorjaustaso"
    },
    "size": {
      "type": "integer",
      "description": "Moduuleja sivua kohden"
    },
    "svg": {
      "type": "string",
      "description": "Itsenäinen SVG-dokumentti"
    }
  }
}
GET /tools/tracker-scanner.json Listaa sivun evästeet ja tunnetut seurantatyökalut tools_tracker_scan

Oikeus: public

Esimerkki
curl https://privatusanalytics.com/tools/tracker-scanner.json
Syötteet
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Skannattava julkinen sivu (http tai https)",
      "examples": [
        "https://example.com"
      ]
    }
  },
  "required": [
    "url"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Lopullinen URL uudelleenohjausten jälkeen"
    },
    "status": {
      "type": "integer",
      "description": "Lopullisen vastauksen HTTP-tila"
    },
    "truncated": {
      "type": "boolean",
      "description": "True, kun sivu oli yli 1 Mt ja vain ensimmäinen 1 Mt skannattiin"
    },
    "cookies": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "HTTP-vastauksen asettamat evästeet: { name, domain, path, expires, secure, http_only, same_site }. Arvoja ei koskaan palauteta"
    },
    "trackers": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Sivun viittaamat tunnetut työkalut: { name, category, match, evidence }"
    },
    "third_party_hosts": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Muut verkkotunnukset, joista sivu lataa resursseja"
    }
  }
}
GET /tools/utm-builder.json Rakenna kampanja-URL UTM-parametreilla tools_utm_builder

Oikeus: public

Esimerkki
curl https://privatusanalytics.com/tools/utm-builder.json
Syötteet
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Laskeutumissivun URL",
      "examples": [
        "https://example.com/pricing"
      ]
    },
    "source": {
      "type": "string",
      "description": "utm_source: mistä liikenne tulee",
      "examples": [
        "newsletter"
      ]
    },
    "medium": {
      "type": "string",
      "description": "utm_medium: kanava, esim. email, cpc, social",
      "examples": [
        "email"
      ]
    },
    "campaign": {
      "type": "string",
      "description": "utm_campaign: kampanjan nimi",
      "examples": [
        "fall_launch"
      ]
    },
    "term": {
      "type": "string",
      "description": "utm_term: maksetun haun avainsana (valinnainen)"
    },
    "content": {
      "type": "string",
      "description": "utm_content: mikä linkki tai mainos (valinnainen)"
    }
  },
  "required": [
    "url",
    "source",
    "medium",
    "campaign"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Laskeutumissivun URL UTM-parametreineen"
    },
    "params": {
      "type": "object",
      "description": "Lisätyt UTM-parametrit"
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Korjaamisen arvoiset ongelmat (kirjainkoko, välilyönnit, henkilötiedot)"
    }
  }
}
POST /waitlist.json Liity odotuslistalle (EU-palvelinsijainti) waitlist_join

Selainasiakkaat lähettävät Cloudflare Turnstile -tunnisteen kentässä `cf-turnstile-response`. API-tunnisteella tehtävät pyynnöt eivät tarvitse sitä.

Oikeus: public · Vain HTTP (ei MCP-työkalu)

Esimerkki
curl -X POST https://privatusanalytics.com/waitlist.json \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "description": "Ilmoitettava sähköpostiosoite",
      "examples": [
        "[email protected]"
      ]
    },
    "list": {
      "type": "string",
      "description": "Mille odotuslistalle liitytään",
      "enum": [
        "eu_hosting"
      ],
      "default": "eu_hosting"
    },
    "website": {
      "type": "string",
      "description": "Jätä tyhjäksi. Robottien loukku. Täytetyt lähetykset hylätään"
    }
  },
  "required": [
    "email"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "received": {
      "type": "boolean",
      "description": "Aina true, kun lähetys hyväksyttiin"
    },
    "message": {
      "type": "string",
      "description": "Mitä seuraavaksi tapahtuu"
    }
  }
}

Viennit

POST /workspaces/:workspace_id/exports.json Lisää vienti jonoon (luodaan taustalla) exports_create

Oikeus: analytics.export

Esimerkki
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/exports.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Vietävä sivusto (pa_…)",
      "examples": [
        "pa_7Q2K9XH3AB"
      ]
    },
    "kind": {
      "type": "string",
      "description": "aggregated: mittarit aikavälin ja dimensioiden mukaan. pageviews/events/raw: yksi rivi kutsua kohden (Pro ja ylemmät). imported: tuodut päivätilastot. dashboard: yleiskatsauspaneelien ZIP",
      "enum": [
        "aggregated",
        "pageviews",
        "events",
        "imported",
        "raw",
        "dashboard"
      ],
      "default": "aggregated"
    },
    "file_format": {
      "type": "string",
      "description": "csv, json tai xlsx (aggregated, pageviews, events, imported), csv tai ndjson (raw), zip (dashboard)",
      "enum": [
        "csv",
        "json",
        "xlsx",
        "ndjson",
        "zip"
      ],
      "default": "csv"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Ensimmäinen päivä, viennin aikavyöhykkeessä",
      "examples": [
        "2026-09-01"
      ]
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Viimeinen päivä, mukaan lukien (enintään 400 päivää, raw 93 päivää)",
      "examples": [
        "2026-09-28"
      ]
    },
    "timezone": {
      "type": "string",
      "description": "Päivämäärien ja ryhmittelyn aikavyöhyke, esim. America/New_York (oletus: sivuston aikavyöhyke)"
    },
    "grouping": {
      "type": "string",
      "description": "Koostettujen vientien aikaväli",
      "enum": [
        "hour",
        "day",
        "week",
        "month",
        "quarter",
        "year"
      ],
      "default": "day"
    },
    "dimensions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Käyntidimensiot, joilla koostetut viennit ryhmitellään (enintään 6), esim. country, channel, entry_page. Tuoduille vienneille: mukaan otettavat tuodut dimensiot",
      "default": []
    },
    "metrics": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Koostettujen vientien mittarit (oletus kaikki): visitors, visits, pageviews, bounce_rate, visit_duration, views_per_visit, revenue",
      "default": []
    },
    "fields": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Sarakkeet pageviews/events/raw-vienteihin (oletuksena kaikki paitsi 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": "Suodattimet, sama muoto kuin tilasto-API:ssa: [[\"dimension\",\"operator\",\"value\"], …]",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Ota käyttöön tallennettu segmentti (seg_…)"
    },
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id",
    "from",
    "to",
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Viennin tunniste, esim. exp_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Viety sivusto (pa_…)"
        },
        {
          "type": "null"
        }
      ]
    },
    "kind": {
      "type": "string",
      "description": "aggregated, pageviews, events, imported, raw tai dashboard"
    },
    "format": {
      "type": "string",
      "description": "csv, json, xlsx, ndjson tai zip"
    },
    "status": {
      "type": "string",
      "description": "queued, running, complete, failed tai expired"
    },
    "params": {
      "type": "object",
      "description": "Viennin määritys (päivät, aikavyöhyke, ryhmittely, dimensiot, mittarit, kentät, suodattimet)"
    },
    "row_count": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Kirjoitetut rivit"
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "anyOf": [
        {
          "type": "string",
          "description": "Miksi vienti epäonnistui"
        },
        {
          "type": "null"
        }
      ]
    },
    "completed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Milloin tiedosto poistetaan"
        },
        {
          "type": "null"
        }
      ]
    },
    "download_url": {
      "anyOf": [
        {
          "type": "string",
          "description": "Polku, joka palauttaa lyhytikäisen allekirjoitetun tiedostolinkin (exports_download)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /exports/:id.json Poista vienti ja sen tiedosto exports_delete

Oikeus: analytics.export

Esimerkki
curl -X DELETE https://privatusanalytics.com/exports/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Viennin tunniste, esim. exp_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Viety sivusto (pa_…)"
        },
        {
          "type": "null"
        }
      ]
    },
    "kind": {
      "type": "string",
      "description": "aggregated, pageviews, events, imported, raw tai dashboard"
    },
    "format": {
      "type": "string",
      "description": "csv, json, xlsx, ndjson tai zip"
    },
    "status": {
      "type": "string",
      "description": "queued, running, complete, failed tai expired"
    },
    "params": {
      "type": "object",
      "description": "Viennin määritys (päivät, aikavyöhyke, ryhmittely, dimensiot, mittarit, kentät, suodattimet)"
    },
    "row_count": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Kirjoitetut rivit"
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "anyOf": [
        {
          "type": "string",
          "description": "Miksi vienti epäonnistui"
        },
        {
          "type": "null"
        }
      ]
    },
    "completed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Milloin tiedosto poistetaan"
        },
        {
          "type": "null"
        }
      ]
    },
    "download_url": {
      "anyOf": [
        {
          "type": "string",
          "description": "Polku, joka palauttaa lyhytikäisen allekirjoitetun tiedostolinkin (exports_download)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /exports/:id/download.json Hae allekirjoitettu linkki tiedostoon (voimassa 10 minuuttia) exports_download

Oikeus: analytics.export

Esimerkki
curl https://privatusanalytics.com/exports/:id/download.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}
GET /workspaces/:workspace_id/exports.json Listaa viennit (työjono) exports_list

Oikeus: analytics.export

Esimerkki
curl https://privatusanalytics.com/workspaces/:workspace_id/exports.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Vain tämän sivuston viennit (pa_…)"
    },
    "status": {
      "type": "string",
      "description": "Vain tämän tilan viennit",
      "enum": [
        "queued",
        "running",
        "complete",
        "failed",
        "expired"
      ]
    },
    "kind": {
      "type": "string",
      "description": "Vain tämän lajin viennit",
      "enum": [
        "aggregated",
        "pageviews",
        "events",
        "imported",
        "raw",
        "dashboard"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Sivu (alkaen 1:stä)"
    },
    "per_page": {
      "type": "integer",
      "description": "Tuloksia sivulla (enintään 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Viennin tunniste, esim. exp_7Q2K9XH3AB"
      },
      "site_id": {
        "anyOf": [
          {
            "type": "string",
            "description": "Viety sivusto (pa_…)"
          },
          {
            "type": "null"
          }
        ]
      },
      "kind": {
        "type": "string",
        "description": "aggregated, pageviews, events, imported, raw tai dashboard"
      },
      "format": {
        "type": "string",
        "description": "csv, json, xlsx, ndjson tai zip"
      },
      "status": {
        "type": "string",
        "description": "queued, running, complete, failed tai expired"
      },
      "params": {
        "type": "object",
        "description": "Viennin määritys (päivät, aikavyöhyke, ryhmittely, dimensiot, mittarit, kentät, suodattimet)"
      },
      "row_count": {
        "anyOf": [
          {
            "type": "integer",
            "description": "Kirjoitetut rivit"
          },
          {
            "type": "null"
          }
        ]
      },
      "error": {
        "anyOf": [
          {
            "type": "string",
            "description": "Miksi vienti epäonnistui"
          },
          {
            "type": "null"
          }
        ]
      },
      "completed_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "expires_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time",
            "description": "Milloin tiedosto poistetaan"
          },
          {
            "type": "null"
          }
        ]
      },
      "download_url": {
        "anyOf": [
          {
            "type": "string",
            "description": "Polku, joka palauttaa lyhytikäisen allekirjoitetun tiedostolinkin (exports_download)"
          },
          {
            "type": "null"
          }
        ]
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
POST /workspaces/:workspace_id/exports/preview.json Esikatsele vientiä: 20 ensimmäistä riviä ja arvioitu rivimäärä exports_preview

Oikeus: analytics.export

Esimerkki
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/exports/preview.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Vietävä sivusto (pa_…)",
      "examples": [
        "pa_7Q2K9XH3AB"
      ]
    },
    "kind": {
      "type": "string",
      "description": "aggregated: mittarit aikavälin ja dimensioiden mukaan. pageviews/events/raw: yksi rivi kutsua kohden (Pro ja ylemmät). imported: tuodut päivätilastot. dashboard: yleiskatsauspaneelien ZIP",
      "enum": [
        "aggregated",
        "pageviews",
        "events",
        "imported",
        "raw",
        "dashboard"
      ],
      "default": "aggregated"
    },
    "file_format": {
      "type": "string",
      "description": "csv, json tai xlsx (aggregated, pageviews, events, imported), csv tai ndjson (raw), zip (dashboard)",
      "enum": [
        "csv",
        "json",
        "xlsx",
        "ndjson",
        "zip"
      ],
      "default": "csv"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Ensimmäinen päivä, viennin aikavyöhykkeessä",
      "examples": [
        "2026-09-01"
      ]
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Viimeinen päivä, mukaan lukien (enintään 400 päivää, raw 93 päivää)",
      "examples": [
        "2026-09-28"
      ]
    },
    "timezone": {
      "type": "string",
      "description": "Päivämäärien ja ryhmittelyn aikavyöhyke, esim. America/New_York (oletus: sivuston aikavyöhyke)"
    },
    "grouping": {
      "type": "string",
      "description": "Koostettujen vientien aikaväli",
      "enum": [
        "hour",
        "day",
        "week",
        "month",
        "quarter",
        "year"
      ],
      "default": "day"
    },
    "dimensions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Käyntidimensiot, joilla koostetut viennit ryhmitellään (enintään 6), esim. country, channel, entry_page. Tuoduille vienneille: mukaan otettavat tuodut dimensiot",
      "default": []
    },
    "metrics": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Koostettujen vientien mittarit (oletus kaikki): visitors, visits, pageviews, bounce_rate, visit_duration, views_per_visit, revenue",
      "default": []
    },
    "fields": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Sarakkeet pageviews/events/raw-vienteihin (oletuksena kaikki paitsi 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": "Suodattimet, sama muoto kuin tilasto-API:ssa: [[\"dimension\",\"operator\",\"value\"], …]",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Ota käyttöön tallennettu segmentti (seg_…)"
    },
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id",
    "from",
    "to",
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "object"
}
GET /exports/:id.json Hae vienti ja sen tila exports_get

Oikeus: analytics.export

Esimerkki
curl https://privatusanalytics.com/exports/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Viennin tunniste, esim. exp_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Viety sivusto (pa_…)"
        },
        {
          "type": "null"
        }
      ]
    },
    "kind": {
      "type": "string",
      "description": "aggregated, pageviews, events, imported, raw tai dashboard"
    },
    "format": {
      "type": "string",
      "description": "csv, json, xlsx, ndjson tai zip"
    },
    "status": {
      "type": "string",
      "description": "queued, running, complete, failed tai expired"
    },
    "params": {
      "type": "object",
      "description": "Viennin määritys (päivät, aikavyöhyke, ryhmittely, dimensiot, mittarit, kentät, suodattimet)"
    },
    "row_count": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Kirjoitetut rivit"
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "anyOf": [
        {
          "type": "string",
          "description": "Miksi vienti epäonnistui"
        },
        {
          "type": "null"
        }
      ]
    },
    "completed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Milloin tiedosto poistetaan"
        },
        {
          "type": "null"
        }
      ]
    },
    "download_url": {
      "anyOf": [
        {
          "type": "string",
          "description": "Polku, joka palauttaa lyhytikäisen allekirjoitetun tiedostolinkin (exports_download)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Webhookit

GET /workspaces/:workspace_id/webhooks/:webhook_id/deliveries.json Listaa webhookin toimitukset webhook_deliveries_list

Oikeus: workspace.manage

Esimerkki
curl https://privatusanalytics.com/workspaces/:workspace_id/webhooks/:webhook_id/deliveries.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Vain onnistuneet tai epäonnistuneet toimitukset",
      "enum": [
        "succeeded",
        "failed"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    },
    "webhook_id": {
      "type": "string",
      "description": "Resurssin Webhook"
    },
    "page": {
      "type": "integer",
      "description": "Sivu (alkaen 1:stä)"
    },
    "per_page": {
      "type": "integer",
      "description": "Tuloksia sivulla (enintään 100)"
    }
  },
  "required": [
    "workspace_id",
    "webhook_id"
  ]
}
Vastauksen tiedot
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Toimituksen tunniste, esim. whd_123"
      },
      "event": {
        "type": "string"
      },
      "status": {
        "type": "string",
        "description": "pending, succeeded tai failed"
      },
      "status_code": {
        "anyOf": [
          {
            "type": "integer",
            "description": "Viimeisen yrityksen HTTP-tila"
          },
          {
            "type": "null"
          }
        ]
      },
      "error": {
        "anyOf": [
          {
            "type": "string",
            "description": "Viimeisen yrityksen yhteysvirhe"
          },
          {
            "type": "null"
          }
        ]
      },
      "attempt": {
        "type": "integer"
      },
      "duration_ms": {
        "anyOf": [
          {
            "type": "integer"
          },
          {
            "type": "null"
          }
        ]
      },
      "payload": {
        "type": "object"
      },
      "response_body": {
        "anyOf": [
          {
            "type": "string",
            "description": "Ensimmäiset 2 000 merkkiä"
          },
          {
            "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 Lähetä toimitus uudelleen webhook_deliveries_redeliver

Oikeus: workspace.manage

Esimerkki
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 '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    },
    "webhook_id": {
      "type": "string",
      "description": "Resurssin Webhook"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "workspace_id",
    "webhook_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Toimituksen tunniste, esim. whd_123"
    },
    "event": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "description": "pending, succeeded tai failed"
    },
    "status_code": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Viimeisen yrityksen HTTP-tila"
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "anyOf": [
        {
          "type": "string",
          "description": "Viimeisen yrityksen yhteysvirhe"
        },
        {
          "type": "null"
        }
      ]
    },
    "attempt": {
      "type": "integer"
    },
    "duration_ms": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "payload": {
      "type": "object"
    },
    "response_body": {
      "anyOf": [
        {
          "type": "string",
          "description": "Ensimmäiset 2 000 merkkiä"
        },
        {
          "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 Lisää webhook-päätepiste webhooks_create

Oikeus: workspace.manage

Esimerkki
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/webhooks.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "HTTPS-päätepiste, joka vastaanottaa POST-lähetetyn JSONin",
      "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": "Lähetettävät tapahtumat"
    },
    "enabled": {
      "type": "boolean",
      "description": "Lähetä toimitukset",
      "default": true
    },
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "url",
    "events",
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Webhookin tunniste, esim. wh_7Q2K9XH3AB"
    },
    "url": {
      "type": "string"
    },
    "events": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "enabled": {
      "type": "boolean"
    },
    "status": {
      "type": "string",
      "description": "active, failing tai disabled"
    },
    "secret": {
      "type": "string",
      "description": "Privatus-Signature-otsakkeen allekirjoitussalaisuus"
    },
    "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 Poista webhook webhooks_delete

Oikeus: workspace.manage

Esimerkki
curl -X DELETE https://privatusanalytics.com/workspaces/:workspace_id/webhooks/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Webhookin tunniste, esim. wh_7Q2K9XH3AB"
    },
    "url": {
      "type": "string"
    },
    "events": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "enabled": {
      "type": "boolean"
    },
    "status": {
      "type": "string",
      "description": "active, failing tai disabled"
    },
    "secret": {
      "type": "string",
      "description": "Privatus-Signature-otsakkeen allekirjoitussalaisuus"
    },
    "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 Listaa webhookit webhooks_list

Oikeus: workspace.manage

Esimerkki
curl https://privatusanalytics.com/workspaces/:workspace_id/webhooks.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Sivu (alkaen 1:stä)"
    },
    "per_page": {
      "type": "integer",
      "description": "Tuloksia sivulla (enintään 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Vastauksen tiedot
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Webhookin tunniste, esim. wh_7Q2K9XH3AB"
      },
      "url": {
        "type": "string"
      },
      "events": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "enabled": {
        "type": "boolean"
      },
      "status": {
        "type": "string",
        "description": "active, failing tai disabled"
      },
      "secret": {
        "type": "string",
        "description": "Privatus-Signature-otsakkeen allekirjoitussalaisuus"
      },
      "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 Hae webhook webhooks_get

Oikeus: workspace.manage

Esimerkki
curl https://privatusanalytics.com/workspaces/:workspace_id/webhooks/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Syötteet
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Webhookin tunniste, esim. wh_7Q2K9XH3AB"
    },
    "url": {
      "type": "string"
    },
    "events": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "enabled": {
      "type": "boolean"
    },
    "status": {
      "type": "string",
      "description": "active, failing tai disabled"
    },
    "secret": {
      "type": "string",
      "description": "Privatus-Signature-otsakkeen allekirjoitussalaisuus"
    },
    "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 Lähetä testitoimitus webhooks_test

Oikeus: workspace.manage

Esimerkki
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/webhooks/:id/test.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Toimituksen tunniste, esim. whd_123"
    },
    "event": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "description": "pending, succeeded tai failed"
    },
    "status_code": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Viimeisen yrityksen HTTP-tila"
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "anyOf": [
        {
          "type": "string",
          "description": "Viimeisen yrityksen yhteysvirhe"
        },
        {
          "type": "null"
        }
      ]
    },
    "attempt": {
      "type": "integer"
    },
    "duration_ms": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "payload": {
      "type": "object"
    },
    "response_body": {
      "anyOf": [
        {
          "type": "string",
          "description": "Ensimmäiset 2 000 merkkiä"
        },
        {
          "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 Päivitä webhook (tapahtumat, URL, käytössä, vaihda salaisuus) webhooks_update

Oikeus: workspace.manage

Esimerkki
curl -X PATCH https://privatusanalytics.com/workspaces/:workspace_id/webhooks/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Syötteet
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "HTTPS-päätepiste"
    },
    "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": "Lähetettävät tapahtumat"
    },
    "enabled": {
      "type": "boolean",
      "description": "Lähetä toimitukset"
    },
    "rotate_secret": {
      "type": "boolean",
      "description": "Korvaa allekirjoitussalaisuus",
      "default": false
    },
    "workspace_id": {
      "type": "string",
      "description": "Työtilan tunniste, esim. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Resurssin Id"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Vastauksen tiedot
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Webhookin tunniste, esim. wh_7Q2K9XH3AB"
    },
    "url": {
      "type": "string"
    },
    "events": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "enabled": {
      "type": "boolean"
    },
    "status": {
      "type": "string",
      "description": "active, failing tai disabled"
    },
    "secret": {
      "type": "string",
      "description": "Privatus-Signature-otsakkeen allekirjoitussalaisuus"
    },
    "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"
    }
  }
}