Dok.
Bla i dokumentasjonen

Analytics REST API

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

Vis som Markdown

Every page and action in Privatus 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.

Alle operasjoner

Autentisering

Send Authorization: Bearer pat_…. Opprett tokener under Arbeidsområdeinnstillinger, API-tokener. Autentiseringsguide.

JSON overalt

Legg til .json på en hvilken som helst sti. Svar er { "data": … } og feil er { "error": { "code", "message" } }. Feil.

MCP

Send JSON-RPC med POST til https://privatusanalytics.com/mcp med det samme tokenet. Hver operasjon nedenfor er et verktøy. MCP-guide.

Last ned openapi.json · 279 operasjoner

API-tokener

POST /workspaces/:workspace_id/api_tokens.json Opprett et API-token (tokenet vises bare én gang) api_tokens_create

Tillatelse: member

Eksempel
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/api_tokens.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Et navn som gjør at du kjenner igjen tokenet",
      "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": "Tillatelser (utelat for alle dine egne, en tom liste avvises)"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Begrens til disse nettsted-ID-ene (pa_…). Tom = alle",
      "default": []
    },
    "expires_at": {
      "type": "string",
      "format": "date-time",
      "description": "Utløpstidspunkt (ISO 8601). Tom = aldri"
    },
    "allowed_ips": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Godta bare forespørsler fra disse IP-ene/CIDR-områdene",
      "default": []
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "name": {
      "type": "string"
    },
    "token": {
      "anyOf": [
        {
          "type": "string",
          "description": "Selve tokenet: returneres bare når det opprettes"
        },
        {
          "type": "null"
        }
      ]
    },
    "token_prefix": {
      "type": "string",
      "description": "De første tegnene, for å kjenne igjen tokenet"
    },
    "owner": {
      "type": "string",
      "description": "E-postadressen til medlemmet som eier det"
    },
    "permissions": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Begrenset til disse nettstedene (tom = alle)"
    },
    "allowed_ips": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "oauth_client": {
      "anyOf": [
        {
          "type": "string",
          "description": "MCP-klient som mottok det"
        },
        {
          "type": "null"
        }
      ]
    },
    "status": {
      "type": "string",
      "description": "active, expired eller 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 Tilbakekall et API-token api_tokens_delete

Tillatelse: member

Eksempel
curl -X DELETE https://privatusanalytics.com/workspaces/:workspace_id/api_tokens/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "name": {
      "type": "string"
    },
    "token": {
      "anyOf": [
        {
          "type": "string",
          "description": "Selve tokenet: returneres bare når det opprettes"
        },
        {
          "type": "null"
        }
      ]
    },
    "token_prefix": {
      "type": "string",
      "description": "De første tegnene, for å kjenne igjen tokenet"
    },
    "owner": {
      "type": "string",
      "description": "E-postadressen til medlemmet som eier det"
    },
    "permissions": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Begrenset til disse nettstedene (tom = alle)"
    },
    "allowed_ips": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "oauth_client": {
      "anyOf": [
        {
          "type": "string",
          "description": "MCP-klient som mottok det"
        },
        {
          "type": "null"
        }
      ]
    },
    "status": {
      "type": "string",
      "description": "active, expired eller 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 List API-tokener api_tokens_list

Tillatelse: member

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/api_tokens.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "include_revoked": {
      "type": "boolean",
      "description": "List også tilbakekalte og utløpte tokener",
      "default": false
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater per side (maks 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "format": "uuid"
      },
      "name": {
        "type": "string"
      },
      "token": {
        "anyOf": [
          {
            "type": "string",
            "description": "Selve tokenet: returneres bare når det opprettes"
          },
          {
            "type": "null"
          }
        ]
      },
      "token_prefix": {
        "type": "string",
        "description": "De første tegnene, for å kjenne igjen tokenet"
      },
      "owner": {
        "type": "string",
        "description": "E-postadressen til medlemmet som eier det"
      },
      "permissions": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "site_ids": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Begrenset til disse nettstedene (tom = alle)"
      },
      "allowed_ips": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "oauth_client": {
        "anyOf": [
          {
            "type": "string",
            "description": "MCP-klient som mottok det"
          },
          {
            "type": "null"
          }
        ]
      },
      "status": {
        "type": "string",
        "description": "active, expired eller 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"
      }
    }
  }
}

Affiliateprogram

GET /account/affiliate/commissions.json List opp affiliateprovisjonene dine affiliate_commissions_list

Provisjoner, tilbakeføringer etter refusjon eller chargeback og reverseringer, nyeste først. Beløp er i cent.

Tillatelse: member

Eksempel
curl https://privatusanalytics.com/account/affiliate/commissions.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Bare provisjoner med denne statusen",
      "enum": [
        "pending",
        "approved",
        "paid",
        "void"
      ]
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater per side (maks 100)"
    }
  },
  "required": []
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "format": "uuid",
        "description": "Provisjons-ID"
      },
      "kind": {
        "type": "string",
        "description": "commission, clawback (refusjon eller chargeback) eller reversal"
      },
      "status": {
        "type": "string",
        "description": "pending (på vent), approved (kan utbetales), paid eller void"
      },
      "amount_cents": {
        "type": "integer",
        "description": "Din andel i cent (negativ ved en tilbakeføring)"
      },
      "basis_cents": {
        "type": "integer",
        "description": "Nettobetalingen (uten avgifter) den ble beregnet fra, i cent"
      },
      "currency": {
        "type": "string",
        "description": "ISO-valutakode"
      },
      "earned_at": {
        "type": "string",
        "format": "date-time",
        "description": "Når betalingen (eller refusjonen) skjedde"
      },
      "approved_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time",
            "description": "Når den kunne utbetales"
          },
          {
            "type": "null"
          }
        ]
      },
      "paid_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time",
            "description": "Når den ble utbetalt"
          },
          {
            "type": "null"
          }
        ]
      }
    }
  }
}
GET /account/affiliate.json Hent affiliatestatusen din, henvisningslenken og statistikk affiliate_get

Statusen for affiliatesøknaden din, henvisningslenken, registreringer og betalende kunder du har henvist, og saldo per valuta (på vent, kan utbetales, utbetalt). status er none når du ikke har søkt.

Tillatelse: member

Eksempel
curl https://privatusanalytics.com/account/affiliate.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {},
  "required": []
}
Svardata
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "none (ikke søkt), pending, approved, rejected eller suspended"
    },
    "code": {
      "anyOf": [
        {
          "type": "string",
          "description": "Henvisningskoden din"
        },
        {
          "type": "null"
        }
      ]
    },
    "referral_url": {
      "anyOf": [
        {
          "type": "string",
          "description": "Lenken du deler (bare godkjente affiliates)"
        },
        {
          "type": "null"
        }
      ]
    },
    "payout_method": {
      "anyOf": [
        {
          "type": "string",
          "description": "wise eller credit"
        },
        {
          "type": "null"
        }
      ]
    },
    "rejection_reason": {
      "anyOf": [
        {
          "type": "string",
          "description": "Hvorfor den siste søknaden ble avslått"
        },
        {
          "type": "null"
        }
      ]
    },
    "applied_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Når du søkte"
        },
        {
          "type": "null"
        }
      ]
    },
    "approved_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Når søknaden ble godkjent"
        },
        {
          "type": "null"
        }
      ]
    },
    "credit_blocked": {
      "anyOf": [
        {
          "type": "string",
          "description": "Hvorfor kontokreditten venter: program (arbeidsområdet er i et rabattprogram), no_subscription eller no_workspace. null når ingenting blokkerer den"
        },
        {
          "type": "null"
        }
      ]
    },
    "signups": {
      "type": "integer",
      "description": "Kontoer opprettet via lenken eller koden din"
    },
    "customers": {
      "type": "integer",
      "description": "Henviste arbeidsområder som har betalt"
    },
    "balances": {
      "type": "array",
      "description": "Per valuta: pending_cents (på vent), approved_cents (kan utbetales) og paid_cents"
    },
    "payouts": {
      "type": "array",
      "description": "Nylige utbetalinger med amount_cents, currency, payout_method, status (applied: kontokreditt som venter på neste fornyelse, eller paid), applied_at og paid_at"
    },
    "terms": {
      "type": "object",
      "description": "Provisjonsprosent, måneder, ventedager og utbetalingsterskelen for Wise i cent"
    }
  }
}

Analyse

GET /sites/:site_id/overview.json Nettstedsoversikt: målinger, diagramserier, toppanel, besøkende nå og notater stats_overview

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/overview.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Forhåndsvalgt datoområde. Bruk custom med from/to",
      "enum": [
        "today",
        "yesterday",
        "24h",
        "7d",
        "14d",
        "28d",
        "30d",
        "90d",
        "mtd",
        "last_month",
        "qtd",
        "last_quarter",
        "ytd",
        "12mo",
        "last_year",
        "all",
        "custom"
      ],
      "default": "30d"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Start på egendefinert område (nettstedets tidssone)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Slutt på egendefinert område, inkludert"
    },
    "compare": {
      "type": "string",
      "description": "Sammenligningsperiode",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Start på egendefinert sammenligning"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Slutt på egendefinert sammenligning"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Juster sammenligningsdagene til ukedagene",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtre: [[\"dimension\",\"operator\",\"value\"], …]. Operatorer: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Pakk betingelser inn i {\"any\": [...]} for ELLER.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Bruk et lagret segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Legg til importerte historiske data (datoer før den første native hendelsen, ignoreres når filtre eller et segment brukes)",
      "default": false
    },
    "interval": {
      "type": "string",
      "description": "Intervallstørrelse for diagrammet",
      "enum": [
        "auto",
        "minute",
        "hour",
        "day",
        "week",
        "month",
        "quarter",
        "year"
      ],
      "default": "auto"
    },
    "panels": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Dimensjoner å ta med toppverdier for",
      "default": [
        "channel",
        "referrer",
        "page",
        "entry_page",
        "country",
        "device",
        "browser",
        "os",
        "utm_campaign",
        "event",
        "goal"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
GET /sites/:site_id/experiments.json Eksperimentrapport: konverteringsrate per variant, forbedring mot kontroll og signifikans (to-proporsjons z-test) experiments_report

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/experiments.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Forhåndsvalgt datoområde. Bruk custom med from/to",
      "enum": [
        "today",
        "yesterday",
        "24h",
        "7d",
        "14d",
        "28d",
        "30d",
        "90d",
        "mtd",
        "last_month",
        "qtd",
        "last_quarter",
        "ytd",
        "12mo",
        "last_year",
        "all",
        "custom"
      ],
      "default": "30d"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Start på egendefinert område (nettstedets tidssone)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Slutt på egendefinert område, inkludert"
    },
    "compare": {
      "type": "string",
      "description": "Sammenligningsperiode",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Start på egendefinert sammenligning"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Slutt på egendefinert sammenligning"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Juster sammenligningsdagene til ukedagene",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtre: [[\"dimension\",\"operator\",\"value\"], …]. Operatorer: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Pakk betingelser inn i {\"any\": [...]} for ELLER.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Bruk et lagret segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Legg til importerte historiske data (datoer før den første native hendelsen, ignoreres når filtre eller et segment brukes)",
      "default": false
    },
    "property": {
      "type": "string",
      "description": "Hendelsesegenskap som inneholder varianten, f.eks. variant",
      "examples": [
        "variant"
      ]
    },
    "goal_id": {
      "type": "string",
      "description": "Mål som telles som en konvertering (goal_…)"
    },
    "control": {
      "type": "string",
      "description": "Kontrollvariant (standard er \"control\" hvis den finnes, ellers varianten med flest besøk)"
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "property",
    "goal_id",
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
GET /sites/:site_id/insights.json Merkbare endringer mot forrige periode, på vanlig språk (største endringer, endringer i målkonvertering) insights_get

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/insights.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Hele dager til og med i går, sammenlignet med like mange dager før",
      "enum": [
        "7d",
        "14d",
        "28d",
        "30d"
      ],
      "default": "7d"
    },
    "limit": {
      "type": "integer",
      "description": "Maksimalt antall innsikter (1 til 20)",
      "default": 8
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
GET /sites/:site_id/journeys.json Reiser: de 3-trinns stiene som oftest følger etter en side (eller et hvilket som helst inngangspunkt), eller som går før en side eller et mål journeys_explore

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/journeys.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Forhåndsvalgt datoområde. Bruk custom med from/to",
      "enum": [
        "today",
        "yesterday",
        "24h",
        "7d",
        "14d",
        "28d",
        "30d",
        "90d",
        "mtd",
        "last_month",
        "qtd",
        "last_quarter",
        "ytd",
        "12mo",
        "last_year",
        "all",
        "custom"
      ],
      "default": "30d"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Start på egendefinert område (nettstedets tidssone)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Slutt på egendefinert område, inkludert"
    },
    "compare": {
      "type": "string",
      "description": "Sammenligningsperiode",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Start på egendefinert sammenligning"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Slutt på egendefinert sammenligning"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Juster sammenligningsdagene til ukedagene",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtre: [[\"dimension\",\"operator\",\"value\"], …]. Operatorer: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Pakk betingelser inn i {\"any\": [...]} for ELLER.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Bruk et lagret segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Legg til importerte historiske data (datoer før den første native hendelsen, ignoreres når filtre eller et segment brukes)",
      "default": false
    },
    "mode": {
      "type": "string",
      "description": "forward: sider etter startsiden, reverse: sider som leder til sluttsiden eller målet",
      "enum": [
        "forward",
        "reverse"
      ],
      "default": "forward"
    },
    "path": {
      "type": "string",
      "description": "Startside (forward) eller sluttside (reverse). Tom betyr et hvilket som helst inngangspunkt (bare forward)"
    },
    "goal_id": {
      "type": "string",
      "description": "Reverse-modus: slutt ved dette målet (goal_…) i stedet for en side"
    },
    "limit": {
      "type": "integer",
      "description": "Sider som vises per trinn (maks 12)",
      "default": 6
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
GET /sites/:site_id/pages/detail.json Sidedetaljer: målinger, forrige og neste sider, kilder, Web Vitals, hendelser og klikkart for én sti pages_detail

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/pages/detail.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Forhåndsvalgt datoområde. Bruk custom med from/to",
      "enum": [
        "today",
        "yesterday",
        "24h",
        "7d",
        "14d",
        "28d",
        "30d",
        "90d",
        "mtd",
        "last_month",
        "qtd",
        "last_quarter",
        "ytd",
        "12mo",
        "last_year",
        "all",
        "custom"
      ],
      "default": "30d"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Start på egendefinert område (nettstedets tidssone)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Slutt på egendefinert område, inkludert"
    },
    "compare": {
      "type": "string",
      "description": "Sammenligningsperiode",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Start på egendefinert sammenligning"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Slutt på egendefinert sammenligning"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Juster sammenligningsdagene til ukedagene",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtre: [[\"dimension\",\"operator\",\"value\"], …]. Operatorer: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Pakk betingelser inn i {\"any\": [...]} for ELLER.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Bruk et lagret segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Legg til importerte historiske data (datoer før den første native hendelsen, ignoreres når filtre eller et segment brukes)",
      "default": false
    },
    "path": {
      "type": "string",
      "description": "Sidesti, f.eks. /pricing",
      "examples": [
        "/pricing"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "path",
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
GET /sites/:site_id/stats/aggregate.json Hovedmålinger for en periode (med sammenligning) stats_aggregate

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/stats/aggregate.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Forhåndsvalgt datoområde. Bruk custom med from/to",
      "enum": [
        "today",
        "yesterday",
        "24h",
        "7d",
        "14d",
        "28d",
        "30d",
        "90d",
        "mtd",
        "last_month",
        "qtd",
        "last_quarter",
        "ytd",
        "12mo",
        "last_year",
        "all",
        "custom"
      ],
      "default": "30d"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Start på egendefinert område (nettstedets tidssone)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Slutt på egendefinert område, inkludert"
    },
    "compare": {
      "type": "string",
      "description": "Sammenligningsperiode",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Start på egendefinert sammenligning"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Slutt på egendefinert sammenligning"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Juster sammenligningsdagene til ukedagene",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtre: [[\"dimension\",\"operator\",\"value\"], …]. Operatorer: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Pakk betingelser inn i {\"any\": [...]} for ELLER.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Bruk et lagret segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Legg til importerte historiske data (datoer før den første native hendelsen, ignoreres når filtre eller et segment brukes)",
      "default": false
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
GET /sites/:site_id/breakdown/:dimension.json De øverste verdiene for en dimensjon (sider, kilder, land …) stats_breakdown

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/breakdown/:dimension.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Forhåndsvalgt datoområde. Bruk custom med from/to",
      "enum": [
        "today",
        "yesterday",
        "24h",
        "7d",
        "14d",
        "28d",
        "30d",
        "90d",
        "mtd",
        "last_month",
        "qtd",
        "last_quarter",
        "ytd",
        "12mo",
        "last_year",
        "all",
        "custom"
      ],
      "default": "30d"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Start på egendefinert område (nettstedets tidssone)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Slutt på egendefinert område, inkludert"
    },
    "compare": {
      "type": "string",
      "description": "Sammenligningsperiode",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Start på egendefinert sammenligning"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Slutt på egendefinert sammenligning"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Juster sammenligningsdagene til ukedagene",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtre: [[\"dimension\",\"operator\",\"value\"], …]. Operatorer: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Pakk betingelser inn i {\"any\": [...]} for ELLER.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Bruk et lagret segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Legg til importerte historiske data (datoer før den første native hendelsen, ignoreres når filtre eller et segment brukes)",
      "default": false
    },
    "dimension": {
      "type": "string",
      "description": "Dimension for ressursen"
    },
    "limit": {
      "type": "integer",
      "description": "Rader per side (maks 1000)",
      "default": 10
    },
    "page": {
      "type": "integer",
      "description": "Sidenummer",
      "default": 1
    },
    "sort": {
      "type": "string",
      "description": "Sorter etter måling",
      "enum": [
        "visitors",
        "visits",
        "pageviews",
        "revenue"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "dimension",
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
GET /sites/:site_id/stats/timeseries.json Målinger per tidsintervall for diagrammer stats_timeseries

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/stats/timeseries.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Forhåndsvalgt datoområde. Bruk custom med from/to",
      "enum": [
        "today",
        "yesterday",
        "24h",
        "7d",
        "14d",
        "28d",
        "30d",
        "90d",
        "mtd",
        "last_month",
        "qtd",
        "last_quarter",
        "ytd",
        "12mo",
        "last_year",
        "all",
        "custom"
      ],
      "default": "30d"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Start på egendefinert område (nettstedets tidssone)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Slutt på egendefinert område, inkludert"
    },
    "compare": {
      "type": "string",
      "description": "Sammenligningsperiode",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Start på egendefinert sammenligning"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Slutt på egendefinert sammenligning"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Juster sammenligningsdagene til ukedagene",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtre: [[\"dimension\",\"operator\",\"value\"], …]. Operatorer: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Pakk betingelser inn i {\"any\": [...]} for ELLER.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Bruk et lagret segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Legg til importerte historiske data (datoer før den første native hendelsen, ignoreres når filtre eller et segment brukes)",
      "default": false
    },
    "interval": {
      "type": "string",
      "description": "Intervallstørrelse. auto velger ett for området",
      "enum": [
        "auto",
        "minute",
        "hour",
        "day",
        "week",
        "month",
        "quarter",
        "year"
      ],
      "default": "auto"
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}

Arbeidsområder

GET /workspaces/:workspace_id/white_label.json Hent white label-merkevaren white_label_get

Tillatelse: workspace.manage

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/white_label.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string"
    },
    "brand_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Navn som vises i stedet for Privatus Analytics"
        },
        {
          "type": "null"
        }
      ]
    },
    "brand_logo_url": {
      "anyOf": [
        {
          "type": "string",
          "description": "URL til logobildet"
        },
        {
          "type": "null"
        }
      ]
    },
    "brand_color": {
      "anyOf": [
        {
          "type": "string",
          "description": "Aksentfarge"
        },
        {
          "type": "null"
        }
      ]
    },
    "hide_branding": {
      "type": "boolean",
      "description": "Privatus-merkevaren er skjult"
    },
    "available": {
      "type": "boolean",
      "description": "Planen inkluderer white label"
    },
    "active": {
      "type": "boolean",
      "description": "Merkevaren er brukt nå"
    }
  }
}
PATCH /workspaces/:workspace_id/white_label.json Angi white label-merkevaren for delte dashbord og e-postrapporter (Business) white_label_update

Tillatelse: workspace.manage

Eksempel
curl -X PATCH https://privatusanalytics.com/workspaces/:workspace_id/white_label.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "brand_name": {
      "type": "string",
      "description": "Navn som vises i stedet for Privatus Analytics (tomt fjerner det)"
    },
    "brand_logo_url": {
      "type": "string",
      "description": "https-URL til et logobilde (tomt fjerner det)"
    },
    "brand_color": {
      "type": "string",
      "description": "Aksentfarge, f.eks. #06755b"
    },
    "hide_branding": {
      "type": "boolean",
      "description": "Skjul \"Privatus\" på delte dashbord og e-postrapporter"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string"
    },
    "brand_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Navn som vises i stedet for Privatus Analytics"
        },
        {
          "type": "null"
        }
      ]
    },
    "brand_logo_url": {
      "anyOf": [
        {
          "type": "string",
          "description": "URL til logobildet"
        },
        {
          "type": "null"
        }
      ]
    },
    "brand_color": {
      "anyOf": [
        {
          "type": "string",
          "description": "Aksentfarge"
        },
        {
          "type": "null"
        }
      ]
    },
    "hide_branding": {
      "type": "boolean",
      "description": "Privatus-merkevaren er skjult"
    },
    "available": {
      "type": "boolean",
      "description": "Planen inkluderer white label"
    },
    "active": {
      "type": "boolean",
      "description": "Merkevaren er brukt nå"
    }
  }
}
GET /workspaces/:workspace_id/security.json Hent sikkerhetsinnstillingene for arbeidsområdet workspace_security_get

Tillatelse: workspace.manage

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/security.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string"
    },
    "enforce_2fa": {
      "type": "boolean",
      "description": "Medlemmer må sette opp 2FA"
    },
    "login_methods": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Tillatte innloggingsmetoder"
    },
    "session_ttl_hours": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Øktlevetid (null = ingen)"
        },
        {
          "type": "null"
        }
      ]
    },
    "app_ip_allowlist": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Tillatte IP-er/CIDR-områder (tom = hvor som helst)"
    },
    "support_access_until": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Privatus-støtten kan se arbeidsområdet til"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
PATCH /workspaces/:workspace_id/security.json Oppdater sikkerhetsinnstillingene for arbeidsområdet (2FA, innloggingsmetoder, øktlevetid, IP-tillatelsesliste, støttetilgang) workspace_security_update

Tillatelse: workspace.manage

Eksempel
curl -X PATCH https://privatusanalytics.com/workspaces/:workspace_id/security.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "enforce_2fa": {
      "type": "boolean",
      "description": "Krev at medlemmer setter opp 2FA"
    },
    "login_methods": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "password",
          "magic_link",
          "passkey",
          "google",
          "github",
          "sso"
        ]
      },
      "description": "Tillatte innloggingsmetoder"
    },
    "session_ttl_hours": {
      "type": "integer",
      "description": "Logg ut medlemmer etter så mange timer (0 = ingen grense)"
    },
    "app_ip_allowlist": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Tillat bare app- og API-tilgang fra disse IP-ene/CIDR-områdene (Business). Tom = hvor som helst"
    },
    "support_access": {
      "type": "boolean",
      "description": "La Privatus-støtten se arbeidsområdet i 7 dager"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string"
    },
    "enforce_2fa": {
      "type": "boolean",
      "description": "Medlemmer må sette opp 2FA"
    },
    "login_methods": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Tillatte innloggingsmetoder"
    },
    "session_ttl_hours": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Øktlevetid (null = ingen)"
        },
        {
          "type": "null"
        }
      ]
    },
    "app_ip_allowlist": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Tillatte IP-er/CIDR-områder (tom = hvor som helst)"
    },
    "support_access_until": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Privatus-støtten kan se arbeidsområdet til"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
POST /workspaces.json Opprett et arbeidsområde (du blir eier) workspaces_create

Tillatelse: member · Kun HTTP (ikke et MCP-verktøy)

Eksempel
curl -X POST https://privatusanalytics.com/workspaces.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Navn på arbeidsområdet",
      "examples": [
        "Acme Inc"
      ]
    },
    "timezone": {
      "type": "string",
      "description": "Standard tidssone for rapportering (standard er brukerens)"
    },
    "currency": {
      "type": "string",
      "description": "Standardvaluta (ISO 4217)",
      "default": "USD"
    },
    "how_heard": {
      "type": "string",
      "description": "Hvordan du hørte om oss"
    }
  },
  "required": [
    "name"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "timezone": {
      "type": "string",
      "description": "Standard tidssone for rapportering"
    },
    "currency": {
      "type": "string",
      "description": "Standardvaluta"
    },
    "plan": {
      "type": "string",
      "description": "free, pro, business eller enterprise"
    },
    "plan_events": {
      "type": "integer",
      "description": "Hendelser per måned inkludert i planen"
    },
    "subscription_status": {
      "type": "string"
    },
    "role": {
      "type": "string",
      "description": "Din rolle i dette arbeidsområdet"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /workspaces/:id.json Slett et arbeidsområde og alle nettstedene i det (kun eieren, sier opp abonnementer) workspaces_delete

Tillatelse: workspace.manage

Eksempel
curl -X DELETE https://privatusanalytics.com/workspaces/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "confirm": {
      "type": "string",
      "description": "Skriv inn navnet på arbeidsområdet for å bekrefte"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "confirm",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "timezone": {
      "type": "string",
      "description": "Standard tidssone for rapportering"
    },
    "currency": {
      "type": "string",
      "description": "Standardvaluta"
    },
    "plan": {
      "type": "string",
      "description": "free, pro, business eller enterprise"
    },
    "plan_events": {
      "type": "integer",
      "description": "Hendelser per måned inkludert i planen"
    },
    "subscription_status": {
      "type": "string"
    },
    "role": {
      "type": "string",
      "description": "Din rolle i dette arbeidsområdet"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /workspaces.json List arbeidsområdene dine workspaces_list

Tillatelse: member

Eksempel
curl https://privatusanalytics.com/workspaces.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater per side (maks 100)"
    }
  },
  "required": []
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
      },
      "name": {
        "type": "string"
      },
      "timezone": {
        "type": "string",
        "description": "Standard tidssone for rapportering"
      },
      "currency": {
        "type": "string",
        "description": "Standardvaluta"
      },
      "plan": {
        "type": "string",
        "description": "free, pro, business eller enterprise"
      },
      "plan_events": {
        "type": "integer",
        "description": "Hendelser per måned inkludert i planen"
      },
      "subscription_status": {
        "type": "string"
      },
      "role": {
        "type": "string",
        "description": "Din rolle i dette arbeidsområdet"
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
GET /workspaces/:id.json Hent et arbeidsområde workspaces_get

Tillatelse: member

Eksempel
curl https://privatusanalytics.com/workspaces/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "timezone": {
      "type": "string",
      "description": "Standard tidssone for rapportering"
    },
    "currency": {
      "type": "string",
      "description": "Standardvaluta"
    },
    "plan": {
      "type": "string",
      "description": "free, pro, business eller enterprise"
    },
    "plan_events": {
      "type": "integer",
      "description": "Hendelser per måned inkludert i planen"
    },
    "subscription_status": {
      "type": "string"
    },
    "role": {
      "type": "string",
      "description": "Din rolle i dette arbeidsområdet"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
PATCH /workspaces/:id.json Oppdater innstillingene for arbeidsområdet workspaces_update

Tillatelse: workspace.manage

Eksempel
curl -X PATCH https://privatusanalytics.com/workspaces/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Navn på arbeidsområdet"
    },
    "timezone": {
      "type": "string",
      "description": "Standard tidssone for rapportering"
    },
    "currency": {
      "type": "string",
      "description": "Standardvaluta (ISO 4217)"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "timezone": {
      "type": "string",
      "description": "Standard tidssone for rapportering"
    },
    "currency": {
      "type": "string",
      "description": "Standardvaluta"
    },
    "plan": {
      "type": "string",
      "description": "free, pro, business eller enterprise"
    },
    "plan_events": {
      "type": "integer",
      "description": "Hendelser per måned inkludert i planen"
    },
    "subscription_status": {
      "type": "string"
    },
    "role": {
      "type": "string",
      "description": "Din rolle i dette arbeidsområdet"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Assistent

POST /sites/:site_id/ask.json Still et spørsmål i en ny samtale (teller mot den månedlige grensen for AI-spørsmål) assistant_ask

Tillatelse: analytics.read

Eksempel
curl -X POST https://privatusanalytics.com/sites/:site_id/ask.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "question": {
      "type": "string",
      "description": "Ditt første spørsmål på vanlig språk",
      "examples": [
        "How many visitors did we have last week?"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "question",
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Samtale-ID, f.eks. ask_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nettsted-ID"
        },
        {
          "type": "null"
        }
      ]
    },
    "title": {
      "anyOf": [
        {
          "type": "string",
          "description": "Det første spørsmålet, forkortet"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Tidspunkt for den siste meldingen"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time",
      "description": "Slettes automatisk etter dette tidspunktet (30 dager etter den siste meldingen)"
    },
    "messages": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Meldings-ID i samtalen"
        },
        "role": {
          "type": "string",
          "description": "user (spørsmålet) eller assistant (svaret)"
        },
        "content": {
          "type": "string",
          "description": "Spørsmål, eller svaret i Markdown"
        },
        "queries": {
          "type": "array",
          "items": {
            "type": "object"
          },
          "description": "Slik kom jeg fram til dette: de nøyaktige API-spørringene bak svaret, som [{tool, input, status, error}]"
        },
        "chart": {
          "anyOf": [
            {
              "type": "object",
              "description": "Diagram for svaret: {type: line, labels, series, comparison, metric, format} eller {type: table, columns, rows}"
            },
            {
              "type": "null"
            }
          ]
        },
        "goal_draft": {
          "anyOf": [
            {
              "type": "object",
              "description": "Et mål foreslått av assistenten, som bekreftes med goals_create"
            },
            {
              "type": "null"
            }
          ]
        },
        "input_tokens": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Brukte inndatatokener for modellen"
            },
            {
              "type": "null"
            }
          ]
        },
        "output_tokens": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Brukte utdatatokener for modellen"
            },
            {
              "type": "null"
            }
          ]
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        }
      },
      "description": "Spørsmål og svar, eldste først"
    }
  }
}
DELETE /sites/:site_id/ask/:id.json Slett en Spør-samtale og meldingene i den assistant_conversations_delete

Tillatelse: analytics.read

Eksempel
curl -X DELETE https://privatusanalytics.com/sites/:site_id/ask/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Samtale-ID, f.eks. ask_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nettsted-ID"
        },
        {
          "type": "null"
        }
      ]
    },
    "title": {
      "anyOf": [
        {
          "type": "string",
          "description": "Det første spørsmålet, forkortet"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Tidspunkt for den siste meldingen"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time",
      "description": "Slettes automatisk etter dette tidspunktet (30 dager etter den siste meldingen)"
    }
  }
}
GET /sites/:site_id/ask.json List Spør-samtalene dine for et nettsted assistant_conversations_list

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/ask.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater per side (maks 100)"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Samtale-ID, f.eks. ask_7Q2K9XH3AB"
      },
      "site_id": {
        "anyOf": [
          {
            "type": "string",
            "description": "Nettsted-ID"
          },
          {
            "type": "null"
          }
        ]
      },
      "title": {
        "anyOf": [
          {
            "type": "string",
            "description": "Det første spørsmålet, forkortet"
          },
          {
            "type": "null"
          }
        ]
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      },
      "updated_at": {
        "type": "string",
        "format": "date-time",
        "description": "Tidspunkt for den siste meldingen"
      },
      "expires_at": {
        "type": "string",
        "format": "date-time",
        "description": "Slettes automatisk etter dette tidspunktet (30 dager etter den siste meldingen)"
      }
    }
  }
}
GET /sites/:site_id/ask/:id.json En Spør-samtale: spørsmål, svar, spørringene bak dem og diagrammer assistant_conversations_get

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/ask/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Samtale-ID, f.eks. ask_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nettsted-ID"
        },
        {
          "type": "null"
        }
      ]
    },
    "title": {
      "anyOf": [
        {
          "type": "string",
          "description": "Det første spørsmålet, forkortet"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Tidspunkt for den siste meldingen"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time",
      "description": "Slettes automatisk etter dette tidspunktet (30 dager etter den siste meldingen)"
    },
    "messages": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Meldings-ID i samtalen"
        },
        "role": {
          "type": "string",
          "description": "user (spørsmålet) eller assistant (svaret)"
        },
        "content": {
          "type": "string",
          "description": "Spørsmål, eller svaret i Markdown"
        },
        "queries": {
          "type": "array",
          "items": {
            "type": "object"
          },
          "description": "Slik kom jeg fram til dette: de nøyaktige API-spørringene bak svaret, som [{tool, input, status, error}]"
        },
        "chart": {
          "anyOf": [
            {
              "type": "object",
              "description": "Diagram for svaret: {type: line, labels, series, comparison, metric, format} eller {type: table, columns, rows}"
            },
            {
              "type": "null"
            }
          ]
        },
        "goal_draft": {
          "anyOf": [
            {
              "type": "object",
              "description": "Et mål foreslått av assistenten, som bekreftes med goals_create"
            },
            {
              "type": "null"
            }
          ]
        },
        "input_tokens": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Brukte inndatatokener for modellen"
            },
            {
              "type": "null"
            }
          ]
        },
        "output_tokens": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Brukte utdatatokener for modellen"
            },
            {
              "type": "null"
            }
          ]
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        }
      },
      "description": "Spørsmål og svar, eldste først"
    }
  }
}
POST /sites/:site_id/ask/:ask_conversation_id/messages.json Still et oppfølgingsspørsmål i en samtale (teller mot den månedlige grensen for AI-spørsmål). Returnerer svaret. assistant_ask_followup

Tillatelse: analytics.read

Eksempel
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 '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "question": {
      "type": "string",
      "description": "Spørsmålet ditt på vanlig språk",
      "examples": [
        "Which pages had the most visitors last week?"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    },
    "ask_conversation_id": {
      "type": "string",
      "description": "Ask conversation for ressursen"
    }
  },
  "required": [
    "question",
    "site_id",
    "ask_conversation_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Meldings-ID i samtalen"
    },
    "role": {
      "type": "string",
      "description": "user (spørsmålet) eller assistant (svaret)"
    },
    "content": {
      "type": "string",
      "description": "Spørsmål, eller svaret i Markdown"
    },
    "queries": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Slik kom jeg fram til dette: de nøyaktige API-spørringene bak svaret, som [{tool, input, status, error}]"
    },
    "chart": {
      "anyOf": [
        {
          "type": "object",
          "description": "Diagram for svaret: {type: line, labels, series, comparison, metric, format} eller {type: table, columns, rows}"
        },
        {
          "type": "null"
        }
      ]
    },
    "goal_draft": {
      "anyOf": [
        {
          "type": "object",
          "description": "Et mål foreslått av assistenten, som bekreftes med goals_create"
        },
        {
          "type": "null"
        }
      ]
    },
    "input_tokens": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Brukte inndatatokener for modellen"
        },
        {
          "type": "null"
        }
      ]
    },
    "output_tokens": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Brukte utdatatokener for modellen"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Dashbord

GET /workspaces/:workspace_id/dashboards/:id/cards/:index.json Data for ett kort i et egendefinert dashbord dashboards_card

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/dashboards/:id/cards/:index.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    },
    "index": {
      "type": "string",
      "description": "Index for ressursen"
    }
  },
  "required": [
    "workspace_id",
    "id",
    "index"
  ]
}
Svardata
{
  "type": "object"
}
POST /workspaces/:workspace_id/dashboards.json Opprett et egendefinert dashbord dashboards_create

Tillatelse: content.write

Eksempel
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/dashboards.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Navn på dashbordet",
      "examples": [
        "Client: Acme"
      ]
    },
    "cards": {
      "type": "array",
      "items": {},
      "description": "Kort i rekkefølge (maks 40): [{\"type\": \"metric|chart|breakdown|goal|live|funnel|uptime|vitals\", \"site_id\": \"pa_…\", \"title\": \"valgfri\", \"params\": {\"period\": \"30d\", \"metric\": \"visitors\", \"dimension\": \"page\", \"funnel_id\": \"fun_…\"}}]. Parametere en type ikke bruker, ignoreres",
      "default": []
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Dashbord-ID, f.eks. dash_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "cards": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Kort i rekkefølge: [{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 Slett et egendefinert dashbord dashboards_delete

Tillatelse: content.write

Eksempel
curl -X DELETE https://privatusanalytics.com/workspaces/:workspace_id/dashboards/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Dashbord-ID, f.eks. dash_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "cards": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Kort i rekkefølge: [{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 List egendefinerte dashbord dashboards_list

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/dashboards.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater per side (maks 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Dashbord-ID, f.eks. dash_7Q2K9XH3AB"
      },
      "name": {
        "type": "string"
      },
      "cards": {
        "type": "array",
        "items": {
          "type": "object"
        },
        "description": "Kort i rekkefølge: [{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 Hent et egendefinert dashbord og kortene det inneholder dashboards_get

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/dashboards/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Dashbord-ID, f.eks. dash_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "cards": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Kort i rekkefølge: [{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 Gi et egendefinert dashbord nytt navn eller erstatt kortene dashboards_update

Tillatelse: content.write

Eksempel
curl -X PATCH https://privatusanalytics.com/workspaces/:workspace_id/dashboards/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nytt navn (uendret når tomt)"
    },
    "cards": {
      "type": "array",
      "items": {},
      "description": "Erstatter alle kort. Kort i rekkefølge (maks 40): [{\"type\": \"metric|chart|breakdown|goal|live|funnel|uptime|vitals\", \"site_id\": \"pa_…\", \"title\": \"valgfri\", \"params\": {\"period\": \"30d\", \"metric\": \"visitors\", \"dimension\": \"page\", \"funnel_id\": \"fun_…\"}}]. Parametere en type ikke bruker, ignoreres"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Dashbord-ID, f.eks. dash_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "cards": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Kort i rekkefølge: [{type, site_id, title, params}]"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Datavarehussynkronisering

POST /workspaces/:workspace_id/warehouses.json Legg til en datavarehusmottaker warehouse_destinations_create

Tillatelse: workspace.manage

Eksempel
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/warehouses.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Visningsnavn, f.eks. Datasjø"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Nettsteder som skal sendes (pa_…). Tom sender alle nettsteder"
    },
    "bucket": {
      "type": "string",
      "description": "s3: bøttenavn"
    },
    "region": {
      "type": "string",
      "description": "s3: region, f.eks. us-east-1 (auto for R2)"
    },
    "prefix": {
      "type": "string",
      "description": "s3/azure: stiprefiks, f.eks. privatus/events"
    },
    "endpoint": {
      "type": "string",
      "description": "s3: https-endepunkt for S3-kompatibel lagring (GCS-interoperabilitet, R2, MinIO)"
    },
    "access_key_id": {
      "type": "string",
      "description": "s3: tilgangsnøkkel-ID"
    },
    "secret_access_key": {
      "type": "string",
      "description": "s3: hemmelig tilgangsnøkkel (kun skrivbar)"
    },
    "service_account_json": {
      "type": "string",
      "description": "bigquery: JSON-nøkkel for tjenestekonto med BigQuery Data Editor (kun skrivbar)"
    },
    "project_id": {
      "type": "string",
      "description": "bigquery: prosjekt-ID (standard: fra nøkkelen)"
    },
    "dataset": {
      "type": "string",
      "description": "bigquery: datasett-ID"
    },
    "table": {
      "type": "string",
      "description": "bigquery/snowflake: tabellnavn (kolonner: skjema v1)"
    },
    "account": {
      "type": "string",
      "description": "snowflake: kontoidentifikator, f.eks. xy12345.us-east-1 eller myorg-myaccount"
    },
    "user": {
      "type": "string",
      "description": "snowflake: bruker med nøkkelparautentisering"
    },
    "private_key": {
      "type": "string",
      "description": "snowflake: privat RSA-nøkkel i PEM (kun skrivbar)"
    },
    "database": {
      "type": "string",
      "description": "snowflake: database"
    },
    "schema": {
      "type": "string",
      "description": "snowflake: skjema"
    },
    "warehouse": {
      "type": "string",
      "description": "snowflake: virtuelt datavarehus"
    },
    "role": {
      "type": "string",
      "description": "snowflake: rolle (valgfri)"
    },
    "sas_url": {
      "type": "string",
      "description": "azure: SAS-URL for container med create-/write-tillatelse (kun skrivbar)"
    },
    "kind": {
      "type": "string",
      "description": "s3 (også GCS/R2/MinIO), bigquery, snowflake eller azure",
      "enum": [
        "s3",
        "bigquery",
        "snowflake",
        "azure"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "kind",
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Mottaker-ID, f.eks. whd_7Q2K9XH3AB"
    },
    "kind": {
      "type": "string",
      "description": "s3, bigquery, snowflake eller azure"
    },
    "name": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "Hvor dataene går: s3://bucket/prefix, project.dataset.table, account/database.schema.table eller Azure-containeren"
    },
    "configured": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Navn på innstillinger som er fylt ut (verdier returneres aldri)"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Nettsteder som sendes (pa_…). Tom betyr alle nettsteder"
    },
    "schedule": {
      "type": "string",
      "description": "daily: 02:00 UTC, sender forrige UTC-dag"
    },
    "schema_version": {
      "type": "string",
      "description": "Radskjema som sendes"
    },
    "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 Slett en datavarehusmottaker warehouse_destinations_delete

Tillatelse: workspace.manage

Eksempel
curl -X DELETE https://privatusanalytics.com/warehouses/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Mottaker-ID, f.eks. whd_7Q2K9XH3AB"
    },
    "kind": {
      "type": "string",
      "description": "s3, bigquery, snowflake eller azure"
    },
    "name": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "Hvor dataene går: s3://bucket/prefix, project.dataset.table, account/database.schema.table eller Azure-containeren"
    },
    "configured": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Navn på innstillinger som er fylt ut (verdier returneres aldri)"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Nettsteder som sendes (pa_…). Tom betyr alle nettsteder"
    },
    "schedule": {
      "type": "string",
      "description": "daily: 02:00 UTC, sender forrige UTC-dag"
    },
    "schema_version": {
      "type": "string",
      "description": "Radskjema som sendes"
    },
    "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 List datavarehusmottakere warehouse_destinations_list

Tillatelse: workspace.manage

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/warehouses.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "description": "Bare mottakere av denne typen",
      "enum": [
        "s3",
        "bigquery",
        "snowflake",
        "azure"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater per side (maks 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Mottaker-ID, f.eks. whd_7Q2K9XH3AB"
      },
      "kind": {
        "type": "string",
        "description": "s3, bigquery, snowflake eller azure"
      },
      "name": {
        "type": "string"
      },
      "target": {
        "type": "string",
        "description": "Hvor dataene går: s3://bucket/prefix, project.dataset.table, account/database.schema.table eller Azure-containeren"
      },
      "configured": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Navn på innstillinger som er fylt ut (verdier returneres aldri)"
      },
      "site_ids": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Nettsteder som sendes (pa_…). Tom betyr alle nettsteder"
      },
      "schedule": {
        "type": "string",
        "description": "daily: 02:00 UTC, sender forrige UTC-dag"
      },
      "schema_version": {
        "type": "string",
        "description": "Radskjema som sendes"
      },
      "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 Hent en datavarehusmottaker (uten hemmeligheter) warehouse_destinations_get

Tillatelse: workspace.manage

Eksempel
curl https://privatusanalytics.com/warehouses/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Mottaker-ID, f.eks. whd_7Q2K9XH3AB"
    },
    "kind": {
      "type": "string",
      "description": "s3, bigquery, snowflake eller azure"
    },
    "name": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "Hvor dataene går: s3://bucket/prefix, project.dataset.table, account/database.schema.table eller Azure-containeren"
    },
    "configured": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Navn på innstillinger som er fylt ut (verdier returneres aldri)"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Nettsteder som sendes (pa_…). Tom betyr alle nettsteder"
    },
    "schedule": {
      "type": "string",
      "description": "daily: 02:00 UTC, sender forrige UTC-dag"
    },
    "schema_version": {
      "type": "string",
      "description": "Radskjema som sendes"
    },
    "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 Legg en synkronisering av én dag i kø nå warehouse_destinations_sync

Tillatelse: workspace.manage

Eksempel
curl -X POST https://privatusanalytics.com/warehouses/:id/sync.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "date": {
      "type": "string",
      "format": "date",
      "description": "UTC-dag som skal sendes, f.eks. 2026-09-28 (standard: i går)"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Mottaker-ID, f.eks. whd_7Q2K9XH3AB"
    },
    "kind": {
      "type": "string",
      "description": "s3, bigquery, snowflake eller azure"
    },
    "name": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "Hvor dataene går: s3://bucket/prefix, project.dataset.table, account/database.schema.table eller Azure-containeren"
    },
    "configured": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Navn på innstillinger som er fylt ut (verdier returneres aldri)"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Nettsteder som sendes (pa_…). Tom betyr alle nettsteder"
    },
    "schedule": {
      "type": "string",
      "description": "daily: 02:00 UTC, sender forrige UTC-dag"
    },
    "schema_version": {
      "type": "string",
      "description": "Radskjema som sendes"
    },
    "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 Oppdater en datavarehusmottaker (tomme hemmeligheter beholdes) warehouse_destinations_update

Tillatelse: workspace.manage

Eksempel
curl -X PATCH https://privatusanalytics.com/warehouses/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Visningsnavn, f.eks. Datasjø"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Nettsteder som skal sendes (pa_…). Tom sender alle nettsteder"
    },
    "bucket": {
      "type": "string",
      "description": "s3: bøttenavn"
    },
    "region": {
      "type": "string",
      "description": "s3: region, f.eks. us-east-1 (auto for R2)"
    },
    "prefix": {
      "type": "string",
      "description": "s3/azure: stiprefiks, f.eks. privatus/events"
    },
    "endpoint": {
      "type": "string",
      "description": "s3: https-endepunkt for S3-kompatibel lagring (GCS-interoperabilitet, R2, MinIO)"
    },
    "access_key_id": {
      "type": "string",
      "description": "s3: tilgangsnøkkel-ID"
    },
    "secret_access_key": {
      "type": "string",
      "description": "s3: hemmelig tilgangsnøkkel (kun skrivbar)"
    },
    "service_account_json": {
      "type": "string",
      "description": "bigquery: JSON-nøkkel for tjenestekonto med BigQuery Data Editor (kun skrivbar)"
    },
    "project_id": {
      "type": "string",
      "description": "bigquery: prosjekt-ID (standard: fra nøkkelen)"
    },
    "dataset": {
      "type": "string",
      "description": "bigquery: datasett-ID"
    },
    "table": {
      "type": "string",
      "description": "bigquery/snowflake: tabellnavn (kolonner: skjema v1)"
    },
    "account": {
      "type": "string",
      "description": "snowflake: kontoidentifikator, f.eks. xy12345.us-east-1 eller myorg-myaccount"
    },
    "user": {
      "type": "string",
      "description": "snowflake: bruker med nøkkelparautentisering"
    },
    "private_key": {
      "type": "string",
      "description": "snowflake: privat RSA-nøkkel i PEM (kun skrivbar)"
    },
    "database": {
      "type": "string",
      "description": "snowflake: database"
    },
    "schema": {
      "type": "string",
      "description": "snowflake: skjema"
    },
    "warehouse": {
      "type": "string",
      "description": "snowflake: virtuelt datavarehus"
    },
    "role": {
      "type": "string",
      "description": "snowflake: rolle (valgfri)"
    },
    "sas_url": {
      "type": "string",
      "description": "azure: SAS-URL for container med create-/write-tillatelse (kun skrivbar)"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Mottaker-ID, f.eks. whd_7Q2K9XH3AB"
    },
    "kind": {
      "type": "string",
      "description": "s3, bigquery, snowflake eller azure"
    },
    "name": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "Hvor dataene går: s3://bucket/prefix, project.dataset.table, account/database.schema.table eller Azure-containeren"
    },
    "configured": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Navn på innstillinger som er fylt ut (verdier returneres aldri)"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Nettsteder som sendes (pa_…). Tom betyr alle nettsteder"
    },
    "schedule": {
      "type": "string",
      "description": "daily: 02:00 UTC, sender forrige UTC-dag"
    },
    "schema_version": {
      "type": "string",
      "description": "Radskjema som sendes"
    },
    "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"
    }
  }
}

Deling

GET /badge/:site_id.json Besøkstellermerke (SVG) for et offentlig nettsted badges_get

Tillatelse: public · Kun HTTP (ikke et MCP-verktøy)

Eksempel
curl https://privatusanalytics.com/badge/:site_id.json
Inndata
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
GET /share/:token/breakdown/:dimension.json De øverste verdiene for en delt dimensjon shares_breakdown

Tillatelse: public

Eksempel
curl https://privatusanalytics.com/share/:token/breakdown/:dimension.json
Inndata
{
  "type": "object",
  "properties": {
    "dimension": {
      "type": "string",
      "description": "Dimension for ressursen"
    },
    "period": {
      "type": "string",
      "description": "Forhåndsvalgt datoområde (ignoreres hvis lenken låser det)",
      "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": "Start på egendefinert område"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Slutt på egendefinert område, inkludert"
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Ekstra filtre, hvis lenken tillater dem",
      "default": []
    },
    "limit": {
      "type": "integer",
      "description": "Rader (maks 100)",
      "default": 10
    },
    "token": {
      "type": "string",
      "description": "Token for ressursen"
    }
  },
  "required": [
    "dimension",
    "token"
  ]
}
Svardata
{
  "type": "object"
}
GET /share/:token.json Oversikt over delt dashbord for et delingstoken shares_overview

Tillatelse: public

Eksempel
curl https://privatusanalytics.com/share/:token.json
Inndata
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Forhåndsvalgt datoområde (ignoreres hvis lenken låser det)",
      "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": "Start på egendefinert område"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Slutt på egendefinert område, inkludert"
    },
    "compare": {
      "type": "string",
      "description": "Sammenligningsperiode",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Ekstra filtre, hvis lenken tillater dem: [[\"dimension\",\"operator\",\"value\"], …]",
      "default": []
    },
    "interval": {
      "type": "string",
      "description": "Intervallstørrelse for diagrammet",
      "enum": [
        "auto",
        "minute",
        "hour",
        "day",
        "week",
        "month",
        "quarter",
        "year"
      ],
      "default": "auto"
    },
    "token": {
      "type": "string",
      "description": "Token for ressursen"
    }
  },
  "required": [
    "token"
  ]
}
Svardata
{
  "type": "object"
}

Dokumentasjon

GET /docs/api.json List alle API-operasjoner og MCP-verktøy docs_api

Tillatelse: public

Eksempel
curl https://privatusanalytics.com/docs/api.json
Inndata
{
  "type": "object",
  "properties": {
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater per side (maks 100)"
    }
  },
  "required": []
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "tool_name": {
        "type": "string",
        "description": "MCP-verktøynavn og OpenAPI operationId"
      },
      "summary": {
        "type": "string"
      },
      "description": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "group": {
        "type": "string"
      },
      "verb": {
        "type": "string",
        "description": "HTTP-metode"
      },
      "path": {
        "type": "string",
        "description": "Stimal. Legg til .json for JSON"
      },
      "permission": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "input_schema": {
        "type": "object",
        "description": "JSON Schema for inndataene"
      },
      "response_schema": {
        "type": "object",
        "description": "JSON Schema for `data`"
      }
    }
  }
}
GET /docs.json List dokumentasjonssider docs_list

Tillatelse: public

Eksempel
curl https://privatusanalytics.com/docs.json
Inndata
{
  "type": "object",
  "properties": {
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater per side (maks 100)"
    }
  },
  "required": []
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "title": {
        "type": "string",
        "description": "Sidetittel"
      },
      "description": {
        "type": "string",
        "description": "Oppsummering på én linje"
      },
      "path": {
        "type": "string",
        "description": "Sidesti. Legg til .md for Markdown eller .json for JSON"
      },
      "section": {
        "type": "string",
        "description": "Seksjons-slug, f.eks. tracker"
      }
    }
  }
}
GET /openapi.json OpenAPI 3.1-dokument for hele API-et docs_openapi

Tillatelse: public

Eksempel
curl https://privatusanalytics.com/openapi.json
Inndata
{
  "type": "object",
  "properties": {},
  "required": []
}
Svardata
{
  "type": "object"
}
GET /docs/:section/:page.json Les en dokumentasjonsside (Markdown og HTML) docs_get

section og page kommer fra sidestien /docs/<section>/<page>. Bruk page "index" for en oversikt over en seksjon.

Tillatelse: public

Eksempel
curl https://privatusanalytics.com/docs/:section/:page.json
Inndata
{
  "type": "object",
  "properties": {
    "section": {
      "type": "string",
      "description": "Section for ressursen"
    },
    "page": {
      "type": "string",
      "description": "Page for ressursen"
    }
  },
  "required": [
    "section",
    "page"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "description": "Sidetittel"
    },
    "description": {
      "type": "string",
      "description": "Oppsummering på én linje"
    },
    "path": {
      "type": "string",
      "description": "Sidesti. Legg til .md for Markdown eller .json for JSON"
    },
    "section": {
      "type": "string",
      "description": "Seksjons-slug, f.eks. tracker"
    },
    "headings": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Seksjoner på siden (id og tekst)"
    },
    "full_markdown": {
      "type": "string",
      "description": "Siden som Markdown (tittel inkludert)"
    },
    "html": {
      "type": "string",
      "description": "Sideinnholdet gjengitt som HTML"
    }
  }
}

E-postrapporter

DELETE /recipients/:id.json Fjern en mottaker fra en e-postrapport email_report_recipients_delete

Tillatelse: content.write

Eksempel
curl -X DELETE https://privatusanalytics.com/recipients/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Mottaker-ID, f.eks. rcp_7Q2K9XH3AB"
    },
    "email": {
      "type": "string",
      "description": "Adressen"
    },
    "status": {
      "type": "string",
      "description": "active, pending, declined eller unsubscribed"
    },
    "invited_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Når den siste invitasjonen ble sendt"
        },
        {
          "type": "null"
        }
      ]
    },
    "expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Når en ventende invitasjon utløper"
        },
        {
          "type": "null"
        }
      ]
    },
    "confirmed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Når adressen ble aktiv"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
GET /reports/:report_id/recipients.json List opp mottakerne av en e-postrapport med status email_report_recipients_list

Statuser: active (får rapporter), pending (invitert, ikke akseptert ennå), declined eller unsubscribed. Legg til eller fjern adresser via rapportens mottakerliste.

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/reports/:report_id/recipients.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Bare mottakere med denne statusen",
      "enum": [
        "pending",
        "active",
        "declined",
        "unsubscribed"
      ]
    },
    "report_id": {
      "type": "string",
      "description": "Report for ressursen"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater per side (maks 100)"
    }
  },
  "required": [
    "report_id"
  ]
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Mottaker-ID, f.eks. rcp_7Q2K9XH3AB"
      },
      "email": {
        "type": "string",
        "description": "Adressen"
      },
      "status": {
        "type": "string",
        "description": "active, pending, declined eller unsubscribed"
      },
      "invited_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time",
            "description": "Når den siste invitasjonen ble sendt"
          },
          {
            "type": "null"
          }
        ]
      },
      "expires_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time",
            "description": "Når en ventende invitasjon utløper"
          },
          {
            "type": "null"
          }
        ]
      },
      "confirmed_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time",
            "description": "Når adressen ble aktiv"
          },
          {
            "type": "null"
          }
        ]
      }
    }
  }
}
POST /recipients/:id/resend.json Send en ventende rapportinvitasjon på nytt email_report_recipients_resend

Sender invitasjonen på nytt med nye lenker. Tillatt én gang hver 7. dag per adresse per rapport.

Tillatelse: content.write

Eksempel
curl -X POST https://privatusanalytics.com/recipients/:id/resend.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Mottaker-ID, f.eks. rcp_7Q2K9XH3AB"
    },
    "email": {
      "type": "string",
      "description": "Adressen"
    },
    "status": {
      "type": "string",
      "description": "active, pending, declined eller unsubscribed"
    },
    "invited_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Når den siste invitasjonen ble sendt"
        },
        {
          "type": "null"
        }
      ]
    },
    "expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Når en ventende invitasjon utløper"
        },
        {
          "type": "null"
        }
      ]
    },
    "confirmed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Når adressen ble aktiv"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
POST /workspaces/:workspace_id/reports.json Opprett en e-postrapport email_reports_create

Tillatelse: content.write

Eksempel
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/reports.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Nettsted-ID-er (pa_…) som tas med i rapporten"
    },
    "frequency": {
      "type": "string",
      "description": "daily, weekly (på ukedag) eller monthly (den 1.)",
      "enum": [
        "daily",
        "weekly",
        "monthly"
      ]
    },
    "hour": {
      "type": "integer",
      "description": "Klokkeslett for sending (0 til 23, arbeidsområdets tidssone)"
    },
    "weekday": {
      "type": "integer",
      "description": "Ukentlige rapporter: 0 = søndag … 6 = lørdag"
    },
    "recipients": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "E-postadresser (ingen konto nødvendig). Oppføringer kan skilles med komma eller linjeskift. Medlemmer av arbeidsområdet legges til med en gang. Alle andre får en invitasjon og mottar rapporter først etter at de har godtatt den. Adresser som har meldt seg av rapporter, avvises"
    },
    "blocks": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Innhold: kpis, chart, pages, sources, goals, campaigns, vitals, uptime"
    },
    "attach_pdf": {
      "type": "boolean",
      "description": "Legg ved en PDF-versjon"
    },
    "intro": {
      "type": "string",
      "description": "Egendefinert introduksjonstekst (maks 2000 tegn)"
    },
    "enabled": {
      "type": "boolean",
      "description": "Send etter plan"
    },
    "name": {
      "type": "string",
      "description": "Navn på rapporten",
      "examples": [
        "Weekly traffic"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Rapport-ID, f.eks. rep_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Nettsted-ID-er i rapporten"
    },
    "frequency": {
      "type": "string",
      "description": "daily, weekly eller monthly"
    },
    "hour": {
      "type": "integer",
      "description": "Sendetime (arbeidsområdets tidssone)"
    },
    "weekday": {
      "type": "integer",
      "description": "Ukentlig: 0 = søndag … 6 = lørdag"
    },
    "recipients": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Alle adresser på rapporten, uansett status"
    },
    "recipient_details": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Mottaker-ID, f.eks. rcp_7Q2K9XH3AB"
          },
          "email": {
            "type": "string",
            "description": "Adressen"
          },
          "status": {
            "type": "string",
            "description": "active, pending, declined eller unsubscribed"
          },
          "invited_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Når den siste invitasjonen ble sendt"
              },
              {
                "type": "null"
              }
            ]
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Når en ventende invitasjon utløper"
              },
              {
                "type": "null"
              }
            ]
          },
          "confirmed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Når adressen ble aktiv"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "description": "Hver mottaker med påmeldingsstatus (bare aktive mottakere får rapporter)"
    },
    "blocks": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Innholdsblokker"
    },
    "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 Leveringslogg for en e-postrapport email_reports_deliveries

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/reports/:id/deliveries.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Bare leveringer med denne statusen",
      "enum": [
        "sent",
        "test",
        "failed",
        "skipped"
      ]
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater per side (maks 100)"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "status": {
        "type": "string",
        "description": "sent, test, failed eller skipped"
      },
      "recipients_count": {
        "type": "integer"
      },
      "error": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "sent_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
DELETE /reports/:id.json Slett en e-postrapport email_reports_delete

Tillatelse: content.write

Eksempel
curl -X DELETE https://privatusanalytics.com/reports/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Rapport-ID, f.eks. rep_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Nettsted-ID-er i rapporten"
    },
    "frequency": {
      "type": "string",
      "description": "daily, weekly eller monthly"
    },
    "hour": {
      "type": "integer",
      "description": "Sendetime (arbeidsområdets tidssone)"
    },
    "weekday": {
      "type": "integer",
      "description": "Ukentlig: 0 = søndag … 6 = lørdag"
    },
    "recipients": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Alle adresser på rapporten, uansett status"
    },
    "recipient_details": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Mottaker-ID, f.eks. rcp_7Q2K9XH3AB"
          },
          "email": {
            "type": "string",
            "description": "Adressen"
          },
          "status": {
            "type": "string",
            "description": "active, pending, declined eller unsubscribed"
          },
          "invited_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Når den siste invitasjonen ble sendt"
              },
              {
                "type": "null"
              }
            ]
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Når en ventende invitasjon utløper"
              },
              {
                "type": "null"
              }
            ]
          },
          "confirmed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Når adressen ble aktiv"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "description": "Hver mottaker med påmeldingsstatus (bare aktive mottakere får rapporter)"
    },
    "blocks": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Innholdsblokker"
    },
    "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 List e-postrapporter email_reports_list

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/reports.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "frequency": {
      "type": "string",
      "description": "Bare rapporter med denne hyppigheten",
      "enum": [
        "daily",
        "weekly",
        "monthly"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater per side (maks 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Rapport-ID, f.eks. rep_7Q2K9XH3AB"
      },
      "name": {
        "type": "string"
      },
      "site_ids": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Nettsted-ID-er i rapporten"
      },
      "frequency": {
        "type": "string",
        "description": "daily, weekly eller monthly"
      },
      "hour": {
        "type": "integer",
        "description": "Sendetime (arbeidsområdets tidssone)"
      },
      "weekday": {
        "type": "integer",
        "description": "Ukentlig: 0 = søndag … 6 = lørdag"
      },
      "recipients": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Alle adresser på rapporten, uansett status"
      },
      "recipient_details": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "description": "Mottaker-ID, f.eks. rcp_7Q2K9XH3AB"
            },
            "email": {
              "type": "string",
              "description": "Adressen"
            },
            "status": {
              "type": "string",
              "description": "active, pending, declined eller unsubscribed"
            },
            "invited_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Når den siste invitasjonen ble sendt"
                },
                {
                  "type": "null"
                }
              ]
            },
            "expires_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Når en ventende invitasjon utløper"
                },
                {
                  "type": "null"
                }
              ]
            },
            "confirmed_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Når adressen ble aktiv"
                },
                {
                  "type": "null"
                }
              ]
            }
          }
        },
        "description": "Hver mottaker med påmeldingsstatus (bare aktive mottakere får rapporter)"
      },
      "blocks": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Innholdsblokker"
      },
      "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 Send en e-postrapport nå som en test email_reports_send_test

Tillatelse: content.write

Eksempel
curl -X POST https://privatusanalytics.com/reports/:id/send_test.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "recipient": {
      "type": "string",
      "description": "Send testen hit (standard: e-posten din)"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "sent, test, failed eller skipped"
    },
    "recipients_count": {
      "type": "integer"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "sent_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /reports/:id.json Hent en e-postrapport email_reports_get

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/reports/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Rapport-ID, f.eks. rep_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Nettsted-ID-er i rapporten"
    },
    "frequency": {
      "type": "string",
      "description": "daily, weekly eller monthly"
    },
    "hour": {
      "type": "integer",
      "description": "Sendetime (arbeidsområdets tidssone)"
    },
    "weekday": {
      "type": "integer",
      "description": "Ukentlig: 0 = søndag … 6 = lørdag"
    },
    "recipients": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Alle adresser på rapporten, uansett status"
    },
    "recipient_details": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Mottaker-ID, f.eks. rcp_7Q2K9XH3AB"
          },
          "email": {
            "type": "string",
            "description": "Adressen"
          },
          "status": {
            "type": "string",
            "description": "active, pending, declined eller unsubscribed"
          },
          "invited_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Når den siste invitasjonen ble sendt"
              },
              {
                "type": "null"
              }
            ]
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Når en ventende invitasjon utløper"
              },
              {
                "type": "null"
              }
            ]
          },
          "confirmed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Når adressen ble aktiv"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "description": "Hver mottaker med påmeldingsstatus (bare aktive mottakere får rapporter)"
    },
    "blocks": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Innholdsblokker"
    },
    "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 Oppdater en e-postrapport email_reports_update

Tillatelse: content.write

Eksempel
curl -X PATCH https://privatusanalytics.com/reports/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Nettsted-ID-er (pa_…) som tas med i rapporten"
    },
    "frequency": {
      "type": "string",
      "description": "daily, weekly (på ukedag) eller monthly (den 1.)",
      "enum": [
        "daily",
        "weekly",
        "monthly"
      ]
    },
    "hour": {
      "type": "integer",
      "description": "Klokkeslett for sending (0 til 23, arbeidsområdets tidssone)"
    },
    "weekday": {
      "type": "integer",
      "description": "Ukentlige rapporter: 0 = søndag … 6 = lørdag"
    },
    "recipients": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "E-postadresser (ingen konto nødvendig). Oppføringer kan skilles med komma eller linjeskift. Medlemmer av arbeidsområdet legges til med en gang. Alle andre får en invitasjon og mottar rapporter først etter at de har godtatt den. Adresser som har meldt seg av rapporter, avvises"
    },
    "blocks": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Innhold: kpis, chart, pages, sources, goals, campaigns, vitals, uptime"
    },
    "attach_pdf": {
      "type": "boolean",
      "description": "Legg ved en PDF-versjon"
    },
    "intro": {
      "type": "string",
      "description": "Egendefinert introduksjonstekst (maks 2000 tegn)"
    },
    "enabled": {
      "type": "boolean",
      "description": "Send etter plan"
    },
    "name": {
      "type": "string",
      "description": "Navn på rapporten"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Rapport-ID, f.eks. rep_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Nettsted-ID-er i rapporten"
    },
    "frequency": {
      "type": "string",
      "description": "daily, weekly eller monthly"
    },
    "hour": {
      "type": "integer",
      "description": "Sendetime (arbeidsområdets tidssone)"
    },
    "weekday": {
      "type": "integer",
      "description": "Ukentlig: 0 = søndag … 6 = lørdag"
    },
    "recipients": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Alle adresser på rapporten, uansett status"
    },
    "recipient_details": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Mottaker-ID, f.eks. rcp_7Q2K9XH3AB"
          },
          "email": {
            "type": "string",
            "description": "Adressen"
          },
          "status": {
            "type": "string",
            "description": "active, pending, declined eller unsubscribed"
          },
          "invited_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Når den siste invitasjonen ble sendt"
              },
              {
                "type": "null"
              }
            ]
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Når en ventende invitasjon utløper"
              },
              {
                "type": "null"
              }
            ]
          },
          "confirmed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Når adressen ble aktiv"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "description": "Hver mottaker med påmeldingsstatus (bare aktive mottakere får rapporter)"
    },
    "blocks": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Innholdsblokker"
    },
    "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 Godta en rapportinvitasjon report_invites_accept

Tillatelse: public · Kun HTTP (ikke et MCP-verktøy)

Eksempel
curl -X POST https://privatusanalytics.com/reports/invites/:token/accept.json \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Token for ressursen"
    }
  },
  "required": [
    "token"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Mottaker-ID, f.eks. rcp_7Q2K9XH3AB"
    },
    "email": {
      "type": "string",
      "description": "Adressen"
    },
    "status": {
      "type": "string",
      "description": "active, pending, declined eller unsubscribed"
    },
    "invited_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Når den siste invitasjonen ble sendt"
        },
        {
          "type": "null"
        }
      ]
    },
    "expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Når en ventende invitasjon utløper"
        },
        {
          "type": "null"
        }
      ]
    },
    "confirmed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Når adressen ble aktiv"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
POST /reports/invites/:token/decline.json Avslå en rapportinvitasjon report_invites_decline

Tillatelse: public · Kun HTTP (ikke et MCP-verktøy)

Eksempel
curl -X POST https://privatusanalytics.com/reports/invites/:token/decline.json \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Token for ressursen"
    }
  },
  "required": [
    "token"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Mottaker-ID, f.eks. rcp_7Q2K9XH3AB"
    },
    "email": {
      "type": "string",
      "description": "Adressen"
    },
    "status": {
      "type": "string",
      "description": "active, pending, declined eller unsubscribed"
    },
    "invited_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Når den siste invitasjonen ble sendt"
        },
        {
          "type": "null"
        }
      ]
    },
    "expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Når en ventende invitasjon utløper"
        },
        {
          "type": "null"
        }
      ]
    },
    "confirmed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Når adressen ble aktiv"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
POST /reports/resubscribe/:token.json Motta rapporter igjen etter å ha meldt deg av report_resubscribes_confirm

Tillatelse: public · Kun HTTP (ikke et MCP-verktøy)

Eksempel
curl -X POST https://privatusanalytics.com/reports/resubscribe/:token.json \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Token for ressursen"
    }
  },
  "required": [
    "token"
  ]
}
Svardata
{
  "type": "object"
}
POST /reports/unsubscribe/:token/resubscribe.json Send en adresse en lenke på e-post for å motta rapporter igjen report_resubscribes_create

Tillatelse: public · Kun HTTP (ikke et MCP-verktøy)

Eksempel
curl -X POST https://privatusanalytics.com/reports/unsubscribe/:token/resubscribe.json \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Token for ressursen"
    }
  },
  "required": [
    "token"
  ]
}
Svardata
{
  "type": "object"
}
POST /reports/unsubscribe/:token.json Avmeld en adresse fra en e-postrapport report_unsubscribes_create

Tillatelse: public · Kun HTTP (ikke et MCP-verktøy)

Eksempel
curl -X POST https://privatusanalytics.com/reports/unsubscribe/:token.json \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Token for ressursen"
    }
  },
  "required": [
    "token"
  ]
}
Svardata
{
  "type": "object"
}

Eksporter

POST /workspaces/:workspace_id/exports.json Legg en eksport i kø (bygges i bakgrunnen) exports_create

Tillatelse: analytics.export

Eksempel
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/exports.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Nettsted som skal eksporteres (pa_…)",
      "examples": [
        "pa_7Q2K9XH3AB"
      ]
    },
    "kind": {
      "type": "string",
      "description": "aggregated: målinger etter tidsintervall og dimensjoner. pageviews/events/raw: én rad per treff (Pro og høyere). imported: importert daglig statistikk. dashboard: ZIP med oversiktspanelene",
      "enum": [
        "aggregated",
        "pageviews",
        "events",
        "imported",
        "raw",
        "dashboard"
      ],
      "default": "aggregated"
    },
    "file_format": {
      "type": "string",
      "description": "csv, json eller xlsx (aggregated, pageviews, events, imported), csv eller ndjson (raw), zip (dashboard)",
      "enum": [
        "csv",
        "json",
        "xlsx",
        "ndjson",
        "zip"
      ],
      "default": "csv"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Første dag, i eksportens tidssone",
      "examples": [
        "2026-09-01"
      ]
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Siste dag, inkludert (maks 400 dager, raw 93 dager)",
      "examples": [
        "2026-09-28"
      ]
    },
    "timezone": {
      "type": "string",
      "description": "Tidssone for datoer og gruppering, f.eks. America/New_York (standard: nettstedets tidssone)"
    },
    "grouping": {
      "type": "string",
      "description": "Tidsintervall for aggregerte eksporter",
      "enum": [
        "hour",
        "day",
        "week",
        "month",
        "quarter",
        "year"
      ],
      "default": "day"
    },
    "dimensions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Besøksdimensjoner å gruppere aggregerte eksporter etter (opptil 6), f.eks. country, channel, entry_page. For importerte eksporter: de importerte dimensjonene som skal tas med",
      "default": []
    },
    "metrics": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Målinger for aggregerte eksporter (standard alle): visitors, visits, pageviews, bounce_rate, visit_duration, views_per_visit, revenue",
      "default": []
    },
    "fields": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Kolonner for eksport av pageviews/events/raw (standard er alle unntatt 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": "Filtre, samme format som statistikk-API-et: [[\"dimension\",\"operator\",\"value\"], …]",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Bruk et lagret segment (seg_…)"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id",
    "from",
    "to",
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Eksport-ID, f.eks. exp_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nettsted som er eksportert (pa_…)"
        },
        {
          "type": "null"
        }
      ]
    },
    "kind": {
      "type": "string",
      "description": "aggregated, pageviews, events, imported, raw eller dashboard"
    },
    "format": {
      "type": "string",
      "description": "csv, json, xlsx, ndjson eller zip"
    },
    "status": {
      "type": "string",
      "description": "queued, running, complete, failed eller expired"
    },
    "params": {
      "type": "object",
      "description": "Eksportdefinisjonen (datoer, tidssone, gruppering, dimensjoner, målinger, felt, filtre)"
    },
    "row_count": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Rader skrevet"
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "anyOf": [
        {
          "type": "string",
          "description": "Hvorfor eksporten mislyktes"
        },
        {
          "type": "null"
        }
      ]
    },
    "completed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Når filen slettes"
        },
        {
          "type": "null"
        }
      ]
    },
    "download_url": {
      "anyOf": [
        {
          "type": "string",
          "description": "Sti som returnerer en kortlevd signert fillenke (exports_download)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /exports/:id.json Slett en eksport og filen exports_delete

Tillatelse: analytics.export

Eksempel
curl -X DELETE https://privatusanalytics.com/exports/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Eksport-ID, f.eks. exp_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nettsted som er eksportert (pa_…)"
        },
        {
          "type": "null"
        }
      ]
    },
    "kind": {
      "type": "string",
      "description": "aggregated, pageviews, events, imported, raw eller dashboard"
    },
    "format": {
      "type": "string",
      "description": "csv, json, xlsx, ndjson eller zip"
    },
    "status": {
      "type": "string",
      "description": "queued, running, complete, failed eller expired"
    },
    "params": {
      "type": "object",
      "description": "Eksportdefinisjonen (datoer, tidssone, gruppering, dimensjoner, målinger, felt, filtre)"
    },
    "row_count": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Rader skrevet"
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "anyOf": [
        {
          "type": "string",
          "description": "Hvorfor eksporten mislyktes"
        },
        {
          "type": "null"
        }
      ]
    },
    "completed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Når filen slettes"
        },
        {
          "type": "null"
        }
      ]
    },
    "download_url": {
      "anyOf": [
        {
          "type": "string",
          "description": "Sti som returnerer en kortlevd signert fillenke (exports_download)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /exports/:id/download.json Få en signert lenke til filen (gyldig i 10 minutter) exports_download

Tillatelse: analytics.export

Eksempel
curl https://privatusanalytics.com/exports/:id/download.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object"
}
GET /workspaces/:workspace_id/exports.json List eksporter (jobbkøen) exports_list

Tillatelse: analytics.export

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/exports.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Bare eksporter for dette nettstedet (pa_…)"
    },
    "status": {
      "type": "string",
      "description": "Bare eksporter med denne statusen",
      "enum": [
        "queued",
        "running",
        "complete",
        "failed",
        "expired"
      ]
    },
    "kind": {
      "type": "string",
      "description": "Bare eksporter av denne typen",
      "enum": [
        "aggregated",
        "pageviews",
        "events",
        "imported",
        "raw",
        "dashboard"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater per side (maks 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Eksport-ID, f.eks. exp_7Q2K9XH3AB"
      },
      "site_id": {
        "anyOf": [
          {
            "type": "string",
            "description": "Nettsted som er eksportert (pa_…)"
          },
          {
            "type": "null"
          }
        ]
      },
      "kind": {
        "type": "string",
        "description": "aggregated, pageviews, events, imported, raw eller dashboard"
      },
      "format": {
        "type": "string",
        "description": "csv, json, xlsx, ndjson eller zip"
      },
      "status": {
        "type": "string",
        "description": "queued, running, complete, failed eller expired"
      },
      "params": {
        "type": "object",
        "description": "Eksportdefinisjonen (datoer, tidssone, gruppering, dimensjoner, målinger, felt, filtre)"
      },
      "row_count": {
        "anyOf": [
          {
            "type": "integer",
            "description": "Rader skrevet"
          },
          {
            "type": "null"
          }
        ]
      },
      "error": {
        "anyOf": [
          {
            "type": "string",
            "description": "Hvorfor eksporten mislyktes"
          },
          {
            "type": "null"
          }
        ]
      },
      "completed_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "expires_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time",
            "description": "Når filen slettes"
          },
          {
            "type": "null"
          }
        ]
      },
      "download_url": {
        "anyOf": [
          {
            "type": "string",
            "description": "Sti som returnerer en kortlevd signert fillenke (exports_download)"
          },
          {
            "type": "null"
          }
        ]
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
POST /workspaces/:workspace_id/exports/preview.json Forhåndsvis en eksport: de første 20 radene og det anslåtte antallet rader exports_preview

Tillatelse: analytics.export

Eksempel
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/exports/preview.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Nettsted som skal eksporteres (pa_…)",
      "examples": [
        "pa_7Q2K9XH3AB"
      ]
    },
    "kind": {
      "type": "string",
      "description": "aggregated: målinger etter tidsintervall og dimensjoner. pageviews/events/raw: én rad per treff (Pro og høyere). imported: importert daglig statistikk. dashboard: ZIP med oversiktspanelene",
      "enum": [
        "aggregated",
        "pageviews",
        "events",
        "imported",
        "raw",
        "dashboard"
      ],
      "default": "aggregated"
    },
    "file_format": {
      "type": "string",
      "description": "csv, json eller xlsx (aggregated, pageviews, events, imported), csv eller ndjson (raw), zip (dashboard)",
      "enum": [
        "csv",
        "json",
        "xlsx",
        "ndjson",
        "zip"
      ],
      "default": "csv"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Første dag, i eksportens tidssone",
      "examples": [
        "2026-09-01"
      ]
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Siste dag, inkludert (maks 400 dager, raw 93 dager)",
      "examples": [
        "2026-09-28"
      ]
    },
    "timezone": {
      "type": "string",
      "description": "Tidssone for datoer og gruppering, f.eks. America/New_York (standard: nettstedets tidssone)"
    },
    "grouping": {
      "type": "string",
      "description": "Tidsintervall for aggregerte eksporter",
      "enum": [
        "hour",
        "day",
        "week",
        "month",
        "quarter",
        "year"
      ],
      "default": "day"
    },
    "dimensions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Besøksdimensjoner å gruppere aggregerte eksporter etter (opptil 6), f.eks. country, channel, entry_page. For importerte eksporter: de importerte dimensjonene som skal tas med",
      "default": []
    },
    "metrics": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Målinger for aggregerte eksporter (standard alle): visitors, visits, pageviews, bounce_rate, visit_duration, views_per_visit, revenue",
      "default": []
    },
    "fields": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Kolonner for eksport av pageviews/events/raw (standard er alle unntatt 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": "Filtre, samme format som statistikk-API-et: [[\"dimension\",\"operator\",\"value\"], …]",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Bruk et lagret segment (seg_…)"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id",
    "from",
    "to",
    "workspace_id"
  ]
}
Svardata
{
  "type": "object"
}
GET /exports/:id.json Hent en eksport og statusen exports_get

Tillatelse: analytics.export

Eksempel
curl https://privatusanalytics.com/exports/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Eksport-ID, f.eks. exp_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nettsted som er eksportert (pa_…)"
        },
        {
          "type": "null"
        }
      ]
    },
    "kind": {
      "type": "string",
      "description": "aggregated, pageviews, events, imported, raw eller dashboard"
    },
    "format": {
      "type": "string",
      "description": "csv, json, xlsx, ndjson eller zip"
    },
    "status": {
      "type": "string",
      "description": "queued, running, complete, failed eller expired"
    },
    "params": {
      "type": "object",
      "description": "Eksportdefinisjonen (datoer, tidssone, gruppering, dimensjoner, målinger, felt, filtre)"
    },
    "row_count": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Rader skrevet"
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "anyOf": [
        {
          "type": "string",
          "description": "Hvorfor eksporten mislyktes"
        },
        {
          "type": "null"
        }
      ]
    },
    "completed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Når filen slettes"
        },
        {
          "type": "null"
        }
      ]
    },
    "download_url": {
      "anyOf": [
        {
          "type": "string",
          "description": "Sti som returnerer en kortlevd signert fillenke (exports_download)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Fakturering

POST /workspaces/:workspace_id/billing/badge.json Meld deg på eller av merkebonusen (gratisplan) billing_badge

Tillatelse: billing.manage

Eksempel
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/billing/badge.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "enabled": {
      "type": "boolean",
      "description": "true for å verifisere merket og få bonusen"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "enabled",
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string"
    },
    "plan": {
      "type": "string",
      "description": "free, pro, business eller enterprise"
    },
    "plan_events": {
      "type": "integer",
      "description": "Hendelser i måneden i det betalte nivået"
    },
    "allowance": {
      "type": "integer",
      "description": "Hendelser i måneden inkludert eventuell merkebonus"
    },
    "billing_interval": {
      "anyOf": [
        {
          "type": "string",
          "description": "month eller year"
        },
        {
          "type": "null"
        }
      ]
    },
    "price": {
      "anyOf": [
        {
          "type": "integer",
          "description": "USD per faktureringsintervall"
        },
        {
          "type": "null"
        }
      ]
    },
    "subscription_status": {
      "type": "string",
      "description": "none, trialing, active, past_due, paused eller canceled"
    },
    "current_period_ends_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Fornyes eller avsluttes"
        },
        {
          "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 eller agency"
            },
            "status": {
              "type": "string",
              "description": "pending, approved (ikke på abonnementet ennå), active, rejected eller revoked"
            },
            "percent": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Prosent rabatt på Pro og Business (null for det gratis programmet for åpen kildekode)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "comp_events": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Gratis hendelser i måneden (kun det gratis programmet for åpen kildekode)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "organization_name": {
              "type": "string",
              "description": "Navn på organisasjon, skole, prosjekt eller byrå"
            },
            "website": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Nettsted"
                },
                {
                  "type": "null"
                }
              ]
            },
            "proof_url": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Lenke til dokumentasjon eller URL til kodelager"
                },
                {
                  "type": "null"
                }
              ]
            },
            "license": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "OSI-lisens (åpen kildekode)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "note": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Notat til vurderingen"
                },
                {
                  "type": "null"
                }
              ]
            },
            "rejection_reason": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Hvorfor søknaden ikke ble godkjent"
                },
                {
                  "type": "null"
                }
              ]
            },
            "created_at": {
              "type": "string",
              "format": "date-time",
              "description": "Søkt"
            },
            "reviewed_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Vurdert"
                },
                {
                  "type": "null"
                }
              ]
            },
            "applied_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Rabatten aktiv siden"
                },
                {
                  "type": "null"
                }
              ]
            },
            "revoked_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Programmet avsluttet"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Den siste søknaden til et rabattprogram, eller null"
        },
        {
          "type": "null"
        }
      ]
    },
    "discount_percent": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Prosent rabatt på Pro og Business fra et godkjent program, eller null"
        },
        {
          "type": "null"
        }
      ]
    },
    "billing_emails": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "tax_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "badge": {
      "type": "object",
      "description": "Merkebonus (gratisplan)"
    },
    "usage": {
      "type": "object",
      "properties": {
        "month": {
          "type": "string",
          "format": "date",
          "description": "Første dag i den rapporterte måneden"
        },
        "events": {
          "type": "integer",
          "description": "Fakturerbare hendelser (sidevisninger og egendefinerte hendelser)"
        },
        "bots": {
          "type": "integer",
          "description": "Bot-treff som er filtrert bort (faktureres ikke)"
        },
        "allowance": {
          "type": "integer",
          "description": "Inkluderte hendelser, med eventuell bonus for merket"
        },
        "percent": {
          "type": "number",
          "description": "Hendelser i prosent av kvoten"
        },
        "forecast": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Forventet antall hendelser ved månedsslutt"
            },
            {
              "type": "null"
            }
          ]
        },
        "forecast_percent": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "days_left": {
          "type": "integer",
          "description": "Dager igjen av måneden"
        },
        "status": {
          "type": "string",
          "description": "ok, warning (80 %+), over (en tidligere måned på eller over kvoten), locked eller paused"
        },
        "sites": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "site_id": {
                "type": "string"
              },
              "domain": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "events": {
                "type": "integer",
                "description": "Sidevisninger og egendefinerte hendelser denne måneden"
              },
              "share": {
                "type": "number",
                "description": "Prosent av totalen for arbeidsområdet"
              }
            }
          },
          "description": "Hendelser per nettsted"
        },
        "history": {
          "type": "array",
          "description": "Tidligere måneder, nyeste først"
        },
        "access_locked_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Dashbordene er låst av Privatus-ansatte siden"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused": {
          "type": "boolean",
          "description": "True mens nye hendelser forkastes (månedsgrensen er nådd, eller ansatte har satt innsamlingen på pause)"
        },
        "pause_reason": {
          "anyOf": [
            {
              "type": "string",
              "description": "Hvorfor innsamlingen er satt på pause: limit (månedskvoten er nådd) eller staff. null når det samles inn"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Når ansatte satte innsamlingen på pause"
            },
            {
              "type": "null"
            }
          ]
        },
        "resumes_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Når en pause på grunn av grensen oppheves: starten på neste måned (UTC), eller tidligere ved en oppgradering. Ellers null"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "description": "Denne måneden så langt"
    }
  }
}
POST /workspaces/:workspace_id/billing/cancel.json Si opp ved slutten av faktureringsperioden billing_cancel

Tillatelse: billing.manage

Eksempel
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/billing/cancel.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "reason": {
      "type": "string",
      "description": "Hovedårsak til oppsigelsen (valgfri undersøkelse)",
      "enum": [
        "too_expensive",
        "missing_features",
        "switching_tool",
        "not_using",
        "temporary",
        "other"
      ]
    },
    "comment": {
      "type": "string",
      "description": "Noe vi kunne gjort bedre"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string"
    },
    "plan": {
      "type": "string",
      "description": "free, pro, business eller enterprise"
    },
    "plan_events": {
      "type": "integer",
      "description": "Hendelser i måneden i det betalte nivået"
    },
    "allowance": {
      "type": "integer",
      "description": "Hendelser i måneden inkludert eventuell merkebonus"
    },
    "billing_interval": {
      "anyOf": [
        {
          "type": "string",
          "description": "month eller year"
        },
        {
          "type": "null"
        }
      ]
    },
    "price": {
      "anyOf": [
        {
          "type": "integer",
          "description": "USD per faktureringsintervall"
        },
        {
          "type": "null"
        }
      ]
    },
    "subscription_status": {
      "type": "string",
      "description": "none, trialing, active, past_due, paused eller canceled"
    },
    "current_period_ends_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Fornyes eller avsluttes"
        },
        {
          "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 eller agency"
            },
            "status": {
              "type": "string",
              "description": "pending, approved (ikke på abonnementet ennå), active, rejected eller revoked"
            },
            "percent": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Prosent rabatt på Pro og Business (null for det gratis programmet for åpen kildekode)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "comp_events": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Gratis hendelser i måneden (kun det gratis programmet for åpen kildekode)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "organization_name": {
              "type": "string",
              "description": "Navn på organisasjon, skole, prosjekt eller byrå"
            },
            "website": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Nettsted"
                },
                {
                  "type": "null"
                }
              ]
            },
            "proof_url": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Lenke til dokumentasjon eller URL til kodelager"
                },
                {
                  "type": "null"
                }
              ]
            },
            "license": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "OSI-lisens (åpen kildekode)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "note": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Notat til vurderingen"
                },
                {
                  "type": "null"
                }
              ]
            },
            "rejection_reason": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Hvorfor søknaden ikke ble godkjent"
                },
                {
                  "type": "null"
                }
              ]
            },
            "created_at": {
              "type": "string",
              "format": "date-time",
              "description": "Søkt"
            },
            "reviewed_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Vurdert"
                },
                {
                  "type": "null"
                }
              ]
            },
            "applied_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Rabatten aktiv siden"
                },
                {
                  "type": "null"
                }
              ]
            },
            "revoked_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Programmet avsluttet"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Den siste søknaden til et rabattprogram, eller null"
        },
        {
          "type": "null"
        }
      ]
    },
    "discount_percent": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Prosent rabatt på Pro og Business fra et godkjent program, eller null"
        },
        {
          "type": "null"
        }
      ]
    },
    "billing_emails": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "tax_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "badge": {
      "type": "object",
      "description": "Merkebonus (gratisplan)"
    },
    "usage": {
      "type": "object",
      "properties": {
        "month": {
          "type": "string",
          "format": "date",
          "description": "Første dag i den rapporterte måneden"
        },
        "events": {
          "type": "integer",
          "description": "Fakturerbare hendelser (sidevisninger og egendefinerte hendelser)"
        },
        "bots": {
          "type": "integer",
          "description": "Bot-treff som er filtrert bort (faktureres ikke)"
        },
        "allowance": {
          "type": "integer",
          "description": "Inkluderte hendelser, med eventuell bonus for merket"
        },
        "percent": {
          "type": "number",
          "description": "Hendelser i prosent av kvoten"
        },
        "forecast": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Forventet antall hendelser ved månedsslutt"
            },
            {
              "type": "null"
            }
          ]
        },
        "forecast_percent": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "days_left": {
          "type": "integer",
          "description": "Dager igjen av måneden"
        },
        "status": {
          "type": "string",
          "description": "ok, warning (80 %+), over (en tidligere måned på eller over kvoten), locked eller paused"
        },
        "sites": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "site_id": {
                "type": "string"
              },
              "domain": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "events": {
                "type": "integer",
                "description": "Sidevisninger og egendefinerte hendelser denne måneden"
              },
              "share": {
                "type": "number",
                "description": "Prosent av totalen for arbeidsområdet"
              }
            }
          },
          "description": "Hendelser per nettsted"
        },
        "history": {
          "type": "array",
          "description": "Tidligere måneder, nyeste først"
        },
        "access_locked_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Dashbordene er låst av Privatus-ansatte siden"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused": {
          "type": "boolean",
          "description": "True mens nye hendelser forkastes (månedsgrensen er nådd, eller ansatte har satt innsamlingen på pause)"
        },
        "pause_reason": {
          "anyOf": [
            {
              "type": "string",
              "description": "Hvorfor innsamlingen er satt på pause: limit (månedskvoten er nådd) eller staff. null når det samles inn"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Når ansatte satte innsamlingen på pause"
            },
            {
              "type": "null"
            }
          ]
        },
        "resumes_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Når en pause på grunn av grensen oppheves: starten på neste måned (UTC), eller tidligere ved en oppgradering. Ellers null"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "description": "Denne måneden så langt"
    }
  }
}
POST /workspaces/:workspace_id/billing/change_plan.json Endre plan, nivå eller intervall (forholdsmessig) billing_change_plan

Tillatelse: billing.manage

Eksempel
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/billing/change_plan.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "plan": {
      "type": "string",
      "description": "Plan å bytte til: pro eller business",
      "enum": [
        "pro",
        "business"
      ]
    },
    "events": {
      "type": "integer",
      "description": "Hendelser i måneden for nivået, fra GET /plans",
      "examples": [
        1000000
      ]
    },
    "interval": {
      "type": "string",
      "description": "Faktureringsintervall. Årlig gir 2 måneder gratis",
      "enum": [
        "month",
        "year"
      ],
      "default": "month"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "plan",
    "events",
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string"
    },
    "plan": {
      "type": "string",
      "description": "free, pro, business eller enterprise"
    },
    "plan_events": {
      "type": "integer",
      "description": "Hendelser i måneden i det betalte nivået"
    },
    "allowance": {
      "type": "integer",
      "description": "Hendelser i måneden inkludert eventuell merkebonus"
    },
    "billing_interval": {
      "anyOf": [
        {
          "type": "string",
          "description": "month eller year"
        },
        {
          "type": "null"
        }
      ]
    },
    "price": {
      "anyOf": [
        {
          "type": "integer",
          "description": "USD per faktureringsintervall"
        },
        {
          "type": "null"
        }
      ]
    },
    "subscription_status": {
      "type": "string",
      "description": "none, trialing, active, past_due, paused eller canceled"
    },
    "current_period_ends_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Fornyes eller avsluttes"
        },
        {
          "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 eller agency"
            },
            "status": {
              "type": "string",
              "description": "pending, approved (ikke på abonnementet ennå), active, rejected eller revoked"
            },
            "percent": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Prosent rabatt på Pro og Business (null for det gratis programmet for åpen kildekode)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "comp_events": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Gratis hendelser i måneden (kun det gratis programmet for åpen kildekode)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "organization_name": {
              "type": "string",
              "description": "Navn på organisasjon, skole, prosjekt eller byrå"
            },
            "website": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Nettsted"
                },
                {
                  "type": "null"
                }
              ]
            },
            "proof_url": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Lenke til dokumentasjon eller URL til kodelager"
                },
                {
                  "type": "null"
                }
              ]
            },
            "license": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "OSI-lisens (åpen kildekode)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "note": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Notat til vurderingen"
                },
                {
                  "type": "null"
                }
              ]
            },
            "rejection_reason": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Hvorfor søknaden ikke ble godkjent"
                },
                {
                  "type": "null"
                }
              ]
            },
            "created_at": {
              "type": "string",
              "format": "date-time",
              "description": "Søkt"
            },
            "reviewed_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Vurdert"
                },
                {
                  "type": "null"
                }
              ]
            },
            "applied_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Rabatten aktiv siden"
                },
                {
                  "type": "null"
                }
              ]
            },
            "revoked_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Programmet avsluttet"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Den siste søknaden til et rabattprogram, eller null"
        },
        {
          "type": "null"
        }
      ]
    },
    "discount_percent": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Prosent rabatt på Pro og Business fra et godkjent program, eller null"
        },
        {
          "type": "null"
        }
      ]
    },
    "billing_emails": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "tax_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "badge": {
      "type": "object",
      "description": "Merkebonus (gratisplan)"
    },
    "usage": {
      "type": "object",
      "properties": {
        "month": {
          "type": "string",
          "format": "date",
          "description": "Første dag i den rapporterte måneden"
        },
        "events": {
          "type": "integer",
          "description": "Fakturerbare hendelser (sidevisninger og egendefinerte hendelser)"
        },
        "bots": {
          "type": "integer",
          "description": "Bot-treff som er filtrert bort (faktureres ikke)"
        },
        "allowance": {
          "type": "integer",
          "description": "Inkluderte hendelser, med eventuell bonus for merket"
        },
        "percent": {
          "type": "number",
          "description": "Hendelser i prosent av kvoten"
        },
        "forecast": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Forventet antall hendelser ved månedsslutt"
            },
            {
              "type": "null"
            }
          ]
        },
        "forecast_percent": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "days_left": {
          "type": "integer",
          "description": "Dager igjen av måneden"
        },
        "status": {
          "type": "string",
          "description": "ok, warning (80 %+), over (en tidligere måned på eller over kvoten), locked eller paused"
        },
        "sites": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "site_id": {
                "type": "string"
              },
              "domain": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "events": {
                "type": "integer",
                "description": "Sidevisninger og egendefinerte hendelser denne måneden"
              },
              "share": {
                "type": "number",
                "description": "Prosent av totalen for arbeidsområdet"
              }
            }
          },
          "description": "Hendelser per nettsted"
        },
        "history": {
          "type": "array",
          "description": "Tidligere måneder, nyeste først"
        },
        "access_locked_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Dashbordene er låst av Privatus-ansatte siden"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused": {
          "type": "boolean",
          "description": "True mens nye hendelser forkastes (månedsgrensen er nådd, eller ansatte har satt innsamlingen på pause)"
        },
        "pause_reason": {
          "anyOf": [
            {
              "type": "string",
              "description": "Hvorfor innsamlingen er satt på pause: limit (månedskvoten er nådd) eller staff. null når det samles inn"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Når ansatte satte innsamlingen på pause"
            },
            {
              "type": "null"
            }
          ]
        },
        "resumes_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Når en pause på grunn av grensen oppheves: starten på neste måned (UTC), eller tidligere ved en oppgradering. Ellers null"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "description": "Denne måneden så langt"
    }
  }
}
POST /workspaces/:workspace_id/billing/checkout.json Start en Paddle-kasse for en betalt plan billing_checkout

Tillatelse: billing.manage

Eksempel
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/billing/checkout.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "plan": {
      "type": "string",
      "description": "Plan å bytte til: pro eller business",
      "enum": [
        "pro",
        "business"
      ]
    },
    "events": {
      "type": "integer",
      "description": "Hendelser i måneden for nivået, fra GET /plans",
      "examples": [
        1000000
      ]
    },
    "interval": {
      "type": "string",
      "description": "Faktureringsintervall. Årlig gir 2 måneder gratis",
      "enum": [
        "month",
        "year"
      ],
      "default": "month"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "plan",
    "events",
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "transaction_id": {
      "type": "string",
      "description": "Paddle-transaksjons-ID (txn_...)"
    },
    "url": {
      "anyOf": [
        {
          "type": "string",
          "description": "URL til den vertsbaserte kassen"
        },
        {
          "type": "null"
        }
      ]
    },
    "price_id": {
      "type": "string"
    },
    "plan": {
      "type": "string"
    },
    "events": {
      "type": "integer"
    },
    "interval": {
      "type": "string"
    },
    "amount": {
      "type": "integer",
      "description": "USD per intervall"
    },
    "client_token": {
      "anyOf": [
        {
          "type": "string",
          "description": "Paddle.js-token for klientsiden"
        },
        {
          "type": "null"
        }
      ]
    },
    "environment": {
      "type": "string",
      "description": "sandbox eller production"
    },
    "custom_data": {
      "type": "object",
      "description": "Sendt til Paddle for å knytte abonnementet"
    },
    "discount_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Paddle-rabatt-ID for et godkjent program, brukt på denne betalingen"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
POST /workspaces/:workspace_id/billing/discount.json Søk om rabatt for ideelle organisasjoner, utdanning eller åpen kildekode billing_discount

Tillatelse: billing.manage

Eksempel
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/billing/discount.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "program": {
      "type": "string",
      "description": "nonprofit, education, open_source (50 % rabatt), open_source_free (gratis Pro opptil 1M hendelser i måneden) eller agency (20 % rabatt på alle arbeidsområder du eier)",
      "enum": [
        "nonprofit",
        "education",
        "open_source",
        "open_source_free",
        "agency"
      ]
    },
    "organization_name": {
      "type": "string",
      "description": "Navnet på organisasjonen, skolen, prosjektet eller byrået"
    },
    "website": {
      "type": "string",
      "description": "Nettstedet deres"
    },
    "proof_url": {
      "type": "string",
      "description": "Lenke til dokumentasjon. For åpen kildekode, URL-en til kodelageret"
    },
    "license": {
      "type": "string",
      "description": "OSI-lisensen til prosjektet (kun åpen kildekode)"
    },
    "note": {
      "type": "string",
      "description": "Alt som hjelper vurderingen, opptil 1000 tegn"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "program",
    "organization_name",
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "program": {
      "type": "string",
      "description": "nonprofit, education, open_source, open_source_free eller agency"
    },
    "status": {
      "type": "string",
      "description": "pending, approved (ikke på abonnementet ennå), active, rejected eller revoked"
    },
    "percent": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Prosent rabatt på Pro og Business (null for det gratis programmet for åpen kildekode)"
        },
        {
          "type": "null"
        }
      ]
    },
    "comp_events": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Gratis hendelser i måneden (kun det gratis programmet for åpen kildekode)"
        },
        {
          "type": "null"
        }
      ]
    },
    "organization_name": {
      "type": "string",
      "description": "Navn på organisasjon, skole, prosjekt eller byrå"
    },
    "website": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nettsted"
        },
        {
          "type": "null"
        }
      ]
    },
    "proof_url": {
      "anyOf": [
        {
          "type": "string",
          "description": "Lenke til dokumentasjon eller URL til kodelager"
        },
        {
          "type": "null"
        }
      ]
    },
    "license": {
      "anyOf": [
        {
          "type": "string",
          "description": "OSI-lisens (åpen kildekode)"
        },
        {
          "type": "null"
        }
      ]
    },
    "note": {
      "anyOf": [
        {
          "type": "string",
          "description": "Notat til vurderingen"
        },
        {
          "type": "null"
        }
      ]
    },
    "rejection_reason": {
      "anyOf": [
        {
          "type": "string",
          "description": "Hvorfor søknaden ikke ble godkjent"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Søkt"
    },
    "reviewed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Vurdert"
        },
        {
          "type": "null"
        }
      ]
    },
    "applied_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Rabatten aktiv siden"
        },
        {
          "type": "null"
        }
      ]
    },
    "revoked_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Programmet avsluttet"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
POST /workspaces/:workspace_id/billing/payment_method.json Få en lenke for å oppdatere betalingsmåten billing_payment_method

Tillatelse: billing.manage

Eksempel
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/billing/payment_method.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "description": "portal, payment_method eller invoice"
    },
    "url": {
      "anyOf": [
        {
          "type": "string",
          "description": "Kortlevd Paddle-URL"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
POST /workspaces/:workspace_id/billing/portal.json Få en lenke til Paddle-kundeportalen billing_portal

Tillatelse: billing.manage

Eksempel
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/billing/portal.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "description": "portal, payment_method eller invoice"
    },
    "url": {
      "anyOf": [
        {
          "type": "string",
          "description": "Kortlevd Paddle-URL"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
GET /workspaces/:workspace_id/billing/preview.json Forhåndsvis en planendring med forholdsmessig beregning billing_preview

Tillatelse: billing.manage

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/billing/preview.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "plan": {
      "type": "string",
      "description": "Plan å bytte til: pro eller business",
      "enum": [
        "pro",
        "business"
      ]
    },
    "events": {
      "type": "integer",
      "description": "Hendelser i måneden for nivået, fra GET /plans",
      "examples": [
        1000000
      ]
    },
    "interval": {
      "type": "string",
      "description": "Faktureringsintervall. Årlig gir 2 måneder gratis",
      "enum": [
        "month",
        "year"
      ],
      "default": "month"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "plan",
    "events",
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "plan": {
      "type": "string"
    },
    "events": {
      "type": "integer"
    },
    "interval": {
      "type": "string"
    },
    "price_id": {
      "type": "string"
    },
    "amount": {
      "type": "integer",
      "description": "Ny pris i USD per intervall"
    },
    "currency": {
      "type": "string"
    },
    "charge_minor": {
      "type": "integer",
      "description": "Belastet nå, i minste enhet"
    },
    "credit_minor": {
      "type": "integer",
      "description": "Kreditt for ubrukt tid, minste enhet"
    },
    "result_action": {
      "anyOf": [
        {
          "type": "string",
          "description": "charge eller credit"
        },
        {
          "type": "null"
        }
      ]
    },
    "result_minor": {
      "type": "integer",
      "description": "Netto belastning eller kreditt, minste enhet"
    },
    "next_billed_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Forbruk eller grenser den nye planen ikke ville dekket"
    }
  }
}
POST /workspaces/:workspace_id/billing/resume.json Angre en planlagt oppsigelse eller gjenoppta en pause billing_resume

Tillatelse: billing.manage

Eksempel
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/billing/resume.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string"
    },
    "plan": {
      "type": "string",
      "description": "free, pro, business eller enterprise"
    },
    "plan_events": {
      "type": "integer",
      "description": "Hendelser i måneden i det betalte nivået"
    },
    "allowance": {
      "type": "integer",
      "description": "Hendelser i måneden inkludert eventuell merkebonus"
    },
    "billing_interval": {
      "anyOf": [
        {
          "type": "string",
          "description": "month eller year"
        },
        {
          "type": "null"
        }
      ]
    },
    "price": {
      "anyOf": [
        {
          "type": "integer",
          "description": "USD per faktureringsintervall"
        },
        {
          "type": "null"
        }
      ]
    },
    "subscription_status": {
      "type": "string",
      "description": "none, trialing, active, past_due, paused eller canceled"
    },
    "current_period_ends_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Fornyes eller avsluttes"
        },
        {
          "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 eller agency"
            },
            "status": {
              "type": "string",
              "description": "pending, approved (ikke på abonnementet ennå), active, rejected eller revoked"
            },
            "percent": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Prosent rabatt på Pro og Business (null for det gratis programmet for åpen kildekode)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "comp_events": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Gratis hendelser i måneden (kun det gratis programmet for åpen kildekode)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "organization_name": {
              "type": "string",
              "description": "Navn på organisasjon, skole, prosjekt eller byrå"
            },
            "website": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Nettsted"
                },
                {
                  "type": "null"
                }
              ]
            },
            "proof_url": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Lenke til dokumentasjon eller URL til kodelager"
                },
                {
                  "type": "null"
                }
              ]
            },
            "license": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "OSI-lisens (åpen kildekode)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "note": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Notat til vurderingen"
                },
                {
                  "type": "null"
                }
              ]
            },
            "rejection_reason": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Hvorfor søknaden ikke ble godkjent"
                },
                {
                  "type": "null"
                }
              ]
            },
            "created_at": {
              "type": "string",
              "format": "date-time",
              "description": "Søkt"
            },
            "reviewed_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Vurdert"
                },
                {
                  "type": "null"
                }
              ]
            },
            "applied_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Rabatten aktiv siden"
                },
                {
                  "type": "null"
                }
              ]
            },
            "revoked_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Programmet avsluttet"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Den siste søknaden til et rabattprogram, eller null"
        },
        {
          "type": "null"
        }
      ]
    },
    "discount_percent": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Prosent rabatt på Pro og Business fra et godkjent program, eller null"
        },
        {
          "type": "null"
        }
      ]
    },
    "billing_emails": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "tax_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "badge": {
      "type": "object",
      "description": "Merkebonus (gratisplan)"
    },
    "usage": {
      "type": "object",
      "properties": {
        "month": {
          "type": "string",
          "format": "date",
          "description": "Første dag i den rapporterte måneden"
        },
        "events": {
          "type": "integer",
          "description": "Fakturerbare hendelser (sidevisninger og egendefinerte hendelser)"
        },
        "bots": {
          "type": "integer",
          "description": "Bot-treff som er filtrert bort (faktureres ikke)"
        },
        "allowance": {
          "type": "integer",
          "description": "Inkluderte hendelser, med eventuell bonus for merket"
        },
        "percent": {
          "type": "number",
          "description": "Hendelser i prosent av kvoten"
        },
        "forecast": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Forventet antall hendelser ved månedsslutt"
            },
            {
              "type": "null"
            }
          ]
        },
        "forecast_percent": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "days_left": {
          "type": "integer",
          "description": "Dager igjen av måneden"
        },
        "status": {
          "type": "string",
          "description": "ok, warning (80 %+), over (en tidligere måned på eller over kvoten), locked eller paused"
        },
        "sites": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "site_id": {
                "type": "string"
              },
              "domain": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "events": {
                "type": "integer",
                "description": "Sidevisninger og egendefinerte hendelser denne måneden"
              },
              "share": {
                "type": "number",
                "description": "Prosent av totalen for arbeidsområdet"
              }
            }
          },
          "description": "Hendelser per nettsted"
        },
        "history": {
          "type": "array",
          "description": "Tidligere måneder, nyeste først"
        },
        "access_locked_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Dashbordene er låst av Privatus-ansatte siden"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused": {
          "type": "boolean",
          "description": "True mens nye hendelser forkastes (månedsgrensen er nådd, eller ansatte har satt innsamlingen på pause)"
        },
        "pause_reason": {
          "anyOf": [
            {
              "type": "string",
              "description": "Hvorfor innsamlingen er satt på pause: limit (månedskvoten er nådd) eller staff. null når det samles inn"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Når ansatte satte innsamlingen på pause"
            },
            {
              "type": "null"
            }
          ]
        },
        "resumes_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Når en pause på grunn av grensen oppheves: starten på neste måned (UTC), eller tidligere ved en oppgradering. Ellers null"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "description": "Denne måneden så langt"
    }
  }
}
GET /workspaces/:workspace_id/billing.json Hent planen, abonnementet og forbruket billing_get

Tillatelse: billing.manage

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/billing.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string"
    },
    "plan": {
      "type": "string",
      "description": "free, pro, business eller enterprise"
    },
    "plan_events": {
      "type": "integer",
      "description": "Hendelser i måneden i det betalte nivået"
    },
    "allowance": {
      "type": "integer",
      "description": "Hendelser i måneden inkludert eventuell merkebonus"
    },
    "billing_interval": {
      "anyOf": [
        {
          "type": "string",
          "description": "month eller year"
        },
        {
          "type": "null"
        }
      ]
    },
    "price": {
      "anyOf": [
        {
          "type": "integer",
          "description": "USD per faktureringsintervall"
        },
        {
          "type": "null"
        }
      ]
    },
    "subscription_status": {
      "type": "string",
      "description": "none, trialing, active, past_due, paused eller canceled"
    },
    "current_period_ends_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Fornyes eller avsluttes"
        },
        {
          "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 eller agency"
            },
            "status": {
              "type": "string",
              "description": "pending, approved (ikke på abonnementet ennå), active, rejected eller revoked"
            },
            "percent": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Prosent rabatt på Pro og Business (null for det gratis programmet for åpen kildekode)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "comp_events": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Gratis hendelser i måneden (kun det gratis programmet for åpen kildekode)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "organization_name": {
              "type": "string",
              "description": "Navn på organisasjon, skole, prosjekt eller byrå"
            },
            "website": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Nettsted"
                },
                {
                  "type": "null"
                }
              ]
            },
            "proof_url": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Lenke til dokumentasjon eller URL til kodelager"
                },
                {
                  "type": "null"
                }
              ]
            },
            "license": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "OSI-lisens (åpen kildekode)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "note": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Notat til vurderingen"
                },
                {
                  "type": "null"
                }
              ]
            },
            "rejection_reason": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Hvorfor søknaden ikke ble godkjent"
                },
                {
                  "type": "null"
                }
              ]
            },
            "created_at": {
              "type": "string",
              "format": "date-time",
              "description": "Søkt"
            },
            "reviewed_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Vurdert"
                },
                {
                  "type": "null"
                }
              ]
            },
            "applied_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Rabatten aktiv siden"
                },
                {
                  "type": "null"
                }
              ]
            },
            "revoked_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Programmet avsluttet"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Den siste søknaden til et rabattprogram, eller null"
        },
        {
          "type": "null"
        }
      ]
    },
    "discount_percent": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Prosent rabatt på Pro og Business fra et godkjent program, eller null"
        },
        {
          "type": "null"
        }
      ]
    },
    "billing_emails": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "tax_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "badge": {
      "type": "object",
      "description": "Merkebonus (gratisplan)"
    },
    "usage": {
      "type": "object",
      "properties": {
        "month": {
          "type": "string",
          "format": "date",
          "description": "Første dag i den rapporterte måneden"
        },
        "events": {
          "type": "integer",
          "description": "Fakturerbare hendelser (sidevisninger og egendefinerte hendelser)"
        },
        "bots": {
          "type": "integer",
          "description": "Bot-treff som er filtrert bort (faktureres ikke)"
        },
        "allowance": {
          "type": "integer",
          "description": "Inkluderte hendelser, med eventuell bonus for merket"
        },
        "percent": {
          "type": "number",
          "description": "Hendelser i prosent av kvoten"
        },
        "forecast": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Forventet antall hendelser ved månedsslutt"
            },
            {
              "type": "null"
            }
          ]
        },
        "forecast_percent": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "days_left": {
          "type": "integer",
          "description": "Dager igjen av måneden"
        },
        "status": {
          "type": "string",
          "description": "ok, warning (80 %+), over (en tidligere måned på eller over kvoten), locked eller paused"
        },
        "sites": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "site_id": {
                "type": "string"
              },
              "domain": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "events": {
                "type": "integer",
                "description": "Sidevisninger og egendefinerte hendelser denne måneden"
              },
              "share": {
                "type": "number",
                "description": "Prosent av totalen for arbeidsområdet"
              }
            }
          },
          "description": "Hendelser per nettsted"
        },
        "history": {
          "type": "array",
          "description": "Tidligere måneder, nyeste først"
        },
        "access_locked_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Dashbordene er låst av Privatus-ansatte siden"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused": {
          "type": "boolean",
          "description": "True mens nye hendelser forkastes (månedsgrensen er nådd, eller ansatte har satt innsamlingen på pause)"
        },
        "pause_reason": {
          "anyOf": [
            {
              "type": "string",
              "description": "Hvorfor innsamlingen er satt på pause: limit (månedskvoten er nådd) eller staff. null når det samles inn"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Når ansatte satte innsamlingen på pause"
            },
            {
              "type": "null"
            }
          ]
        },
        "resumes_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Når en pause på grunn av grensen oppheves: starten på neste måned (UTC), eller tidligere ved en oppgradering. Ellers null"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "description": "Denne måneden så langt"
    }
  }
}
PATCH /workspaces/:workspace_id/billing.json Oppdater faktura-e-poster, avgiftsnummer og automatisk oppgradering billing_update

Tillatelse: billing.manage

Eksempel
curl -X PATCH https://privatusanalytics.com/workspaces/:workspace_id/billing.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "billing_emails": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Ekstra adresser for fakturaer og faktureringsmeldinger (opptil 5)"
    },
    "tax_id": {
      "type": "string",
      "description": "MVA-/avgiftsnummer som vises på fakturaer"
    },
    "auto_upgrade": {
      "type": "boolean",
      "description": "true for å gå til neste nivå og belaste differansen når månedsgrensen er nådd, i stedet for å sette innsamlingen på pause. Av som standard"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string"
    },
    "plan": {
      "type": "string",
      "description": "free, pro, business eller enterprise"
    },
    "plan_events": {
      "type": "integer",
      "description": "Hendelser i måneden i det betalte nivået"
    },
    "allowance": {
      "type": "integer",
      "description": "Hendelser i måneden inkludert eventuell merkebonus"
    },
    "billing_interval": {
      "anyOf": [
        {
          "type": "string",
          "description": "month eller year"
        },
        {
          "type": "null"
        }
      ]
    },
    "price": {
      "anyOf": [
        {
          "type": "integer",
          "description": "USD per faktureringsintervall"
        },
        {
          "type": "null"
        }
      ]
    },
    "subscription_status": {
      "type": "string",
      "description": "none, trialing, active, past_due, paused eller canceled"
    },
    "current_period_ends_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Fornyes eller avsluttes"
        },
        {
          "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 eller agency"
            },
            "status": {
              "type": "string",
              "description": "pending, approved (ikke på abonnementet ennå), active, rejected eller revoked"
            },
            "percent": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Prosent rabatt på Pro og Business (null for det gratis programmet for åpen kildekode)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "comp_events": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Gratis hendelser i måneden (kun det gratis programmet for åpen kildekode)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "organization_name": {
              "type": "string",
              "description": "Navn på organisasjon, skole, prosjekt eller byrå"
            },
            "website": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Nettsted"
                },
                {
                  "type": "null"
                }
              ]
            },
            "proof_url": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Lenke til dokumentasjon eller URL til kodelager"
                },
                {
                  "type": "null"
                }
              ]
            },
            "license": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "OSI-lisens (åpen kildekode)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "note": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Notat til vurderingen"
                },
                {
                  "type": "null"
                }
              ]
            },
            "rejection_reason": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Hvorfor søknaden ikke ble godkjent"
                },
                {
                  "type": "null"
                }
              ]
            },
            "created_at": {
              "type": "string",
              "format": "date-time",
              "description": "Søkt"
            },
            "reviewed_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Vurdert"
                },
                {
                  "type": "null"
                }
              ]
            },
            "applied_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Rabatten aktiv siden"
                },
                {
                  "type": "null"
                }
              ]
            },
            "revoked_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Programmet avsluttet"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Den siste søknaden til et rabattprogram, eller null"
        },
        {
          "type": "null"
        }
      ]
    },
    "discount_percent": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Prosent rabatt på Pro og Business fra et godkjent program, eller null"
        },
        {
          "type": "null"
        }
      ]
    },
    "billing_emails": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "tax_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "badge": {
      "type": "object",
      "description": "Merkebonus (gratisplan)"
    },
    "usage": {
      "type": "object",
      "properties": {
        "month": {
          "type": "string",
          "format": "date",
          "description": "Første dag i den rapporterte måneden"
        },
        "events": {
          "type": "integer",
          "description": "Fakturerbare hendelser (sidevisninger og egendefinerte hendelser)"
        },
        "bots": {
          "type": "integer",
          "description": "Bot-treff som er filtrert bort (faktureres ikke)"
        },
        "allowance": {
          "type": "integer",
          "description": "Inkluderte hendelser, med eventuell bonus for merket"
        },
        "percent": {
          "type": "number",
          "description": "Hendelser i prosent av kvoten"
        },
        "forecast": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Forventet antall hendelser ved månedsslutt"
            },
            {
              "type": "null"
            }
          ]
        },
        "forecast_percent": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "days_left": {
          "type": "integer",
          "description": "Dager igjen av måneden"
        },
        "status": {
          "type": "string",
          "description": "ok, warning (80 %+), over (en tidligere måned på eller over kvoten), locked eller paused"
        },
        "sites": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "site_id": {
                "type": "string"
              },
              "domain": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "events": {
                "type": "integer",
                "description": "Sidevisninger og egendefinerte hendelser denne måneden"
              },
              "share": {
                "type": "number",
                "description": "Prosent av totalen for arbeidsområdet"
              }
            }
          },
          "description": "Hendelser per nettsted"
        },
        "history": {
          "type": "array",
          "description": "Tidligere måneder, nyeste først"
        },
        "access_locked_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Dashbordene er låst av Privatus-ansatte siden"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused": {
          "type": "boolean",
          "description": "True mens nye hendelser forkastes (månedsgrensen er nådd, eller ansatte har satt innsamlingen på pause)"
        },
        "pause_reason": {
          "anyOf": [
            {
              "type": "string",
              "description": "Hvorfor innsamlingen er satt på pause: limit (månedskvoten er nådd) eller staff. null når det samles inn"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Når ansatte satte innsamlingen på pause"
            },
            {
              "type": "null"
            }
          ]
        },
        "resumes_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Når en pause på grunn av grensen oppheves: starten på neste måned (UTC), eller tidligere ved en oppgradering. Ellers null"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "description": "Denne måneden så langt"
    }
  }
}
GET /workspaces/:workspace_id/billing/usage.json Hent forbruket denne måneden, prognosen og fordelingen per nettsted billing_usage

Tillatelse: billing.manage

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/billing/usage.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "month": {
      "type": "string",
      "format": "date",
      "description": "En hvilken som helst dag i måneden som skal rapporteres (standard er denne måneden)",
      "examples": [
        "2026-09-01"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "month": {
      "type": "string",
      "format": "date",
      "description": "Første dag i den rapporterte måneden"
    },
    "events": {
      "type": "integer",
      "description": "Fakturerbare hendelser (sidevisninger og egendefinerte hendelser)"
    },
    "bots": {
      "type": "integer",
      "description": "Bot-treff som er filtrert bort (faktureres ikke)"
    },
    "allowance": {
      "type": "integer",
      "description": "Inkluderte hendelser, med eventuell bonus for merket"
    },
    "percent": {
      "type": "number",
      "description": "Hendelser i prosent av kvoten"
    },
    "forecast": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Forventet antall hendelser ved månedsslutt"
        },
        {
          "type": "null"
        }
      ]
    },
    "forecast_percent": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "days_left": {
      "type": "integer",
      "description": "Dager igjen av måneden"
    },
    "status": {
      "type": "string",
      "description": "ok, warning (80 %+), over (en tidligere måned på eller over kvoten), locked eller paused"
    },
    "sites": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "site_id": {
            "type": "string"
          },
          "domain": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "events": {
            "type": "integer",
            "description": "Sidevisninger og egendefinerte hendelser denne måneden"
          },
          "share": {
            "type": "number",
            "description": "Prosent av totalen for arbeidsområdet"
          }
        }
      },
      "description": "Hendelser per nettsted"
    },
    "history": {
      "type": "array",
      "description": "Tidligere måneder, nyeste først"
    },
    "access_locked_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Dashbordene er låst av Privatus-ansatte siden"
        },
        {
          "type": "null"
        }
      ]
    },
    "collection_paused": {
      "type": "boolean",
      "description": "True mens nye hendelser forkastes (månedsgrensen er nådd, eller ansatte har satt innsamlingen på pause)"
    },
    "pause_reason": {
      "anyOf": [
        {
          "type": "string",
          "description": "Hvorfor innsamlingen er satt på pause: limit (månedskvoten er nådd) eller staff. null når det samles inn"
        },
        {
          "type": "null"
        }
      ]
    },
    "collection_paused_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Når ansatte satte innsamlingen på pause"
        },
        {
          "type": "null"
        }
      ]
    },
    "resumes_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Når en pause på grunn av grensen oppheves: starten på neste måned (UTC), eller tidligere ved en oppgradering. Ellers null"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
GET /workspaces/:workspace_id/billing/invoices.json List fakturaer billing_invoices_list

Tillatelse: billing.manage

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/billing/invoices.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater per side (maks 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Paddle-transaksjons-ID"
      },
      "invoice_number": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "status": {
        "type": "string",
        "description": "paid, completed, payment_failed, ..."
      },
      "amount_minor": {
        "type": "integer",
        "description": "Totalt i minste enhet (øre/cent)"
      },
      "currency": {
        "type": "string"
      },
      "billed_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      }
    }
  }
}
GET /workspaces/:workspace_id/billing/invoices/:id.json Hent PDF-lenken for en faktura billing_invoices_get

Tillatelse: billing.manage

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/billing/invoices/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "description": "portal, payment_method eller invoice"
    },
    "url": {
      "anyOf": [
        {
          "type": "string",
          "description": "Kortlevd Paddle-URL"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}

Hendelser

GET /sites/:site_id/events/properties.json List egenskapsnøkler for hendelser sett de siste 30 dagene event_properties_list

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/events/properties.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "event": {
      "type": "string",
      "description": "Bare nøkler sett på dette rå hendelsesnavnet"
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
PATCH /sites/:site_id/events/properties.json Gi en egenskapsnøkkel for hendelser nytt navn eller skjul den event_properties_update

Tillatelse: sites.manage

Eksempel
curl -X PATCH https://privatusanalytics.com/sites/:site_id/events/properties.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "key": {
      "type": "string",
      "description": "Egenskapsnøkkel slik den er lagret, f.eks. plan"
    },
    "display_name": {
      "type": "string",
      "description": "Etikett som vises i stedet (tom fjerner den)"
    },
    "hidden": {
      "type": "boolean",
      "description": "Skjul denne nøkkelen fra rapporter"
    },
    "export_safe": {
      "type": "boolean",
      "description": "Nøkkelen inneholder ingen personopplysninger, så den tas med i rå eksporter og datavarehussynkroniseringer"
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "key",
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
DELETE /sites/:site_id/events.json Slett en hendelse og historikken (kjører i bakgrunnen, bekreft ved å skrive navnet) events_delete

Tillatelse: sites.manage

Eksempel
curl -X DELETE https://privatusanalytics.com/sites/:site_id/events.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Rått hendelsesnavn som skal slettes"
    },
    "confirm": {
      "type": "string",
      "description": "Skriv hendelsesnavnet igjen for å bekrefte"
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "confirm",
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
GET /sites/:site_id/events.json List hendelser med fullføringer, besøk, konverteringsrate og første/siste gang sett events_list

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/events.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Forhåndsvalgt datoområde. Bruk custom med from/to",
      "enum": [
        "today",
        "yesterday",
        "24h",
        "7d",
        "14d",
        "28d",
        "30d",
        "90d",
        "mtd",
        "last_month",
        "qtd",
        "last_quarter",
        "ytd",
        "12mo",
        "last_year",
        "all",
        "custom"
      ],
      "default": "30d"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Start på egendefinert område (nettstedets tidssone)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Slutt på egendefinert område, inkludert"
    },
    "compare": {
      "type": "string",
      "description": "Sammenligningsperiode",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Start på egendefinert sammenligning"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Slutt på egendefinert sammenligning"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Juster sammenligningsdagene til ukedagene",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtre: [[\"dimension\",\"operator\",\"value\"], …]. Operatorer: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Pakk betingelser inn i {\"any\": [...]} for ELLER.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Bruk et lagret segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Legg til importerte historiske data (datoer før den første native hendelsen, ignoreres når filtre eller et segment brukes)",
      "default": false
    },
    "search": {
      "type": "string",
      "description": "Bare hendelser hvis navn inneholder dette"
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
POST /sites/:site_id/events/merge.json Slå sammen flere hendelser til ett visningsnavn events_merge

Tillatelse: sites.manage

Eksempel
curl -X POST https://privatusanalytics.com/sites/:site_id/events/merge.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "names": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Rå hendelsesnavn som skal slås sammen"
    },
    "into": {
      "type": "string",
      "description": "Visningsnavn for den sammenslåtte hendelsen",
      "examples": [
        "Signup"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "names",
    "into",
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Rått hendelsesnavn slik sporeren sendte det"
    },
    "display_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Navn som vises i rapporter"
        },
        {
          "type": "null"
        }
      ]
    },
    "hidden": {
      "type": "boolean",
      "description": "Skjult fra rapporter"
    },
    "currency": {
      "anyOf": [
        {
          "type": "string",
          "description": "Inntektsvaluta"
        },
        {
          "type": "null"
        }
      ]
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/events/detail.json Én hendelse: diagram, egenskapspivot, aggregater for tallegenskaper, sider og kilder events_get

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/events/detail.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Forhåndsvalgt datoområde. Bruk custom med from/to",
      "enum": [
        "today",
        "yesterday",
        "24h",
        "7d",
        "14d",
        "28d",
        "30d",
        "90d",
        "mtd",
        "last_month",
        "qtd",
        "last_quarter",
        "ytd",
        "12mo",
        "last_year",
        "all",
        "custom"
      ],
      "default": "30d"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Start på egendefinert område (nettstedets tidssone)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Slutt på egendefinert område, inkludert"
    },
    "compare": {
      "type": "string",
      "description": "Sammenligningsperiode",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Start på egendefinert sammenligning"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Slutt på egendefinert sammenligning"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Juster sammenligningsdagene til ukedagene",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtre: [[\"dimension\",\"operator\",\"value\"], …]. Operatorer: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Pakk betingelser inn i {\"any\": [...]} for ELLER.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Bruk et lagret segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Legg til importerte historiske data (datoer før den første native hendelsen, ignoreres når filtre eller et segment brukes)",
      "default": false
    },
    "name": {
      "type": "string",
      "description": "Hendelsesnavn slik det vises (etter navneendringer)",
      "examples": [
        "Signup"
      ]
    },
    "properties": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Opptil 3 egenskapsnøkler å pivotere etter",
      "default": []
    },
    "interval": {
      "type": "string",
      "description": "Intervallstørrelse for diagrammet",
      "enum": [
        "auto",
        "minute",
        "hour",
        "day",
        "week",
        "month",
        "quarter",
        "year"
      ],
      "default": "auto"
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
PATCH /sites/:site_id/events/settings.json Gi en hendelse nytt navn, skjul eller vis den, eller angi valutaen events_update

Tillatelse: sites.manage

Eksempel
curl -X PATCH https://privatusanalytics.com/sites/:site_id/events/settings.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Rått hendelsesnavn slik sporeren sendte det",
      "examples": [
        "signup_click"
      ]
    },
    "display_name": {
      "type": "string",
      "description": "Navn som vises i stedet (tom fjerner navneendringen)"
    },
    "hidden": {
      "type": "boolean",
      "description": "Skjul fra rapporter (dataene beholdes)"
    },
    "currency": {
      "type": "string",
      "description": "Valuta for inntekt på denne hendelsen (ISO 4217)"
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Rått hendelsesnavn slik sporeren sendte det"
    },
    "display_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Navn som vises i rapporter"
        },
        {
          "type": "null"
        }
      ]
    },
    "hidden": {
      "type": "boolean",
      "description": "Skjult fra rapporter"
    },
    "currency": {
      "anyOf": [
        {
          "type": "string",
          "description": "Inntektsvaluta"
        },
        {
          "type": "null"
        }
      ]
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Importer

GET /sites/:site_id/imports/google/properties.json List Google Analytics 4-egenskaper som kan importeres imports_google_properties

Tillatelse: sites.manage

Eksempel
curl https://privatusanalytics.com/sites/:site_id/imports/google/properties.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
POST /sites/:site_id/imports.json Start en import (GA4-egenskap eller CSV-opplasting) imports_create

Tillatelse: sites.manage

Eksempel
curl -X POST https://privatusanalytics.com/sites/:site_id/imports.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "source": {
      "type": "string",
      "description": "ga4 (Google Analytics 4 API) eller verktøyet du laster opp CSV-eksporten fra",
      "enum": [
        "ga4",
        "universal_analytics",
        "fathom",
        "simple_analytics",
        "plausible",
        "matomo",
        "umami",
        "clicky"
      ]
    },
    "property_id": {
      "type": "string",
      "description": "GA4-egenskap, f.eks. properties/123 (se imports_google_properties). Kreves for ga4",
      "examples": [
        "properties/123456789"
      ]
    },
    "date_from": {
      "type": "string",
      "format": "date",
      "description": "Første dag som skal importeres. Kreves for ga4. For CSV-filer uten datokolonne får hver rad denne datoen"
    },
    "date_to": {
      "type": "string",
      "format": "date",
      "description": "Siste dag som skal importeres (ga4 bruker som standard dagen før din første sporede hendelse, eller i går)"
    },
    "file": {
      "type": "string",
      "format": "binary",
      "description": "CSV-eksport (multipart-opplasting, maks 50 MB). Kreves for CSV-kilder"
    },
    "dimension": {
      "type": "string",
      "description": "Hva CSV-radene brytes ned etter (overstyrer gjenkjenning, nødvendig for Matomo \"Label\"-eksporter)",
      "enum": [
        "total",
        "page",
        "source",
        "country",
        "device",
        "browser",
        "os"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "source",
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Import-ID"
    },
    "site_id": {
      "type": "string"
    },
    "source": {
      "type": "string",
      "description": "ga4, universal_analytics, fathom, simple_analytics, plausible, matomo, umami eller clicky"
    },
    "status": {
      "type": "string",
      "description": "queued, running, complete eller failed"
    },
    "date_from": {
      "anyOf": [
        {
          "type": "string",
          "format": "date",
          "description": "Første importerte dag"
        },
        {
          "type": "null"
        }
      ]
    },
    "date_to": {
      "anyOf": [
        {
          "type": "string",
          "format": "date",
          "description": "Siste importerte dag"
        },
        {
          "type": "null"
        }
      ]
    },
    "rows_imported": {
      "type": "integer",
      "description": "Daglige rader lagret"
    },
    "error": {
      "anyOf": [
        {
          "type": "string",
          "description": "Hvorfor importen mislyktes"
        },
        {
          "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 Slett en import og alle importerte data imports_delete

Tillatelse: sites.manage

Eksempel
curl -X DELETE https://privatusanalytics.com/sites/:site_id/imports/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Import-ID"
    },
    "site_id": {
      "type": "string"
    },
    "source": {
      "type": "string",
      "description": "ga4, universal_analytics, fathom, simple_analytics, plausible, matomo, umami eller clicky"
    },
    "status": {
      "type": "string",
      "description": "queued, running, complete eller failed"
    },
    "date_from": {
      "anyOf": [
        {
          "type": "string",
          "format": "date",
          "description": "Første importerte dag"
        },
        {
          "type": "null"
        }
      ]
    },
    "date_to": {
      "anyOf": [
        {
          "type": "string",
          "format": "date",
          "description": "Siste importerte dag"
        },
        {
          "type": "null"
        }
      ]
    },
    "rows_imported": {
      "type": "integer",
      "description": "Daglige rader lagret"
    },
    "error": {
      "anyOf": [
        {
          "type": "string",
          "description": "Hvorfor importen mislyktes"
        },
        {
          "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 List importer for et nettsted imports_list

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/imports.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Bare importer med denne statusen",
      "enum": [
        "queued",
        "running",
        "complete",
        "failed"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater per side (maks 100)"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Import-ID"
      },
      "site_id": {
        "type": "string"
      },
      "source": {
        "type": "string",
        "description": "ga4, universal_analytics, fathom, simple_analytics, plausible, matomo, umami eller clicky"
      },
      "status": {
        "type": "string",
        "description": "queued, running, complete eller failed"
      },
      "date_from": {
        "anyOf": [
          {
            "type": "string",
            "format": "date",
            "description": "Første importerte dag"
          },
          {
            "type": "null"
          }
        ]
      },
      "date_to": {
        "anyOf": [
          {
            "type": "string",
            "format": "date",
            "description": "Siste importerte dag"
          },
          {
            "type": "null"
          }
        ]
      },
      "rows_imported": {
        "type": "integer",
        "description": "Daglige rader lagret"
      },
      "error": {
        "anyOf": [
          {
            "type": "string",
            "description": "Hvorfor importen mislyktes"
          },
          {
            "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 Hent en import og statusen imports_get

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/imports/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Import-ID"
    },
    "site_id": {
      "type": "string"
    },
    "source": {
      "type": "string",
      "description": "ga4, universal_analytics, fathom, simple_analytics, plausible, matomo, umami eller clicky"
    },
    "status": {
      "type": "string",
      "description": "queued, running, complete eller failed"
    },
    "date_from": {
      "anyOf": [
        {
          "type": "string",
          "format": "date",
          "description": "Første importerte dag"
        },
        {
          "type": "null"
        }
      ]
    },
    "date_to": {
      "anyOf": [
        {
          "type": "string",
          "format": "date",
          "description": "Siste importerte dag"
        },
        {
          "type": "null"
        }
      ]
    },
    "rows_imported": {
      "type": "integer",
      "description": "Daglige rader lagret"
    },
    "error": {
      "anyOf": [
        {
          "type": "string",
          "description": "Hvorfor importen mislyktes"
        },
        {
          "type": "null"
        }
      ]
    },
    "completed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Innsamling

POST /api/logs.json Send servertilgangslogger for rapportering om AI-roboter (JSON {lines: [...]} eller kombinert logtekst, med innsamlingsnøkkelen for nettstedet som Bearer-token) crawler_logs_create

Tillatelse: public · Kun HTTP (ikke et MCP-verktøy)

Eksempel
curl -X POST https://privatusanalytics.com/api/logs.json \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "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": "Loggelinjer: [{ts, path, status, user_agent}] (maks 1000)"
    }
  },
  "required": [
    "lines"
  ]
}
Svardata
{
  "type": "object"
}
POST /api/event.json Samle inn et nettlesertreff (brukes av /js/pa.js) ingest_event

Tillatelse: public · Kun HTTP (ikke et MCP-verktøy)

Eksempel
curl -X POST https://privatusanalytics.com/api/event.json \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "site": {
      "type": "string",
      "description": "Nettsted-ID (pa_…)"
    },
    "type": {
      "type": "string",
      "description": "Treff-type",
      "enum": [
        "pageview",
        "event",
        "engagement",
        "vital",
        "click"
      ]
    },
    "url": {
      "type": "string",
      "description": "Full side-URL"
    },
    "referrer": {
      "type": "string",
      "description": "document.referrer"
    },
    "name": {
      "type": "string",
      "description": "Hendelsesnavn (type=event) eller vital-navn"
    },
    "props": {
      "type": "object",
      "additionalProperties": true,
      "description": "Hendelsesegenskaper: opptil 30 verdier av typen streng/tall/boolsk",
      "default": {}
    },
    "screen_width": {
      "type": "integer",
      "description": "Skjermbredde i piksler"
    },
    "language": {
      "type": "string",
      "description": "navigator.language"
    },
    "engaged_ms": {
      "type": "integer",
      "description": "Synlig tid på siden (engasjement)"
    },
    "scroll_depth": {
      "type": "integer",
      "description": "Maks rulledybde i % (engasjement)"
    },
    "value": {
      "type": "number",
      "description": "Web Vital-verdi (type=vital)"
    },
    "selector": {
      "type": "string",
      "description": "Selektor for elementet som ble klikket (type=click)"
    },
    "hash_mode": {
      "type": "boolean",
      "description": "Behold #fragmentet (nettsteder med hash-ruting)",
      "default": false
    },
    "dnt": {
      "type": "boolean",
      "description": "Do Not Track er på",
      "default": false
    },
    "gpc": {
      "type": "boolean",
      "description": "Global Privacy Control er på",
      "default": false
    },
    "revenue": {
      "type": "number",
      "description": "Inntekt i hovedenheter, f.eks. 49.99"
    },
    "currency": {
      "type": "string",
      "description": "ISO 4217-valuta for inntekten"
    }
  },
  "required": [
    "site",
    "type",
    "url"
  ]
}
Svardata
{
  "type": "object"
}
POST /api/events.json Samle inn hendelser fra serversiden med en innsamlingsnøkkel for nettstedet ingest_events

Tillatelse: public · Kun HTTP (ikke et MCP-verktøy)

Eksempel
curl -X POST https://privatusanalytics.com/api/events.json \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "events": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      },
      "description": "Opptil 100 hendelser"
    }
  },
  "required": [
    "events"
  ]
}
Svardata
{
  "type": "object"
}
GET /api/pixel.json Samle inn en sidevisning uten JavaScript (1×1 GIF) ingest_pixel

Tillatelse: public · Kun HTTP (ikke et MCP-verktøy)

Eksempel
curl https://privatusanalytics.com/api/pixel.json
Inndata
{
  "type": "object",
  "properties": {},
  "required": []
}
Svardata
{
  "type": "object"
}

Kampanjer

POST /sites/:site_id/campaigns/costs.json Angi utgiftene for en kampanje i en måned campaign_costs_create

Tillatelse: content.write

Eksempel
curl -X POST https://privatusanalytics.com/sites/:site_id/campaigns/costs.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "campaign": {
      "type": "string",
      "description": "utm_campaign-verdien utgiftene tilhører",
      "examples": [
        "spring_sale"
      ]
    },
    "month": {
      "type": "string",
      "description": "Måned, YYYY-MM",
      "examples": [
        "2026-09"
      ]
    },
    "amount": {
      "type": "number",
      "description": "Utgift i hovedenheter, f.eks. 1250.50"
    },
    "currency": {
      "type": "string",
      "description": "ISO 4217-valuta (standard er nettstedets valuta)"
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "campaign",
    "month",
    "amount",
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "ID for kostnadsoppføring"
    },
    "campaign": {
      "type": "string",
      "description": "utm_campaign-verdi"
    },
    "month": {
      "type": "string",
      "description": "Måned, YYYY-MM"
    },
    "amount_minor": {
      "type": "integer",
      "description": "Utgift i minste enhet"
    },
    "currency": {
      "type": "string",
      "description": "ISO 4217-valuta for beløpet"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:site_id/campaigns/costs/:id.json Slett en kampanjekostnad campaign_costs_delete

Tillatelse: content.write

Eksempel
curl -X DELETE https://privatusanalytics.com/sites/:site_id/campaigns/costs/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "ID for kostnadsoppføring"
    },
    "campaign": {
      "type": "string",
      "description": "utm_campaign-verdi"
    },
    "month": {
      "type": "string",
      "description": "Måned, YYYY-MM"
    },
    "amount_minor": {
      "type": "integer",
      "description": "Utgift i minste enhet"
    },
    "currency": {
      "type": "string",
      "description": "ISO 4217-valuta for beløpet"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /sites/:site_id/campaigns/costs/import.json Importer kampanjekostnader fra CSV (campaign,month,amount[,currency]) campaign_costs_import

Tillatelse: content.write

Eksempel
curl -X POST https://privatusanalytics.com/sites/:site_id/campaigns/costs/import.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "file": {
      "type": "string",
      "format": "binary",
      "description": "Opplasting av CSV-fil (multipart-skjemaer)"
    },
    "csv": {
      "type": "string",
      "description": "CSV-tekst: campaign,month,amount[,currency]"
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "imported": {
      "type": "integer",
      "description": "Rader lagret"
    },
    "failed": {
      "type": "integer",
      "description": "Rader hoppet over"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Hvorfor rader ble hoppet over (de første 50)"
    }
  }
}
GET /sites/:site_id/campaigns/costs.json List kampanjekostnader campaign_costs_list

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/campaigns/costs.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "campaign": {
      "type": "string",
      "description": "Bare denne kampanjen"
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater per side (maks 100)"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "format": "uuid",
        "description": "ID for kostnadsoppføring"
      },
      "campaign": {
        "type": "string",
        "description": "utm_campaign-verdi"
      },
      "month": {
        "type": "string",
        "description": "Måned, YYYY-MM"
      },
      "amount_minor": {
        "type": "integer",
        "description": "Utgift i minste enhet"
      },
      "currency": {
        "type": "string",
        "description": "ISO 4217-valuta for beløpet"
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      },
      "updated_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
PATCH /sites/:site_id/campaigns/costs/:id.json Endre en kampanjekostnad campaign_costs_update

Tillatelse: content.write

Eksempel
curl -X PATCH https://privatusanalytics.com/sites/:site_id/campaigns/costs/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "campaign": {
      "type": "string",
      "description": "utm_campaign-verdi"
    },
    "month": {
      "type": "string",
      "description": "Måned, YYYY-MM"
    },
    "amount": {
      "type": "number",
      "description": "Utgift i hovedenheter"
    },
    "currency": {
      "type": "string",
      "description": "ISO 4217-valuta"
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "ID for kostnadsoppføring"
    },
    "campaign": {
      "type": "string",
      "description": "utm_campaign-verdi"
    },
    "month": {
      "type": "string",
      "description": "Måned, YYYY-MM"
    },
    "amount_minor": {
      "type": "integer",
      "description": "Utgift i minste enhet"
    },
    "currency": {
      "type": "string",
      "description": "ISO 4217-valuta for beløpet"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/campaigns/builder.json Bygg og valider en URL med UTM-koder campaigns_builder

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/campaigns/builder.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "destination": {
      "type": "string",
      "description": "URL til landingssiden (https://…)",
      "examples": [
        "https://example.com/pricing"
      ]
    },
    "preset": {
      "type": "string",
      "description": "Fyll ut utm_source/utm_medium for en kanal når de er tomme",
      "enum": [
        "newsletter",
        "social",
        "paid_search",
        "paid_social",
        "print",
        "partner"
      ]
    },
    "utm_source": {
      "type": "string",
      "description": "Hvor trafikken kommer fra"
    },
    "utm_medium": {
      "type": "string",
      "description": "Markedsføringsmedium, f.eks. email, cpc"
    },
    "utm_campaign": {
      "type": "string",
      "description": "Kampanjenavn, f.eks. spring_sale"
    },
    "utm_content": {
      "type": "string",
      "description": "Variant, f.eks. header_button"
    },
    "utm_term": {
      "type": "string",
      "description": "Nøkkelord for betalt søk"
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "url": {
      "anyOf": [
        {
          "type": "string",
          "description": "URL med koder (null så lenge det er feil)"
        },
        {
          "type": "null"
        }
      ]
    },
    "valid": {
      "type": "boolean",
      "description": "True når det ikke er feil"
    },
    "destination": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "preset": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "utm_source": {
      "anyOf": [
        {
          "type": "string",
          "description": "Normalisert utm_source"
        },
        {
          "type": "null"
        }
      ]
    },
    "utm_medium": {
      "anyOf": [
        {
          "type": "string",
          "description": "Normalisert utm_medium"
        },
        {
          "type": "null"
        }
      ]
    },
    "utm_campaign": {
      "anyOf": [
        {
          "type": "string",
          "description": "Normalisert utm_campaign"
        },
        {
          "type": "null"
        }
      ]
    },
    "utm_content": {
      "anyOf": [
        {
          "type": "string",
          "description": "Normalisert utm_content"
        },
        {
          "type": "null"
        }
      ]
    },
    "utm_term": {
      "anyOf": [
        {
          "type": "string",
          "description": "Normalisert utm_term"
        },
        {
          "type": "null"
        }
      ]
    },
    "issues": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "field, level (error eller warning) og message"
    },
    "presets": {
      "type": "object",
      "description": "Kanalforhåndsinnstillinger: utm_source/utm_medium per forhåndsinnstilling"
    }
  }
}
GET /sites/:site_id/campaigns/hygiene.json UTM-hygiene: nesten like verdier, stilproblemer og ukjente kilder campaigns_hygiene

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/campaigns/hygiene.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Forhåndsvalgt datoområde. Bruk custom med from/to",
      "enum": [
        "today",
        "yesterday",
        "24h",
        "7d",
        "14d",
        "28d",
        "30d",
        "90d",
        "mtd",
        "last_month",
        "qtd",
        "last_quarter",
        "ytd",
        "12mo",
        "last_year",
        "all",
        "custom"
      ],
      "default": "30d"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Start på egendefinert område (nettstedets tidssone)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Slutt på egendefinert område, inkludert"
    },
    "compare": {
      "type": "string",
      "description": "Sammenligningsperiode",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Start på egendefinert sammenligning"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Slutt på egendefinert sammenligning"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Juster sammenligningsdagene til ukedagene",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtre: [[\"dimension\",\"operator\",\"value\"], …]. Operatorer: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Pakk betingelser inn i {\"any\": [...]} for ELLER.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Bruk et lagret segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Legg til importerte historiske data (datoer før den første native hendelsen, ignoreres når filtre eller et segment brukes)",
      "default": false
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "period": {
      "type": "object",
      "description": "from/to for perioden (UTC)"
    },
    "duplicates": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Nesten like verdier: felt, forslag og varianter [{value, visits}]"
    },
    "style_issues": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Verdier som ikke er med små bokstaver og understreker: felt, verdi, besøk, forslag"
    },
    "unknown_sources": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "utm_source-verdier vi ikke gjenkjenner: verdi, besøk"
    }
  }
}
GET /sites/:site_id/campaigns.json Kampanjeoppsummering med konverteringer, inntekt, kostnad, CPA og ROAS campaigns_list

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/campaigns.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Forhåndsvalgt datoområde. Bruk custom med from/to",
      "enum": [
        "today",
        "yesterday",
        "24h",
        "7d",
        "14d",
        "28d",
        "30d",
        "90d",
        "mtd",
        "last_month",
        "qtd",
        "last_quarter",
        "ytd",
        "12mo",
        "last_year",
        "all",
        "custom"
      ],
      "default": "30d"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Start på egendefinert område (nettstedets tidssone)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Slutt på egendefinert område, inkludert"
    },
    "compare": {
      "type": "string",
      "description": "Sammenligningsperiode",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Start på egendefinert sammenligning"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Slutt på egendefinert sammenligning"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Juster sammenligningsdagene til ukedagene",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtre: [[\"dimension\",\"operator\",\"value\"], …]. Operatorer: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Pakk betingelser inn i {\"any\": [...]} for ELLER.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Bruk et lagret segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Legg til importerte historiske data (datoer før den første native hendelsen, ignoreres når filtre eller et segment brukes)",
      "default": false
    },
    "goal_id": {
      "type": "string",
      "description": "Mål (goal_…) som konverteringene telles for. Standard er det første aktive målet"
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "period": {
      "type": "object",
      "description": "from/to for perioden (UTC)"
    },
    "currency": {
      "type": "string",
      "description": "Nettstedets valuta for inntekt og kostnad"
    },
    "goal_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Mål som telles som en konvertering"
        },
        {
          "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 (minste enhet), roas (inntekt ÷ kostnad) og sources [{source, medium, visitors, visits, conversions, conversion_rate, revenue}]"
    },
    "totals": {
      "type": "object",
      "description": "Summer for alle viste kampanjer"
    }
  }
}

Kanalregler

POST /sites/:site_id/channel_rules.json Legg til en kanalregel channel_rules_create

Tillatelse: sites.manage

Eksempel
curl -X POST https://privatusanalytics.com/sites/:site_id/channel_rules.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "channel": {
      "type": "string",
      "description": "Kanalnavn som skal tildeles, f.eks. Partnere"
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "operator": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        }
      },
      "description": "Betingelser som alle må stemme: [{\"field\": \"utm_source\", \"operator\": \"is\", \"value\": \"newsletter\"}]. Felt: referrer_host, utm_source, utm_medium, utm_campaign, ref, path. Operatorer: is, contains, starts_with, regex."
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "channel",
    "conditions",
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Regel-ID"
    },
    "channel": {
      "type": "string",
      "description": "Kanal som tildeles når alle betingelser stemmer"
    },
    "position": {
      "type": "integer",
      "description": "Rekkefølge for evaluering (første treff vinner)"
    },
    "conditions": {
      "type": "array",
      "description": "Betingelser: field, operator, value"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:site_id/channel_rules/:id.json Slett en kanalregel channel_rules_delete

Tillatelse: sites.manage

Eksempel
curl -X DELETE https://privatusanalytics.com/sites/:site_id/channel_rules/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Regel-ID"
    },
    "channel": {
      "type": "string",
      "description": "Kanal som tildeles når alle betingelser stemmer"
    },
    "position": {
      "type": "integer",
      "description": "Rekkefølge for evaluering (første treff vinner)"
    },
    "conditions": {
      "type": "array",
      "description": "Betingelser: field, operator, value"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/channel_rules.json List kanalregler i rekkefølge channel_rules_list

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/channel_rules.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Regel-ID"
    },
    "channel": {
      "type": "string",
      "description": "Kanal som tildeles når alle betingelser stemmer"
    },
    "position": {
      "type": "integer",
      "description": "Rekkefølge for evaluering (første treff vinner)"
    },
    "conditions": {
      "type": "array",
      "description": "Betingelser: field, operator, value"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
PATCH /sites/:site_id/channel_rules/:id/move.json Flytt en kanalregel opp eller ned channel_rules_move

Tillatelse: sites.manage

Eksempel
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 '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "direction": {
      "type": "string",
      "description": "Hvor regelen skal flyttes",
      "enum": [
        "up",
        "down",
        "top",
        "bottom"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "direction",
    "site_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Regel-ID"
    },
    "channel": {
      "type": "string",
      "description": "Kanal som tildeles når alle betingelser stemmer"
    },
    "position": {
      "type": "integer",
      "description": "Rekkefølge for evaluering (første treff vinner)"
    },
    "conditions": {
      "type": "array",
      "description": "Betingelser: field, operator, value"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /sites/:site_id/channel_rules/preview.json Forhåndsvis kanalen for en eksempelhenviser og UTM-koder channel_rules_preview

Tillatelse: analytics.read

Eksempel
curl -X POST https://privatusanalytics.com/sites/:site_id/channel_rules/preview.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "referrer": {
      "type": "string",
      "description": "Henviser-URL eller vertsnavn"
    },
    "utm_source": {
      "type": "string",
      "description": "utm_source-verdi"
    },
    "utm_medium": {
      "type": "string",
      "description": "utm_medium-verdi"
    },
    "utm_campaign": {
      "type": "string",
      "description": "utm_campaign-verdi"
    },
    "ref": {
      "type": "string",
      "description": "ref / via / source-parameter"
    },
    "path": {
      "type": "string",
      "description": "Sti til landingssiden, f.eks. /pricing"
    },
    "paid_click": {
      "type": "boolean",
      "description": "URL-en hadde en klikk-ID som gclid",
      "default": false
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
PATCH /sites/:site_id/channel_rules/:id.json Endre en kanalregel channel_rules_update

Tillatelse: sites.manage

Eksempel
curl -X PATCH https://privatusanalytics.com/sites/:site_id/channel_rules/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "channel": {
      "type": "string",
      "description": "Kanalnavn som skal tildeles"
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "operator": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        }
      },
      "description": "Betingelser som alle må stemme: [{\"field\": \"utm_source\", \"operator\": \"is\", \"value\": \"newsletter\"}]. Felt: referrer_host, utm_source, utm_medium, utm_campaign, ref, path. Operatorer: is, contains, starts_with, regex."
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Regel-ID"
    },
    "channel": {
      "type": "string",
      "description": "Kanal som tildeles når alle betingelser stemmer"
    },
    "position": {
      "type": "integer",
      "description": "Rekkefølge for evaluering (første treff vinner)"
    },
    "conditions": {
      "type": "array",
      "description": "Betingelser: field, operator, value"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Konto

GET /account.json Hent profilen og preferansene dine account_get

Tillatelse: member

Eksempel
curl https://privatusanalytics.com/account.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {},
  "required": []
}
Svardata
{
  "type": "object",
  "properties": {
    "email": {
      "type": "string"
    },
    "unconfirmed_email": {
      "anyOf": [
        {
          "type": "string",
          "description": "Ny e-postadresse som venter på bekreftelse"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "theme": {
      "type": "string"
    },
    "default_landing": {
      "type": "string"
    },
    "locale": {
      "type": "string",
      "description": "Språkkoden for appen for denne kontoen (en som standard)"
    },
    "timezone": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "shortcuts_enabled": {
      "type": "boolean"
    },
    "reduce_motion": {
      "type": "boolean"
    },
    "product_emails": {
      "type": "boolean"
    },
    "marketing_emails": {
      "type": "boolean",
      "description": "Om markedsførings-e-poster (drypp-kampanjer) kan sendes. false etter en avmelding"
    },
    "newsletter": {
      "type": "boolean"
    },
    "two_factor": {
      "type": "boolean"
    },
    "passkeys": {
      "type": "integer"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
PATCH /account.json Oppdater profilen og preferansene dine account_update

Tillatelse: member

Eksempel
curl -X PATCH https://privatusanalytics.com/account.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Navnet ditt"
    },
    "email": {
      "type": "string",
      "description": "Ny e-postadresse (bekreftes først med e-post)"
    },
    "theme": {
      "type": "string",
      "description": "Fargetema",
      "enum": [
        "system",
        "light",
        "dark"
      ]
    },
    "default_landing": {
      "type": "string",
      "description": "Side etter innlogging: sites eller last_site",
      "enum": [
        "sites",
        "last_site"
      ]
    },
    "locale": {
      "type": "string",
      "description": "Språket i appen når du er logget inn, som språkkode (en, de, fr og så videre). Offentlige sider og API-et forblir som de er",
      "enum": [
        "en",
        "de",
        "es",
        "fr",
        "it",
        "nl",
        "pt",
        "pl",
        "sv",
        "da",
        "no",
        "fi",
        "ja",
        "ko",
        "zh-CN",
        "zh-TW"
      ]
    },
    "timezone": {
      "type": "string",
      "description": "Tidssonen din (IANA-navn)"
    },
    "shortcuts_enabled": {
      "type": "boolean",
      "description": "Tastatursnarveier"
    },
    "reduce_motion": {
      "type": "boolean",
      "description": "Reduser animasjoner"
    },
    "product_emails": {
      "type": "boolean",
      "description": "E-poster om produktoppdateringer og tips"
    },
    "marketing_emails": {
      "type": "boolean",
      "description": "Markedsførings-e-poster, for eksempel onboarding-tips. Å slå dem på igjen etter en avmelding krever en innlogget nettleser"
    },
    "newsletter": {
      "type": "boolean",
      "description": "Månedlig nyhetsbrev"
    }
  },
  "required": []
}
Svardata
{
  "type": "object",
  "properties": {
    "email": {
      "type": "string"
    },
    "unconfirmed_email": {
      "anyOf": [
        {
          "type": "string",
          "description": "Ny e-postadresse som venter på bekreftelse"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "theme": {
      "type": "string"
    },
    "default_landing": {
      "type": "string"
    },
    "locale": {
      "type": "string",
      "description": "Språkkoden for appen for denne kontoen (en som standard)"
    },
    "timezone": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "shortcuts_enabled": {
      "type": "boolean"
    },
    "reduce_motion": {
      "type": "boolean"
    },
    "product_emails": {
      "type": "boolean"
    },
    "marketing_emails": {
      "type": "boolean",
      "description": "Om markedsførings-e-poster (drypp-kampanjer) kan sendes. false etter en avmelding"
    },
    "newsletter": {
      "type": "boolean"
    },
    "two_factor": {
      "type": "boolean"
    },
    "passkeys": {
      "type": "integer"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Live

GET /sites/:site_id/live.json Besøkende nå, aktivitetsstrøm og hva som er populært akkurat nå (siste 30 minutter) live_get

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/live.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "feed": {
      "type": "string",
      "description": "Aktivitetsstrøm: alle treff, sidevisninger eller egendefinerte hendelser",
      "enum": [
        "all",
        "pageviews",
        "events"
      ],
      "default": "all"
    },
    "limit": {
      "type": "integer",
      "description": "Oppføringer i aktivitetsstrømmen (maks 100)",
      "default": 50
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
GET /sites/:site_id/live/wallboard.json Veggtavlekort (live og i dag) for ett eller flere nettsteder live_wallboard

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/live/wallboard.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Nettsted-ID-er å veksle mellom (standard er dette nettstedet)",
      "default": []
    },
    "rotate_seconds": {
      "type": "integer",
      "description": "Sekunder hvert nettsted vises på skjermen (5-300)",
      "default": 20
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
GET /wallboard/:token.json Veggtavle for et veggtavletoken (ingen innlogging nødvendig) live_public_wallboard

Tillatelse: public · Kun HTTP (ikke et MCP-verktøy)

Eksempel
curl https://privatusanalytics.com/wallboard/:token.json
Inndata
{
  "type": "object",
  "properties": {
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Nettsted-ID-er å veksle mellom (standard er dette nettstedet)",
      "default": []
    },
    "rotate_seconds": {
      "type": "integer",
      "description": "Sekunder hvert nettsted vises på skjermen (5-300)",
      "default": 20
    },
    "token": {
      "type": "string",
      "description": "Token for ressursen"
    }
  },
  "required": [
    "token"
  ]
}
Svardata
{
  "type": "object"
}

Medlemmer

POST /workspaces/:workspace_id/invitations.json Inviter personer med e-post invitations_create

Tillatelse: members.manage

Eksempel
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/invitations.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "emails": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "E-postadresser som skal inviteres"
    },
    "role": {
      "type": "string",
      "description": "Rolle for de nye medlemmene (custom krever custom_role_id)",
      "enum": [
        "admin",
        "editor",
        "analyst",
        "viewer",
        "billing",
        "custom"
      ],
      "default": "viewer"
    },
    "custom_role_id": {
      "type": "string",
      "description": "ID for egendefinert rolle (Business)"
    },
    "all_sites": {
      "type": "boolean",
      "description": "Tilgang til alle nettsteder, også framtidige",
      "default": true
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Nettsted-ID-er (pa_…) når all_sites er false",
      "default": []
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "emails",
    "workspace_id"
  ]
}
Svardata
{
  "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 Trekk tilbake en ventende invitasjon invitations_delete

Tillatelse: members.manage

Eksempel
curl -X DELETE https://privatusanalytics.com/workspaces/:workspace_id/invitations/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Svardata
{
  "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 List ventende invitasjoner invitations_list

Tillatelse: members.manage

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/invitations.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater per side (maks 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "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 Fjern et medlem (eller forlat arbeidsområdet) members_delete

Tillatelse: member

Eksempel
curl -X DELETE https://privatusanalytics.com/workspaces/:workspace_id/members/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Medlems-ID (bruk den til å oppdatere eller fjerne medlemmet)"
    },
    "email": {
      "type": "string"
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "role": {
      "type": "string",
      "description": "owner, admin, editor, analyst, viewer, billing eller custom"
    },
    "custom_role": {
      "anyOf": [
        {
          "type": "string",
          "description": "Navn på egendefinert rolle"
        },
        {
          "type": "null"
        }
      ]
    },
    "custom_role_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ]
    },
    "all_sites": {
      "type": "boolean",
      "description": "Tilgang til alle nettsteder"
    },
    "include_future_sites": {
      "type": "boolean"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Nettsted-ID-er når all_sites er false"
    },
    "two_factor": {
      "type": "boolean",
      "description": "Har 2FA eller en passkey"
    },
    "last_active_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Ble med"
    }
  }
}
GET /workspaces/:workspace_id/members.json List medlemmer av arbeidsområdet members_list

Tillatelse: member

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/members.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "description": "Filtrer etter navn eller e-post"
    },
    "role": {
      "type": "string",
      "description": "Bare medlemmer med denne rollen",
      "enum": [
        "owner",
        "admin",
        "editor",
        "analyst",
        "viewer",
        "billing",
        "custom"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater per side (maks 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "format": "uuid",
        "description": "Medlems-ID (bruk den til å oppdatere eller fjerne medlemmet)"
      },
      "email": {
        "type": "string"
      },
      "name": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "role": {
        "type": "string",
        "description": "owner, admin, editor, analyst, viewer, billing eller custom"
      },
      "custom_role": {
        "anyOf": [
          {
            "type": "string",
            "description": "Navn på egendefinert rolle"
          },
          {
            "type": "null"
          }
        ]
      },
      "custom_role_id": {
        "anyOf": [
          {
            "type": "string",
            "format": "uuid"
          },
          {
            "type": "null"
          }
        ]
      },
      "all_sites": {
        "type": "boolean",
        "description": "Tilgang til alle nettsteder"
      },
      "include_future_sites": {
        "type": "boolean"
      },
      "site_ids": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Nettsted-ID-er når all_sites er false"
      },
      "two_factor": {
        "type": "boolean",
        "description": "Har 2FA eller en passkey"
      },
      "last_active_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "created_at": {
        "type": "string",
        "format": "date-time",
        "description": "Ble med"
      }
    }
  }
}
PATCH /workspaces/:workspace_id/members/:id.json Endre rollen eller nettstedstilgangen til et medlem members_update

Tillatelse: members.manage

Eksempel
curl -X PATCH https://privatusanalytics.com/workspaces/:workspace_id/members/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "role": {
      "type": "string",
      "description": "Ny rolle (custom krever custom_role_id)",
      "enum": [
        "admin",
        "editor",
        "analyst",
        "viewer",
        "billing",
        "custom"
      ]
    },
    "custom_role_id": {
      "type": "string",
      "description": "ID for egendefinert rolle (Business)"
    },
    "all_sites": {
      "type": "boolean",
      "description": "Tilgang til alle nettsteder, også framtidige"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Nettsted-ID-er (pa_…) når all_sites er false"
    },
    "include_future_sites": {
      "type": "boolean",
      "description": "Gi også tilgang til nettsteder som legges til senere"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Medlems-ID (bruk den til å oppdatere eller fjerne medlemmet)"
    },
    "email": {
      "type": "string"
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "role": {
      "type": "string",
      "description": "owner, admin, editor, analyst, viewer, billing eller custom"
    },
    "custom_role": {
      "anyOf": [
        {
          "type": "string",
          "description": "Navn på egendefinert rolle"
        },
        {
          "type": "null"
        }
      ]
    },
    "custom_role_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ]
    },
    "all_sites": {
      "type": "boolean",
      "description": "Tilgang til alle nettsteder"
    },
    "include_future_sites": {
      "type": "boolean"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Nettsted-ID-er når all_sites er false"
    },
    "two_factor": {
      "type": "boolean",
      "description": "Har 2FA eller en passkey"
    },
    "last_active_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Ble med"
    }
  }
}
POST /workspaces/:workspace_id/ownership_transfer.json Overfør eierskapet til arbeidsområdet til et annet medlem (kun eieren, du blir administrator) ownership_transfers_create

Tillatelse: member

Eksempel
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/ownership_transfer.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "membership_id": {
      "type": "string",
      "description": "Medlems-ID for den nye eieren"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "membership_id",
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Medlems-ID (bruk den til å oppdatere eller fjerne medlemmet)"
    },
    "email": {
      "type": "string"
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "role": {
      "type": "string",
      "description": "owner, admin, editor, analyst, viewer, billing eller custom"
    },
    "custom_role": {
      "anyOf": [
        {
          "type": "string",
          "description": "Navn på egendefinert rolle"
        },
        {
          "type": "null"
        }
      ]
    },
    "custom_role_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ]
    },
    "all_sites": {
      "type": "boolean",
      "description": "Tilgang til alle nettsteder"
    },
    "include_future_sites": {
      "type": "boolean"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Nettsted-ID-er når all_sites er false"
    },
    "two_factor": {
      "type": "boolean",
      "description": "Har 2FA eller en passkey"
    },
    "last_active_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Ble med"
    }
  }
}

Mål

POST /sites/:site_id/goals/:id/archive.json Arkiver et mål (skjult fra rapporter) goals_archive

Tillatelse: content.write

Eksempel
curl -X POST https://privatusanalytics.com/sites/:site_id/goals/:id/archive.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Mål-ID, f.eks. goal_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "page, event, engagement, outbound eller download"
    },
    "match_type": {
      "type": "string",
      "description": "exact, prefix, glob eller regex"
    },
    "pattern": {
      "anyOf": [
        {
          "type": "string",
          "description": "Sti-, domene- eller filmønster"
        },
        {
          "type": "null"
        }
      ]
    },
    "hostname": {
      "anyOf": [
        {
          "type": "string",
          "description": "Begrensning til vertsnavn (sidemål)"
        },
        {
          "type": "null"
        }
      ]
    },
    "event_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Navn på egendefinert hendelse (hendelsesmål)"
        },
        {
          "type": "null"
        }
      ]
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Betingelser for hendelsesegenskaper"
    },
    "scroll_threshold": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engasjement: rulling i %"
        },
        {
          "type": "null"
        }
      ]
    },
    "time_threshold_seconds": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engasjement: sekunder på siden"
        },
        {
          "type": "null"
        }
      ]
    },
    "value_mode": {
      "type": "string",
      "description": "none, fixed eller revenue"
    },
    "fixed_value_minor": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Fast verdi i minste enhet"
        },
        {
          "type": "null"
        }
      ]
    },
    "count_mode": {
      "type": "string",
      "description": "once_per_visit eller every"
    },
    "archived": {
      "type": "boolean"
    },
    "archived_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "stats": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "completions": {
              "type": "integer",
              "description": "Samsvarende hendelser, gjentakelser inkludert"
            },
            "conversions": {
              "type": "integer",
              "description": "Besøk med minst én fullføring"
            },
            "conversion_rate": {
              "type": "number",
              "description": "Konverteringer ÷ besøk (eller ÷ besøkende, etter nettstedets innstilling), %"
            },
            "value": {
              "type": "integer",
              "description": "Målverdi i nettstedets valuta i minste enhet"
            },
            "change": {
              "anyOf": [
                {
                  "type": "number",
                  "description": "Endring i konverteringer mot forrige periode, %"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Periodestatistikk (bare i lister)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /sites/:site_id/goals.json Opprett et mål goals_create

Tillatelse: content.write

Eksempel
curl -X POST https://privatusanalytics.com/sites/:site_id/goals.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Navn på målet",
      "examples": [
        "Signed up"
      ]
    },
    "kind": {
      "type": "string",
      "description": "page (besøk på en side), event (egendefinert hendelse), engagement (rulling eller tid på siden), outbound (klikk på utgående lenke) eller download (filnedlasting)",
      "enum": [
        "page",
        "event",
        "engagement",
        "outbound",
        "download"
      ]
    },
    "match_type": {
      "type": "string",
      "description": "Hvordan pattern samsvarer med stien (page, engagement), lenkedomenet (outbound) eller filen (download): exact, prefix, glob (*) eller regex",
      "enum": [
        "exact",
        "prefix",
        "glob",
        "regex"
      ],
      "default": "exact"
    },
    "pattern": {
      "type": "string",
      "description": "Sti-, domene- eller filmønster, f.eks. /pricing, /blog/*, stripe.com eller *.pdf"
    },
    "hostname": {
      "type": "string",
      "description": "Tell bare sider på dette vertsnavnet (sidemål)"
    },
    "event_name": {
      "type": "string",
      "description": "Navn på egendefinert hendelse (hendelsesmål)"
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      },
      "description": "Betingelser for hendelsesegenskaper: [{\"key\": \"plan\", \"operator\": \"is|is_not|contains|gt|lt\", \"value\": \"pro\"}]",
      "default": []
    },
    "scroll_threshold": {
      "type": "integer",
      "description": "Engasjement: rulledybde i % som må nås"
    },
    "time_threshold_seconds": {
      "type": "integer",
      "description": "Engasjement: sekunder på siden"
    },
    "value_mode": {
      "type": "string",
      "description": "none, fixed (fixed_value per konvertering) eller revenue (hendelsens inntekt)",
      "enum": [
        "none",
        "fixed",
        "revenue"
      ],
      "default": "none"
    },
    "fixed_value": {
      "type": "number",
      "description": "Fast verdi per konvertering i nettstedets valuta, f.eks. 50.0"
    },
    "count_mode": {
      "type": "string",
      "description": "Verdien telles once_per_visit eller ved hver fullføring",
      "enum": [
        "once_per_visit",
        "every"
      ],
      "default": "once_per_visit"
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "kind",
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Mål-ID, f.eks. goal_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "page, event, engagement, outbound eller download"
    },
    "match_type": {
      "type": "string",
      "description": "exact, prefix, glob eller regex"
    },
    "pattern": {
      "anyOf": [
        {
          "type": "string",
          "description": "Sti-, domene- eller filmønster"
        },
        {
          "type": "null"
        }
      ]
    },
    "hostname": {
      "anyOf": [
        {
          "type": "string",
          "description": "Begrensning til vertsnavn (sidemål)"
        },
        {
          "type": "null"
        }
      ]
    },
    "event_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Navn på egendefinert hendelse (hendelsesmål)"
        },
        {
          "type": "null"
        }
      ]
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Betingelser for hendelsesegenskaper"
    },
    "scroll_threshold": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engasjement: rulling i %"
        },
        {
          "type": "null"
        }
      ]
    },
    "time_threshold_seconds": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engasjement: sekunder på siden"
        },
        {
          "type": "null"
        }
      ]
    },
    "value_mode": {
      "type": "string",
      "description": "none, fixed eller revenue"
    },
    "fixed_value_minor": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Fast verdi i minste enhet"
        },
        {
          "type": "null"
        }
      ]
    },
    "count_mode": {
      "type": "string",
      "description": "once_per_visit eller every"
    },
    "archived": {
      "type": "boolean"
    },
    "archived_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "stats": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "completions": {
              "type": "integer",
              "description": "Samsvarende hendelser, gjentakelser inkludert"
            },
            "conversions": {
              "type": "integer",
              "description": "Besøk med minst én fullføring"
            },
            "conversion_rate": {
              "type": "number",
              "description": "Konverteringer ÷ besøk (eller ÷ besøkende, etter nettstedets innstilling), %"
            },
            "value": {
              "type": "integer",
              "description": "Målverdi i nettstedets valuta i minste enhet"
            },
            "change": {
              "anyOf": [
                {
                  "type": "number",
                  "description": "Endring i konverteringer mot forrige periode, %"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Periodestatistikk (bare i lister)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:site_id/goals/:id.json Slett et mål (dataene beholdes) goals_delete

Tillatelse: content.write

Eksempel
curl -X DELETE https://privatusanalytics.com/sites/:site_id/goals/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Mål-ID, f.eks. goal_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "page, event, engagement, outbound eller download"
    },
    "match_type": {
      "type": "string",
      "description": "exact, prefix, glob eller regex"
    },
    "pattern": {
      "anyOf": [
        {
          "type": "string",
          "description": "Sti-, domene- eller filmønster"
        },
        {
          "type": "null"
        }
      ]
    },
    "hostname": {
      "anyOf": [
        {
          "type": "string",
          "description": "Begrensning til vertsnavn (sidemål)"
        },
        {
          "type": "null"
        }
      ]
    },
    "event_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Navn på egendefinert hendelse (hendelsesmål)"
        },
        {
          "type": "null"
        }
      ]
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Betingelser for hendelsesegenskaper"
    },
    "scroll_threshold": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engasjement: rulling i %"
        },
        {
          "type": "null"
        }
      ]
    },
    "time_threshold_seconds": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engasjement: sekunder på siden"
        },
        {
          "type": "null"
        }
      ]
    },
    "value_mode": {
      "type": "string",
      "description": "none, fixed eller revenue"
    },
    "fixed_value_minor": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Fast verdi i minste enhet"
        },
        {
          "type": "null"
        }
      ]
    },
    "count_mode": {
      "type": "string",
      "description": "once_per_visit eller every"
    },
    "archived": {
      "type": "boolean"
    },
    "archived_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "stats": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "completions": {
              "type": "integer",
              "description": "Samsvarende hendelser, gjentakelser inkludert"
            },
            "conversions": {
              "type": "integer",
              "description": "Besøk med minst én fullføring"
            },
            "conversion_rate": {
              "type": "number",
              "description": "Konverteringer ÷ besøk (eller ÷ besøkende, etter nettstedets innstilling), %"
            },
            "value": {
              "type": "integer",
              "description": "Målverdi i nettstedets valuta i minste enhet"
            },
            "change": {
              "anyOf": [
                {
                  "type": "number",
                  "description": "Endring i konverteringer mot forrige periode, %"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Periodestatistikk (bare i lister)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /sites/:site_id/goals/:id/duplicate.json Kopier et mål goals_duplicate

Tillatelse: content.write

Eksempel
curl -X POST https://privatusanalytics.com/sites/:site_id/goals/:id/duplicate.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Navn på kopien"
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Mål-ID, f.eks. goal_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "page, event, engagement, outbound eller download"
    },
    "match_type": {
      "type": "string",
      "description": "exact, prefix, glob eller regex"
    },
    "pattern": {
      "anyOf": [
        {
          "type": "string",
          "description": "Sti-, domene- eller filmønster"
        },
        {
          "type": "null"
        }
      ]
    },
    "hostname": {
      "anyOf": [
        {
          "type": "string",
          "description": "Begrensning til vertsnavn (sidemål)"
        },
        {
          "type": "null"
        }
      ]
    },
    "event_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Navn på egendefinert hendelse (hendelsesmål)"
        },
        {
          "type": "null"
        }
      ]
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Betingelser for hendelsesegenskaper"
    },
    "scroll_threshold": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engasjement: rulling i %"
        },
        {
          "type": "null"
        }
      ]
    },
    "time_threshold_seconds": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engasjement: sekunder på siden"
        },
        {
          "type": "null"
        }
      ]
    },
    "value_mode": {
      "type": "string",
      "description": "none, fixed eller revenue"
    },
    "fixed_value_minor": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Fast verdi i minste enhet"
        },
        {
          "type": "null"
        }
      ]
    },
    "count_mode": {
      "type": "string",
      "description": "once_per_visit eller every"
    },
    "archived": {
      "type": "boolean"
    },
    "archived_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "stats": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "completions": {
              "type": "integer",
              "description": "Samsvarende hendelser, gjentakelser inkludert"
            },
            "conversions": {
              "type": "integer",
              "description": "Besøk med minst én fullføring"
            },
            "conversion_rate": {
              "type": "number",
              "description": "Konverteringer ÷ besøk (eller ÷ besøkende, etter nettstedets innstilling), %"
            },
            "value": {
              "type": "integer",
              "description": "Målverdi i nettstedets valuta i minste enhet"
            },
            "change": {
              "anyOf": [
                {
                  "type": "number",
                  "description": "Endring i konverteringer mot forrige periode, %"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Periodestatistikk (bare i lister)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/goals.json List mål med fullføringer, konverteringer, rate og verdi for en periode goals_list

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/goals.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Forhåndsvalgt datoområde. Bruk custom med from/to",
      "enum": [
        "today",
        "yesterday",
        "24h",
        "7d",
        "14d",
        "28d",
        "30d",
        "90d",
        "mtd",
        "last_month",
        "qtd",
        "last_quarter",
        "ytd",
        "12mo",
        "last_year",
        "all",
        "custom"
      ],
      "default": "30d"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Start på egendefinert område (nettstedets tidssone)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Slutt på egendefinert område, inkludert"
    },
    "compare": {
      "type": "string",
      "description": "Sammenligningsperiode",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Start på egendefinert sammenligning"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Slutt på egendefinert sammenligning"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Juster sammenligningsdagene til ukedagene",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtre: [[\"dimension\",\"operator\",\"value\"], …]. Operatorer: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Pakk betingelser inn i {\"any\": [...]} for ELLER.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Bruk et lagret segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Legg til importerte historiske data (datoer før den første native hendelsen, ignoreres når filtre eller et segment brukes)",
      "default": false
    },
    "status": {
      "type": "string",
      "description": "active, archived eller all mål",
      "enum": [
        "active",
        "archived",
        "all"
      ],
      "default": "active"
    },
    "page": {
      "type": "integer",
      "description": "Sidenummer",
      "default": 1
    },
    "per_page": {
      "type": "integer",
      "description": "Mål per side (maks 100)",
      "default": 25
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Mål-ID, f.eks. goal_7Q2K9XH3AB"
      },
      "name": {
        "type": "string"
      },
      "kind": {
        "type": "string",
        "description": "page, event, engagement, outbound eller download"
      },
      "match_type": {
        "type": "string",
        "description": "exact, prefix, glob eller regex"
      },
      "pattern": {
        "anyOf": [
          {
            "type": "string",
            "description": "Sti-, domene- eller filmønster"
          },
          {
            "type": "null"
          }
        ]
      },
      "hostname": {
        "anyOf": [
          {
            "type": "string",
            "description": "Begrensning til vertsnavn (sidemål)"
          },
          {
            "type": "null"
          }
        ]
      },
      "event_name": {
        "anyOf": [
          {
            "type": "string",
            "description": "Navn på egendefinert hendelse (hendelsesmål)"
          },
          {
            "type": "null"
          }
        ]
      },
      "conditions": {
        "type": "array",
        "items": {
          "type": "object"
        },
        "description": "Betingelser for hendelsesegenskaper"
      },
      "scroll_threshold": {
        "anyOf": [
          {
            "type": "integer",
            "description": "Engasjement: rulling i %"
          },
          {
            "type": "null"
          }
        ]
      },
      "time_threshold_seconds": {
        "anyOf": [
          {
            "type": "integer",
            "description": "Engasjement: sekunder på siden"
          },
          {
            "type": "null"
          }
        ]
      },
      "value_mode": {
        "type": "string",
        "description": "none, fixed eller revenue"
      },
      "fixed_value_minor": {
        "anyOf": [
          {
            "type": "integer",
            "description": "Fast verdi i minste enhet"
          },
          {
            "type": "null"
          }
        ]
      },
      "count_mode": {
        "type": "string",
        "description": "once_per_visit eller every"
      },
      "archived": {
        "type": "boolean"
      },
      "archived_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "stats": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "completions": {
                "type": "integer",
                "description": "Samsvarende hendelser, gjentakelser inkludert"
              },
              "conversions": {
                "type": "integer",
                "description": "Besøk med minst én fullføring"
              },
              "conversion_rate": {
                "type": "number",
                "description": "Konverteringer ÷ besøk (eller ÷ besøkende, etter nettstedets innstilling), %"
              },
              "value": {
                "type": "integer",
                "description": "Målverdi i nettstedets valuta i minste enhet"
              },
              "change": {
                "anyOf": [
                  {
                    "type": "number",
                    "description": "Endring i konverteringer mot forrige periode, %"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "description": "Periodestatistikk (bare i lister)"
          },
          {
            "type": "null"
          }
        ]
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      },
      "updated_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
GET /sites/:site_id/goals/:id.json Målrapport: målinger, diagram, nedbrytninger og veien fram til konvertering goals_get

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/goals/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Forhåndsvalgt datoområde. Bruk custom med from/to",
      "enum": [
        "today",
        "yesterday",
        "24h",
        "7d",
        "14d",
        "28d",
        "30d",
        "90d",
        "mtd",
        "last_month",
        "qtd",
        "last_quarter",
        "ytd",
        "12mo",
        "last_year",
        "all",
        "custom"
      ],
      "default": "30d"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Start på egendefinert område (nettstedets tidssone)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Slutt på egendefinert område, inkludert"
    },
    "compare": {
      "type": "string",
      "description": "Sammenligningsperiode",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Start på egendefinert sammenligning"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Slutt på egendefinert sammenligning"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Juster sammenligningsdagene til ukedagene",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtre: [[\"dimension\",\"operator\",\"value\"], …]. Operatorer: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Pakk betingelser inn i {\"any\": [...]} for ELLER.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Bruk et lagret segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Legg til importerte historiske data (datoer før den første native hendelsen, ignoreres når filtre eller et segment brukes)",
      "default": false
    },
    "interval": {
      "type": "string",
      "description": "Intervallstørrelse for diagrammet",
      "enum": [
        "auto",
        "minute",
        "hour",
        "day",
        "week",
        "month",
        "quarter",
        "year"
      ],
      "default": "auto"
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "period": {
      "type": "object",
      "description": "from/to for perioden (UTC)"
    },
    "goal": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Mål-ID, f.eks. goal_7Q2K9XH3AB"
        },
        "name": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "description": "page, event, engagement, outbound eller download"
        },
        "match_type": {
          "type": "string",
          "description": "exact, prefix, glob eller regex"
        },
        "pattern": {
          "anyOf": [
            {
              "type": "string",
              "description": "Sti-, domene- eller filmønster"
            },
            {
              "type": "null"
            }
          ]
        },
        "hostname": {
          "anyOf": [
            {
              "type": "string",
              "description": "Begrensning til vertsnavn (sidemål)"
            },
            {
              "type": "null"
            }
          ]
        },
        "event_name": {
          "anyOf": [
            {
              "type": "string",
              "description": "Navn på egendefinert hendelse (hendelsesmål)"
            },
            {
              "type": "null"
            }
          ]
        },
        "conditions": {
          "type": "array",
          "items": {
            "type": "object"
          },
          "description": "Betingelser for hendelsesegenskaper"
        },
        "scroll_threshold": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Engasjement: rulling i %"
            },
            {
              "type": "null"
            }
          ]
        },
        "time_threshold_seconds": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Engasjement: sekunder på siden"
            },
            {
              "type": "null"
            }
          ]
        },
        "value_mode": {
          "type": "string",
          "description": "none, fixed eller revenue"
        },
        "fixed_value_minor": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Fast verdi i minste enhet"
            },
            {
              "type": "null"
            }
          ]
        },
        "count_mode": {
          "type": "string",
          "description": "once_per_visit eller every"
        },
        "archived": {
          "type": "boolean"
        },
        "archived_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "stats": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "completions": {
                  "type": "integer",
                  "description": "Samsvarende hendelser, gjentakelser inkludert"
                },
                "conversions": {
                  "type": "integer",
                  "description": "Besøk med minst én fullføring"
                },
                "conversion_rate": {
                  "type": "number",
                  "description": "Konverteringer ÷ besøk (eller ÷ besøkende, etter nettstedets innstilling), %"
                },
                "value": {
                  "type": "integer",
                  "description": "Målverdi i nettstedets valuta i minste enhet"
                },
                "change": {
                  "anyOf": [
                    {
                      "type": "number",
                      "description": "Endring i konverteringer mot forrige periode, %"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "description": "Periodestatistikk (bare i lister)"
            },
            {
              "type": "null"
            }
          ]
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        }
      },
      "description": "Måldefinisjonen"
    },
    "metrics": {
      "type": "object",
      "description": "completions, conversions, conversion_rate (%), value (minste enhet)"
    },
    "comparison_period": {
      "anyOf": [
        {
          "type": "object",
          "description": "from/to for sammenligning"
        },
        {
          "type": "null"
        }
      ]
    },
    "comparison": {
      "anyOf": [
        {
          "type": "object",
          "description": "Målinger for sammenligningsperioden"
        },
        {
          "type": "null"
        }
      ]
    },
    "change": {
      "anyOf": [
        {
          "type": "object",
          "description": "Endring mot sammenligning, % per måling"
        },
        {
          "type": "null"
        }
      ]
    },
    "interval": {
      "type": "string",
      "description": "Intervallstørrelse for diagrammet"
    },
    "series": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Per intervall: date, completions, conversions, conversion_rate"
    },
    "breakdowns": {
      "type": "object",
      "description": "Toppverdier etter konverteringer for channel, utm_campaign, entry_page, country og device: value, completions, conversions, conversion_rate"
    },
    "journey": {
      "anyOf": [
        {
          "type": "object",
          "description": "converting_visits, median_seconds_to_convert, median_pages_before og pages_before (sider vist tidligere i besøket, etter konverterende besøk)"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
POST /sites/:site_id/goals/:id/unarchive.json Gjenopprett et arkivert mål goals_unarchive

Tillatelse: content.write

Eksempel
curl -X POST https://privatusanalytics.com/sites/:site_id/goals/:id/unarchive.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Mål-ID, f.eks. goal_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "page, event, engagement, outbound eller download"
    },
    "match_type": {
      "type": "string",
      "description": "exact, prefix, glob eller regex"
    },
    "pattern": {
      "anyOf": [
        {
          "type": "string",
          "description": "Sti-, domene- eller filmønster"
        },
        {
          "type": "null"
        }
      ]
    },
    "hostname": {
      "anyOf": [
        {
          "type": "string",
          "description": "Begrensning til vertsnavn (sidemål)"
        },
        {
          "type": "null"
        }
      ]
    },
    "event_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Navn på egendefinert hendelse (hendelsesmål)"
        },
        {
          "type": "null"
        }
      ]
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Betingelser for hendelsesegenskaper"
    },
    "scroll_threshold": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engasjement: rulling i %"
        },
        {
          "type": "null"
        }
      ]
    },
    "time_threshold_seconds": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engasjement: sekunder på siden"
        },
        {
          "type": "null"
        }
      ]
    },
    "value_mode": {
      "type": "string",
      "description": "none, fixed eller revenue"
    },
    "fixed_value_minor": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Fast verdi i minste enhet"
        },
        {
          "type": "null"
        }
      ]
    },
    "count_mode": {
      "type": "string",
      "description": "once_per_visit eller every"
    },
    "archived": {
      "type": "boolean"
    },
    "archived_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "stats": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "completions": {
              "type": "integer",
              "description": "Samsvarende hendelser, gjentakelser inkludert"
            },
            "conversions": {
              "type": "integer",
              "description": "Besøk med minst én fullføring"
            },
            "conversion_rate": {
              "type": "number",
              "description": "Konverteringer ÷ besøk (eller ÷ besøkende, etter nettstedets innstilling), %"
            },
            "value": {
              "type": "integer",
              "description": "Målverdi i nettstedets valuta i minste enhet"
            },
            "change": {
              "anyOf": [
                {
                  "type": "number",
                  "description": "Endring i konverteringer mot forrige periode, %"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Periodestatistikk (bare i lister)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
PATCH /sites/:site_id/goals/:id.json Oppdater et mål goals_update

Tillatelse: content.write

Eksempel
curl -X PATCH https://privatusanalytics.com/sites/:site_id/goals/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Navn på målet",
      "examples": [
        "Signed up"
      ]
    },
    "kind": {
      "type": "string",
      "description": "page (besøk på en side), event (egendefinert hendelse), engagement (rulling eller tid på siden), outbound (klikk på utgående lenke) eller download (filnedlasting)",
      "enum": [
        "page",
        "event",
        "engagement",
        "outbound",
        "download"
      ]
    },
    "match_type": {
      "type": "string",
      "description": "Hvordan pattern samsvarer med stien (page, engagement), lenkedomenet (outbound) eller filen (download): exact, prefix, glob (*) eller regex",
      "enum": [
        "exact",
        "prefix",
        "glob",
        "regex"
      ]
    },
    "pattern": {
      "type": "string",
      "description": "Sti-, domene- eller filmønster, f.eks. /pricing, /blog/*, stripe.com eller *.pdf"
    },
    "hostname": {
      "type": "string",
      "description": "Tell bare sider på dette vertsnavnet (sidemål)"
    },
    "event_name": {
      "type": "string",
      "description": "Navn på egendefinert hendelse (hendelsesmål)"
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      },
      "description": "Betingelser for hendelsesegenskaper: [{\"key\": \"plan\", \"operator\": \"is|is_not|contains|gt|lt\", \"value\": \"pro\"}]"
    },
    "scroll_threshold": {
      "type": "integer",
      "description": "Engasjement: rulledybde i % som må nås"
    },
    "time_threshold_seconds": {
      "type": "integer",
      "description": "Engasjement: sekunder på siden"
    },
    "value_mode": {
      "type": "string",
      "description": "none, fixed (fixed_value per konvertering) eller revenue (hendelsens inntekt)",
      "enum": [
        "none",
        "fixed",
        "revenue"
      ]
    },
    "fixed_value": {
      "type": "number",
      "description": "Fast verdi per konvertering i nettstedets valuta, f.eks. 50.0"
    },
    "count_mode": {
      "type": "string",
      "description": "Verdien telles once_per_visit eller ved hver fullføring",
      "enum": [
        "once_per_visit",
        "every"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Mål-ID, f.eks. goal_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "page, event, engagement, outbound eller download"
    },
    "match_type": {
      "type": "string",
      "description": "exact, prefix, glob eller regex"
    },
    "pattern": {
      "anyOf": [
        {
          "type": "string",
          "description": "Sti-, domene- eller filmønster"
        },
        {
          "type": "null"
        }
      ]
    },
    "hostname": {
      "anyOf": [
        {
          "type": "string",
          "description": "Begrensning til vertsnavn (sidemål)"
        },
        {
          "type": "null"
        }
      ]
    },
    "event_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Navn på egendefinert hendelse (hendelsesmål)"
        },
        {
          "type": "null"
        }
      ]
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Betingelser for hendelsesegenskaper"
    },
    "scroll_threshold": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engasjement: rulling i %"
        },
        {
          "type": "null"
        }
      ]
    },
    "time_threshold_seconds": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engasjement: sekunder på siden"
        },
        {
          "type": "null"
        }
      ]
    },
    "value_mode": {
      "type": "string",
      "description": "none, fixed eller revenue"
    },
    "fixed_value_minor": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Fast verdi i minste enhet"
        },
        {
          "type": "null"
        }
      ]
    },
    "count_mode": {
      "type": "string",
      "description": "once_per_visit eller every"
    },
    "archived": {
      "type": "boolean"
    },
    "archived_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "stats": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "completions": {
              "type": "integer",
              "description": "Samsvarende hendelser, gjentakelser inkludert"
            },
            "conversions": {
              "type": "integer",
              "description": "Besøk med minst én fullføring"
            },
            "conversion_rate": {
              "type": "number",
              "description": "Konverteringer ÷ besøk (eller ÷ besøkende, etter nettstedets innstilling), %"
            },
            "value": {
              "type": "integer",
              "description": "Målverdi i nettstedets valuta i minste enhet"
            },
            "change": {
              "anyOf": [
                {
                  "type": "number",
                  "description": "Endring i konverteringer mot forrige periode, %"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Periodestatistikk (bare i lister)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Nettside

GET /changelog.json List oppføringer i endringsloggen changelog_list

Publiserte produktoppdateringer, nyeste først. Også tilgjengelig som RSS på /changelog.rss.

Tillatelse: public

Eksempel
curl https://privatusanalytics.com/changelog.json
Inndata
{
  "type": "object",
  "properties": {
    "area": {
      "type": "string",
      "description": "Bare oppføringer for dette produktområdet",
      "enum": [
        "product",
        "dashboard",
        "tracker",
        "privacy",
        "api",
        "integrations",
        "billing",
        "docs"
      ]
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater per side (maks 100)"
    }
  },
  "required": []
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Oppførings-ID, f.eks. chg_7Q2K9XH3AB"
      },
      "title": {
        "type": "string",
        "description": "Overskrift"
      },
      "area": {
        "type": "string",
        "description": "Produktområde, f.eks. dashboard, tracker, api"
      },
      "body": {
        "type": "string",
        "description": "Markdown-innhold"
      },
      "published_at": {
        "type": "string",
        "format": "date-time",
        "description": "Publiseringstidspunkt"
      },
      "url": {
        "type": "string",
        "description": "Permanent lenke"
      }
    }
  }
}
GET /changelog/:id.json Hent en oppføring i endringsloggen changelog_get

Tillatelse: public

Eksempel
curl https://privatusanalytics.com/changelog/:id.json
Inndata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Oppførings-ID, f.eks. chg_7Q2K9XH3AB"
    },
    "title": {
      "type": "string",
      "description": "Overskrift"
    },
    "area": {
      "type": "string",
      "description": "Produktområde, f.eks. dashboard, tracker, api"
    },
    "body": {
      "type": "string",
      "description": "Markdown-innhold"
    },
    "published_at": {
      "type": "string",
      "format": "date-time",
      "description": "Publiseringstidspunkt"
    },
    "url": {
      "type": "string",
      "description": "Permanent lenke"
    }
  }
}
POST /contact.json Send en melding til Privatus-teamet contact_create

Nettleserklienter sender et Cloudflare Turnstile-token som `cf-turnstile-response`. Forespørsler med et API-token trenger ikke det.

Tillatelse: public · Kun HTTP (ikke et MCP-verktøy)

Eksempel
curl -X POST https://privatusanalytics.com/contact.json \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Navnet ditt",
      "examples": [
        "Ada Lovelace"
      ]
    },
    "email": {
      "type": "string",
      "description": "Hvor vi skal svare",
      "examples": [
        "[email protected]"
      ]
    },
    "company": {
      "type": "string",
      "description": "Selskap eller organisasjon (valgfritt)"
    },
    "topic": {
      "type": "string",
      "description": "Hva meldingen handler om",
      "enum": [
        "general",
        "sales",
        "support",
        "privacy",
        "security",
        "partnerships",
        "press"
      ],
      "default": "general"
    },
    "message": {
      "type": "string",
      "description": "Meldingen din (10 til 5 000 tegn)"
    },
    "website": {
      "type": "string",
      "description": "La stå tomt. Spamfelle for roboter. Utfylte innsendinger forkastes"
    }
  },
  "required": [
    "name",
    "email",
    "message"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "received": {
      "type": "boolean",
      "description": "Alltid true når innsendingen ble godtatt"
    },
    "message": {
      "type": "string",
      "description": "Hva som skjer videre"
    }
  }
}
POST /newsletter/confirm.json Bekreft et abonnement på nyhetsbrevet (signert token) newsletter_confirm

Tillatelse: public · Kun HTTP (ikke et MCP-verktøy)

Eksempel
curl -X POST https://privatusanalytics.com/newsletter/confirm.json \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Signert token fra bekreftelses-e-posten"
    }
  },
  "required": [
    "token"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "received": {
      "type": "boolean",
      "description": "Alltid true når innsendingen ble godtatt"
    },
    "message": {
      "type": "string",
      "description": "Hva som skjer videre"
    }
  }
}
POST /newsletter.json Abonner på nyhetsbrevet med en e-postadresse newsletter_subscribe

Nettleserklienter sender et Cloudflare Turnstile-token som `cf-turnstile-response`. Forespørsler med et API-token trenger ikke det.

Tillatelse: public · Kun HTTP (ikke et MCP-verktøy)

Eksempel
curl -X POST https://privatusanalytics.com/newsletter.json \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "description": "E-postadresse som skal abonnere. En bekreftelseslenke sendes til den",
      "examples": [
        "[email protected]"
      ]
    },
    "website": {
      "type": "string",
      "description": "La stå tomt. Spamfelle for roboter. Utfylte innsendinger forkastes"
    }
  },
  "required": [
    "email"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "received": {
      "type": "boolean",
      "description": "Alltid true når innsendingen ble godtatt"
    },
    "message": {
      "type": "string",
      "description": "Hva som skjer videre"
    }
  }
}
POST /newsletter/unsubscribe.json Avslutt abonnementet med et signert lenketoken newsletter_unsubscribe

Tillatelse: public · Kun HTTP (ikke et MCP-verktøy)

Eksempel
curl -X POST https://privatusanalytics.com/newsletter/unsubscribe.json \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Signert token fra avmeldingslenken"
    },
    "list": {
      "type": "string",
      "description": "newsletter (standard: listen lenken gjaldt) eller marketing (all markedsførings-e-post)",
      "enum": [
        "newsletter",
        "marketing"
      ]
    }
  },
  "required": [
    "token"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "received": {
      "type": "boolean",
      "description": "Alltid true når innsendingen ble godtatt"
    },
    "message": {
      "type": "string",
      "description": "Hva som skjer videre"
    }
  }
}
GET /pricing.json Hent planer, priser og plangrenser pricing_get

De samme dataene som prissiden: hendelsestrappen, alle plangrenser og hva som teller som en hendelse. Send events for å få det tilsvarende nivået.

Tillatelse: public

Eksempel
curl https://privatusanalytics.com/pricing.json
Inndata
{
  "type": "object",
  "properties": {
    "events": {
      "type": "integer",
      "description": "Forventede sidevisninger pluss egendefinerte hendelser i måneden. Returnerer det tilsvarende nivået som `recommendation`",
      "examples": [
        750000
      ]
    },
    "interval": {
      "type": "string",
      "description": "Faktureringsintervall for prisene som vises: month, eller year (10 ganger månedsprisen)",
      "enum": [
        "month",
        "year"
      ],
      "default": "month"
    }
  },
  "required": []
}
Svardata
{
  "type": "object",
  "properties": {
    "currency": {
      "type": "string",
      "description": "Valuta for alle priser (USD)"
    },
    "tax_included": {
      "type": "boolean",
      "description": "Alltid true. Prisene inkluderer MVA eller omsetningsavgift, så prisen som vises, er prisen du betaler"
    },
    "interval": {
      "type": "string",
      "description": "month eller year. Prisene gjelder for dette intervallet"
    },
    "annual_multiplier": {
      "type": "integer",
      "description": "Årspris = månedspris x dette (to måneder gratis)"
    },
    "free_events": {
      "type": "integer",
      "description": "Hendelser i måneden inkludert i Gratis-planen"
    },
    "badge_bonus": {
      "type": "integer",
      "description": "Ekstra gratis hendelser i måneden når det valgfrie merket vises"
    },
    "tiers": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Hendelsestrapp: { events, pro, business }-priser for intervallet (pro er null der bare Business tilbys), pluss månedsprisene"
    },
    "plans": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Planer med { id, name, from_price, limits }. Grenser som er null betyr ubegrenset"
    },
    "counted": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Hva som teller som en fakturerbar hendelse"
    },
    "not_counted": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Hva som aldri teller mot forbruket"
    },
    "recommendation": {
      "anyOf": [
        {
          "type": "object",
          "description": "{ events, plan, tier_events, price } for inndataen `events`, eller null når ingen mengde ble oppgitt"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
GET /status.json Hent gjeldende systemstatus status_get

Tilstanden til database, Redis og bakgrunnsjobber, kontrollert maksimalt hvert 15. sekund.

Tillatelse: public

Eksempel
curl https://privatusanalytics.com/status.json
Inndata
{
  "type": "object",
  "properties": {
    "fresh": {
      "type": "boolean",
      "description": "Hopp over hurtigbufferen på 15 sekunder og kontroller på nytt nå",
      "default": false
    }
  },
  "required": []
}
Svardata
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Samlet: operational, degraded eller outage"
    },
    "checked_at": {
      "type": "string",
      "format": "date-time",
      "description": "Når kontrollene ble kjørt (bufret i opptil 15 s)"
    },
    "components": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Per komponent: { id, name, status, detail, latency_ms }, pluss queue_latency_s og queue_depth for køer"
    }
  }
}
GET /tools/header-checker.json Kontroller Referrer-Policy og CSP for en side med tanke på analyse tools_header_check

Tillatelse: public

Eksempel
curl https://privatusanalytics.com/tools/header-checker.json
Inndata
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Offentlig side som skal kontrolleres (http eller https)",
      "examples": [
        "https://example.com"
      ]
    }
  },
  "required": [
    "url"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Endelig URL etter omdirigeringer"
    },
    "status": {
      "type": "integer",
      "description": "HTTP-status for det endelige svaret"
    },
    "findings": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Kontroller: { check, value, level (ok, warn, info), note }"
    }
  }
}
GET /tools/privacy-policy-generator.json Lag et utkast til et avsnitt i personvernerklæringen for Privatus Analytics tools_privacy_policy

Tillatelse: public

Eksempel
curl https://privatusanalytics.com/tools/privacy-policy-generator.json
Inndata
{
  "type": "object",
  "properties": {
    "site_name": {
      "type": "string",
      "description": "Navnet på nettstedet eller selskapet ditt",
      "examples": [
        "Example Books"
      ]
    },
    "contact_email": {
      "type": "string",
      "description": "Personvernkontakt som skal nevnes (valgfritt)"
    },
    "honors_gpc": {
      "type": "boolean",
      "description": "Om Do Not Track og Global Privacy Control respekteres (standard)",
      "default": true
    }
  },
  "required": [
    "site_name"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "site_name": {
      "type": "string",
      "description": "Inndata: navn på nettsted eller selskap"
    },
    "paragraphs": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Erklæringsteksten, ett avsnitt per element"
    },
    "text": {
      "type": "string",
      "description": "Avsnittene slått sammen med blanke linjer"
    }
  }
}
GET /tools/qr-code.json Generer en QR-kode som SVG tools_qr_code

Tillatelse: public

Eksempel
curl https://privatusanalytics.com/tools/qr-code.json
Inndata
{
  "type": "object",
  "properties": {
    "text": {
      "type": "string",
      "description": "URL eller tekst som skal kodes (opptil 1 000 tegn)",
      "examples": [
        "https://example.com/?utm_source=poster"
      ]
    },
    "level": {
      "type": "string",
      "description": "Feilretting: l (7 %), m (15 %), q (25 %), h (30 %)",
      "enum": [
        "l",
        "m",
        "q",
        "h"
      ],
      "default": "m"
    }
  },
  "required": [
    "text"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "text": {
      "type": "string",
      "description": "Teksten som er kodet"
    },
    "level": {
      "type": "string",
      "description": "Nivå for feilretting"
    },
    "size": {
      "type": "integer",
      "description": "Moduler per side"
    },
    "svg": {
      "type": "string",
      "description": "Selvstendig SVG-dokument"
    }
  }
}
GET /tools/tracker-scanner.json List informasjonskapsler og kjente sporere på en side tools_tracker_scan

Tillatelse: public

Eksempel
curl https://privatusanalytics.com/tools/tracker-scanner.json
Inndata
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Offentlig side som skal skannes (http eller https)",
      "examples": [
        "https://example.com"
      ]
    }
  },
  "required": [
    "url"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Endelig URL etter omdirigeringer"
    },
    "status": {
      "type": "integer",
      "description": "HTTP-status for det endelige svaret"
    },
    "truncated": {
      "type": "boolean",
      "description": "True når siden var over 1 MB og bare den første 1 MB ble skannet"
    },
    "cookies": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Informasjonskapsler satt av HTTP-svaret: { name, domain, path, expires, secure, http_only, same_site }. Verdier returneres aldri"
    },
    "trackers": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Kjente verktøy referert av siden: { name, category, match, evidence }"
    },
    "third_party_hosts": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Andre domener siden laster ressurser fra"
    }
  }
}
GET /tools/utm-builder.json Bygg en kampanje-URL med UTM-parametere tools_utm_builder

Tillatelse: public

Eksempel
curl https://privatusanalytics.com/tools/utm-builder.json
Inndata
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "URL til landingssiden",
      "examples": [
        "https://example.com/pricing"
      ]
    },
    "source": {
      "type": "string",
      "description": "utm_source: hvor trafikken kommer fra",
      "examples": [
        "newsletter"
      ]
    },
    "medium": {
      "type": "string",
      "description": "utm_medium: kanalen, f.eks. email, cpc, social",
      "examples": [
        "email"
      ]
    },
    "campaign": {
      "type": "string",
      "description": "utm_campaign: kampanjenavnet",
      "examples": [
        "fall_launch"
      ]
    },
    "term": {
      "type": "string",
      "description": "utm_term: nøkkelord for betalt søk (valgfritt)"
    },
    "content": {
      "type": "string",
      "description": "utm_content: hvilken lenke eller annonse (valgfritt)"
    }
  },
  "required": [
    "url",
    "source",
    "medium",
    "campaign"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "URL-en til landingssiden med UTM-parametere"
    },
    "params": {
      "type": "object",
      "description": "UTM-parametrene som ble lagt til"
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Problemer det er verdt å rette (store/små bokstaver, mellomrom, personopplysninger)"
    }
  }
}
POST /waitlist.json Bli med på en venteliste (EU-hosting) waitlist_join

Nettleserklienter sender et Cloudflare Turnstile-token som `cf-turnstile-response`. Forespørsler med et API-token trenger ikke det.

Tillatelse: public · Kun HTTP (ikke et MCP-verktøy)

Eksempel
curl -X POST https://privatusanalytics.com/waitlist.json \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "description": "E-postadresse å varsle",
      "examples": [
        "[email protected]"
      ]
    },
    "list": {
      "type": "string",
      "description": "Hvilken venteliste du vil bli med på",
      "enum": [
        "eu_hosting"
      ],
      "default": "eu_hosting"
    },
    "website": {
      "type": "string",
      "description": "La stå tomt. Spamfelle for roboter. Utfylte innsendinger forkastes"
    }
  },
  "required": [
    "email"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "received": {
      "type": "boolean",
      "description": "Alltid true når innsendingen ble godtatt"
    },
    "message": {
      "type": "string",
      "description": "Hva som skjer videre"
    }
  }
}

Nettsteder

POST /sites/:site_id/data_reset.json Slett alle hendelser og besøk i et datoområde (kjører i bakgrunnen, kan ikke angres) sites_reset_data

Tillatelse: sites.manage

Eksempel
curl -X POST https://privatusanalytics.com/sites/:site_id/data_reset.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "from": {
      "type": "string",
      "format": "date",
      "description": "Første dag som skal slettes (nettstedets tidssone)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Siste dag som skal slettes, inkludert"
    },
    "confirm": {
      "type": "string",
      "description": "Skriv inn domenet for å bekrefte"
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "from",
    "to",
    "confirm",
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
GET /sites/:site_id/filter_stats.json Oppsummering av filtrert trafikk: roboter, trafikkregler eller PII-sladding etter årsak og land (kun antall) sites_filter_stats

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/filter_stats.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "description": "bot (filtrerte roboter), rule (trafikkregler) eller redaction (PII-sladder)",
      "enum": [
        "bot",
        "rule",
        "redaction"
      ],
      "default": "bot"
    },
    "days": {
      "type": "integer",
      "description": "Antall dager å se tilbake (1-395)",
      "default": 30
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
GET /sites/:site_id/access.json List medlemmer og om de kan se dette nettstedet sites_access_list

Tillatelse: members.manage

Eksempel
curl https://privatusanalytics.com/sites/:site_id/access.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "membership_id": {
      "type": "string",
      "format": "uuid",
      "description": "Medlemskaps-ID"
    },
    "email": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "role": {
      "type": "string"
    },
    "access": {
      "type": "boolean",
      "description": "Kan se dette nettstedet"
    },
    "locked": {
      "type": "boolean",
      "description": "Eiere og administratorer har alltid tilgang"
    }
  }
}
PATCH /sites/:site_id/access.json Gi eller fjern ett medlems tilgang til dette nettstedet sites_access_update

Tillatelse: members.manage

Eksempel
curl -X PATCH https://privatusanalytics.com/sites/:site_id/access.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "membership_id": {
      "type": "string",
      "description": "Medlemskaps-ID fra sites_access_list"
    },
    "access": {
      "type": "boolean",
      "description": "true for å gi tilgang, false for å fjerne den"
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "membership_id",
    "access",
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "membership_id": {
      "type": "string",
      "format": "uuid",
      "description": "Medlemskaps-ID"
    },
    "email": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "role": {
      "type": "string"
    },
    "access": {
      "type": "boolean",
      "description": "Kan se dette nettstedet"
    },
    "locked": {
      "type": "boolean",
      "description": "Eiere og administratorer har alltid tilgang"
    }
  }
}
POST /sites/:site_id/favorite.json Stjernemerk et nettsted (festes øverst under Alle nettsteder) sites_favorite

Tillatelse: analytics.read

Eksempel
curl -X POST https://privatusanalytics.com/sites/:site_id/favorite.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Nettsted-ID brukt i sporingskoden"
    },
    "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": "Begynnelsen av innsamlingsnøkkelen for serveren"
        },
        {
          "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-sporingskode"
    },
    "favorite": {
      "type": "boolean",
      "description": "Stjernemerket av deg"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:site_id/favorite.json Fjern stjernen fra et nettsted sites_unfavorite

Tillatelse: analytics.read

Eksempel
curl -X DELETE https://privatusanalytics.com/sites/:site_id/favorite.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Nettsted-ID brukt i sporingskoden"
    },
    "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": "Begynnelsen av innsamlingsnøkkelen for serveren"
        },
        {
          "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-sporingskode"
    },
    "favorite": {
      "type": "boolean",
      "description": "Stjernemerket av deg"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/setup.json Installasjonsstatus og kode for et nettsted sites_setup_get

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/setup.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
POST /transfers/:token/accept.json Godta en nettstedsoverføring til ett av arbeidsområdene dine site_transfers_accept

Tillatelse: public

Eksempel
curl -X POST https://privatusanalytics.com/transfers/:token/accept.json \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde nettstedet skal flyttes til (ws_…)"
    },
    "token": {
      "type": "string",
      "description": "Token for ressursen"
    }
  },
  "required": [
    "workspace_id",
    "token"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Nettsted som overføres"
    },
    "site_domain": {
      "type": "string"
    },
    "from_workspace": {
      "type": "string",
      "description": "Nåværende arbeidsområdenavn"
    },
    "to_workspace_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Mottakende arbeidsområde"
        },
        {
          "type": "null"
        }
      ]
    },
    "to_email": {
      "type": "string",
      "description": "Mottakerens e-postadresse"
    },
    "status": {
      "type": "string",
      "description": "pending, accepted eller canceled"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /sites/:site_id/transfer.json Start overføring av et nettsted til et annet arbeidsområde (sender e-post til mottakeren) sites_transfer_start

Tillatelse: sites.manage

Eksempel
curl -X POST https://privatusanalytics.com/sites/:site_id/transfer.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "description": "E-postadressen til personen som skal motta nettstedet (de velger ett av sine arbeidsområder)"
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "email",
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Nettsted som overføres"
    },
    "site_domain": {
      "type": "string"
    },
    "from_workspace": {
      "type": "string",
      "description": "Nåværende arbeidsområdenavn"
    },
    "to_workspace_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Mottakende arbeidsområde"
        },
        {
          "type": "null"
        }
      ]
    },
    "to_email": {
      "type": "string",
      "description": "Mottakerens e-postadresse"
    },
    "status": {
      "type": "string",
      "description": "pending, accepted eller canceled"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:site_id/transfer.json Avbryt en ventende nettstedsoverføring sites_transfer_cancel

Tillatelse: sites.manage

Eksempel
curl -X DELETE https://privatusanalytics.com/sites/:site_id/transfer.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Nettsted som overføres"
    },
    "site_domain": {
      "type": "string"
    },
    "from_workspace": {
      "type": "string",
      "description": "Nåværende arbeidsområdenavn"
    },
    "to_workspace_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Mottakende arbeidsområde"
        },
        {
          "type": "null"
        }
      ]
    },
    "to_email": {
      "type": "string",
      "description": "Mottakerens e-postadresse"
    },
    "status": {
      "type": "string",
      "description": "pending, accepted eller canceled"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /transfers/:token.json Hent en ventende overføring fra tokenet i e-posten site_transfers_get

Tillatelse: public

Eksempel
curl https://privatusanalytics.com/transfers/:token.json
Inndata
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Token for ressursen"
    }
  },
  "required": [
    "token"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Nettsted som overføres"
    },
    "site_domain": {
      "type": "string"
    },
    "from_workspace": {
      "type": "string",
      "description": "Nåværende arbeidsområdenavn"
    },
    "to_workspace_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Mottakende arbeidsområde"
        },
        {
          "type": "null"
        }
      ]
    },
    "to_email": {
      "type": "string",
      "description": "Mottakerens e-postadresse"
    },
    "status": {
      "type": "string",
      "description": "pending, accepted eller canceled"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /workspaces/:workspace_id/sites.json Legg til et nettsted sites_create

Tillatelse: sites.manage

Eksempel
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/sites.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "domain": {
      "type": "string",
      "description": "Hoveddomene, f.eks. example.com",
      "examples": [
        "example.com"
      ]
    },
    "name": {
      "type": "string",
      "description": "Visningsnavn (standard er domenet)"
    },
    "timezone": {
      "type": "string",
      "description": "Tidssone for rapportering"
    },
    "currency": {
      "type": "string",
      "description": "Valuta for inntekt (ISO 4217)"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "domain",
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Nettsted-ID brukt i sporingskoden"
    },
    "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": "Begynnelsen av innsamlingsnøkkelen for serveren"
        },
        {
          "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-sporingskode"
    },
    "favorite": {
      "type": "boolean",
      "description": "Stjernemerket av deg"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:id.json Slett et nettsted (fjernes permanent etter 7 dager) sites_delete

Tillatelse: sites.manage

Eksempel
curl -X DELETE https://privatusanalytics.com/sites/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "confirm": {
      "type": "string",
      "description": "Skriv inn domenet for å bekrefte"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "confirm",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Nettsted-ID brukt i sporingskoden"
    },
    "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": "Begynnelsen av innsamlingsnøkkelen for serveren"
        },
        {
          "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-sporingskode"
    },
    "favorite": {
      "type": "boolean",
      "description": "Stjernemerket av deg"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /workspaces/:workspace_id/sites.json List nettsteder i et arbeidsområde sites_list

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/sites.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "description": "Filtrer etter domene eller navn"
    },
    "label": {
      "type": "string",
      "description": "Bare nettsteder med denne etiketten"
    },
    "sort": {
      "type": "string",
      "description": "position (din rekkefølge), name, eller besøkende de siste 30 dagene (flest først)",
      "enum": [
        "position",
        "name",
        "visitors"
      ],
      "default": "position"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater per side (maks 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Nettsted-ID brukt i sporingskoden"
      },
      "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": "Begynnelsen av innsamlingsnøkkelen for serveren"
          },
          {
            "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-sporingskode"
      },
      "favorite": {
        "type": "boolean",
        "description": "Stjernemerket av deg"
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
GET /sites/:id.json Hent et nettsted og alle innstillingene sites_get

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Nettsted-ID brukt i sporingskoden"
    },
    "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": "Begynnelsen av innsamlingsnøkkelen for serveren"
        },
        {
          "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-sporingskode"
    },
    "favorite": {
      "type": "boolean",
      "description": "Stjernemerket av deg"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
PATCH /sites/:id.json Oppdater nettstedsinnstillinger sites_update

Tillatelse: sites.manage

Eksempel
curl -X PATCH https://privatusanalytics.com/sites/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Visningsnavn"
    },
    "domain": {
      "type": "string",
      "description": "Hoveddomene"
    },
    "extra_domains": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Ekstra vertsnavn"
    },
    "multi_domain_mode": {
      "type": "string",
      "description": "combined: én besøkende på tvers av domener",
      "enum": [
        "combined",
        "separate"
      ]
    },
    "timezone": {
      "type": "string",
      "description": "Tidssone for rapportering"
    },
    "currency": {
      "type": "string",
      "description": "Inntektsvaluta (ISO 4217)"
    },
    "week_start": {
      "type": "integer",
      "description": "0 = søndag, 1 = mandag"
    },
    "labels": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Etiketter for gruppering av nettsteder"
    },
    "honor_dnt": {
      "type": "boolean",
      "description": "Hopp over besøkende som sender DNT"
    },
    "honor_gpc": {
      "type": "boolean",
      "description": "Hopp over besøkende som sender GPC"
    },
    "pii_scrubber": {
      "type": "boolean",
      "description": "Sladd e-poster, tokener og ID-er"
    },
    "redaction_rules": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "pattern": {
            "type": "string"
          }
        }
      },
      "description": "Egendefinerte sladderegulære uttrykk"
    },
    "allowed_params": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Spørringsparametere som beholdes på stier"
    },
    "path_masks": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "pattern": {
            "type": "string"
          },
          "replacement": {
            "type": "string"
          }
        }
      },
      "description": "Regler for maskering av stier, f.eks. /u/* -> /u/:id"
    },
    "retention_months": {
      "type": "integer",
      "description": "Slett data eldre enn dette"
    },
    "bot_filtering": {
      "type": "boolean",
      "description": "Filtrer robottrafikk"
    },
    "traffic_rule_modes": {
      "type": "object",
      "additionalProperties": true,
      "description": "block eller allow per trafikkregelliste"
    },
    "vitals_sample_rate": {
      "type": "integer",
      "description": "Utvalg for Web Vitals i %"
    },
    "conversion_denominator": {
      "type": "string",
      "description": "Konverteringsrate over besøk eller besøkende",
      "enum": [
        "visits",
        "visitors"
      ]
    },
    "public_dashboard": {
      "type": "boolean",
      "description": "Alle med lenken kan se statistikken"
    },
    "public_indexable": {
      "type": "boolean",
      "description": "La søkemotorer indeksere den offentlige siden"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Nettsted-ID brukt i sporingskoden"
    },
    "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": "Begynnelsen av innsamlingsnøkkelen for serveren"
        },
        {
          "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-sporingskode"
    },
    "favorite": {
      "type": "boolean",
      "description": "Stjernemerket av deg"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Notater

POST /sites/:site_id/notes.json Legg til et notat på et nettsted (bruk kilden "deploy" for webhooks ved utgivelser) notes_create

Tillatelse: content.write

Eksempel
curl -X POST https://privatusanalytics.com/sites/:site_id/notes.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "date": {
      "type": "string",
      "format": "date",
      "description": "Dagen for notatet (nettstedets tidssone). Standard er i dag"
    },
    "end_date": {
      "type": "string",
      "format": "date",
      "description": "Siste dag, for et datoområde"
    },
    "title": {
      "type": "string",
      "description": "Kort tittel som vises på diagrammer",
      "examples": [
        "Launched new pricing"
      ]
    },
    "body": {
      "type": "string",
      "description": "Detaljer (Markdown)"
    },
    "url": {
      "type": "string",
      "description": "Lenke, f.eks. til en PR eller endringslogg"
    },
    "color": {
      "type": "string",
      "description": "Nålefarge",
      "enum": [
        "neutral",
        "brand",
        "blue",
        "amber",
        "red",
        "violet"
      ]
    },
    "source": {
      "type": "string",
      "description": "manual, eller deploy for webhooks ved utgivelser",
      "enum": [
        "manual",
        "deploy",
        "system",
        "import",
        "incident"
      ],
      "default": "manual"
    },
    "version": {
      "type": "string",
      "description": "Deploy: utgivelsesversjon eller commit, brukes til standardtittelen"
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Notat-ID, f.eks. note_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nettsted, eller null for notater for hele arbeidsområdet"
        },
        {
          "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 Slett et notat notes_delete

Tillatelse: content.write

Eksempel
curl -X DELETE https://privatusanalytics.com/sites/:site_id/notes/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Notat-ID, f.eks. note_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nettsted, eller null for notater for hele arbeidsområdet"
        },
        {
          "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 List notater for et nettsted (inkludert notater for hele arbeidsområdet) notes_list

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/notes.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "from": {
      "type": "string",
      "format": "date",
      "description": "Bare notater på eller etter denne datoen"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Bare notater på eller før denne datoen"
    },
    "source": {
      "type": "string",
      "description": "Bare notater fra denne kilden",
      "enum": [
        "manual",
        "deploy",
        "system",
        "import",
        "incident"
      ]
    },
    "query": {
      "type": "string",
      "description": "Søk i tittel, innhold og lenke"
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater per side (maks 100)"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Notat-ID, f.eks. note_7Q2K9XH3AB"
      },
      "site_id": {
        "anyOf": [
          {
            "type": "string",
            "description": "Nettsted, eller null for notater for hele arbeidsområdet"
          },
          {
            "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 Hent et notat notes_get

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/notes/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Notat-ID, f.eks. note_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nettsted, eller null for notater for hele arbeidsområdet"
        },
        {
          "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 Rediger et notat notes_update

Tillatelse: content.write

Eksempel
curl -X PATCH https://privatusanalytics.com/sites/:site_id/notes/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "date": {
      "type": "string",
      "format": "date",
      "description": "Dagen for notatet"
    },
    "end_date": {
      "type": "string",
      "format": "date",
      "description": "Siste dag, for et datoområde"
    },
    "title": {
      "type": "string",
      "description": "Kort tittel som vises på diagrammer"
    },
    "body": {
      "type": "string",
      "description": "Detaljer (Markdown)"
    },
    "url": {
      "type": "string",
      "description": "Lenke"
    },
    "color": {
      "type": "string",
      "description": "Nålefarge",
      "enum": [
        "neutral",
        "brand",
        "blue",
        "amber",
        "red",
        "violet"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Notat-ID, f.eks. note_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nettsted, eller null for notater for hele arbeidsområdet"
        },
        {
          "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 Legg til et notat for hele arbeidsområdet (vises på alle nettsteder) workspace_notes_create

Tillatelse: content.write

Eksempel
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/notes.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "date": {
      "type": "string",
      "format": "date",
      "description": "Dagen for notatet (nettstedets tidssone). Standard er i dag"
    },
    "end_date": {
      "type": "string",
      "format": "date",
      "description": "Siste dag, for et datoområde"
    },
    "title": {
      "type": "string",
      "description": "Kort tittel som vises på diagrammer",
      "examples": [
        "Launched new pricing"
      ]
    },
    "body": {
      "type": "string",
      "description": "Detaljer (Markdown)"
    },
    "url": {
      "type": "string",
      "description": "Lenke, f.eks. til en PR eller endringslogg"
    },
    "color": {
      "type": "string",
      "description": "Nålefarge",
      "enum": [
        "neutral",
        "brand",
        "blue",
        "amber",
        "red",
        "violet"
      ]
    },
    "source": {
      "type": "string",
      "description": "manual, eller deploy for webhooks ved utgivelser",
      "enum": [
        "manual",
        "deploy",
        "system",
        "import",
        "incident"
      ],
      "default": "manual"
    },
    "version": {
      "type": "string",
      "description": "Deploy: utgivelsesversjon eller commit, brukes til standardtittelen"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Notat-ID, f.eks. note_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nettsted, eller null for notater for hele arbeidsområdet"
        },
        {
          "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 Slett et arbeidsområdenotat workspace_notes_delete

Tillatelse: content.write

Eksempel
curl -X DELETE https://privatusanalytics.com/workspaces/:workspace_id/notes/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Notat-ID, f.eks. note_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nettsted, eller null for notater for hele arbeidsområdet"
        },
        {
          "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 List notater på tvers av et arbeidsområde workspace_notes_list

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/notes.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "from": {
      "type": "string",
      "format": "date",
      "description": "Bare notater på eller etter denne datoen"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Bare notater på eller før denne datoen"
    },
    "source": {
      "type": "string",
      "description": "Bare notater fra denne kilden",
      "enum": [
        "manual",
        "deploy",
        "system",
        "import",
        "incident"
      ]
    },
    "query": {
      "type": "string",
      "description": "Søk i tittel, innhold og lenke"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater per side (maks 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Notat-ID, f.eks. note_7Q2K9XH3AB"
      },
      "site_id": {
        "anyOf": [
          {
            "type": "string",
            "description": "Nettsted, eller null for notater for hele arbeidsområdet"
          },
          {
            "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 Rediger et arbeidsområdenotat workspace_notes_update

Tillatelse: content.write

Eksempel
curl -X PATCH https://privatusanalytics.com/workspaces/:workspace_id/notes/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "date": {
      "type": "string",
      "format": "date",
      "description": "Dagen for notatet"
    },
    "end_date": {
      "type": "string",
      "format": "date",
      "description": "Siste dag, for et datoområde"
    },
    "title": {
      "type": "string",
      "description": "Kort tittel som vises på diagrammer"
    },
    "body": {
      "type": "string",
      "description": "Detaljer (Markdown)"
    },
    "url": {
      "type": "string",
      "description": "Lenke"
    },
    "color": {
      "type": "string",
      "description": "Nålefarge",
      "enum": [
        "neutral",
        "brand",
        "blue",
        "amber",
        "red",
        "violet"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Notat-ID, f.eks. note_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nettsted, eller null for notater for hele arbeidsområdet"
        },
        {
          "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"
    }
  }
}

Oppetid

POST /sites/:site_id/uptime.json Legg til en oppetidskontroll for et nettsted uptime_checks_create

Tillatelse: uptime.manage

Eksempel
curl -X POST https://privatusanalytics.com/sites/:site_id/uptime.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Visningsnavn (standard er målet)"
    },
    "kind": {
      "type": "string",
      "description": "http (statuskode), keyword (innhold inneholder), tcp (vert:port) eller dns (navn slås opp)",
      "enum": [
        "http",
        "keyword",
        "tcp",
        "dns"
      ],
      "default": "http"
    },
    "url": {
      "type": "string",
      "description": "URL for http-/keyword-kontroller",
      "examples": [
        "https://example.com/health"
      ]
    },
    "host": {
      "type": "string",
      "description": "Vertsnavn for tcp-/dns-kontroller"
    },
    "port": {
      "type": "integer",
      "description": "TCP-port for tcp-kontroller"
    },
    "keyword": {
      "type": "string",
      "description": "Tekst svarinnholdet må inneholde (keyword)"
    },
    "expected_status": {
      "type": "integer",
      "description": "Forventet HTTP-statuskode",
      "default": 200
    },
    "http_method": {
      "type": "string",
      "description": "HTTP-metode",
      "enum": [
        "GET",
        "HEAD"
      ],
      "default": "GET"
    },
    "interval_seconds": {
      "type": "integer",
      "description": "Sekunder mellom kontroller (planens minimum gjelder, standard 300 eller minimum)"
    },
    "timeout_seconds": {
      "type": "integer",
      "description": "Sekunder før en probe går ut på tid (1-30)",
      "default": 20
    },
    "public": {
      "type": "boolean",
      "description": "Kan vises på offentlige statussider",
      "default": false
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Kontroll-ID (upc_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nettstedet kontrollen tilhører"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "http, keyword, tcp eller 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 eller paused"
    },
    "enabled": {
      "type": "boolean"
    },
    "public": {
      "type": "boolean",
      "description": "Kan vises på statussider"
    },
    "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 Slett en oppetidskontroll og historikken uptime_checks_delete

Tillatelse: uptime.manage

Eksempel
curl -X DELETE https://privatusanalytics.com/uptime/checks/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Kontroll-ID (upc_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nettstedet kontrollen tilhører"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "http, keyword, tcp eller 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 eller paused"
    },
    "enabled": {
      "type": "boolean"
    },
    "public": {
      "type": "boolean",
      "description": "Kan vises på statussider"
    },
    "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 List oppetidskontrollene for et nettsted uptime_checks_list

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/uptime.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Bare kontroller i denne tilstanden",
      "enum": [
        "up",
        "down",
        "pending",
        "paused"
      ]
    },
    "query": {
      "type": "string",
      "description": "Filtrer etter navn eller mål"
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater per side (maks 100)"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Kontroll-ID (upc_…)"
      },
      "workspace_id": {
        "type": "string"
      },
      "site_id": {
        "anyOf": [
          {
            "type": "string",
            "description": "Nettstedet kontrollen tilhører"
          },
          {
            "type": "null"
          }
        ]
      },
      "name": {
        "type": "string"
      },
      "kind": {
        "type": "string",
        "description": "http, keyword, tcp eller 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 eller paused"
      },
      "enabled": {
        "type": "boolean"
      },
      "public": {
        "type": "boolean",
        "description": "Kan vises på statussider"
      },
      "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 Sett en oppetidskontroll på pause uptime_checks_pause

Tillatelse: uptime.manage

Eksempel
curl -X POST https://privatusanalytics.com/uptime/checks/:id/pause.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Kontroll-ID (upc_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nettstedet kontrollen tilhører"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "http, keyword, tcp eller 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 eller paused"
    },
    "enabled": {
      "type": "boolean"
    },
    "public": {
      "type": "boolean",
      "description": "Kan vises på statussider"
    },
    "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 Gjenoppta en oppetidskontroll som står på pause uptime_checks_resume

Tillatelse: uptime.manage

Eksempel
curl -X POST https://privatusanalytics.com/uptime/checks/:id/resume.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Kontroll-ID (upc_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nettstedet kontrollen tilhører"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "http, keyword, tcp eller 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 eller paused"
    },
    "enabled": {
      "type": "boolean"
    },
    "public": {
      "type": "boolean",
      "description": "Kan vises på statussider"
    },
    "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 Hent en oppetidskontroll: oppetid 24 t/7 d/30 d, responstider og hendelser uptime_checks_get

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/uptime/checks/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "range": {
      "type": "string",
      "description": "Vindu for responstidsdiagrammet",
      "enum": [
        "24h",
        "7d",
        "30d"
      ],
      "default": "24h"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "check": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Kontroll-ID (upc_…)"
        },
        "workspace_id": {
          "type": "string"
        },
        "site_id": {
          "anyOf": [
            {
              "type": "string",
              "description": "Nettstedet kontrollen tilhører"
            },
            {
              "type": "null"
            }
          ]
        },
        "name": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "description": "http, keyword, tcp eller 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 eller paused"
        },
        "enabled": {
          "type": "boolean"
        },
        "public": {
          "type": "boolean",
          "description": "Kan vises på statussider"
        },
        "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": "Oppetid i % for 24 t, 7 d og 30 d"
    },
    "range": {
      "type": "string",
      "description": "Vindu for response_times"
    },
    "response_times": {
      "type": "object",
      "description": "Gjennomsnittlig respons i ms per intervall: {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": "Så langt, hvis fortsatt åpen"
          },
          "cause": {
            "anyOf": [
              {
                "type": "string",
                "description": "Vanligste feil, f.eks. timeout eller status_503"
              },
              {
                "type": "null"
              }
            ]
          },
          "failed_locations": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    }
  }
}
PATCH /uptime/checks/:id.json Endre en oppetidskontroll uptime_checks_update

Tillatelse: uptime.manage

Eksempel
curl -X PATCH https://privatusanalytics.com/uptime/checks/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Visningsnavn (standard er målet)"
    },
    "kind": {
      "type": "string",
      "description": "http (statuskode), keyword (innhold inneholder), tcp (vert:port) eller dns (navn slås opp)",
      "enum": [
        "http",
        "keyword",
        "tcp",
        "dns"
      ]
    },
    "url": {
      "type": "string",
      "description": "URL for http-/keyword-kontroller",
      "examples": [
        "https://example.com/health"
      ]
    },
    "host": {
      "type": "string",
      "description": "Vertsnavn for tcp-/dns-kontroller"
    },
    "port": {
      "type": "integer",
      "description": "TCP-port for tcp-kontroller"
    },
    "keyword": {
      "type": "string",
      "description": "Tekst svarinnholdet må inneholde (keyword)"
    },
    "expected_status": {
      "type": "integer",
      "description": "Forventet HTTP-statuskode"
    },
    "http_method": {
      "type": "string",
      "description": "HTTP-metode",
      "enum": [
        "GET",
        "HEAD"
      ]
    },
    "interval_seconds": {
      "type": "integer",
      "description": "Sekunder mellom kontroller (planens minimum gjelder, standard 300 eller minimum)"
    },
    "timeout_seconds": {
      "type": "integer",
      "description": "Sekunder før en probe går ut på tid (1-30)"
    },
    "public": {
      "type": "boolean",
      "description": "Kan vises på offentlige statussider"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Kontroll-ID (upc_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nettstedet kontrollen tilhører"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "http, keyword, tcp eller 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 eller paused"
    },
    "enabled": {
      "type": "boolean"
    },
    "public": {
      "type": "boolean",
      "description": "Kan vises på statussider"
    },
    "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 Datasenter for prober, User-Agent og IP-områder for utgående trafikk (for å tillate oppetidsprobene våre) uptime_probes_list

Tillatelse: public · Kun HTTP (ikke et MCP-verktøy)

Eksempel
curl https://privatusanalytics.com/uptime/probes.json
Inndata
{
  "type": "object",
  "properties": {},
  "required": []
}
Svardata
{
  "type": "object"
}
POST /uptime/probes/results.json Send resultater fra en ekstern probeagent (Bearer-token for oppetidsprobe) uptime_probes_results

Tillatelse: public · Kun HTTP (ikke et MCP-verktøy)

Eksempel
curl -X POST https://privatusanalytics.com/uptime/probes/results.json \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "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": "Proberesultater: [{check_id, location, ok, status_code, response_ms, error, checked_at}]"
    }
  },
  "required": [
    "results"
  ]
}
Svardata
{
  "type": "object"
}
POST /workspaces/:workspace_id/uptime.json Legg til en oppetidskontroll for arbeidsområdet (ikke knyttet til et nettsted) workspace_uptime_checks_create

Tillatelse: uptime.manage

Eksempel
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/uptime.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Visningsnavn (standard er målet)"
    },
    "kind": {
      "type": "string",
      "description": "http (statuskode), keyword (innhold inneholder), tcp (vert:port) eller dns (navn slås opp)",
      "enum": [
        "http",
        "keyword",
        "tcp",
        "dns"
      ],
      "default": "http"
    },
    "url": {
      "type": "string",
      "description": "URL for http-/keyword-kontroller",
      "examples": [
        "https://example.com/health"
      ]
    },
    "host": {
      "type": "string",
      "description": "Vertsnavn for tcp-/dns-kontroller"
    },
    "port": {
      "type": "integer",
      "description": "TCP-port for tcp-kontroller"
    },
    "keyword": {
      "type": "string",
      "description": "Tekst svarinnholdet må inneholde (keyword)"
    },
    "expected_status": {
      "type": "integer",
      "description": "Forventet HTTP-statuskode",
      "default": 200
    },
    "http_method": {
      "type": "string",
      "description": "HTTP-metode",
      "enum": [
        "GET",
        "HEAD"
      ],
      "default": "GET"
    },
    "interval_seconds": {
      "type": "integer",
      "description": "Sekunder mellom kontroller (planens minimum gjelder, standard 300 eller minimum)"
    },
    "timeout_seconds": {
      "type": "integer",
      "description": "Sekunder før en probe går ut på tid (1-30)",
      "default": 20
    },
    "public": {
      "type": "boolean",
      "description": "Kan vises på offentlige statussider",
      "default": false
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Kontroll-ID (upc_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nettstedet kontrollen tilhører"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "http, keyword, tcp eller 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 eller paused"
    },
    "enabled": {
      "type": "boolean"
    },
    "public": {
      "type": "boolean",
      "description": "Kan vises på statussider"
    },
    "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 List alle oppetidskontroller i et arbeidsområde workspace_uptime_checks_list

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/uptime.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Bare kontroller i denne tilstanden",
      "enum": [
        "up",
        "down",
        "pending",
        "paused"
      ]
    },
    "query": {
      "type": "string",
      "description": "Filtrer etter navn eller mål"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater per side (maks 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Kontroll-ID (upc_…)"
      },
      "workspace_id": {
        "type": "string"
      },
      "site_id": {
        "anyOf": [
          {
            "type": "string",
            "description": "Nettstedet kontrollen tilhører"
          },
          {
            "type": "null"
          }
        ]
      },
      "name": {
        "type": "string"
      },
      "kind": {
        "type": "string",
        "description": "http, keyword, tcp eller 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 eller paused"
      },
      "enabled": {
        "type": "boolean"
      },
      "public": {
        "type": "boolean",
        "description": "Kan vises på statussider"
      },
      "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"
      }
    }
  }
}

Planer

GET /plans.json List planer, priser og grenser plans_list

Tillatelse: public

Eksempel
curl https://privatusanalytics.com/plans.json
Inndata
{
  "type": "object",
  "properties": {
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater per side (maks 100)"
    }
  },
  "required": []
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "name": {
        "type": "string",
        "description": "free, pro, business eller enterprise"
      },
      "events": {
        "anyOf": [
          {
            "type": "integer",
            "description": "Inkluderte hendelser i måneden (bare gratisplan)"
          },
          {
            "type": "null"
          }
        ]
      },
      "badge_bonus": {
        "anyOf": [
          {
            "type": "integer",
            "description": "Ekstra hendelser i måneden for å vise merket (gratisplan)"
          },
          {
            "type": "null"
          }
        ]
      },
      "limits": {
        "type": "object",
        "description": "Plangrenser. Null betyr ubegrenset"
      },
      "tiers": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "events": {
              "type": "integer",
              "description": "Inkluderte hendelser i måneden"
            },
            "monthly": {
              "type": "integer",
              "description": "USD i måneden, fakturert månedlig"
            },
            "yearly": {
              "type": "integer",
              "description": "USD i året, fakturert årlig (2 måneder gratis)"
            },
            "monthly_price_id": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Paddle-pris-ID (månedlig)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "yearly_price_id": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Paddle-pris-ID (årlig)"
                },
                {
                  "type": "null"
                }
              ]
            }
          }
        },
        "description": "Prisstige etter hendelser i måneden"
      },
      "contact_sales": {
        "type": "boolean",
        "description": "Prisen avtales per kontrakt"
      }
    }
  }
}

Revisjonslogg

GET /workspaces/:workspace_id/audit_log.json List oppføringer i revisjonsloggen (legg til .csv for å eksportere) audit_logs_get

Tillatelse: workspace.manage

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/audit_log.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "actor": {
      "type": "string",
      "description": "Bare endringer av dette medlemmet (e-post)"
    },
    "item_type": {
      "type": "string",
      "description": "Bare denne typen oppføring, f.eks. Site"
    },
    "event": {
      "type": "string",
      "description": "Bare denne handlingen",
      "enum": [
        "create",
        "update",
        "destroy"
      ]
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Fra dato (inkludert)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Til dato (inkludert)"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater per side (maks 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "format": "uuid"
      },
      "created_at": {
        "type": "string",
        "format": "date-time",
        "description": "Når"
      },
      "event": {
        "type": "string",
        "description": "create, update eller destroy"
      },
      "item_type": {
        "type": "string",
        "description": "Type oppføring, f.eks. Site"
      },
      "item_id": {
        "type": "string",
        "format": "uuid"
      },
      "target": {
        "type": "string",
        "description": "Oppføringen, med navn der det er kjent"
      },
      "actor_email": {
        "anyOf": [
          {
            "type": "string",
            "description": "Medlemmet som gjorde endringen"
          },
          {
            "type": "null"
          }
        ]
      },
      "actor_name": {
        "type": "string"
      },
      "token_name": {
        "anyOf": [
          {
            "type": "string",
            "description": "API-token som ble brukt, hvis noen"
          },
          {
            "type": "null"
          }
        ]
      },
      "changes": {
        "type": "object",
        "description": "Endrede felt: { field: [før, etter] }"
      },
      "ip": {
        "anyOf": [
          {
            "type": "string",
            "description": "Medlemmets IP-adresse"
          },
          {
            "type": "null"
          }
        ]
      }
    }
  }
}

Roboter

GET /sites/:site_id/crawlers.json Rapport om AI-roboter: treff per robot over tid, toppstier per robot, etter kategori crawlers_report

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/crawlers.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Forhåndsvalgt datoområde. Bruk custom med from/to",
      "enum": [
        "today",
        "yesterday",
        "24h",
        "7d",
        "14d",
        "28d",
        "30d",
        "90d",
        "mtd",
        "last_month",
        "qtd",
        "last_quarter",
        "ytd",
        "12mo",
        "last_year",
        "all",
        "custom"
      ],
      "default": "30d"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Start på egendefinert område (nettstedets tidssone)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Slutt på egendefinert område, inkludert"
    },
    "category": {
      "type": "string",
      "description": "ai, search, seo, other eller all",
      "enum": [
        "all",
        "ai",
        "search",
        "seo",
        "other"
      ],
      "default": "ai"
    },
    "crawler": {
      "type": "string",
      "description": "Bare denne roboten, f.eks. GPTBot"
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}

Roller

POST /workspaces/:workspace_id/roles.json Opprett en egendefinert rolle roles_create

Tillatelse: members.manage

Eksempel
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/roles.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Navn på rollen",
      "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": "Tillatelser rollen gir"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "permissions",
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "ID for egendefinert rolle (custom_role_id på medlemmer)"
    },
    "name": {
      "type": "string"
    },
    "permissions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Tildelte tillatelser"
    },
    "members": {
      "type": "integer",
      "description": "Medlemmer med denne rollen"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /workspaces/:workspace_id/roles/:id.json Slett en egendefinert rolle (må være ubrukt) roles_delete

Tillatelse: members.manage

Eksempel
curl -X DELETE https://privatusanalytics.com/workspaces/:workspace_id/roles/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "ID for egendefinert rolle (custom_role_id på medlemmer)"
    },
    "name": {
      "type": "string"
    },
    "permissions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Tildelte tillatelser"
    },
    "members": {
      "type": "integer",
      "description": "Medlemmer med denne rollen"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /workspaces/:workspace_id/roles.json List egendefinerte roller roles_list

Tillatelse: member

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/roles.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater per side (maks 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "format": "uuid",
        "description": "ID for egendefinert rolle (custom_role_id på medlemmer)"
      },
      "name": {
        "type": "string"
      },
      "permissions": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Tildelte tillatelser"
      },
      "members": {
        "type": "integer",
        "description": "Medlemmer med denne rollen"
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
PATCH /workspaces/:workspace_id/roles/:id.json Oppdater en egendefinert rolle roles_update

Tillatelse: members.manage

Eksempel
curl -X PATCH https://privatusanalytics.com/workspaces/:workspace_id/roles/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Navn på rollen"
    },
    "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": "Tillatelser rollen gir"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "ID for egendefinert rolle (custom_role_id på medlemmer)"
    },
    "name": {
      "type": "string"
    },
    "permissions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Tildelte tillatelser"
    },
    "members": {
      "type": "integer",
      "description": "Medlemmer med denne rollen"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

SCIM

POST /scim/v2/Users.json Etabler en bruker scim_users_create

Tillatelse: public · Kun HTTP (ikke et MCP-verktøy)

Eksempel
curl -X POST https://privatusanalytics.com/scim/v2/Users.json \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "userName": {
      "type": "string",
      "description": "E-postadresse"
    },
    "name": {
      "type": "object",
      "additionalProperties": true,
      "description": "givenName, familyName, formatted",
      "default": {}
    },
    "active": {
      "type": "boolean",
      "description": "Medlem av arbeidsområdet",
      "default": true
    }
  },
  "required": [
    "userName"
  ]
}
Svardata
{
  "type": "object"
}
DELETE /scim/v2/Users/:id.json Avetabler en bruker scim_users_delete

Tillatelse: public · Kun HTTP (ikke et MCP-verktøy)

Eksempel
curl -X DELETE https://privatusanalytics.com/scim/v2/Users/:id.json \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object"
}
GET /scim/v2/Users.json List etablerte brukere scim_users_list

Tillatelse: public · Kun HTTP (ikke et MCP-verktøy)

Eksempel
curl https://privatusanalytics.com/scim/v2/Users.json
Inndata
{
  "type": "object",
  "properties": {
    "scim_filter": {
      "type": "string",
      "description": "SCIM-filter (spørringsparameteren `filter`), f.eks. userName eq \"[email protected]\""
    },
    "startIndex": {
      "type": "integer",
      "description": "1-basert indeks for det første resultatet",
      "default": 1
    },
    "count": {
      "type": "integer",
      "description": "Sidestørrelse (maks 200)",
      "default": 100
    }
  },
  "required": []
}
Svardata
{
  "type": "object"
}
GET /scim/v2/Users/:id.json Hent en etablert bruker scim_users_get

Tillatelse: public · Kun HTTP (ikke et MCP-verktøy)

Eksempel
curl https://privatusanalytics.com/scim/v2/Users/:id.json
Inndata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object"
}
PATCH /scim/v2/Users/:id.json Oppdater en bruker (PATCH active, name) scim_users_update

Tillatelse: public · Kun HTTP (ikke et MCP-verktøy)

Eksempel
curl -X PATCH https://privatusanalytics.com/scim/v2/Users/:id.json \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "Operations": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      },
      "description": "SCIM PatchOp-operasjoner"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "Operations",
    "id"
  ]
}
Svardata
{
  "type": "object"
}

SSO

POST /workspaces/:workspace_id/sso/activate.json Aktiver en testet SSO-konfigurasjon sso_activate

Tillatelse: workspace.manage

Eksempel
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/sso/activate.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "protocol": {
      "type": "string",
      "description": "saml eller oidc"
    },
    "status": {
      "type": "string",
      "description": "draft, testing, tested eller active"
    },
    "enforced": {
      "type": "boolean",
      "description": "SSO er den eneste veien inn (unntatt eieren)"
    },
    "domains": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Verifiserte e-postdomener"
    },
    "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 Slå av SSO (tilbake til utkast) sso_deactivate

Tillatelse: workspace.manage

Eksempel
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/sso/deactivate.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "protocol": {
      "type": "string",
      "description": "saml eller oidc"
    },
    "status": {
      "type": "string",
      "description": "draft, testing, tested eller active"
    },
    "enforced": {
      "type": "boolean",
      "description": "SSO er den eneste veien inn (unntatt eieren)"
    },
    "domains": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Verifiserte e-postdomener"
    },
    "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 Generer et nytt SCIM-token (vises bare én gang) sso_scim_token

Tillatelse: workspace.manage · Kun HTTP (ikke et MCP-verktøy)

Eksempel
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/sso/scim_token.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "object"
}
GET /workspaces/:workspace_id/sso.json Hent SSO-innstillinger sso_get

Tillatelse: workspace.manage

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/sso.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "protocol": {
      "type": "string",
      "description": "saml eller oidc"
    },
    "status": {
      "type": "string",
      "description": "draft, testing, tested eller active"
    },
    "enforced": {
      "type": "boolean",
      "description": "SSO er den eneste veien inn (unntatt eieren)"
    },
    "domains": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Verifiserte e-postdomener"
    },
    "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 Opprett eller oppdater SSO-innstillinger sso_update

Tillatelse: workspace.manage

Eksempel
curl -X PATCH https://privatusanalytics.com/workspaces/:workspace_id/sso.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "protocol": {
      "type": "string",
      "description": "saml eller oidc",
      "enum": [
        "saml",
        "oidc"
      ]
    },
    "idp_sso_url": {
      "type": "string",
      "description": "SAML: IdP-URL for single sign-on"
    },
    "idp_entity_id": {
      "type": "string",
      "description": "SAML: IdP-enhets-ID (utsteder)"
    },
    "idp_cert": {
      "type": "string",
      "description": "SAML: IdP X.509-signeringssertifikat (PEM)"
    },
    "oidc_issuer": {
      "type": "string",
      "description": "OIDC: utsteder-URL (discovery)"
    },
    "oidc_client_id": {
      "type": "string",
      "description": "OIDC: klient-ID"
    },
    "oidc_client_secret": {
      "type": "string",
      "description": "OIDC: klienthemmelighet (kun skrivbar)"
    },
    "domains": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Verifiserte e-postdomener som bruker denne SSO-en"
    },
    "default_role": {
      "type": "string",
      "description": "Rolle for medlemmer opprettet via JIT eller SCIM",
      "enum": [
        "admin",
        "editor",
        "analyst",
        "viewer",
        "billing"
      ]
    },
    "jit_provisioning": {
      "type": "boolean",
      "description": "Opprett medlemmer ved første SSO-innlogging"
    },
    "enforced": {
      "type": "boolean",
      "description": "Tillat bare SSO-innlogginger (krever en aktiv konfigurasjon)"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "protocol": {
      "type": "string",
      "description": "saml eller oidc"
    },
    "status": {
      "type": "string",
      "description": "draft, testing, tested eller active"
    },
    "enforced": {
      "type": "boolean",
      "description": "SSO er den eneste veien inn (unntatt eieren)"
    },
    "domains": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Verifiserte e-postdomener"
    },
    "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"
    }
  }
}

Segmenter

POST /sites/:site_id/segments.json Lagre filtre som et segment segments_create

Tillatelse: content.write

Eksempel
curl -X POST https://privatusanalytics.com/sites/:site_id/segments.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Segmentnavn, f.eks. «Mobilbesøkende fra annonser»",
      "examples": [
        "Mobile visitors from ads"
      ]
    },
    "description": {
      "type": "string",
      "description": "Valgfritt notat om hva segmentet er til (maks 300 tegn)",
      "examples": [
        "People who might buy the Pro plan"
      ]
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtre, som alle må treffe. Hvert element er en betingelse [\"dimension\", \"operator\", \"value\"], eller {\"any\": [betingelser]} når én av flere kan treffe. Dimensjoner: page, entry_page, exit_page, hostname, channel, referrer, referrer_url, ref, utm_source, utm_medium, utm_campaign, utm_content, utm_term, country (ISO-kode, f.eks. US), language, device (desktop, mobile, tablet, tv, other), browser, browser_version, os, os_version, screen, goal (mål-ID), event (navn på egendefinert hendelse) og prop:<key> (egenskap på egendefinert hendelse). Operatorer: is, is_not, contains, not_contains, starts_with, regex, not_regex, any_of og none_of (verdien er en liste), gt og lt (et tall), between (en liste med to tall). Rader fra segmentskjemaet godtas også: {\"dimension\", \"operator\", \"value\", \"property\" (for dimensjonen prop), \"join\": \"and\" eller \"or\" (or kombinerer raden med den foregående)}. Eksempel: [[\"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": "Synlig for alle med tilgang til nettstedet (false: bare deg)",
      "default": true
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "filters",
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Segment-ID, f.eks. seg_7Q2K9XH3AB"
    },
    "site_id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "anyOf": [
        {
          "type": "string",
          "description": "Hva segmentet er til, eller null"
        },
        {
          "type": "null"
        }
      ]
    },
    "filters": {
      "type": "array",
      "description": "Filtre i statistikkens filterformat: betingelser [\"dimension\", \"operator\", \"value\"] som alle må treffe, og grupper med {\"any\": [betingelser]}"
    },
    "summary": {
      "type": "string",
      "description": "Filtrene på vanlig språk, f.eks. «Besøkende fra USA på mobil som så /pricing»"
    },
    "shared": {
      "type": "boolean",
      "description": "Synlig for alle med tilgang til nettstedet"
    },
    "mine": {
      "type": "boolean",
      "description": "Opprettet av deg"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:site_id/segments/:id.json Slett et segment segments_delete

Tillatelse: content.write

Eksempel
curl -X DELETE https://privatusanalytics.com/sites/:site_id/segments/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Segment-ID, f.eks. seg_7Q2K9XH3AB"
    },
    "site_id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "anyOf": [
        {
          "type": "string",
          "description": "Hva segmentet er til, eller null"
        },
        {
          "type": "null"
        }
      ]
    },
    "filters": {
      "type": "array",
      "description": "Filtre i statistikkens filterformat: betingelser [\"dimension\", \"operator\", \"value\"] som alle må treffe, og grupper med {\"any\": [betingelser]}"
    },
    "summary": {
      "type": "string",
      "description": "Filtrene på vanlig språk, f.eks. «Besøkende fra USA på mobil som så /pricing»"
    },
    "shared": {
      "type": "boolean",
      "description": "Synlig for alle med tilgang til nettstedet"
    },
    "mine": {
      "type": "boolean",
      "description": "Opprettet av deg"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/segments.json List segmenter du kan bruke på et nettsted segments_list

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/segments.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater per side (maks 100)"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Segment-ID, f.eks. seg_7Q2K9XH3AB"
      },
      "site_id": {
        "type": "string"
      },
      "name": {
        "type": "string"
      },
      "description": {
        "anyOf": [
          {
            "type": "string",
            "description": "Hva segmentet er til, eller null"
          },
          {
            "type": "null"
          }
        ]
      },
      "filters": {
        "type": "array",
        "description": "Filtre i statistikkens filterformat: betingelser [\"dimension\", \"operator\", \"value\"] som alle må treffe, og grupper med {\"any\": [betingelser]}"
      },
      "summary": {
        "type": "string",
        "description": "Filtrene på vanlig språk, f.eks. «Besøkende fra USA på mobil som så /pricing»"
      },
      "shared": {
        "type": "boolean",
        "description": "Synlig for alle med tilgang til nettstedet"
      },
      "mine": {
        "type": "boolean",
        "description": "Opprettet av deg"
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      },
      "updated_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
POST /sites/:site_id/segments/preview.json Beskriv filtre på vanlig språk og tell de besøkende de traff de siste 30 dagene segments_preview

Tillatelse: analytics.read

Eksempel
curl -X POST https://privatusanalytics.com/sites/:site_id/segments/preview.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtre, som alle må treffe. Hvert element er en betingelse [\"dimension\", \"operator\", \"value\"], eller {\"any\": [betingelser]} når én av flere kan treffe. Dimensjoner: page, entry_page, exit_page, hostname, channel, referrer, referrer_url, ref, utm_source, utm_medium, utm_campaign, utm_content, utm_term, country (ISO-kode, f.eks. US), language, device (desktop, mobile, tablet, tv, other), browser, browser_version, os, os_version, screen, goal (mål-ID), event (navn på egendefinert hendelse) og prop:<key> (egenskap på egendefinert hendelse). Operatorer: is, is_not, contains, not_contains, starts_with, regex, not_regex, any_of og none_of (verdien er en liste), gt og lt (et tall), between (en liste med to tall). Rader fra segmentskjemaet godtas også: {\"dimension\", \"operator\", \"value\", \"property\" (for dimensjonen prop), \"join\": \"and\" eller \"or\" (or kombinerer raden med den foregående)}. Eksempel: [[\"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": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
GET /sites/:site_id/segments/:id.json Hent et segment segments_get

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/segments/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Segment-ID, f.eks. seg_7Q2K9XH3AB"
    },
    "site_id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "anyOf": [
        {
          "type": "string",
          "description": "Hva segmentet er til, eller null"
        },
        {
          "type": "null"
        }
      ]
    },
    "filters": {
      "type": "array",
      "description": "Filtre i statistikkens filterformat: betingelser [\"dimension\", \"operator\", \"value\"] som alle må treffe, og grupper med {\"any\": [betingelser]}"
    },
    "summary": {
      "type": "string",
      "description": "Filtrene på vanlig språk, f.eks. «Besøkende fra USA på mobil som så /pricing»"
    },
    "shared": {
      "type": "boolean",
      "description": "Synlig for alle med tilgang til nettstedet"
    },
    "mine": {
      "type": "boolean",
      "description": "Opprettet av deg"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
PATCH /sites/:site_id/segments/:id.json Gi et segment nytt navn eller endre filtrene eller delingen segments_update

Tillatelse: content.write

Eksempel
curl -X PATCH https://privatusanalytics.com/sites/:site_id/segments/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Navn på segmentet"
    },
    "description": {
      "type": "string",
      "description": "Valgfritt notat om hva segmentet er til (maks 300 tegn, tomt for å fjerne)"
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Nye filtre som erstatter de gamle, i samme format som ved oppretting. Filtre, som alle må treffe. Hvert element er en betingelse [\"dimension\", \"operator\", \"value\"], eller {\"any\": [betingelser]} når én av flere kan treffe. Dimensjoner: page, entry_page, exit_page, hostname, channel, referrer, referrer_url, ref, utm_source, utm_medium, utm_campaign, utm_content, utm_term, country (ISO-kode, f.eks. US), language, device (desktop, mobile, tablet, tv, other), browser, browser_version, os, os_version, screen, goal (mål-ID), event (navn på egendefinert hendelse) og prop:<key> (egenskap på egendefinert hendelse). Operatorer: is, is_not, contains, not_contains, starts_with, regex, not_regex, any_of og none_of (verdien er en liste), gt og lt (et tall), between (en liste med to tall). Rader fra segmentskjemaet godtas også: {\"dimension\", \"operator\", \"value\", \"property\" (for dimensjonen prop), \"join\": \"and\" eller \"or\" (or kombinerer raden med den foregående)}. Eksempel: [[\"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": "Synlig for alle på nettstedet"
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Segment-ID, f.eks. seg_7Q2K9XH3AB"
    },
    "site_id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "anyOf": [
        {
          "type": "string",
          "description": "Hva segmentet er til, eller null"
        },
        {
          "type": "null"
        }
      ]
    },
    "filters": {
      "type": "array",
      "description": "Filtre i statistikkens filterformat: betingelser [\"dimension\", \"operator\", \"value\"] som alle må treffe, og grupper med {\"any\": [betingelser]}"
    },
    "summary": {
      "type": "string",
      "description": "Filtrene på vanlig språk, f.eks. «Besøkende fra USA på mobil som så /pricing»"
    },
    "shared": {
      "type": "boolean",
      "description": "Synlig for alle med tilgang til nettstedet"
    },
    "mine": {
      "type": "boolean",
      "description": "Opprettet av deg"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Sporing

POST /sites/:site_id/tracking/ingest_key.json Opprett eller roter innsamlingsnøkkelen for serveren (vises bare én gang) tracking_ingest_key_rotate

Tillatelse: sites.manage

Eksempel
curl -X POST https://privatusanalytics.com/sites/:site_id/tracking/ingest_key.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID"
    },
    "key": {
      "type": "string",
      "description": "Innsamlingsnøkkelen. Vises bare én gang: lagre den nå. Send den som Bearer-token til POST /api/events"
    },
    "prefix": {
      "type": "string",
      "description": "Nøkkelprefiks som vises i innstillingene"
    }
  }
}
DELETE /sites/:site_id/tracking/ingest_key.json Tilbakekall innsamlingsnøkkelen for serveren tracking_ingest_key_revoke

Tillatelse: sites.manage

Eksempel
curl -X DELETE https://privatusanalytics.com/sites/:site_id/tracking/ingest_key.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Nettsted-ID brukt i sporingskoden"
    },
    "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": "Begynnelsen av innsamlingsnøkkelen for serveren"
        },
        {
          "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-sporingskode"
    },
    "favorite": {
      "type": "boolean",
      "description": "Stjernemerket av deg"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /sites/:site_id/tracking/verify.json Kontroller at sporeren er installert på nettstedet (script-tag, nettsted-ID, CSP og henviserpolicy) tracking_verify

Tillatelse: sites.manage

Eksempel
curl -X POST https://privatusanalytics.com/sites/:site_id/tracking/verify.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Side som skal kontrolleres (standard er https://<domain>/)"
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
GET /sites/:site_id/tracking/snippet.json Bygg sporingskoden for valgte alternativer tracking_snippet

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/tracking/snippet.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "modules": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Valgfrie moduler: auto (utgående lenker, nedlastinger, skjemaer, 404-er), engage (tid og rulling), vitals (Web Vitals), clicks",
      "default": [
        "engage"
      ]
    },
    "manual": {
      "type": "boolean",
      "description": "Slå av den automatiske sidevisningen",
      "default": false
    },
    "spa": {
      "type": "string",
      "description": "Sporing av navigering i enkeltsideapper",
      "enum": [
        "auto",
        "history",
        "hash",
        "off"
      ],
      "default": "auto"
    },
    "domains": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Spor bare på disse vertsnavnene",
      "default": []
    },
    "exclude": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Stimønstre (glob) som ikke skal spores, f.eks. /admin/*",
      "default": []
    },
    "query_params": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Ekstra spørringsparametere som beholdes, f.eks. page",
      "default": []
    },
    "mask": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Stimasker på klientsiden, f.eks. /u/*->/u/:id",
      "default": []
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}

Statussider

GET /status/:slug/confirm/:token.json Bekreft et abonnement fra lenken i e-posten public_status_pages_confirm

Tillatelse: public · Kun HTTP (ikke et MCP-verktøy)

Eksempel
curl https://privatusanalytics.com/status/:slug/confirm/:token.json
Inndata
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Token for ressursen"
    },
    "slug": {
      "type": "string",
      "description": "Slug for ressursen"
    }
  },
  "required": [
    "token",
    "slug"
  ]
}
Svardata
{
  "type": "object"
}
GET /status/:slug.json Offentlig statusside: nåværende status, oppetidsstolper for 90 dager, hendelser og innlegg public_status_pages_get

Tillatelse: public · Kun HTTP (ikke et MCP-verktøy)

Eksempel
curl https://privatusanalytics.com/status/:slug.json
Inndata
{
  "type": "object",
  "properties": {
    "slug": {
      "type": "string",
      "description": "Slug for ressursen"
    }
  },
  "required": [
    "slug"
  ]
}
Svardata
{
  "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 eller outage"
    },
    "checks": {
      "type": "array",
      "description": "Hver: {name, status, uptime_90d, days: [{date, uptime, downtime_seconds}]}"
    },
    "posts": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Innleggs-ID (spp_…)"
          },
          "title": {
            "type": "string"
          },
          "body": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "description": "investigating, identified, monitoring eller resolved"
          },
          "posted_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
    },
    "incidents": {
      "type": "array",
      "description": "Nylige hendelser: {check, started_at, resolved_at, duration_seconds}"
    }
  }
}
POST /status/:slug/subscribers.json Abonner med en e-postadresse (dobbel bekreftelse) public_status_pages_subscribe

Nettleserklienter sender et Cloudflare Turnstile-token som `cf-turnstile-response`. Forespørsler med et API-token trenger ikke det.

Tillatelse: public · Kun HTTP (ikke et MCP-verktøy)

Eksempel
curl -X POST https://privatusanalytics.com/status/:slug/subscribers.json \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "description": "E-postadresse å varsle",
      "examples": [
        "[email protected]"
      ]
    },
    "slug": {
      "type": "string",
      "description": "Slug for ressursen"
    }
  },
  "required": [
    "email",
    "slug"
  ]
}
Svardata
{
  "type": "object"
}
POST /status/:slug/unsubscribe/:token.json Avslutt abonnementet med tokenet i e-posten public_status_pages_unsubscribe

Tillatelse: public · Kun HTTP (ikke et MCP-verktøy)

Eksempel
curl -X POST https://privatusanalytics.com/status/:slug/unsubscribe/:token.json \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Token for ressursen"
    },
    "slug": {
      "type": "string",
      "description": "Slug for ressursen"
    }
  },
  "required": [
    "token",
    "slug"
  ]
}
Svardata
{
  "type": "object"
}
POST /status_pages/:status_page_id/posts.json Publiser en hendelsesoppdatering (sender e-post til abonnentene) status_page_posts_create

Tillatelse: uptime.manage

Eksempel
curl -X POST https://privatusanalytics.com/status_pages/:status_page_id/posts.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "description": "Overskrift, f.eks. \"Økt feilrate\""
    },
    "body": {
      "type": "string",
      "description": "Oppdateringstekst (ren tekst)"
    },
    "status": {
      "type": "string",
      "description": "investigating, identified, monitoring eller resolved",
      "enum": [
        "investigating",
        "identified",
        "monitoring",
        "resolved"
      ],
      "default": "investigating"
    },
    "posted_at": {
      "type": "string",
      "format": "date-time",
      "description": "Når det skjedde (standard er nå)"
    },
    "notify": {
      "type": "boolean",
      "description": "Send e-post til bekreftede abonnenter",
      "default": true
    },
    "status_page_id": {
      "type": "string",
      "description": "Status page for ressursen"
    }
  },
  "required": [
    "title",
    "status_page_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Innleggs-ID (spp_…)"
    },
    "title": {
      "type": "string"
    },
    "body": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "status": {
      "type": "string",
      "description": "investigating, identified, monitoring eller resolved"
    },
    "posted_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /status_pages/:status_page_id/posts/:id.json Slett et innlegg på en statusside status_page_posts_delete

Tillatelse: uptime.manage

Eksempel
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 '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "status_page_id": {
      "type": "string",
      "description": "Status page for ressursen"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "status_page_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Innleggs-ID (spp_…)"
    },
    "title": {
      "type": "string"
    },
    "body": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "status": {
      "type": "string",
      "description": "investigating, identified, monitoring eller resolved"
    },
    "posted_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /status_pages/:status_page_id/posts.json List innlegg på en statusside status_page_posts_list

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/status_pages/:status_page_id/posts.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Bare innlegg med denne statusen",
      "enum": [
        "investigating",
        "identified",
        "monitoring",
        "resolved"
      ]
    },
    "status_page_id": {
      "type": "string",
      "description": "Status page for ressursen"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater per side (maks 100)"
    }
  },
  "required": [
    "status_page_id"
  ]
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Innleggs-ID (spp_…)"
      },
      "title": {
        "type": "string"
      },
      "body": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "status": {
        "type": "string",
        "description": "investigating, identified, monitoring eller resolved"
      },
      "posted_at": {
        "type": "string",
        "format": "date-time"
      },
      "updated_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
PATCH /status_pages/:status_page_id/posts/:id.json Rediger et innlegg på en statusside status_page_posts_update

Tillatelse: uptime.manage

Eksempel
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 '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "description": "Overskrift"
    },
    "body": {
      "type": "string",
      "description": "Oppdateringstekst (ren tekst)"
    },
    "status": {
      "type": "string",
      "description": "investigating, identified, monitoring eller resolved",
      "enum": [
        "investigating",
        "identified",
        "monitoring",
        "resolved"
      ]
    },
    "notify": {
      "type": "boolean",
      "description": "Send e-post til bekreftede abonnenter hvis statusen endres",
      "default": true
    },
    "status_page_id": {
      "type": "string",
      "description": "Status page for ressursen"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "status_page_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Innleggs-ID (spp_…)"
    },
    "title": {
      "type": "string"
    },
    "body": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "status": {
      "type": "string",
      "description": "investigating, identified, monitoring eller resolved"
    },
    "posted_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /status_pages/:status_page_id/subscribers/:id.json Fjern en abonnent status_page_subscribers_delete

Tillatelse: uptime.manage

Eksempel
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 '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "status_page_id": {
      "type": "string",
      "description": "Status page for ressursen"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "status_page_id",
    "id"
  ]
}
Svardata
{
  "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 List abonnenter på en statusside status_page_subscribers_list

Tillatelse: uptime.manage

Eksempel
curl https://privatusanalytics.com/status_pages/:status_page_id/subscribers.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "confirmed": {
      "type": "boolean",
      "description": "true: bare bekreftede, false: bare ventende"
    },
    "status_page_id": {
      "type": "string",
      "description": "Status page for ressursen"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater per side (maks 100)"
    }
  },
  "required": [
    "status_page_id"
  ]
}
Svardata
{
  "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 Opprett en statusside status_pages_create

Tillatelse: uptime.manage

Eksempel
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/status_pages.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Sidetittel, f.eks. \"Acme-status\""
    },
    "slug": {
      "type": "string",
      "description": "Slug i offentlig URL: /status/<slug> (utledes fra navnet som standard)"
    },
    "description": {
      "type": "string",
      "description": "Introduksjonstekst under tittelen"
    },
    "logo_url": {
      "type": "string",
      "description": "HTTPS-URL til et logobilde"
    },
    "brand_color": {
      "type": "string",
      "description": "Aksentfarge, f.eks. #06755b"
    },
    "custom_domain": {
      "type": "string",
      "description": "Eget domene (CNAME til vår vert), f.eks. status.example.com. Tomt for å fjerne"
    },
    "check_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "ID-er for oppetidskontroller (upc_…) som skal vises"
    },
    "published": {
      "type": "boolean",
      "description": "Synlig for offentligheten",
      "default": true
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Statusside-ID (sp_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "slug": {
      "type": "string",
      "description": "Offentlig 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": "ID-er for oppetidskontroller som vises"
    },
    "subscribers": {
      "type": "integer",
      "description": "Bekreftede abonnenter"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /status_pages/:id.json Slett en statusside status_pages_delete

Tillatelse: uptime.manage

Eksempel
curl -X DELETE https://privatusanalytics.com/status_pages/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Statusside-ID (sp_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "slug": {
      "type": "string",
      "description": "Offentlig 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": "ID-er for oppetidskontroller som vises"
    },
    "subscribers": {
      "type": "integer",
      "description": "Bekreftede abonnenter"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /workspaces/:workspace_id/status_pages.json List statussider status_pages_list

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/status_pages.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "description": "Filtrer etter navn eller slug"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater per side (maks 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Statusside-ID (sp_…)"
      },
      "workspace_id": {
        "type": "string"
      },
      "name": {
        "type": "string"
      },
      "slug": {
        "type": "string",
        "description": "Offentlig 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": "ID-er for oppetidskontroller som vises"
      },
      "subscribers": {
        "type": "integer",
        "description": "Bekreftede abonnenter"
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
GET /status_pages/:id.json Hent en statusside status_pages_get

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/status_pages/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Statusside-ID (sp_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "slug": {
      "type": "string",
      "description": "Offentlig 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": "ID-er for oppetidskontroller som vises"
    },
    "subscribers": {
      "type": "integer",
      "description": "Bekreftede abonnenter"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
PATCH /status_pages/:id.json Endre en statusside status_pages_update

Tillatelse: uptime.manage

Eksempel
curl -X PATCH https://privatusanalytics.com/status_pages/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Sidetittel, f.eks. \"Acme-status\""
    },
    "slug": {
      "type": "string",
      "description": "Slug i offentlig URL: /status/<slug> (utledes fra navnet som standard)"
    },
    "description": {
      "type": "string",
      "description": "Introduksjonstekst under tittelen"
    },
    "logo_url": {
      "type": "string",
      "description": "HTTPS-URL til et logobilde"
    },
    "brand_color": {
      "type": "string",
      "description": "Aksentfarge, f.eks. #06755b"
    },
    "custom_domain": {
      "type": "string",
      "description": "Eget domene (CNAME til vår vert), f.eks. status.example.com. Tomt for å fjerne"
    },
    "check_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "ID-er for oppetidskontroller (upc_…) som skal vises"
    },
    "published": {
      "type": "boolean",
      "description": "Synlig for offentligheten"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Statusside-ID (sp_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "slug": {
      "type": "string",
      "description": "Offentlig 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": "ID-er for oppetidskontroller som vises"
    },
    "subscribers": {
      "type": "integer",
      "description": "Bekreftede abonnenter"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Søk

GET /sites/:site_id/search.json Søkerapport: klikk, visninger, CTR, posisjon, toppspørringer og -sider, landingssider og muligheter search_report

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/search.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Forhåndsvalgt datoområde. Bruk custom med from/to",
      "enum": [
        "today",
        "yesterday",
        "24h",
        "7d",
        "14d",
        "28d",
        "30d",
        "90d",
        "mtd",
        "last_month",
        "qtd",
        "last_quarter",
        "ytd",
        "12mo",
        "last_year",
        "all",
        "custom"
      ],
      "default": "30d"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Start på egendefinert område (nettstedets tidssone)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Slutt på egendefinert område, inkludert"
    },
    "compare": {
      "type": "string",
      "description": "Sammenligningsperiode",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Start på egendefinert sammenligning"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Slutt på egendefinert sammenligning"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Juster sammenligningsdagene til ukedagene",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtre: [[\"dimension\",\"operator\",\"value\"], …]. Operatorer: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Pakk betingelser inn i {\"any\": [...]} for ELLER.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Bruk et lagret segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Legg til importerte historiske data (datoer før den første native hendelsen, ignoreres når filtre eller et segment brukes)",
      "default": false
    },
    "provider": {
      "type": "string",
      "description": "google (Search Console) eller bing",
      "enum": [
        "google",
        "bing"
      ],
      "default": "google"
    },
    "limit": {
      "type": "integer",
      "description": "Rader per tabell (maks 100)",
      "default": 25
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
POST /sites/:site_id/search/connections.json Koble til en Search Console-egenskap eller et Bing-nettsted search_connect

Tillatelse: sites.manage

Eksempel
curl -X POST https://privatusanalytics.com/sites/:site_id/search/connections.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "provider": {
      "type": "string",
      "description": "google eller bing",
      "enum": [
        "google",
        "bing"
      ],
      "default": "google"
    },
    "property": {
      "type": "string",
      "description": "Search Console-egenskap (f.eks. sc-domain:example.com) eller Bing-nettsted-URL",
      "examples": [
        "sc-domain:example.com"
      ]
    },
    "bing_api_key": {
      "type": "string",
      "description": "Din egen API-nøkkel for Bing Webmaster Tools (Settings > API access). Påkrevd når provider er bing. Lagres kryptert og returneres aldri."
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "property",
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "provider": {
      "type": "string",
      "description": "google eller bing"
    },
    "property": {
      "type": "string",
      "description": "Search Console-egenskap eller Bing-nettsted-URL"
    },
    "status": {
      "type": "string",
      "description": "active eller 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 Koble fra Search Console eller Bing og slett dataene search_disconnect

Tillatelse: sites.manage

Eksempel
curl -X DELETE https://privatusanalytics.com/sites/:site_id/search/connections/:provider.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    },
    "provider": {
      "type": "string",
      "description": "Provider for ressursen"
    }
  },
  "required": [
    "site_id",
    "provider"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "provider": {
      "type": "string",
      "description": "google eller bing"
    },
    "property": {
      "type": "string",
      "description": "Search Console-egenskap eller Bing-nettsted-URL"
    },
    "status": {
      "type": "string",
      "description": "active eller 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 List egenskaper du kan koble til (Search Console trenger en Google-tillatelse fra nettleseren) search_properties

Tillatelse: sites.manage

Eksempel
curl -X POST https://privatusanalytics.com/sites/:site_id/search/properties.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "provider": {
      "type": "string",
      "description": "google eller bing",
      "enum": [
        "google",
        "bing"
      ],
      "default": "google"
    },
    "bing_api_key": {
      "type": "string",
      "description": "Din egen API-nøkkel for Bing Webmaster Tools (Settings > API access). Påkrevd når provider er bing. Brukes bare til å liste opp nettstedene den kan se."
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
POST /sites/:site_id/search/sync.json Importer søkedata nå search_sync

Tillatelse: sites.manage

Eksempel
curl -X POST https://privatusanalytics.com/sites/:site_id/search/sync.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "provider": {
      "type": "string",
      "description": "google eller bing",
      "enum": [
        "google",
        "bing"
      ],
      "default": "google"
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "provider": {
      "type": "string",
      "description": "google eller bing"
    },
    "property": {
      "type": "string",
      "description": "Search Console-egenskap eller Bing-nettsted-URL"
    },
    "status": {
      "type": "string",
      "description": "active eller error"
    },
    "last_synced_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Trafikkregler

POST /sites/:site_id/traffic_rules.json Legg til en trafikkregel traffic_rules_create

Tillatelse: sites.manage

Eksempel
curl -X POST https://privatusanalytics.com/sites/:site_id/traffic_rules.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "list": {
      "type": "string",
      "description": "hostnames, paths, referrers, countries, ip_ranges, user_agents eller events",
      "enum": [
        "hostnames",
        "paths",
        "referrers",
        "countries",
        "ip_ranges",
        "user_agents",
        "events"
      ]
    },
    "pattern": {
      "type": "string",
      "description": "Verdi som skal samsvare. * er et jokertegn. ip_ranges tar en IP eller CIDR (v4/v6), countries en ISO-kode",
      "examples": [
        "/admin/*"
      ]
    },
    "label": {
      "type": "string",
      "description": "Valgfritt notat, f.eks. \"Kontor\""
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "list",
    "pattern",
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Regel-ID"
    },
    "list": {
      "type": "string",
      "description": "hostnames, paths, referrers, countries, ip_ranges, user_agents eller events"
    },
    "pattern": {
      "type": "string",
      "description": "Mønster (* jokertegn, CIDR for ip_ranges)"
    },
    "label": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "mode": {
      "type": "string",
      "description": "block eller allow (modusen til listen)"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:site_id/traffic_rules/:id.json Slett en trafikkregel traffic_rules_delete

Tillatelse: sites.manage

Eksempel
curl -X DELETE https://privatusanalytics.com/sites/:site_id/traffic_rules/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Regel-ID"
    },
    "list": {
      "type": "string",
      "description": "hostnames, paths, referrers, countries, ip_ranges, user_agents eller events"
    },
    "pattern": {
      "type": "string",
      "description": "Mønster (* jokertegn, CIDR for ip_ranges)"
    },
    "label": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "mode": {
      "type": "string",
      "description": "block eller allow (modusen til listen)"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/traffic_rules.json List trafikkregler traffic_rules_list

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/traffic_rules.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "list": {
      "type": "string",
      "description": "Bare regler i denne listen",
      "enum": [
        "hostnames",
        "paths",
        "referrers",
        "countries",
        "ip_ranges",
        "user_agents",
        "events"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Regel-ID"
    },
    "list": {
      "type": "string",
      "description": "hostnames, paths, referrers, countries, ip_ranges, user_agents eller events"
    },
    "pattern": {
      "type": "string",
      "description": "Mønster (* jokertegn, CIDR for ip_ranges)"
    },
    "label": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "mode": {
      "type": "string",
      "description": "block eller allow (modusen til listen)"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /sites/:site_id/traffic_rules/test.json Test om et treff ville blitt talt med nettstedets gjeldende regler traffic_rules_test

Tillatelse: analytics.read

Eksempel
curl -X POST https://privatusanalytics.com/sites/:site_id/traffic_rules/test.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Side-URL, f.eks. https://example.com/a"
    },
    "referrer": {
      "type": "string",
      "description": "Henviser-URL eller vertsnavn"
    },
    "country": {
      "type": "string",
      "description": "ISO-landskode, f.eks. US"
    },
    "ip": {
      "type": "string",
      "description": "IP-adresse som testes mot ip_ranges (lagres ikke)"
    },
    "user_agent": {
      "type": "string",
      "description": "User-Agent-streng (redusert til nettleser og hovedversjon, som ved innsamling)"
    },
    "event": {
      "type": "string",
      "description": "Navn på egendefinert hendelse"
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
PATCH /sites/:site_id/traffic_rules/:id.json Endre en trafikkregel traffic_rules_update

Tillatelse: sites.manage

Eksempel
curl -X PATCH https://privatusanalytics.com/sites/:site_id/traffic_rules/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "pattern": {
      "type": "string",
      "description": "Nytt mønster"
    },
    "label": {
      "type": "string",
      "description": "Ny etikett"
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Regel-ID"
    },
    "list": {
      "type": "string",
      "description": "hostnames, paths, referrers, countries, ip_ranges, user_agents eller events"
    },
    "pattern": {
      "type": "string",
      "description": "Mønster (* jokertegn, CIDR for ip_ranges)"
    },
    "label": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "mode": {
      "type": "string",
      "description": "block eller allow (modusen til listen)"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Trakter

POST /sites/:site_id/funnels.json Opprett en trakt funnels_create

Tillatelse: content.write

Eksempel
curl -X POST https://privatusanalytics.com/sites/:site_id/funnels.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Navn på trakten",
      "examples": [
        "Signup flow"
      ]
    },
    "steps": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      },
      "description": "Trinn i rekkefølge (2 til plangrensen din): [{\"type\": \"page|event|goal\", \"value\": \"/pricing | Signup | goal_…\", \"match\": \"exact|prefix|glob|regex\" (sidetrinn), \"name\": \"valgfri etikett\"}]"
    },
    "order_mode": {
      "type": "string",
      "description": "strict: trinn i denne rekkefølgen, any: i vilkårlig rekkefølge",
      "enum": [
        "strict",
        "any"
      ],
      "default": "strict"
    },
    "window": {
      "type": "string",
      "description": "Konverteringsvindu: visit, eller day (målt innenfor et besøk, som aldri strekker seg over et UTC-døgn)",
      "enum": [
        "visit",
        "day"
      ],
      "default": "visit"
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "steps",
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Trakt-ID, f.eks. fun_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "steps": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Trinn: {type: page|event|goal, value, match, name}"
    },
    "order_mode": {
      "type": "string",
      "description": "strict eller any"
    },
    "window": {
      "type": "string",
      "description": "visit eller day"
    },
    "stats": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "entered": {
              "type": "integer",
              "description": "Besøk som nådde trinn 1"
            },
            "completed": {
              "type": "integer",
              "description": "Besøk som nådde det siste trinnet"
            },
            "conversion_rate": {
              "type": "number",
              "description": "Fullført ÷ startet, %"
            }
          },
          "description": "Periodestatistikk (bare i lister)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:site_id/funnels/:id.json Slett en trakt funnels_delete

Tillatelse: content.write

Eksempel
curl -X DELETE https://privatusanalytics.com/sites/:site_id/funnels/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Trakt-ID, f.eks. fun_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "steps": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Trinn: {type: page|event|goal, value, match, name}"
    },
    "order_mode": {
      "type": "string",
      "description": "strict eller any"
    },
    "window": {
      "type": "string",
      "description": "visit eller day"
    },
    "stats": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "entered": {
              "type": "integer",
              "description": "Besøk som nådde trinn 1"
            },
            "completed": {
              "type": "integer",
              "description": "Besøk som nådde det siste trinnet"
            },
            "conversion_rate": {
              "type": "number",
              "description": "Fullført ÷ startet, %"
            }
          },
          "description": "Periodestatistikk (bare i lister)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/funnels.json List trakter med innganger, fullføringer og rate funnels_list

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/funnels.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Forhåndsvalgt datoområde. Bruk custom med from/to",
      "enum": [
        "today",
        "yesterday",
        "24h",
        "7d",
        "14d",
        "28d",
        "30d",
        "90d",
        "mtd",
        "last_month",
        "qtd",
        "last_quarter",
        "ytd",
        "12mo",
        "last_year",
        "all",
        "custom"
      ],
      "default": "30d"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Start på egendefinert område (nettstedets tidssone)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Slutt på egendefinert område, inkludert"
    },
    "compare": {
      "type": "string",
      "description": "Sammenligningsperiode",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Start på egendefinert sammenligning"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Slutt på egendefinert sammenligning"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Juster sammenligningsdagene til ukedagene",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtre: [[\"dimension\",\"operator\",\"value\"], …]. Operatorer: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Pakk betingelser inn i {\"any\": [...]} for ELLER.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Bruk et lagret segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Legg til importerte historiske data (datoer før den første native hendelsen, ignoreres når filtre eller et segment brukes)",
      "default": false
    },
    "page": {
      "type": "integer",
      "description": "Sidenummer",
      "default": 1
    },
    "per_page": {
      "type": "integer",
      "description": "Trakter per side (maks 100)",
      "default": 25
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Trakt-ID, f.eks. fun_7Q2K9XH3AB"
      },
      "name": {
        "type": "string"
      },
      "steps": {
        "type": "array",
        "items": {
          "type": "object"
        },
        "description": "Trinn: {type: page|event|goal, value, match, name}"
      },
      "order_mode": {
        "type": "string",
        "description": "strict eller any"
      },
      "window": {
        "type": "string",
        "description": "visit eller day"
      },
      "stats": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "entered": {
                "type": "integer",
                "description": "Besøk som nådde trinn 1"
              },
              "completed": {
                "type": "integer",
                "description": "Besøk som nådde det siste trinnet"
              },
              "conversion_rate": {
                "type": "number",
                "description": "Fullført ÷ startet, %"
              }
            },
            "description": "Periodestatistikk (bare i lister)"
          },
          {
            "type": "null"
          }
        ]
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      },
      "updated_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
GET /sites/:site_id/funnels/:id.json Traktrapport: trinnantall, konvertering, frafall, tid mellom trinn og hvor besøkene gikk i stedet funnels_get

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/funnels/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Forhåndsvalgt datoområde. Bruk custom med from/to",
      "enum": [
        "today",
        "yesterday",
        "24h",
        "7d",
        "14d",
        "28d",
        "30d",
        "90d",
        "mtd",
        "last_month",
        "qtd",
        "last_quarter",
        "ytd",
        "12mo",
        "last_year",
        "all",
        "custom"
      ],
      "default": "30d"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Start på egendefinert område (nettstedets tidssone)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Slutt på egendefinert område, inkludert"
    },
    "compare": {
      "type": "string",
      "description": "Sammenligningsperiode",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Start på egendefinert sammenligning"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Slutt på egendefinert sammenligning"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Juster sammenligningsdagene til ukedagene",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtre: [[\"dimension\",\"operator\",\"value\"], …]. Operatorer: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Pakk betingelser inn i {\"any\": [...]} for ELLER.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Bruk et lagret segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Legg til importerte historiske data (datoer før den første native hendelsen, ignoreres når filtre eller et segment brukes)",
      "default": false
    },
    "breakdown": {
      "type": "string",
      "description": "Del trinnantall opp etter en besøksdimensjon",
      "enum": [
        "channel",
        "device",
        "country",
        "utm_campaign",
        "utm_source",
        "browser",
        "os"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "period": {
      "type": "object",
      "description": "from/to for perioden (UTC)"
    },
    "funnel": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Trakt-ID, f.eks. fun_7Q2K9XH3AB"
        },
        "name": {
          "type": "string"
        },
        "steps": {
          "type": "array",
          "items": {
            "type": "object"
          },
          "description": "Trinn: {type: page|event|goal, value, match, name}"
        },
        "order_mode": {
          "type": "string",
          "description": "strict eller any"
        },
        "window": {
          "type": "string",
          "description": "visit eller day"
        },
        "stats": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "entered": {
                  "type": "integer",
                  "description": "Besøk som nådde trinn 1"
                },
                "completed": {
                  "type": "integer",
                  "description": "Besøk som nådde det siste trinnet"
                },
                "conversion_rate": {
                  "type": "number",
                  "description": "Fullført ÷ startet, %"
                }
              },
              "description": "Periodestatistikk (bare i lister)"
            },
            {
              "type": "null"
            }
          ]
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        }
      },
      "description": "Traktdefinisjonen"
    },
    "order_mode": {
      "type": "string",
      "description": "strict eller any"
    },
    "window": {
      "type": "string",
      "description": "visit eller day (day måles innenfor et besøk)"
    },
    "steps": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Per trinn: 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": "Siste trinn ÷ første trinn, %"
    },
    "breakdown": {
      "anyOf": [
        {
          "type": "object",
          "description": "dimension, label og rows [{value, counts, overall_conversion_rate}]"
        },
        {
          "type": "null"
        }
      ]
    },
    "comparison": {
      "anyOf": [
        {
          "type": "object",
          "description": "period, antall per trinn, overall_conversion_rate og change (%)"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
PATCH /sites/:site_id/funnels/:id.json Oppdater en trakt funnels_update

Tillatelse: content.write

Eksempel
curl -X PATCH https://privatusanalytics.com/sites/:site_id/funnels/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Navn på trakten",
      "examples": [
        "Signup flow"
      ]
    },
    "steps": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      },
      "description": "Trinn i rekkefølge (2 til plangrensen din): [{\"type\": \"page|event|goal\", \"value\": \"/pricing | Signup | goal_…\", \"match\": \"exact|prefix|glob|regex\" (sidetrinn), \"name\": \"valgfri etikett\"}]"
    },
    "order_mode": {
      "type": "string",
      "description": "strict: trinn i denne rekkefølgen, any: i vilkårlig rekkefølge",
      "enum": [
        "strict",
        "any"
      ]
    },
    "window": {
      "type": "string",
      "description": "Konverteringsvindu: visit, eller day (målt innenfor et besøk, som aldri strekker seg over et UTC-døgn)",
      "enum": [
        "visit",
        "day"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Trakt-ID, f.eks. fun_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "steps": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Trinn: {type: page|event|goal, value, match, name}"
    },
    "order_mode": {
      "type": "string",
      "description": "strict eller any"
    },
    "window": {
      "type": "string",
      "description": "visit eller day"
    },
    "stats": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "entered": {
              "type": "integer",
              "description": "Besøk som nådde trinn 1"
            },
            "completed": {
              "type": "integer",
              "description": "Besøk som nådde det siste trinnet"
            },
            "conversion_rate": {
              "type": "number",
              "description": "Fullført ÷ startet, %"
            }
          },
          "description": "Periodestatistikk (bare i lister)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Varsler

POST /alerts/:id/acknowledge.json Bekreft den siste hendelsen alerts_acknowledge

Tillatelse: analytics.read

Eksempel
curl -X POST https://privatusanalytics.com/alerts/:id/acknowledge.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Varsel-ID, f.eks. alr_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nettsted-ID (null for forbruksvarsler)"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "threshold, anomaly, goal, no_data, usage, uptime, ssl eller vitals"
    },
    "metric": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "operator": {
      "anyOf": [
        {
          "type": "string",
          "description": "gt, gte, lt eller lte"
        },
        {
          "type": "null"
        }
      ]
    },
    "threshold": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "window_minutes": {
      "type": "integer"
    },
    "sensitivity": {
      "type": "string",
      "description": "følsomhet for anomaly"
    },
    "goal_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "channel_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "ID-er for varslingskanaler"
    },
    "state": {
      "type": "string",
      "description": "ok eller 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 Opprett et varsel alerts_create

Tillatelse: content.write

Eksempel
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/alerts.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID (pa_…). Kreves unntatt for forbruksvarsler"
    },
    "metric": {
      "type": "string",
      "description": "threshold/anomaly: visitors, visits, pageviews, bounce_rate eller conversion. vitals: lcp, inp, cls, fcp eller ttfb"
    },
    "operator": {
      "type": "string",
      "description": "Sammenligning (gt, gte, lt, lte). anomaly: lt bare fall, gt bare topper, tom begge",
      "enum": [
        "gt",
        "gte",
        "lt",
        "lte"
      ]
    },
    "threshold": {
      "type": "number",
      "description": "threshold: målingsverdi, goal: fullføringer, no_data: timer, usage: prosent, ssl: dager, vitals: ms (CLS: poengsum)"
    },
    "window_minutes": {
      "type": "integer",
      "description": "Evalueringsvindu i minutter (5 til 10080)"
    },
    "sensitivity": {
      "type": "string",
      "description": "anomaly: low, medium eller high",
      "enum": [
        "low",
        "medium",
        "high"
      ]
    },
    "goal_id": {
      "type": "string",
      "description": "goal- og conversion-varsler: mål-ID (goal_…)"
    },
    "uptime_check_id": {
      "type": "string",
      "description": "uptime/ssl: kontroll-ID (standard: alle kontrollene for nettstedet)"
    },
    "channel_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "ID-er for varslingskanaler (nch_…)"
    },
    "enabled": {
      "type": "boolean",
      "description": "Evaluer dette varselet"
    },
    "name": {
      "type": "string",
      "description": "Navn på varselet",
      "examples": [
        "Traffic dropped"
      ]
    },
    "kind": {
      "type": "string",
      "description": "threshold, anomaly, goal, no_data, usage, uptime, ssl eller vitals",
      "enum": [
        "threshold",
        "anomaly",
        "goal",
        "no_data",
        "usage",
        "uptime",
        "ssl",
        "vitals"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "kind",
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Varsel-ID, f.eks. alr_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nettsted-ID (null for forbruksvarsler)"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "threshold, anomaly, goal, no_data, usage, uptime, ssl eller vitals"
    },
    "metric": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "operator": {
      "anyOf": [
        {
          "type": "string",
          "description": "gt, gte, lt eller lte"
        },
        {
          "type": "null"
        }
      ]
    },
    "threshold": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "window_minutes": {
      "type": "integer"
    },
    "sensitivity": {
      "type": "string",
      "description": "følsomhet for anomaly"
    },
    "goal_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "channel_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "ID-er for varslingskanaler"
    },
    "state": {
      "type": "string",
      "description": "ok eller 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 Slett et varsel alerts_delete

Tillatelse: content.write

Eksempel
curl -X DELETE https://privatusanalytics.com/alerts/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Varsel-ID, f.eks. alr_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nettsted-ID (null for forbruksvarsler)"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "threshold, anomaly, goal, no_data, usage, uptime, ssl eller vitals"
    },
    "metric": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "operator": {
      "anyOf": [
        {
          "type": "string",
          "description": "gt, gte, lt eller lte"
        },
        {
          "type": "null"
        }
      ]
    },
    "threshold": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "window_minutes": {
      "type": "integer"
    },
    "sensitivity": {
      "type": "string",
      "description": "følsomhet for anomaly"
    },
    "goal_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "channel_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "ID-er for varslingskanaler"
    },
    "state": {
      "type": "string",
      "description": "ok eller 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 Hendelseshistorikk for et varsel alerts_history

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/alerts/:id/history.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "open": {
      "type": "boolean",
      "description": "Bare uløste hendelser",
      "default": false
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater per side (maks 100)"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "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": "Målt verdi da varselet utløstes"
          },
          {
            "type": "null"
          }
        ]
      },
      "message": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "acknowledged_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "acknowledged_by": {
        "anyOf": [
          {
            "type": "string",
            "description": "Navn på medlemmet som bekreftet"
          },
          {
            "type": "null"
          }
        ]
      }
    }
  }
}
GET /workspaces/:workspace_id/alerts.json List varsler alerts_list

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/alerts.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Bare varsler for dette nettstedet (pa_…)"
    },
    "state": {
      "type": "string",
      "description": "Bare varsler som er ok eller utløst",
      "enum": [
        "ok",
        "triggered"
      ]
    },
    "kind": {
      "type": "string",
      "description": "Bare denne typen",
      "enum": [
        "threshold",
        "anomaly",
        "goal",
        "no_data",
        "usage",
        "uptime",
        "ssl",
        "vitals"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater per side (maks 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Varsel-ID, f.eks. alr_7Q2K9XH3AB"
      },
      "site_id": {
        "anyOf": [
          {
            "type": "string",
            "description": "Nettsted-ID (null for forbruksvarsler)"
          },
          {
            "type": "null"
          }
        ]
      },
      "name": {
        "type": "string"
      },
      "kind": {
        "type": "string",
        "description": "threshold, anomaly, goal, no_data, usage, uptime, ssl eller vitals"
      },
      "metric": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "operator": {
        "anyOf": [
          {
            "type": "string",
            "description": "gt, gte, lt eller lte"
          },
          {
            "type": "null"
          }
        ]
      },
      "threshold": {
        "anyOf": [
          {
            "type": "number"
          },
          {
            "type": "null"
          }
        ]
      },
      "window_minutes": {
        "type": "integer"
      },
      "sensitivity": {
        "type": "string",
        "description": "følsomhet for anomaly"
      },
      "goal_id": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "channel_ids": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "ID-er for varslingskanaler"
      },
      "state": {
        "type": "string",
        "description": "ok eller 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 Demp (eller opphev demping av) varslingene for et varsel alerts_mute

Tillatelse: content.write

Eksempel
curl -X POST https://privatusanalytics.com/alerts/:id/mute.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "minutes": {
      "type": "integer",
      "description": "Demp i så mange minutter (0 opphever demping, maks 30 dager)",
      "default": 60
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Varsel-ID, f.eks. alr_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nettsted-ID (null for forbruksvarsler)"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "threshold, anomaly, goal, no_data, usage, uptime, ssl eller vitals"
    },
    "metric": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "operator": {
      "anyOf": [
        {
          "type": "string",
          "description": "gt, gte, lt eller lte"
        },
        {
          "type": "null"
        }
      ]
    },
    "threshold": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "window_minutes": {
      "type": "integer"
    },
    "sensitivity": {
      "type": "string",
      "description": "følsomhet for anomaly"
    },
    "goal_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "channel_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "ID-er for varslingskanaler"
    },
    "state": {
      "type": "string",
      "description": "ok eller 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 Hent et varsel alerts_get

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/alerts/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Varsel-ID, f.eks. alr_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nettsted-ID (null for forbruksvarsler)"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "threshold, anomaly, goal, no_data, usage, uptime, ssl eller vitals"
    },
    "metric": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "operator": {
      "anyOf": [
        {
          "type": "string",
          "description": "gt, gte, lt eller lte"
        },
        {
          "type": "null"
        }
      ]
    },
    "threshold": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "window_minutes": {
      "type": "integer"
    },
    "sensitivity": {
      "type": "string",
      "description": "følsomhet for anomaly"
    },
    "goal_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "channel_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "ID-er for varslingskanaler"
    },
    "state": {
      "type": "string",
      "description": "ok eller 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 Oppdater et varsel alerts_update

Tillatelse: content.write

Eksempel
curl -X PATCH https://privatusanalytics.com/alerts/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID (pa_…). Kreves unntatt for forbruksvarsler"
    },
    "metric": {
      "type": "string",
      "description": "threshold/anomaly: visitors, visits, pageviews, bounce_rate eller conversion. vitals: lcp, inp, cls, fcp eller ttfb"
    },
    "operator": {
      "type": "string",
      "description": "Sammenligning (gt, gte, lt, lte). anomaly: lt bare fall, gt bare topper, tom begge",
      "enum": [
        "gt",
        "gte",
        "lt",
        "lte"
      ]
    },
    "threshold": {
      "type": "number",
      "description": "threshold: målingsverdi, goal: fullføringer, no_data: timer, usage: prosent, ssl: dager, vitals: ms (CLS: poengsum)"
    },
    "window_minutes": {
      "type": "integer",
      "description": "Evalueringsvindu i minutter (5 til 10080)"
    },
    "sensitivity": {
      "type": "string",
      "description": "anomaly: low, medium eller high",
      "enum": [
        "low",
        "medium",
        "high"
      ]
    },
    "goal_id": {
      "type": "string",
      "description": "goal- og conversion-varsler: mål-ID (goal_…)"
    },
    "uptime_check_id": {
      "type": "string",
      "description": "uptime/ssl: kontroll-ID (standard: alle kontrollene for nettstedet)"
    },
    "channel_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "ID-er for varslingskanaler (nch_…)"
    },
    "enabled": {
      "type": "boolean",
      "description": "Evaluer dette varselet"
    },
    "name": {
      "type": "string",
      "description": "Navn på varselet"
    },
    "kind": {
      "type": "string",
      "description": "Varseltype",
      "enum": [
        "threshold",
        "anomaly",
        "goal",
        "no_data",
        "usage",
        "uptime",
        "ssl",
        "vitals"
      ]
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Varsel-ID, f.eks. alr_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nettsted-ID (null for forbruksvarsler)"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "threshold, anomaly, goal, no_data, usage, uptime, ssl eller vitals"
    },
    "metric": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "operator": {
      "anyOf": [
        {
          "type": "string",
          "description": "gt, gte, lt eller lte"
        },
        {
          "type": "null"
        }
      ]
    },
    "threshold": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "window_minutes": {
      "type": "integer"
    },
    "sensitivity": {
      "type": "string",
      "description": "følsomhet for anomaly"
    },
    "goal_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "channel_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "ID-er for varslingskanaler"
    },
    "state": {
      "type": "string",
      "description": "ok eller 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 List varsler for et nettsted site_alerts_list

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/alerts.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "state": {
      "type": "string",
      "description": "Bare varsler som er ok eller utløst",
      "enum": [
        "ok",
        "triggered"
      ]
    },
    "kind": {
      "type": "string",
      "description": "Bare denne typen",
      "enum": [
        "threshold",
        "anomaly",
        "goal",
        "no_data",
        "usage",
        "uptime",
        "ssl",
        "vitals"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater per side (maks 100)"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Varsel-ID, f.eks. alr_7Q2K9XH3AB"
      },
      "site_id": {
        "anyOf": [
          {
            "type": "string",
            "description": "Nettsted-ID (null for forbruksvarsler)"
          },
          {
            "type": "null"
          }
        ]
      },
      "name": {
        "type": "string"
      },
      "kind": {
        "type": "string",
        "description": "threshold, anomaly, goal, no_data, usage, uptime, ssl eller vitals"
      },
      "metric": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "operator": {
        "anyOf": [
          {
            "type": "string",
            "description": "gt, gte, lt eller lte"
          },
          {
            "type": "null"
          }
        ]
      },
      "threshold": {
        "anyOf": [
          {
            "type": "number"
          },
          {
            "type": "null"
          }
        ]
      },
      "window_minutes": {
        "type": "integer"
      },
      "sensitivity": {
        "type": "string",
        "description": "følsomhet for anomaly"
      },
      "goal_id": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "channel_ids": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "ID-er for varslingskanaler"
      },
      "state": {
        "type": "string",
        "description": "ok eller 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"
      }
    }
  }
}

Varslingskanaler

POST /workspaces/:workspace_id/channels.json Legg til en varslingskanal notification_channels_create

Tillatelse: content.write

Eksempel
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/channels.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Webhook-URL (slack, teams, discord, webhook), HTTPS"
    },
    "secret": {
      "type": "string",
      "description": "webhook: HMAC-hemmelighet for X-Privatus-Signature"
    },
    "emails": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "email: mottakeradresser (maks 20)"
    },
    "routing_key": {
      "type": "string",
      "description": "pagerduty: integrasjonsnøkkel for Events API v2"
    },
    "api_key": {
      "type": "string",
      "description": "opsgenie: API-integrasjonsnøkkel"
    },
    "region": {
      "type": "string",
      "description": "opsgenie: kontoregion",
      "enum": [
        "us",
        "eu"
      ]
    },
    "kind": {
      "type": "string",
      "description": "email, slack, teams, discord, webhook, pagerduty, opsgenie eller push",
      "enum": [
        "email",
        "slack",
        "teams",
        "discord",
        "webhook",
        "pagerduty",
        "opsgenie",
        "push"
      ]
    },
    "name": {
      "type": "string",
      "description": "Visningsnavn",
      "examples": [
        "#alerts"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "kind",
    "name",
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Kanal-ID, f.eks. nch_7Q2K9XH3AB"
    },
    "kind": {
      "type": "string",
      "description": "email, slack, teams, discord, webhook, pagerduty, opsgenie eller push"
    },
    "name": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "Maskert mottaker"
    },
    "last_used_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /channels/:id.json Slett en varslingskanal notification_channels_delete

Tillatelse: content.write

Eksempel
curl -X DELETE https://privatusanalytics.com/channels/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Kanal-ID, f.eks. nch_7Q2K9XH3AB"
    },
    "kind": {
      "type": "string",
      "description": "email, slack, teams, discord, webhook, pagerduty, opsgenie eller push"
    },
    "name": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "Maskert mottaker"
    },
    "last_used_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /workspaces/:workspace_id/channels.json List varslingskanaler notification_channels_list

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/channels.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "description": "Bare kanaler av denne typen",
      "enum": [
        "email",
        "slack",
        "teams",
        "discord",
        "webhook",
        "pagerduty",
        "opsgenie",
        "push"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater per side (maks 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Kanal-ID, f.eks. nch_7Q2K9XH3AB"
      },
      "kind": {
        "type": "string",
        "description": "email, slack, teams, discord, webhook, pagerduty, opsgenie eller push"
      },
      "name": {
        "type": "string"
      },
      "target": {
        "type": "string",
        "description": "Maskert mottaker"
      },
      "last_used_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
POST /channels/:id/send_test.json Send en testmelding gjennom en kanal notification_channels_send_test

Tillatelse: content.write

Eksempel
curl -X POST https://privatusanalytics.com/channels/:id/send_test.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Kanal-ID, f.eks. nch_7Q2K9XH3AB"
    },
    "kind": {
      "type": "string",
      "description": "email, slack, teams, discord, webhook, pagerduty, opsgenie eller push"
    },
    "name": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "Maskert mottaker"
    },
    "last_used_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /channels/:id.json Hent en varslingskanal notification_channels_get

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/channels/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Kanal-ID, f.eks. nch_7Q2K9XH3AB"
    },
    "kind": {
      "type": "string",
      "description": "email, slack, teams, discord, webhook, pagerduty, opsgenie eller push"
    },
    "name": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "Maskert mottaker"
    },
    "last_used_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
PATCH /channels/:id.json Oppdater en varslingskanal notification_channels_update

Tillatelse: content.write

Eksempel
curl -X PATCH https://privatusanalytics.com/channels/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Webhook-URL (slack, teams, discord, webhook), HTTPS"
    },
    "secret": {
      "type": "string",
      "description": "webhook: HMAC-hemmelighet for X-Privatus-Signature"
    },
    "emails": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "email: mottakeradresser (maks 20)"
    },
    "routing_key": {
      "type": "string",
      "description": "pagerduty: integrasjonsnøkkel for Events API v2"
    },
    "api_key": {
      "type": "string",
      "description": "opsgenie: API-integrasjonsnøkkel"
    },
    "region": {
      "type": "string",
      "description": "opsgenie: kontoregion",
      "enum": [
        "us",
        "eu"
      ]
    },
    "name": {
      "type": "string",
      "description": "Visningsnavn"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Kanal-ID, f.eks. nch_7Q2K9XH3AB"
    },
    "kind": {
      "type": "string",
      "description": "email, slack, teams, discord, webhook, pagerduty, opsgenie eller push"
    },
    "name": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "Maskert mottaker"
    },
    "last_used_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /push_subscription.json Registrer en nettleser for push-varsler push_subscriptions_create

Tillatelse: member

Eksempel
curl -X POST https://privatusanalytics.com/push_subscription.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "endpoint": {
      "type": "string",
      "description": "PushSubscription.endpoint fra nettleseren"
    },
    "p256dh": {
      "type": "string",
      "description": "PushSubscription keys.p256dh (base64url)"
    },
    "auth": {
      "type": "string",
      "description": "PushSubscription keys.auth (base64url)"
    }
  },
  "required": [
    "endpoint",
    "p256dh",
    "auth"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "endpoint_host": {
      "type": "string",
      "description": "Vert for push-tjenesten"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /push_subscription.json Fjern en nettlesers push-registrering push_subscriptions_delete

Tillatelse: member

Eksempel
curl -X DELETE https://privatusanalytics.com/push_subscription.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "endpoint": {
      "type": "string",
      "description": "PushSubscription.endpoint som skal fjernes"
    }
  },
  "required": [
    "endpoint"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "endpoint_host": {
      "type": "string",
      "description": "Vert for push-tjenesten"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Webhooks

GET /workspaces/:workspace_id/webhooks/:webhook_id/deliveries.json List leveringer for en webhook webhook_deliveries_list

Tillatelse: workspace.manage

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/webhooks/:webhook_id/deliveries.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Bare vellykkede eller mislykkede leveringer",
      "enum": [
        "succeeded",
        "failed"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    },
    "webhook_id": {
      "type": "string",
      "description": "Webhook for ressursen"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater per side (maks 100)"
    }
  },
  "required": [
    "workspace_id",
    "webhook_id"
  ]
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Leverings-ID, f.eks. whd_123"
      },
      "event": {
        "type": "string"
      },
      "status": {
        "type": "string",
        "description": "pending, succeeded eller failed"
      },
      "status_code": {
        "anyOf": [
          {
            "type": "integer",
            "description": "HTTP-status for det siste forsøket"
          },
          {
            "type": "null"
          }
        ]
      },
      "error": {
        "anyOf": [
          {
            "type": "string",
            "description": "Tilkoblingsfeil for det siste forsøket"
          },
          {
            "type": "null"
          }
        ]
      },
      "attempt": {
        "type": "integer"
      },
      "duration_ms": {
        "anyOf": [
          {
            "type": "integer"
          },
          {
            "type": "null"
          }
        ]
      },
      "payload": {
        "type": "object"
      },
      "response_body": {
        "anyOf": [
          {
            "type": "string",
            "description": "De første 2000 tegnene"
          },
          {
            "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 Send en levering på nytt webhook_deliveries_redeliver

Tillatelse: workspace.manage

Eksempel
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 '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    },
    "webhook_id": {
      "type": "string",
      "description": "Webhook for ressursen"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "workspace_id",
    "webhook_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Leverings-ID, f.eks. whd_123"
    },
    "event": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "description": "pending, succeeded eller failed"
    },
    "status_code": {
      "anyOf": [
        {
          "type": "integer",
          "description": "HTTP-status for det siste forsøket"
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "anyOf": [
        {
          "type": "string",
          "description": "Tilkoblingsfeil for det siste forsøket"
        },
        {
          "type": "null"
        }
      ]
    },
    "attempt": {
      "type": "integer"
    },
    "duration_ms": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "payload": {
      "type": "object"
    },
    "response_body": {
      "anyOf": [
        {
          "type": "string",
          "description": "De første 2000 tegnene"
        },
        {
          "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 Legg til et webhook-endepunkt webhooks_create

Tillatelse: workspace.manage

Eksempel
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/webhooks.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "HTTPS-endepunkt som mottar JSON sendt med POST",
      "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": "Hendelser som skal sendes"
    },
    "enabled": {
      "type": "boolean",
      "description": "Send leveringer",
      "default": true
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "url",
    "events",
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Webhook-ID, f.eks. wh_7Q2K9XH3AB"
    },
    "url": {
      "type": "string"
    },
    "events": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "enabled": {
      "type": "boolean"
    },
    "status": {
      "type": "string",
      "description": "active, failing eller disabled"
    },
    "secret": {
      "type": "string",
      "description": "Signeringshemmelighet for Privatus-Signature"
    },
    "consecutive_failures": {
      "type": "integer"
    },
    "last_success_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_failure_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /workspaces/:workspace_id/webhooks/:id.json Slett en webhook webhooks_delete

Tillatelse: workspace.manage

Eksempel
curl -X DELETE https://privatusanalytics.com/workspaces/:workspace_id/webhooks/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Webhook-ID, f.eks. wh_7Q2K9XH3AB"
    },
    "url": {
      "type": "string"
    },
    "events": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "enabled": {
      "type": "boolean"
    },
    "status": {
      "type": "string",
      "description": "active, failing eller disabled"
    },
    "secret": {
      "type": "string",
      "description": "Signeringshemmelighet for Privatus-Signature"
    },
    "consecutive_failures": {
      "type": "integer"
    },
    "last_success_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_failure_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /workspaces/:workspace_id/webhooks.json List webhooks webhooks_list

Tillatelse: workspace.manage

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/webhooks.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater per side (maks 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Webhook-ID, f.eks. wh_7Q2K9XH3AB"
      },
      "url": {
        "type": "string"
      },
      "events": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "enabled": {
        "type": "boolean"
      },
      "status": {
        "type": "string",
        "description": "active, failing eller disabled"
      },
      "secret": {
        "type": "string",
        "description": "Signeringshemmelighet for Privatus-Signature"
      },
      "consecutive_failures": {
        "type": "integer"
      },
      "last_success_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "last_failure_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
GET /workspaces/:workspace_id/webhooks/:id.json Hent en webhook webhooks_get

Tillatelse: workspace.manage

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/webhooks/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Webhook-ID, f.eks. wh_7Q2K9XH3AB"
    },
    "url": {
      "type": "string"
    },
    "events": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "enabled": {
      "type": "boolean"
    },
    "status": {
      "type": "string",
      "description": "active, failing eller disabled"
    },
    "secret": {
      "type": "string",
      "description": "Signeringshemmelighet for Privatus-Signature"
    },
    "consecutive_failures": {
      "type": "integer"
    },
    "last_success_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_failure_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /workspaces/:workspace_id/webhooks/:id/test.json Send en testlevering webhooks_test

Tillatelse: workspace.manage

Eksempel
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/webhooks/:id/test.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Leverings-ID, f.eks. whd_123"
    },
    "event": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "description": "pending, succeeded eller failed"
    },
    "status_code": {
      "anyOf": [
        {
          "type": "integer",
          "description": "HTTP-status for det siste forsøket"
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "anyOf": [
        {
          "type": "string",
          "description": "Tilkoblingsfeil for det siste forsøket"
        },
        {
          "type": "null"
        }
      ]
    },
    "attempt": {
      "type": "integer"
    },
    "duration_ms": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "payload": {
      "type": "object"
    },
    "response_body": {
      "anyOf": [
        {
          "type": "string",
          "description": "De første 2000 tegnene"
        },
        {
          "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 Oppdater en webhook (hendelser, URL, aktivert, roter hemmelighet) webhooks_update

Tillatelse: workspace.manage

Eksempel
curl -X PATCH https://privatusanalytics.com/workspaces/:workspace_id/webhooks/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Inndata
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "HTTPS-endepunkt"
    },
    "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": "Hendelser som skal sendes"
    },
    "enabled": {
      "type": "boolean",
      "description": "Send leveringer"
    },
    "rotate_secret": {
      "type": "boolean",
      "description": "Erstatt signeringshemmeligheten",
      "default": false
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbeidsområde-ID, f.eks. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressursen"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Webhook-ID, f.eks. wh_7Q2K9XH3AB"
    },
    "url": {
      "type": "string"
    },
    "events": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "enabled": {
      "type": "boolean"
    },
    "status": {
      "type": "string",
      "description": "active, failing eller disabled"
    },
    "secret": {
      "type": "string",
      "description": "Signeringshemmelighet for Privatus-Signature"
    },
    "consecutive_failures": {
      "type": "integer"
    },
    "last_success_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_failure_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Ytelse

GET /sites/:site_id/performance.json Web Vitals: p75-resultattavle, daglig trend og nedbrytninger etter side, enhet, nettleser og land performance_report

Tillatelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/performance.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Inndata
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Forhåndsvalgt datoområde. Bruk custom med from/to",
      "enum": [
        "today",
        "yesterday",
        "24h",
        "7d",
        "14d",
        "28d",
        "30d",
        "90d",
        "mtd",
        "last_month",
        "qtd",
        "last_quarter",
        "ytd",
        "12mo",
        "last_year",
        "all",
        "custom"
      ],
      "default": "30d"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Start på egendefinert område (nettstedets tidssone)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Slutt på egendefinert område, inkludert"
    },
    "compare": {
      "type": "string",
      "description": "Sammenligningsperiode",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Start på egendefinert sammenligning"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Slutt på egendefinert sammenligning"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Juster sammenligningsdagene til ukedagene",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtre: [[\"dimension\",\"operator\",\"value\"], …]. Operatorer: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Pakk betingelser inn i {\"any\": [...]} for ELLER.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Bruk et lagret segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Legg til importerte historiske data (datoer før den første native hendelsen, ignoreres når filtre eller et segment brukes)",
      "default": false
    },
    "metric": {
      "type": "string",
      "description": "Måling for trenden og nedbrytningene",
      "enum": [
        "LCP",
        "INP",
        "CLS",
        "FCP",
        "TTFB"
      ],
      "default": "LCP"
    },
    "limit": {
      "type": "integer",
      "description": "Rader per nedbrytning (maks 100)",
      "default": 10
    },
    "site_id": {
      "type": "string",
      "description": "Nettsted-ID, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}