Dokumentation
Gennemse dokumentationen

Analytics REST API

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

Vis som Markdown

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

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

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

Conventions#

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

Common tasks#

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

See Stats endpoints and Examples.

In this section#

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

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

Alle operationer

Godkendelse

Send Authorization: Bearer pat_…. Opret tokens under Indstillinger for arbejdsområdet, API-tokens. Vejledning i godkendelse.

JSON overalt

Tilføj .json til enhver sti. Svar er { "data": … }, og fejl er { "error": { "code", "message" } }. Fejl.

MCP

Send JSON-RPC med POST til https://privatusanalytics.com/mcp med samme token. Hver operation nedenfor er et værktøj. MCP-vejledning.

Download openapi.json · 285 operationer

API-tokens

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

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Et navn, så du kan genkende 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": "Tilladelser (udelad for alle dine egne, en tom liste afvises)"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Begræns til disse websted-id'er (pa_…). Tom = alle",
      "default": []
    },
    "expires_at": {
      "type": "string",
      "format": "date-time",
      "description": "Udløbstidspunkt (ISO 8601). Tom = aldrig"
    },
    "allowed_ips": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Acceptér kun forespørgsler fra disse IP-adresser/CIDR-områder",
      "default": []
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområ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 kun ved oprettelse"
        },
        {
          "type": "null"
        }
      ]
    },
    "token_prefix": {
      "type": "string",
      "description": "De første tegn, så du kan genkende tokenet"
    },
    "owner": {
      "type": "string",
      "description": "E-mailadresse på det medlem, der ejer det"
    },
    "permissions": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Begrænset til disse websteder (tom = alle)"
    },
    "allowed_ips": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "oauth_client": {
      "anyOf": [
        {
          "type": "string",
          "description": "MCP-klient, der modtog 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 Tilbagekald et API-token api_tokens_delete

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "name": {
      "type": "string"
    },
    "token": {
      "anyOf": [
        {
          "type": "string",
          "description": "Selve tokenet: returneres kun ved oprettelse"
        },
        {
          "type": "null"
        }
      ]
    },
    "token_prefix": {
      "type": "string",
      "description": "De første tegn, så du kan genkende tokenet"
    },
    "owner": {
      "type": "string",
      "description": "E-mailadresse på det medlem, der ejer det"
    },
    "permissions": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Begrænset til disse websteder (tom = alle)"
    },
    "allowed_ips": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "oauth_client": {
      "anyOf": [
        {
          "type": "string",
          "description": "MCP-klient, der modtog 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 Vis API-tokens api_tokens_list

Tilladelse: member

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/api_tokens.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "include_revoked": {
      "type": "boolean",
      "description": "Vis også tilbagekaldte og udløbne tokens",
      "default": false
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater pr. 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 kun ved oprettelse"
          },
          {
            "type": "null"
          }
        ]
      },
      "token_prefix": {
        "type": "string",
        "description": "De første tegn, så du kan genkende tokenet"
      },
      "owner": {
        "type": "string",
        "description": "E-mailadresse på det medlem, der ejer det"
      },
      "permissions": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "site_ids": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Begrænset til disse websteder (tom = alle)"
      },
      "allowed_ips": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "oauth_client": {
        "anyOf": [
          {
            "type": "string",
            "description": "MCP-klient, der modtog 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"
      }
    }
  }
}

Abonnementer

GET /plans.json Vis abonnementer, priser og grænser plans_list

Tilladelse: public

Eksempel
curl https://privatusanalytics.com/plans.json
Input
{
  "type": "object",
  "properties": {
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater pr. 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": "Inkluderede hændelser pr. måned (kun gratis abonnement)"
          },
          {
            "type": "null"
          }
        ]
      },
      "badge_bonus": {
        "anyOf": [
          {
            "type": "integer",
            "description": "Ekstra hændelser pr. måned for at vise badget (gratis abonnement)"
          },
          {
            "type": "null"
          }
        ]
      },
      "limits": {
        "type": "object",
        "description": "Grænser for abonnementet. Null betyder ubegrænset"
      },
      "tiers": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "events": {
              "type": "integer",
              "description": "Inkluderede hændelser pr. måned"
            },
            "monthly": {
              "type": "integer",
              "description": "USD pr. måned, faktureret månedligt"
            },
            "yearly": {
              "type": "integer",
              "description": "USD pr. år, faktureret årligt (2 måneder gratis)"
            },
            "monthly_price_id": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Paddle-pris-id (månedligt)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "yearly_price_id": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Paddle-pris-id (årligt)"
                },
                {
                  "type": "null"
                }
              ]
            }
          }
        },
        "description": "Prisstige efter hændelser pr. måned"
      },
      "contact_sales": {
        "type": "boolean",
        "description": "Prissat pr. kontrakt"
      }
    }
  }
}

Advarsler

POST /alerts/:id/acknowledge.json Kvittér for den seneste hændelse alerts_acknowledge

Tilladelse: analytics.read

Eksempel
curl -X POST https://privatusanalytics.com/alerts/:id/acknowledge.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Input
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Advarsels-id, f.eks. alr_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Websted-id (null for forbrugsadvarsler)"
        },
        {
          "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ølsomhed for anomaly"
    },
    "goal_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "channel_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Id'er for notifikationskanaler"
    },
    "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 Opret en advarsel alerts_create

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Webstedets id (pa_…). Påkrævet undtagen for forbrugsadvarsler"
    },
    "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 kun fald, gt kun stigninger, tom begge",
      "enum": [
        "gt",
        "gte",
        "lt",
        "lte"
      ]
    },
    "threshold": {
      "type": "number",
      "description": "threshold: målingens værdi, goal: gennemførelser, no_data: timer, usage: procent, ssl: dage, vitals: ms (CLS: score)"
    },
    "window_minutes": {
      "type": "integer",
      "description": "Evalueringsvindue 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-advarsler: mål-id (goal_…)"
    },
    "uptime_check_id": {
      "type": "string",
      "description": "uptime/ssl: kontrol-id (standard: alle webstedets kontroller)"
    },
    "channel_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Id'er for notifikationskanaler (nch_…)"
    },
    "enabled": {
      "type": "boolean",
      "description": "Evaluér denne advarsel"
    },
    "name": {
      "type": "string",
      "description": "Navn på advarslen",
      "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": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "kind",
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Advarsels-id, f.eks. alr_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Websted-id (null for forbrugsadvarsler)"
        },
        {
          "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ølsomhed for anomaly"
    },
    "goal_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "channel_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Id'er for notifikationskanaler"
    },
    "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 Slet en advarsel alerts_delete

Tilladelse: content.write

Eksempel
curl -X DELETE https://privatusanalytics.com/alerts/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Input
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Advarsels-id, f.eks. alr_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Websted-id (null for forbrugsadvarsler)"
        },
        {
          "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ølsomhed for anomaly"
    },
    "goal_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "channel_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Id'er for notifikationskanaler"
    },
    "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 Hændelseshistorik for en advarsel alerts_history

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/alerts/:id/history.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "open": {
      "type": "boolean",
      "description": "Kun uløste hændelser",
      "default": false
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater pr. 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 værdi, da den blev udløst"
          },
          {
            "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å det medlem, der kvitterede"
          },
          {
            "type": "null"
          }
        ]
      }
    }
  }
}
GET /workspaces/:workspace_id/alerts.json Vis advarsler alerts_list

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/alerts.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Kun advarsler for dette websted (pa_…)"
    },
    "state": {
      "type": "string",
      "description": "Kun ok- eller udløste advarsler",
      "enum": [
        "ok",
        "triggered"
      ]
    },
    "kind": {
      "type": "string",
      "description": "Kun denne type",
      "enum": [
        "threshold",
        "anomaly",
        "goal",
        "no_data",
        "usage",
        "uptime",
        "ssl",
        "vitals"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater pr. side (maks. 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Advarsels-id, f.eks. alr_7Q2K9XH3AB"
      },
      "site_id": {
        "anyOf": [
          {
            "type": "string",
            "description": "Websted-id (null for forbrugsadvarsler)"
          },
          {
            "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ølsomhed for anomaly"
      },
      "goal_id": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "channel_ids": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Id'er for notifikationskanaler"
      },
      "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 Slå notifikationer fra (eller til) for en advarsel alerts_mute

Tilladelse: content.write

Eksempel
curl -X POST https://privatusanalytics.com/alerts/:id/mute.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Input
{
  "type": "object",
  "properties": {
    "minutes": {
      "type": "integer",
      "description": "Slå fra i så mange minutter (0 slår til igen, maks. 30 dage)",
      "default": 60
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Advarsels-id, f.eks. alr_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Websted-id (null for forbrugsadvarsler)"
        },
        {
          "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ølsomhed for anomaly"
    },
    "goal_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "channel_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Id'er for notifikationskanaler"
    },
    "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 en advarsel alerts_get

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/alerts/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Advarsels-id, f.eks. alr_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Websted-id (null for forbrugsadvarsler)"
        },
        {
          "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ølsomhed for anomaly"
    },
    "goal_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "channel_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Id'er for notifikationskanaler"
    },
    "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 Opdatér en advarsel alerts_update

Tilladelse: content.write

Eksempel
curl -X PATCH https://privatusanalytics.com/alerts/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Input
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Webstedets id (pa_…). Påkrævet undtagen for forbrugsadvarsler"
    },
    "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 kun fald, gt kun stigninger, tom begge",
      "enum": [
        "gt",
        "gte",
        "lt",
        "lte"
      ]
    },
    "threshold": {
      "type": "number",
      "description": "threshold: målingens værdi, goal: gennemførelser, no_data: timer, usage: procent, ssl: dage, vitals: ms (CLS: score)"
    },
    "window_minutes": {
      "type": "integer",
      "description": "Evalueringsvindue 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-advarsler: mål-id (goal_…)"
    },
    "uptime_check_id": {
      "type": "string",
      "description": "uptime/ssl: kontrol-id (standard: alle webstedets kontroller)"
    },
    "channel_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Id'er for notifikationskanaler (nch_…)"
    },
    "enabled": {
      "type": "boolean",
      "description": "Evaluér denne advarsel"
    },
    "name": {
      "type": "string",
      "description": "Navn på advarslen"
    },
    "kind": {
      "type": "string",
      "description": "Type af advarsel",
      "enum": [
        "threshold",
        "anomaly",
        "goal",
        "no_data",
        "usage",
        "uptime",
        "ssl",
        "vitals"
      ]
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Advarsels-id, f.eks. alr_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Websted-id (null for forbrugsadvarsler)"
        },
        {
          "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ølsomhed for anomaly"
    },
    "goal_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "channel_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Id'er for notifikationskanaler"
    },
    "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 Vis advarsler for et websted site_alerts_list

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/alerts.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "state": {
      "type": "string",
      "description": "Kun ok- eller udløste advarsler",
      "enum": [
        "ok",
        "triggered"
      ]
    },
    "kind": {
      "type": "string",
      "description": "Kun denne type",
      "enum": [
        "threshold",
        "anomaly",
        "goal",
        "no_data",
        "usage",
        "uptime",
        "ssl",
        "vitals"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater pr. side (maks. 100)"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Advarsels-id, f.eks. alr_7Q2K9XH3AB"
      },
      "site_id": {
        "anyOf": [
          {
            "type": "string",
            "description": "Websted-id (null for forbrugsadvarsler)"
          },
          {
            "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ølsomhed for anomaly"
      },
      "goal_id": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "channel_ids": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Id'er for notifikationskanaler"
      },
      "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"
      }
    }
  }
}

Affiliateprogram

GET /account/affiliate/commissions.json Vis dine affiliateprovisioner affiliate_commissions_list

Provisioner, modregninger ved refusion og chargeback samt tilbageførsler, nyeste først. Beløb er i cent.

Tilladelse: member

Eksempel
curl https://privatusanalytics.com/account/affiliate/commissions.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Kun provisioner med denne status",
      "enum": [
        "pending",
        "approved",
        "paid",
        "void"
      ]
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater pr. side (maks. 100)"
    }
  },
  "required": []
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "format": "uuid",
        "description": "Provisions-id"
      },
      "kind": {
        "type": "string",
        "description": "commission, clawback (refusion eller chargeback) eller reversal"
      },
      "status": {
        "type": "string",
        "description": "pending (tilbageholdt), approved (til udbetaling), paid eller void"
      },
      "amount_cents": {
        "type": "integer",
        "description": "Din andel i cent (negativ ved en modregning)"
      },
      "basis_cents": {
        "type": "integer",
        "description": "Den nettobetaling (ekskl. moms), den er beregnet ud fra, i cent"
      },
      "currency": {
        "type": "string",
        "description": "ISO-valutakode"
      },
      "earned_at": {
        "type": "string",
        "format": "date-time",
        "description": "Hvornår betalingen (eller refusionen) fandt sted"
      },
      "approved_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time",
            "description": "Hvornår den blev klar til udbetaling"
          },
          {
            "type": "null"
          }
        ]
      },
      "paid_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time",
            "description": "Hvornår den blev udbetalt"
          },
          {
            "type": "null"
          }
        ]
      }
    }
  }
}
GET /account/affiliate/signup-box.json Hent koden til din affiliate-tilmeldingsboks og resultaterne affiliate_signup_box_get

Indlejringskoden til din tilmeldingsboks (et script og en almindelig iframe) til det valgte tema, de attributter, der udfylder formularen på forhånd, de hændelser, scriptet udløser på din side, og boksens tal: tilmeldinger, der venter på bekræftelse, bekræftede tilmeldinger og betalende kunder. available er false, indtil din affiliateansøgning er godkendt.

Tilladelse: member

Eksempel
curl https://privatusanalytics.com/account/affiliate/signup-box.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "theme": {
      "type": "string",
      "description": "Boksens tema: auto (følger den besøgendes enhed), light eller dark",
      "enum": [
        "auto",
        "light",
        "dark"
      ],
      "examples": [
        "auto"
      ],
      "default": "auto"
    }
  },
  "required": []
}
Svardata
{
  "type": "object",
  "properties": {
    "available": {
      "type": "boolean",
      "description": "Om du har en tilmeldingsboks (kun godkendte affiliates)"
    },
    "theme": {
      "type": "string",
      "description": "Det tema, koden er bygget til"
    },
    "frame_url": {
      "anyOf": [
        {
          "type": "string",
          "description": "Boksens adresse, til en almindelig iframe"
        },
        {
          "type": "null"
        }
      ]
    },
    "script": {
      "anyOf": [
        {
          "type": "string",
          "description": "Scriptets indlejringskode: et element og loader-scriptet"
        },
        {
          "type": "null"
        }
      ]
    },
    "iframe": {
      "anyOf": [
        {
          "type": "string",
          "description": "Indlejringskoden til en almindelig iframe"
        },
        {
          "type": "null"
        }
      ]
    },
    "prefill_attributes": {
      "type": "array",
      "description": "Attributter på elementet, der udfylder formularen på forhånd for loggede ind besøgende"
    },
    "events": {
      "type": "array",
      "description": "DOM-hændelser, som scriptet udløser på elementet"
    },
    "waiting": {
      "type": "integer",
      "description": "Tilmeldinger, hvis link i e-mailen endnu ikke er åbnet"
    },
    "signups": {
      "type": "integer",
      "description": "Bekræftede tilmeldinger, der kom via boksen"
    },
    "customers": {
      "type": "integer",
      "description": "De af dem, der blev betalende kunder"
    }
  }
}
GET /account/affiliate.json Hent din affiliatestatus, dit henvisningslink og statistik affiliate_get

Status for din affiliateansøgning, henvisningslink, tilmeldinger og betalende kunder, du har henvist, samt saldi pr. valuta (tilbageholdt, til udbetaling, udbetalt). status er none, når du ikke har ansøgt.

Tilladelse: member

Eksempel
curl https://privatusanalytics.com/account/affiliate.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {},
  "required": []
}
Svardata
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "none (ikke ansøgt), pending, approved, rejected eller suspended"
    },
    "code": {
      "anyOf": [
        {
          "type": "string",
          "description": "Din henvisningskode"
        },
        {
          "type": "null"
        }
      ]
    },
    "referral_url": {
      "anyOf": [
        {
          "type": "string",
          "description": "Linket, du skal dele (kun godkendte affiliates)"
        },
        {
          "type": "null"
        }
      ]
    },
    "payout_method": {
      "anyOf": [
        {
          "type": "string",
          "description": "wise eller credit"
        },
        {
          "type": "null"
        }
      ]
    },
    "rejection_reason": {
      "anyOf": [
        {
          "type": "string",
          "description": "Hvorfor den seneste ansøgning blev afvist"
        },
        {
          "type": "null"
        }
      ]
    },
    "applied_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Hvornår du ansøgte"
        },
        {
          "type": "null"
        }
      ]
    },
    "approved_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Hvornår ansøgningen blev godkendt"
        },
        {
          "type": "null"
        }
      ]
    },
    "credit_blocked": {
      "anyOf": [
        {
          "type": "string",
          "description": "Hvorfor kontokreditten venter: program (arbejdsområdet er med i et rabatprogram), no_subscription eller no_workspace. null, når intet blokerer den"
        },
        {
          "type": "null"
        }
      ]
    },
    "signups": {
      "type": "integer",
      "description": "Konti oprettet via dit link eller din kode"
    },
    "customers": {
      "type": "integer",
      "description": "Henviste arbejdsområder, der har betalt"
    },
    "balances": {
      "type": "array",
      "description": "Pr. valuta: pending_cents (tilbageholdt), approved_cents (til udbetaling) og paid_cents"
    },
    "payouts": {
      "type": "array",
      "description": "Seneste udbetalinger med amount_cents, currency, payout_method, status (applied: kontokredit, der venter på din næste fornyelse, eller paid), applied_at og paid_at"
    },
    "terms": {
      "type": "object",
      "description": "Provisionsprocent, måneder, tilbageholdelsesdage og grænsen for Wise-udbetaling i cent"
    }
  }
}

Analyse

GET /sites/:site_id/overview.json Overblik over webstedet: målinger, diagramserier, topoversigter, live-besøgende og noter stats_overview

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/overview.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Forudindstilling for datointerval. Brug 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å eget interval (webstedets tidszone)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Slut på eget interval, inklusive"
    },
    "compare": {
      "type": "string",
      "description": "Sammenligningsperiode",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Start på egen sammenligning"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Slut på egen sammenligning"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Afstem ugedage i sammenligningen",
      "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. Pak betingelser ind i {\"any\": [...]} for ELLER.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Anvend et gemt segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Tilføj importerede historiske data (datoer før den første egne hændelse, ignoreres når filtre eller et segment anvendes)",
      "default": false
    },
    "interval": {
      "type": "string",
      "description": "Størrelse på diagraminterval",
      "enum": [
        "auto",
        "minute",
        "hour",
        "day",
        "week",
        "month",
        "quarter",
        "year"
      ],
      "default": "auto"
    },
    "panels": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Dimensioner, der skal medtage topværdier",
      "default": [
        "channel",
        "referrer",
        "page",
        "entry_page",
        "country",
        "device",
        "browser",
        "os",
        "utm_campaign",
        "event",
        "goal"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
GET /sites/:site_id/experiments.json Eksperimentrapport: konverteringsrate pr. variant, løft i forhold til kontrol og signifikans (z-test for to andele) experiments_report

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/experiments.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Forudindstilling for datointerval. Brug 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å eget interval (webstedets tidszone)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Slut på eget interval, inklusive"
    },
    "compare": {
      "type": "string",
      "description": "Sammenligningsperiode",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Start på egen sammenligning"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Slut på egen sammenligning"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Afstem ugedage i sammenligningen",
      "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. Pak betingelser ind i {\"any\": [...]} for ELLER.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Anvend et gemt segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Tilføj importerede historiske data (datoer før den første egne hændelse, ignoreres når filtre eller et segment anvendes)",
      "default": false
    },
    "property": {
      "type": "string",
      "description": "Hændelsesegenskab, der indeholder varianten, f.eks. variant",
      "examples": [
        "variant"
      ]
    },
    "goal_id": {
      "type": "string",
      "description": "Mål, der tælles som en konvertering (goal_…)"
    },
    "control": {
      "type": "string",
      "description": "Kontrolvariant (standard er \"control\", hvis den findes, ellers varianten med flest besøg)"
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "property",
    "goal_id",
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
GET /sites/:site_id/insights.json Bemærkelsesværdige ændringer i forhold til den forrige periode, på almindeligt dansk (største bevægelser, ændringer i målkonvertering) insights_get

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/insights.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Hele dage til og med i går, sammenlignet med det samme antal dage før",
      "enum": [
        "7d",
        "14d",
        "28d",
        "30d"
      ],
      "default": "7d"
    },
    "limit": {
      "type": "integer",
      "description": "Maksimalt antal indsigter (1 til 20)",
      "default": 8
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
GET /sites/:site_id/journeys.json Rejser: de 3-trins stier, der oftest følger efter en side (eller en vilkårlig indgang), eller som går forud for en side eller et mål journeys_explore

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/journeys.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Forudindstilling for datointerval. Brug 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å eget interval (webstedets tidszone)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Slut på eget interval, inklusive"
    },
    "compare": {
      "type": "string",
      "description": "Sammenligningsperiode",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Start på egen sammenligning"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Slut på egen sammenligning"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Afstem ugedage i sammenligningen",
      "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. Pak betingelser ind i {\"any\": [...]} for ELLER.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Anvend et gemt segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Tilføj importerede historiske data (datoer før den første egne hændelse, ignoreres når filtre eller et segment anvendes)",
      "default": false
    },
    "mode": {
      "type": "string",
      "description": "forward: sider efter startsiden, reverse: sider, der fører til slutsiden eller målet",
      "enum": [
        "forward",
        "reverse"
      ],
      "default": "forward"
    },
    "path": {
      "type": "string",
      "description": "Startside (forward) eller slutside (reverse). Tom betyder en vilkårlig indgang (kun forward)"
    },
    "goal_id": {
      "type": "string",
      "description": "Omvendt tilstand: slut ved dette mål (goal_…) i stedet for en side"
    },
    "limit": {
      "type": "integer",
      "description": "Sider vist pr. trin (maks. 12)",
      "default": 6
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
GET /sites/:site_id/pages/detail.json Sidedetaljer: målinger, forrige og næste sider, kilder, Web Vitals, hændelser og klikkort for én sti pages_detail

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/pages/detail.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Forudindstilling for datointerval. Brug 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å eget interval (webstedets tidszone)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Slut på eget interval, inklusive"
    },
    "compare": {
      "type": "string",
      "description": "Sammenligningsperiode",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Start på egen sammenligning"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Slut på egen sammenligning"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Afstem ugedage i sammenligningen",
      "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. Pak betingelser ind i {\"any\": [...]} for ELLER.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Anvend et gemt segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Tilføj importerede historiske data (datoer før den første egne hændelse, ignoreres når filtre eller et segment anvendes)",
      "default": false
    },
    "path": {
      "type": "string",
      "description": "Sidesti, f.eks. /pricing",
      "examples": [
        "/pricing"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Websted-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

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/stats/aggregate.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Forudindstilling for datointerval. Brug 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å eget interval (webstedets tidszone)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Slut på eget interval, inklusive"
    },
    "compare": {
      "type": "string",
      "description": "Sammenligningsperiode",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Start på egen sammenligning"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Slut på egen sammenligning"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Afstem ugedage i sammenligningen",
      "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. Pak betingelser ind i {\"any\": [...]} for ELLER.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Anvend et gemt segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Tilføj importerede historiske data (datoer før den første egne hændelse, ignoreres når filtre eller et segment anvendes)",
      "default": false
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
GET /sites/:site_id/breakdown/:dimension.json Topværdier for en dimension (sider, kilder, lande…) stats_breakdown

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/breakdown/:dimension.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Forudindstilling for datointerval. Brug 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å eget interval (webstedets tidszone)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Slut på eget interval, inklusive"
    },
    "compare": {
      "type": "string",
      "description": "Sammenligningsperiode",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Start på egen sammenligning"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Slut på egen sammenligning"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Afstem ugedage i sammenligningen",
      "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. Pak betingelser ind i {\"any\": [...]} for ELLER.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Anvend et gemt segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Tilføj importerede historiske data (datoer før den første egne hændelse, ignoreres når filtre eller et segment anvendes)",
      "default": false
    },
    "dimension": {
      "type": "string",
      "description": "Dimension for ressourcen"
    },
    "limit": {
      "type": "integer",
      "description": "Rækker pr. side (maks. 1000)",
      "default": 10
    },
    "page": {
      "type": "integer",
      "description": "Sidenummer",
      "default": 1
    },
    "sort": {
      "type": "string",
      "description": "Sortér efter måling",
      "enum": [
        "visitors",
        "visits",
        "pageviews",
        "revenue"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "dimension",
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
GET /sites/:site_id/stats/timeseries.json Målinger pr. tidsinterval til diagrammer stats_timeseries

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/stats/timeseries.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Forudindstilling for datointerval. Brug 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å eget interval (webstedets tidszone)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Slut på eget interval, inklusive"
    },
    "compare": {
      "type": "string",
      "description": "Sammenligningsperiode",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Start på egen sammenligning"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Slut på egen sammenligning"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Afstem ugedage i sammenligningen",
      "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. Pak betingelser ind i {\"any\": [...]} for ELLER.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Anvend et gemt segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Tilføj importerede historiske data (datoer før den første egne hændelse, ignoreres når filtre eller et segment anvendes)",
      "default": false
    },
    "interval": {
      "type": "string",
      "description": "Intervalstørrelse. auto vælger en til perioden",
      "enum": [
        "auto",
        "minute",
        "hour",
        "day",
        "week",
        "month",
        "quarter",
        "year"
      ],
      "default": "auto"
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}

Arbejdsområder

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

Tilladelse: workspace.manage

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/white_label.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string"
    },
    "brand_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Navn vist i stedet for Privatus Analytics"
        },
        {
          "type": "null"
        }
      ]
    },
    "brand_logo_url": {
      "anyOf": [
        {
          "type": "string",
          "description": "URL til logobillede"
        },
        {
          "type": "null"
        }
      ]
    },
    "brand_color": {
      "anyOf": [
        {
          "type": "string",
          "description": "Accentfarve"
        },
        {
          "type": "null"
        }
      ]
    },
    "hide_branding": {
      "type": "boolean",
      "description": "Privatus Analytics-branding er skjult"
    },
    "available": {
      "type": "boolean",
      "description": "Abonnementet inkluderer white label"
    },
    "active": {
      "type": "boolean",
      "description": "Brandet er anvendt lige nu"
    }
  }
}
PATCH /workspaces/:workspace_id/white_label.json Angiv white label-brandet for delte dashboards og e-mailrapporter (Business) white_label_update

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "brand_name": {
      "type": "string",
      "description": "Navn vist i stedet for Privatus Analytics (tomt fjerner det)"
    },
    "brand_logo_url": {
      "type": "string",
      "description": "https-URL til et logobillede (tomt fjerner det)"
    },
    "brand_color": {
      "type": "string",
      "description": "Accentfarve, f.eks. #06755b"
    },
    "hide_branding": {
      "type": "boolean",
      "description": "Skjul \"Privatus Analytics\" på delte dashboards og e-mailrapporter"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string"
    },
    "brand_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Navn vist i stedet for Privatus Analytics"
        },
        {
          "type": "null"
        }
      ]
    },
    "brand_logo_url": {
      "anyOf": [
        {
          "type": "string",
          "description": "URL til logobillede"
        },
        {
          "type": "null"
        }
      ]
    },
    "brand_color": {
      "anyOf": [
        {
          "type": "string",
          "description": "Accentfarve"
        },
        {
          "type": "null"
        }
      ]
    },
    "hide_branding": {
      "type": "boolean",
      "description": "Privatus Analytics-branding er skjult"
    },
    "available": {
      "type": "boolean",
      "description": "Abonnementet inkluderer white label"
    },
    "active": {
      "type": "boolean",
      "description": "Brandet er anvendt lige nu"
    }
  }
}
GET /workspaces/:workspace_id/security.json Hent sikkerhedsindstillinger for arbejdsområdet workspace_security_get

Tilladelse: workspace.manage

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/security.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string"
    },
    "enforce_2fa": {
      "type": "boolean",
      "description": "Medlemmer skal opsætte 2FA"
    },
    "login_methods": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Tilladte loginmetoder"
    },
    "session_ttl_hours": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Sessionens levetid (null = ingen)"
        },
        {
          "type": "null"
        }
      ]
    },
    "app_ip_allowlist": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Tilladte IP-adresser/CIDR-områder (tom = alle steder)"
    },
    "support_access_until": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Privatus Analytics-support må se arbejdsområdet indtil"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
PATCH /workspaces/:workspace_id/security.json Opdatér sikkerhedsindstillinger for arbejdsområdet (2FA, loginmetoder, sessionslevetid, IP-tilladelsesliste, supportadgang) workspace_security_update

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "enforce_2fa": {
      "type": "boolean",
      "description": "Kræv, at medlemmer opsætter 2FA"
    },
    "login_methods": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "password",
          "magic_link",
          "passkey",
          "google",
          "github",
          "sso"
        ]
      },
      "description": "Tilladte loginmetoder"
    },
    "session_ttl_hours": {
      "type": "integer",
      "description": "Log medlemmer ud efter så mange timer (0 = ingen grænse)"
    },
    "app_ip_allowlist": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Tillad kun adgang til appen og API'et fra disse IP-adresser/CIDR-områder (Business). Tom = alle steder"
    },
    "support_access": {
      "type": "boolean",
      "description": "Lad Privatus Analytics-support se arbejdsområdet i 7 dage"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string"
    },
    "enforce_2fa": {
      "type": "boolean",
      "description": "Medlemmer skal opsætte 2FA"
    },
    "login_methods": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Tilladte loginmetoder"
    },
    "session_ttl_hours": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Sessionens levetid (null = ingen)"
        },
        {
          "type": "null"
        }
      ]
    },
    "app_ip_allowlist": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Tilladte IP-adresser/CIDR-områder (tom = alle steder)"
    },
    "support_access_until": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Privatus Analytics-support må se arbejdsområdet indtil"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
POST /workspaces.json Opret et arbejdsområde (du bliver ejer) workspaces_create

Tilladelse: member · Kun HTTP (ikke et MCP-værktøj)

Eksempel
curl -X POST https://privatusanalytics.com/workspaces.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Input
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Navn på arbejdsområdet",
      "examples": [
        "Acme Inc"
      ]
    },
    "timezone": {
      "type": "string",
      "description": "Standardtidszone for rapportering (standard er brugerens)"
    },
    "currency": {
      "type": "string",
      "description": "Standardvaluta (ISO 4217)",
      "default": "USD"
    },
    "how_heard": {
      "type": "string",
      "description": "Hvordan du hørte om os"
    }
  },
  "required": [
    "name"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "timezone": {
      "type": "string",
      "description": "Standardtidszone for rapportering"
    },
    "currency": {
      "type": "string",
      "description": "Standardvaluta"
    },
    "plan": {
      "type": "string",
      "description": "free, pro, business eller enterprise"
    },
    "plan_events": {
      "type": "integer",
      "description": "Hændelser pr. måned inkluderet i abonnementet"
    },
    "subscription_status": {
      "type": "string"
    },
    "role": {
      "type": "string",
      "description": "Din rolle i dette arbejdsområde"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /workspaces/:id.json Slet et arbejdsområde og alle dets websteder (kun ejeren, opsiger ethvert abonnement) workspaces_delete

Tilladelse: workspace.manage

Eksempel
curl -X DELETE https://privatusanalytics.com/workspaces/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Input
{
  "type": "object",
  "properties": {
    "confirm": {
      "type": "string",
      "description": "Skriv arbejdsområdets navn for at bekræfte"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "confirm",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "timezone": {
      "type": "string",
      "description": "Standardtidszone for rapportering"
    },
    "currency": {
      "type": "string",
      "description": "Standardvaluta"
    },
    "plan": {
      "type": "string",
      "description": "free, pro, business eller enterprise"
    },
    "plan_events": {
      "type": "integer",
      "description": "Hændelser pr. måned inkluderet i abonnementet"
    },
    "subscription_status": {
      "type": "string"
    },
    "role": {
      "type": "string",
      "description": "Din rolle i dette arbejdsområde"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /workspaces.json Vis dine arbejdsområder workspaces_list

Tilladelse: member

Eksempel
curl https://privatusanalytics.com/workspaces.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater pr. side (maks. 100)"
    }
  },
  "required": []
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
      },
      "name": {
        "type": "string"
      },
      "timezone": {
        "type": "string",
        "description": "Standardtidszone for rapportering"
      },
      "currency": {
        "type": "string",
        "description": "Standardvaluta"
      },
      "plan": {
        "type": "string",
        "description": "free, pro, business eller enterprise"
      },
      "plan_events": {
        "type": "integer",
        "description": "Hændelser pr. måned inkluderet i abonnementet"
      },
      "subscription_status": {
        "type": "string"
      },
      "role": {
        "type": "string",
        "description": "Din rolle i dette arbejdsområde"
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
GET /workspaces/:id.json Hent et arbejdsområde workspaces_get

Tilladelse: member

Eksempel
curl https://privatusanalytics.com/workspaces/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "timezone": {
      "type": "string",
      "description": "Standardtidszone for rapportering"
    },
    "currency": {
      "type": "string",
      "description": "Standardvaluta"
    },
    "plan": {
      "type": "string",
      "description": "free, pro, business eller enterprise"
    },
    "plan_events": {
      "type": "integer",
      "description": "Hændelser pr. måned inkluderet i abonnementet"
    },
    "subscription_status": {
      "type": "string"
    },
    "role": {
      "type": "string",
      "description": "Din rolle i dette arbejdsområde"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
PATCH /workspaces/:id.json Opdatér indstillinger for arbejdsområdet workspaces_update

Tilladelse: workspace.manage

Eksempel
curl -X PATCH https://privatusanalytics.com/workspaces/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Input
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Navn på arbejdsområdet"
    },
    "timezone": {
      "type": "string",
      "description": "Standardtidszone for rapportering"
    },
    "currency": {
      "type": "string",
      "description": "Standardvaluta (ISO 4217)"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "timezone": {
      "type": "string",
      "description": "Standardtidszone for rapportering"
    },
    "currency": {
      "type": "string",
      "description": "Standardvaluta"
    },
    "plan": {
      "type": "string",
      "description": "free, pro, business eller enterprise"
    },
    "plan_events": {
      "type": "integer",
      "description": "Hændelser pr. måned inkluderet i abonnementet"
    },
    "subscription_status": {
      "type": "string"
    },
    "role": {
      "type": "string",
      "description": "Din rolle i dette arbejdsområde"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Assistent

POST /sites/:site_id/ask.json Stil et spørgsmål i en ny samtale (tæller med i den månedlige grænse for AI-spørgsmål) assistant_ask

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "question": {
      "type": "string",
      "description": "Dit første spørgsmål på almindeligt dansk",
      "examples": [
        "How many visitors did we have last week?"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Websted-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": "Websted-id"
        },
        {
          "type": "null"
        }
      ]
    },
    "title": {
      "anyOf": [
        {
          "type": "string",
          "description": "Det første spørgsmål, forkortet"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Tidspunkt for den seneste besked"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time",
      "description": "Slettes automatisk efter dette tidspunkt (30 dage efter den seneste besked)"
    },
    "messages": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Besked-id i samtalen"
        },
        "role": {
          "type": "string",
          "description": "user (spørgsmålet) eller assistant (svaret)"
        },
        "content": {
          "type": "string",
          "description": "Spørgsmålet, eller svaret i Markdown"
        },
        "queries": {
          "type": "array",
          "items": {
            "type": "object"
          },
          "description": "Sådan nåede jeg frem til det: de præcise API-forespørgsler bag svaret, som [{tool, input, status, error}]"
        },
        "chart": {
          "anyOf": [
            {
              "type": "object",
              "description": "Diagram til 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ået af assistenten, der skal bekræftes med goals_create"
            },
            {
              "type": "null"
            }
          ]
        },
        "input_tokens": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Anvendte inputtokens til modellen"
            },
            {
              "type": "null"
            }
          ]
        },
        "output_tokens": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Anvendte outputtokens fra modellen"
            },
            {
              "type": "null"
            }
          ]
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        }
      },
      "description": "Spørgsmål og svar, ældste først"
    }
  }
}
DELETE /sites/:site_id/ask/:id.json Slet en Spørg-samtale og dens beskeder assistant_conversations_delete

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Samtale-id, f.eks. ask_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Websted-id"
        },
        {
          "type": "null"
        }
      ]
    },
    "title": {
      "anyOf": [
        {
          "type": "string",
          "description": "Det første spørgsmål, forkortet"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Tidspunkt for den seneste besked"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time",
      "description": "Slettes automatisk efter dette tidspunkt (30 dage efter den seneste besked)"
    }
  }
}
GET /sites/:site_id/ask.json Vis dine Spørg-samtaler for et websted assistant_conversations_list

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/ask.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater pr. 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": "Websted-id"
          },
          {
            "type": "null"
          }
        ]
      },
      "title": {
        "anyOf": [
          {
            "type": "string",
            "description": "Det første spørgsmål, forkortet"
          },
          {
            "type": "null"
          }
        ]
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      },
      "updated_at": {
        "type": "string",
        "format": "date-time",
        "description": "Tidspunkt for den seneste besked"
      },
      "expires_at": {
        "type": "string",
        "format": "date-time",
        "description": "Slettes automatisk efter dette tidspunkt (30 dage efter den seneste besked)"
      }
    }
  }
}
GET /sites/:site_id/ask/:id.json En Spørg-samtale: spørgsmål, svar, forespørgslerne bag dem og diagrammer assistant_conversations_get

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/ask/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Samtale-id, f.eks. ask_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Websted-id"
        },
        {
          "type": "null"
        }
      ]
    },
    "title": {
      "anyOf": [
        {
          "type": "string",
          "description": "Det første spørgsmål, forkortet"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Tidspunkt for den seneste besked"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time",
      "description": "Slettes automatisk efter dette tidspunkt (30 dage efter den seneste besked)"
    },
    "messages": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Besked-id i samtalen"
        },
        "role": {
          "type": "string",
          "description": "user (spørgsmålet) eller assistant (svaret)"
        },
        "content": {
          "type": "string",
          "description": "Spørgsmålet, eller svaret i Markdown"
        },
        "queries": {
          "type": "array",
          "items": {
            "type": "object"
          },
          "description": "Sådan nåede jeg frem til det: de præcise API-forespørgsler bag svaret, som [{tool, input, status, error}]"
        },
        "chart": {
          "anyOf": [
            {
              "type": "object",
              "description": "Diagram til 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ået af assistenten, der skal bekræftes med goals_create"
            },
            {
              "type": "null"
            }
          ]
        },
        "input_tokens": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Anvendte inputtokens til modellen"
            },
            {
              "type": "null"
            }
          ]
        },
        "output_tokens": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Anvendte outputtokens fra modellen"
            },
            {
              "type": "null"
            }
          ]
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        }
      },
      "description": "Spørgsmål og svar, ældste først"
    }
  }
}
POST /sites/:site_id/ask/:ask_conversation_id/messages.json Stil et opfølgende spørgsmål i en samtale (tæller med i den månedlige grænse for AI-spørgsmål). Returnerer svaret. assistant_ask_followup

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "question": {
      "type": "string",
      "description": "Dit spørgsmål på almindeligt dansk",
      "examples": [
        "Which pages had the most visitors last week?"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    },
    "ask_conversation_id": {
      "type": "string",
      "description": "Ask conversation for ressourcen"
    }
  },
  "required": [
    "question",
    "site_id",
    "ask_conversation_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Besked-id i samtalen"
    },
    "role": {
      "type": "string",
      "description": "user (spørgsmålet) eller assistant (svaret)"
    },
    "content": {
      "type": "string",
      "description": "Spørgsmålet, eller svaret i Markdown"
    },
    "queries": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Sådan nåede jeg frem til det: de præcise API-forespørgsler bag svaret, som [{tool, input, status, error}]"
    },
    "chart": {
      "anyOf": [
        {
          "type": "object",
          "description": "Diagram til 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ået af assistenten, der skal bekræftes med goals_create"
        },
        {
          "type": "null"
        }
      ]
    },
    "input_tokens": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Anvendte inputtokens til modellen"
        },
        {
          "type": "null"
        }
      ]
    },
    "output_tokens": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Anvendte outputtokens fra modellen"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Crawlere

POST /sites/:site_id/crawlers/connection.json Synkronisér AI-crawlerhits fra en Cloudflare-zone (kræver en Cloudflare-tilladelse fra browseren) crawlers_cloudflare_connect

Tilladelse: sites.manage

Eksempel
curl -X POST https://privatusanalytics.com/sites/:site_id/crawlers/connection.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Input
{
  "type": "object",
  "properties": {
    "zone_id": {
      "type": "string",
      "description": "Cloudflare-zone-id fra crawlers_cloudflare_zones",
      "examples": [
        "023e105f4ecef8ad9ca31a8372d0c353"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "zone_id",
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "zone_id": {
      "type": "string",
      "description": "Cloudflare-zone-id"
    },
    "zone_name": {
      "type": "string",
      "description": "Navn på Cloudflare-zonen, f.eks. example.com"
    },
    "status": {
      "type": "string",
      "description": "active eller error"
    },
    "last_synced_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Hvornår crawlerhits sidst blev importeret, eller null før den første import"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:site_id/crawlers/connection.json Afbryd Cloudflare, og slet de crawlerhits, der er importeret derfra crawlers_cloudflare_disconnect

Tilladelse: sites.manage

Eksempel
curl -X DELETE https://privatusanalytics.com/sites/:site_id/crawlers/connection.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Input
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "zone_id": {
      "type": "string",
      "description": "Cloudflare-zone-id"
    },
    "zone_name": {
      "type": "string",
      "description": "Navn på Cloudflare-zonen, f.eks. example.com"
    },
    "status": {
      "type": "string",
      "description": "active eller error"
    },
    "last_synced_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Hvornår crawlerhits sidst blev importeret, eller null før den første import"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /sites/:site_id/crawlers/sync.json Importér crawlerhits fra Cloudflare nu crawlers_cloudflare_sync

Tilladelse: sites.manage

Eksempel
curl -X POST https://privatusanalytics.com/sites/:site_id/crawlers/sync.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Input
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "zone_id": {
      "type": "string",
      "description": "Cloudflare-zone-id"
    },
    "zone_name": {
      "type": "string",
      "description": "Navn på Cloudflare-zonen, f.eks. example.com"
    },
    "status": {
      "type": "string",
      "description": "active eller error"
    },
    "last_synced_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Hvornår crawlerhits sidst blev importeret, eller null før den første import"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/crawlers/zones.json Vis de Cloudflare-zoner, du kan forbinde (kræver en Cloudflare-tilladelse fra browseren) crawlers_cloudflare_zones

Tilladelse: sites.manage

Eksempel
curl https://privatusanalytics.com/sites/:site_id/crawlers/zones.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
GET /sites/:site_id/crawlers.json Rapport om AI-crawlere: hits pr. crawler over tid, topstier pr. crawler, efter kategori crawlers_report

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/crawlers.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Forudindstilling for datointerval. Brug 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å eget interval (webstedets tidszone)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Slut på eget interval, inklusive"
    },
    "category": {
      "type": "string",
      "description": "ai, search, seo, other eller all",
      "enum": [
        "all",
        "ai",
        "search",
        "seo",
        "other"
      ],
      "default": "ai"
    },
    "crawler": {
      "type": "string",
      "description": "Kun denne crawler, f.eks. GPTBot"
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}

Dashboards

GET /workspaces/:workspace_id/dashboards/:id/cards/:index.json Data til ét kort på et eget dashboard dashboards_card

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/dashboards/:id/cards/:index.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    },
    "index": {
      "type": "string",
      "description": "Index for ressourcen"
    }
  },
  "required": [
    "workspace_id",
    "id",
    "index"
  ]
}
Svardata
{
  "type": "object"
}
POST /workspaces/:workspace_id/dashboards.json Opret et eget dashboard dashboards_create

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Navn på dashboard",
      "examples": [
        "Client: Acme"
      ]
    },
    "cards": {
      "type": "array",
      "items": {},
      "description": "Kort i rækkefø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_…\"}}]. Parametre, som en type ikke bruger, ignoreres",
      "default": []
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Dashboard-id, f.eks. dash_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "cards": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Kort i rækkefø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 Slet et eget dashboard dashboards_delete

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Dashboard-id, f.eks. dash_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "cards": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Kort i rækkefø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 Vis egne dashboards dashboards_list

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/dashboards.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater pr. side (maks. 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Dashboard-id, f.eks. dash_7Q2K9XH3AB"
      },
      "name": {
        "type": "string"
      },
      "cards": {
        "type": "array",
        "items": {
          "type": "object"
        },
        "description": "Kort i rækkefø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 eget dashboard og dets kort dashboards_get

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/dashboards/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Dashboard-id, f.eks. dash_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "cards": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Kort i rækkefø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 Omdøb et eget dashboard eller erstat dets kort dashboards_update

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nyt navn (uændret, når tomt)"
    },
    "cards": {
      "type": "array",
      "items": {},
      "description": "Erstatter alle kort. Kort i rækkefø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_…\"}}]. Parametre, som en type ikke bruger, ignoreres"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Dashboard-id, f.eks. dash_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "cards": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Kort i rækkefø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 Tilføj en datavarehusdestination warehouse_destinations_create

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Visningsnavn, f.eks. Data lake"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Websteder, der skal sendes (pa_…). Tom sender alle websteder"
    },
    "bucket": {
      "type": "string",
      "description": "s3: bucket-navn"
    },
    "region": {
      "type": "string",
      "description": "s3: region, f.eks. us-east-1 (auto for R2)"
    },
    "prefix": {
      "type": "string",
      "description": "s3/azure: stipræfiks, f.eks. privatus/events"
    },
    "endpoint": {
      "type": "string",
      "description": "s3: https-endpoint til S3-kompatibel lagring (GCS-interoperabilitet, R2, MinIO)"
    },
    "access_key_id": {
      "type": "string",
      "description": "s3: adgangsnøgle-id"
    },
    "secret_access_key": {
      "type": "string",
      "description": "s3: hemmelig adgangsnøgle (kun skrivbar)"
    },
    "service_account_json": {
      "type": "string",
      "description": "bigquery: JSON-nøgle til servicekonto med BigQuery Data Editor (kun skrivbar)"
    },
    "project_id": {
      "type": "string",
      "description": "bigquery: projekt-id (standard: fra nøglen)"
    },
    "dataset": {
      "type": "string",
      "description": "bigquery: datasæt-id"
    },
    "table": {
      "type": "string",
      "description": "bigquery/snowflake: tabelnavn (kolonner: skema v1)"
    },
    "account": {
      "type": "string",
      "description": "snowflake: kontoidentifikator, f.eks. xy12345.us-east-1 eller myorg-myaccount"
    },
    "user": {
      "type": "string",
      "description": "snowflake: bruger med godkendelse via nøglepar"
    },
    "private_key": {
      "type": "string",
      "description": "snowflake: PEM RSA-privatnøgle (kun skrivbar)"
    },
    "database": {
      "type": "string",
      "description": "snowflake: database"
    },
    "schema": {
      "type": "string",
      "description": "snowflake: skema"
    },
    "warehouse": {
      "type": "string",
      "description": "snowflake: virtuelt datavarehus"
    },
    "role": {
      "type": "string",
      "description": "snowflake: rolle (valgfri)"
    },
    "sas_url": {
      "type": "string",
      "description": "azure: SAS-URL til container med create/write-tilladelse (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": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "kind",
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Destinations-id, f.eks. whd_7Q2K9XH3AB"
    },
    "kind": {
      "type": "string",
      "description": "s3, bigquery, snowflake eller azure"
    },
    "name": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "Hvor data sendes hen: s3://bucket/prefix, project.dataset.table, account/database.schema.table eller Azure-containeren"
    },
    "configured": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Navne på indstillinger, der er udfyldt (værdier returneres aldrig)"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Sendte websteder (pa_…). Tom betyder alle websteder"
    },
    "schedule": {
      "type": "string",
      "description": "daily: 02:00 UTC, sender den forrige UTC-dag"
    },
    "schema_version": {
      "type": "string",
      "description": "Sendt rækkeskema"
    },
    "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 Slet en datavarehusdestination warehouse_destinations_delete

Tilladelse: workspace.manage

Eksempel
curl -X DELETE https://privatusanalytics.com/warehouses/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Input
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Destinations-id, f.eks. whd_7Q2K9XH3AB"
    },
    "kind": {
      "type": "string",
      "description": "s3, bigquery, snowflake eller azure"
    },
    "name": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "Hvor data sendes hen: s3://bucket/prefix, project.dataset.table, account/database.schema.table eller Azure-containeren"
    },
    "configured": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Navne på indstillinger, der er udfyldt (værdier returneres aldrig)"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Sendte websteder (pa_…). Tom betyder alle websteder"
    },
    "schedule": {
      "type": "string",
      "description": "daily: 02:00 UTC, sender den forrige UTC-dag"
    },
    "schema_version": {
      "type": "string",
      "description": "Sendt rækkeskema"
    },
    "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 Vis datavarehusdestinationer warehouse_destinations_list

Tilladelse: workspace.manage

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/warehouses.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "description": "Kun destinationer af denne type",
      "enum": [
        "s3",
        "bigquery",
        "snowflake",
        "azure"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater pr. side (maks. 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Destinations-id, f.eks. whd_7Q2K9XH3AB"
      },
      "kind": {
        "type": "string",
        "description": "s3, bigquery, snowflake eller azure"
      },
      "name": {
        "type": "string"
      },
      "target": {
        "type": "string",
        "description": "Hvor data sendes hen: s3://bucket/prefix, project.dataset.table, account/database.schema.table eller Azure-containeren"
      },
      "configured": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Navne på indstillinger, der er udfyldt (værdier returneres aldrig)"
      },
      "site_ids": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Sendte websteder (pa_…). Tom betyder alle websteder"
      },
      "schedule": {
        "type": "string",
        "description": "daily: 02:00 UTC, sender den forrige UTC-dag"
      },
      "schema_version": {
        "type": "string",
        "description": "Sendt rækkeskema"
      },
      "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 datavarehusdestination (ingen hemmeligheder) warehouse_destinations_get

Tilladelse: workspace.manage

Eksempel
curl https://privatusanalytics.com/warehouses/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Destinations-id, f.eks. whd_7Q2K9XH3AB"
    },
    "kind": {
      "type": "string",
      "description": "s3, bigquery, snowflake eller azure"
    },
    "name": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "Hvor data sendes hen: s3://bucket/prefix, project.dataset.table, account/database.schema.table eller Azure-containeren"
    },
    "configured": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Navne på indstillinger, der er udfyldt (værdier returneres aldrig)"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Sendte websteder (pa_…). Tom betyder alle websteder"
    },
    "schedule": {
      "type": "string",
      "description": "daily: 02:00 UTC, sender den forrige UTC-dag"
    },
    "schema_version": {
      "type": "string",
      "description": "Sendt rækkeskema"
    },
    "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 Sæt en synkronisering af én dag i kø nu warehouse_destinations_sync

Tilladelse: workspace.manage

Eksempel
curl -X POST https://privatusanalytics.com/warehouses/:id/sync.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Input
{
  "type": "object",
  "properties": {
    "date": {
      "type": "string",
      "format": "date",
      "description": "UTC-dag, der skal sendes, f.eks. 2026-09-28 (standard: i går)"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Destinations-id, f.eks. whd_7Q2K9XH3AB"
    },
    "kind": {
      "type": "string",
      "description": "s3, bigquery, snowflake eller azure"
    },
    "name": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "Hvor data sendes hen: s3://bucket/prefix, project.dataset.table, account/database.schema.table eller Azure-containeren"
    },
    "configured": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Navne på indstillinger, der er udfyldt (værdier returneres aldrig)"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Sendte websteder (pa_…). Tom betyder alle websteder"
    },
    "schedule": {
      "type": "string",
      "description": "daily: 02:00 UTC, sender den forrige UTC-dag"
    },
    "schema_version": {
      "type": "string",
      "description": "Sendt rækkeskema"
    },
    "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 Opdatér en datavarehusdestination (tomme hemmeligheder beholdes) warehouse_destinations_update

Tilladelse: workspace.manage

Eksempel
curl -X PATCH https://privatusanalytics.com/warehouses/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Input
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Visningsnavn, f.eks. Data lake"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Websteder, der skal sendes (pa_…). Tom sender alle websteder"
    },
    "bucket": {
      "type": "string",
      "description": "s3: bucket-navn"
    },
    "region": {
      "type": "string",
      "description": "s3: region, f.eks. us-east-1 (auto for R2)"
    },
    "prefix": {
      "type": "string",
      "description": "s3/azure: stipræfiks, f.eks. privatus/events"
    },
    "endpoint": {
      "type": "string",
      "description": "s3: https-endpoint til S3-kompatibel lagring (GCS-interoperabilitet, R2, MinIO)"
    },
    "access_key_id": {
      "type": "string",
      "description": "s3: adgangsnøgle-id"
    },
    "secret_access_key": {
      "type": "string",
      "description": "s3: hemmelig adgangsnøgle (kun skrivbar)"
    },
    "service_account_json": {
      "type": "string",
      "description": "bigquery: JSON-nøgle til servicekonto med BigQuery Data Editor (kun skrivbar)"
    },
    "project_id": {
      "type": "string",
      "description": "bigquery: projekt-id (standard: fra nøglen)"
    },
    "dataset": {
      "type": "string",
      "description": "bigquery: datasæt-id"
    },
    "table": {
      "type": "string",
      "description": "bigquery/snowflake: tabelnavn (kolonner: skema v1)"
    },
    "account": {
      "type": "string",
      "description": "snowflake: kontoidentifikator, f.eks. xy12345.us-east-1 eller myorg-myaccount"
    },
    "user": {
      "type": "string",
      "description": "snowflake: bruger med godkendelse via nøglepar"
    },
    "private_key": {
      "type": "string",
      "description": "snowflake: PEM RSA-privatnøgle (kun skrivbar)"
    },
    "database": {
      "type": "string",
      "description": "snowflake: database"
    },
    "schema": {
      "type": "string",
      "description": "snowflake: skema"
    },
    "warehouse": {
      "type": "string",
      "description": "snowflake: virtuelt datavarehus"
    },
    "role": {
      "type": "string",
      "description": "snowflake: rolle (valgfri)"
    },
    "sas_url": {
      "type": "string",
      "description": "azure: SAS-URL til container med create/write-tilladelse (kun skrivbar)"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Destinations-id, f.eks. whd_7Q2K9XH3AB"
    },
    "kind": {
      "type": "string",
      "description": "s3, bigquery, snowflake eller azure"
    },
    "name": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "Hvor data sendes hen: s3://bucket/prefix, project.dataset.table, account/database.schema.table eller Azure-containeren"
    },
    "configured": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Navne på indstillinger, der er udfyldt (værdier returneres aldrig)"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Sendte websteder (pa_…). Tom betyder alle websteder"
    },
    "schedule": {
      "type": "string",
      "description": "daily: 02:00 UTC, sender den forrige UTC-dag"
    },
    "schema_version": {
      "type": "string",
      "description": "Sendt rækkeskema"
    },
    "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 Badge med besøgstæller (SVG) for et offentligt websted badges_get

Tilladelse: public · Kun HTTP (ikke et MCP-værktøj)

Eksempel
curl https://privatusanalytics.com/badge/:site_id.json
Input
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
GET /share/:token/breakdown/:dimension.json Topværdier for en delt dimension shares_breakdown

Tilladelse: public

Eksempel
curl https://privatusanalytics.com/share/:token/breakdown/:dimension.json
Input
{
  "type": "object",
  "properties": {
    "dimension": {
      "type": "string",
      "description": "Dimension for ressourcen"
    },
    "period": {
      "type": "string",
      "description": "Forudindstilling for datointerval (ignoreres, hvis linket 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å eget interval"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Slut på eget interval, inklusive"
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Ekstra filtre, hvis linket tillader dem",
      "default": []
    },
    "limit": {
      "type": "integer",
      "description": "Rækker (maks. 100)",
      "default": 10
    },
    "token": {
      "type": "string",
      "description": "Token for ressourcen"
    }
  },
  "required": [
    "dimension",
    "token"
  ]
}
Svardata
{
  "type": "object"
}
GET /share/:token.json Overblik over delt dashboard for et delingstoken shares_overview

Tilladelse: public

Eksempel
curl https://privatusanalytics.com/share/:token.json
Input
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Forudindstilling for datointerval (ignoreres, hvis linket 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å eget interval"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Slut på eget interval, inklusive"
    },
    "compare": {
      "type": "string",
      "description": "Sammenligningsperiode",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Ekstra filtre, hvis linket tillader dem: [[\"dimension\",\"operator\",\"value\"], …]",
      "default": []
    },
    "interval": {
      "type": "string",
      "description": "Størrelse på diagraminterval",
      "enum": [
        "auto",
        "minute",
        "hour",
        "day",
        "week",
        "month",
        "quarter",
        "year"
      ],
      "default": "auto"
    },
    "token": {
      "type": "string",
      "description": "Token for ressourcen"
    }
  },
  "required": [
    "token"
  ]
}
Svardata
{
  "type": "object"
}

Dokumentation

GET /docs/api.json Vis alle API-operationer og MCP-værktøjer docs_api

Tilladelse: public

Eksempel
curl https://privatusanalytics.com/docs/api.json
Input
{
  "type": "object",
  "properties": {
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater pr. side (maks. 100)"
    }
  },
  "required": []
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "tool_name": {
        "type": "string",
        "description": "MCP-værktøjsnavn 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": "Stiskabelon. Tilføj .json for JSON"
      },
      "permission": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "input_schema": {
        "type": "object",
        "description": "JSON Schema for inputtene"
      },
      "response_schema": {
        "type": "object",
        "description": "JSON Schema for `data`"
      }
    }
  }
}
GET /docs.json Vis dokumentationssider docs_list

Tilladelse: public

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

Tilladelse: public

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

section og page kommer fra sidestien /docs/<section>/<page>. Brug siden "index" til et overblik over et afsnit.

Tilladelse: public

Eksempel
curl https://privatusanalytics.com/docs/:section/:page.json
Input
{
  "type": "object",
  "properties": {
    "section": {
      "type": "string",
      "description": "Section for ressourcen"
    },
    "page": {
      "type": "string",
      "description": "Page for ressourcen"
    }
  },
  "required": [
    "section",
    "page"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "description": "Sidetitel"
    },
    "description": {
      "type": "string",
      "description": "Resumé på én linje"
    },
    "path": {
      "type": "string",
      "description": "Sidesti. Tilføj .md for Markdown eller .json for JSON"
    },
    "section": {
      "type": "string",
      "description": "Afsnittets slug, f.eks. tracker"
    },
    "headings": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Afsnit på siden (id og tekst)"
    },
    "full_markdown": {
      "type": "string",
      "description": "Siden som Markdown (titel inkluderet)"
    },
    "html": {
      "type": "string",
      "description": "Sidens indhold gengivet som HTML"
    }
  }
}

E-mailrapporter

DELETE /recipients/:id.json Fjern en modtager fra en e-mailrapport email_report_recipients_delete

Tilladelse: content.write

Eksempel
curl -X DELETE https://privatusanalytics.com/recipients/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Input
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Modtager-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": "Hvornår den seneste invitation blev sendt"
        },
        {
          "type": "null"
        }
      ]
    },
    "expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Hvornår en afventende invitation udløber"
        },
        {
          "type": "null"
        }
      ]
    },
    "confirmed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Hvornår adressen blev aktiv"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
GET /reports/:report_id/recipients.json Vis modtagerne af en e-mailrapport med deres status email_report_recipients_list

Statusser: active (modtager rapporter), pending (inviteret, endnu ikke accepteret), declined eller unsubscribed. Tilføj eller fjern adresser via rapportens modtagerliste.

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/reports/:report_id/recipients.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Kun modtagere med denne status",
      "enum": [
        "pending",
        "active",
        "declined",
        "unsubscribed"
      ]
    },
    "report_id": {
      "type": "string",
      "description": "Report for ressourcen"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater pr. side (maks. 100)"
    }
  },
  "required": [
    "report_id"
  ]
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Modtager-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": "Hvornår den seneste invitation blev sendt"
          },
          {
            "type": "null"
          }
        ]
      },
      "expires_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time",
            "description": "Hvornår en afventende invitation udløber"
          },
          {
            "type": "null"
          }
        ]
      },
      "confirmed_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time",
            "description": "Hvornår adressen blev aktiv"
          },
          {
            "type": "null"
          }
        ]
      }
    }
  }
}
POST /recipients/:id/resend.json Send en afventende rapportinvitation igen email_report_recipients_resend

Sender invitationen igen med nye links. Tilladt én gang hver 7. dag pr. adresse pr. rapport.

Tilladelse: content.write

Eksempel
curl -X POST https://privatusanalytics.com/recipients/:id/resend.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Input
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Modtager-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": "Hvornår den seneste invitation blev sendt"
        },
        {
          "type": "null"
        }
      ]
    },
    "expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Hvornår en afventende invitation udløber"
        },
        {
          "type": "null"
        }
      ]
    },
    "confirmed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Hvornår adressen blev aktiv"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
POST /workspaces/:workspace_id/reports.json Opret en e-mailrapport email_reports_create

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Websted-id'er (pa_…), der indgår i rapporten"
    },
    "frequency": {
      "type": "string",
      "description": "daily, weekly (på ugedag) eller monthly (den 1.)",
      "enum": [
        "daily",
        "weekly",
        "monthly"
      ]
    },
    "hour": {
      "type": "integer",
      "description": "Time på dagen, der sendes (0 til 23, arbejdsområdets tidszone)"
    },
    "weekday": {
      "type": "integer",
      "description": "Ugentlige rapporter: 0 = søndag … 6 = lørdag"
    },
    "recipients": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "E-mailadresser (ingen konto nødvendig). Poster kan adskilles med komma eller linjeskift. Medlemmer af arbejdsområdet tilføjes med det samme. Alle andre får en invitation og modtager først rapporter, når de har accepteret den. Adresser, der har frameldt sig rapporter, afvises"
    },
    "blocks": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Indhold: kpis, chart, pages, sources, goals, campaigns, vitals, uptime"
    },
    "attach_pdf": {
      "type": "boolean",
      "description": "Vedhæft en PDF-version"
    },
    "intro": {
      "type": "string",
      "description": "Egen introtekst (maks. 2000 tegn)"
    },
    "enabled": {
      "type": "boolean",
      "description": "Send efter planen"
    },
    "name": {
      "type": "string",
      "description": "Navn på rapporten",
      "examples": [
        "Weekly traffic"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområ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": "Websted-id'er i rapporten"
    },
    "frequency": {
      "type": "string",
      "description": "daily, weekly eller monthly"
    },
    "hour": {
      "type": "integer",
      "description": "Sendetime (arbejdsområdets tidszone)"
    },
    "weekday": {
      "type": "integer",
      "description": "Ugentligt: 0 = søndag … 6 = lørdag"
    },
    "recipients": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Alle adresser på rapporten, uanset status"
    },
    "recipient_details": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Modtager-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": "Hvornår den seneste invitation blev sendt"
              },
              {
                "type": "null"
              }
            ]
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Hvornår en afventende invitation udløber"
              },
              {
                "type": "null"
              }
            ]
          },
          "confirmed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Hvornår adressen blev aktiv"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "description": "Hver modtager med sin tilmeldingsstatus (kun aktive modtagere får rapporter)"
    },
    "blocks": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Indholdsblokke"
    },
    "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 Leveringslog for en e-mailrapport email_reports_deliveries

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/reports/:id/deliveries.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Kun leveringer med denne status",
      "enum": [
        "sent",
        "test",
        "failed",
        "skipped"
      ]
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater pr. 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 Slet en e-mailrapport email_reports_delete

Tilladelse: content.write

Eksempel
curl -X DELETE https://privatusanalytics.com/reports/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Input
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "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": "Websted-id'er i rapporten"
    },
    "frequency": {
      "type": "string",
      "description": "daily, weekly eller monthly"
    },
    "hour": {
      "type": "integer",
      "description": "Sendetime (arbejdsområdets tidszone)"
    },
    "weekday": {
      "type": "integer",
      "description": "Ugentligt: 0 = søndag … 6 = lørdag"
    },
    "recipients": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Alle adresser på rapporten, uanset status"
    },
    "recipient_details": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Modtager-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": "Hvornår den seneste invitation blev sendt"
              },
              {
                "type": "null"
              }
            ]
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Hvornår en afventende invitation udløber"
              },
              {
                "type": "null"
              }
            ]
          },
          "confirmed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Hvornår adressen blev aktiv"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "description": "Hver modtager med sin tilmeldingsstatus (kun aktive modtagere får rapporter)"
    },
    "blocks": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Indholdsblokke"
    },
    "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 Vis e-mailrapporter email_reports_list

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/reports.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "frequency": {
      "type": "string",
      "description": "Kun rapporter med denne hyppighed",
      "enum": [
        "daily",
        "weekly",
        "monthly"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater pr. 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": "Websted-id'er i rapporten"
      },
      "frequency": {
        "type": "string",
        "description": "daily, weekly eller monthly"
      },
      "hour": {
        "type": "integer",
        "description": "Sendetime (arbejdsområdets tidszone)"
      },
      "weekday": {
        "type": "integer",
        "description": "Ugentligt: 0 = søndag … 6 = lørdag"
      },
      "recipients": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Alle adresser på rapporten, uanset status"
      },
      "recipient_details": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "description": "Modtager-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": "Hvornår den seneste invitation blev sendt"
                },
                {
                  "type": "null"
                }
              ]
            },
            "expires_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Hvornår en afventende invitation udløber"
                },
                {
                  "type": "null"
                }
              ]
            },
            "confirmed_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Hvornår adressen blev aktiv"
                },
                {
                  "type": "null"
                }
              ]
            }
          }
        },
        "description": "Hver modtager med sin tilmeldingsstatus (kun aktive modtagere får rapporter)"
      },
      "blocks": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Indholdsblokke"
      },
      "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-mailrapport nu som en test email_reports_send_test

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "recipient": {
      "type": "string",
      "description": "Send testen hertil (standard: din e-mail)"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "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-mailrapport email_reports_get

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/reports/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "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": "Websted-id'er i rapporten"
    },
    "frequency": {
      "type": "string",
      "description": "daily, weekly eller monthly"
    },
    "hour": {
      "type": "integer",
      "description": "Sendetime (arbejdsområdets tidszone)"
    },
    "weekday": {
      "type": "integer",
      "description": "Ugentligt: 0 = søndag … 6 = lørdag"
    },
    "recipients": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Alle adresser på rapporten, uanset status"
    },
    "recipient_details": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Modtager-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": "Hvornår den seneste invitation blev sendt"
              },
              {
                "type": "null"
              }
            ]
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Hvornår en afventende invitation udløber"
              },
              {
                "type": "null"
              }
            ]
          },
          "confirmed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Hvornår adressen blev aktiv"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "description": "Hver modtager med sin tilmeldingsstatus (kun aktive modtagere får rapporter)"
    },
    "blocks": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Indholdsblokke"
    },
    "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 Opdatér en e-mailrapport email_reports_update

Tilladelse: content.write

Eksempel
curl -X PATCH https://privatusanalytics.com/reports/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Input
{
  "type": "object",
  "properties": {
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Websted-id'er (pa_…), der indgår i rapporten"
    },
    "frequency": {
      "type": "string",
      "description": "daily, weekly (på ugedag) eller monthly (den 1.)",
      "enum": [
        "daily",
        "weekly",
        "monthly"
      ]
    },
    "hour": {
      "type": "integer",
      "description": "Time på dagen, der sendes (0 til 23, arbejdsområdets tidszone)"
    },
    "weekday": {
      "type": "integer",
      "description": "Ugentlige rapporter: 0 = søndag … 6 = lørdag"
    },
    "recipients": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "E-mailadresser (ingen konto nødvendig). Poster kan adskilles med komma eller linjeskift. Medlemmer af arbejdsområdet tilføjes med det samme. Alle andre får en invitation og modtager først rapporter, når de har accepteret den. Adresser, der har frameldt sig rapporter, afvises"
    },
    "blocks": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Indhold: kpis, chart, pages, sources, goals, campaigns, vitals, uptime"
    },
    "attach_pdf": {
      "type": "boolean",
      "description": "Vedhæft en PDF-version"
    },
    "intro": {
      "type": "string",
      "description": "Egen introtekst (maks. 2000 tegn)"
    },
    "enabled": {
      "type": "boolean",
      "description": "Send efter planen"
    },
    "name": {
      "type": "string",
      "description": "Navn på rapporten"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "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": "Websted-id'er i rapporten"
    },
    "frequency": {
      "type": "string",
      "description": "daily, weekly eller monthly"
    },
    "hour": {
      "type": "integer",
      "description": "Sendetime (arbejdsområdets tidszone)"
    },
    "weekday": {
      "type": "integer",
      "description": "Ugentligt: 0 = søndag … 6 = lørdag"
    },
    "recipients": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Alle adresser på rapporten, uanset status"
    },
    "recipient_details": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Modtager-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": "Hvornår den seneste invitation blev sendt"
              },
              {
                "type": "null"
              }
            ]
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Hvornår en afventende invitation udløber"
              },
              {
                "type": "null"
              }
            ]
          },
          "confirmed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Hvornår adressen blev aktiv"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "description": "Hver modtager med sin tilmeldingsstatus (kun aktive modtagere får rapporter)"
    },
    "blocks": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Indholdsblokke"
    },
    "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 Acceptér en rapportinvitation report_invites_accept

Tilladelse: public · Kun HTTP (ikke et MCP-værktøj)

Eksempel
curl -X POST https://privatusanalytics.com/reports/invites/:token/accept.json \
  -H "Content-Type: application/json" -d '{…}'
Input
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Token for ressourcen"
    }
  },
  "required": [
    "token"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Modtager-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": "Hvornår den seneste invitation blev sendt"
        },
        {
          "type": "null"
        }
      ]
    },
    "expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Hvornår en afventende invitation udløber"
        },
        {
          "type": "null"
        }
      ]
    },
    "confirmed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Hvornår adressen blev aktiv"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
POST /reports/invites/:token/decline.json Afvis en rapportinvitation report_invites_decline

Tilladelse: public · Kun HTTP (ikke et MCP-værktøj)

Eksempel
curl -X POST https://privatusanalytics.com/reports/invites/:token/decline.json \
  -H "Content-Type: application/json" -d '{…}'
Input
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Token for ressourcen"
    }
  },
  "required": [
    "token"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Modtager-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": "Hvornår den seneste invitation blev sendt"
        },
        {
          "type": "null"
        }
      ]
    },
    "expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Hvornår en afventende invitation udløber"
        },
        {
          "type": "null"
        }
      ]
    },
    "confirmed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Hvornår adressen blev aktiv"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
POST /reports/resubscribe/:token.json Modtag rapporter igen efter en afmelding report_resubscribes_confirm

Tilladelse: public · Kun HTTP (ikke et MCP-værktøj)

Eksempel
curl -X POST https://privatusanalytics.com/reports/resubscribe/:token.json \
  -H "Content-Type: application/json" -d '{…}'
Input
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Token for ressourcen"
    }
  },
  "required": [
    "token"
  ]
}
Svardata
{
  "type": "object"
}
POST /reports/unsubscribe/:token/resubscribe.json Send en adresse et link til at modtage rapporter igen report_resubscribes_create

Tilladelse: public · Kun HTTP (ikke et MCP-værktøj)

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

Tilladelse: public · Kun HTTP (ikke et MCP-værktøj)

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

Eksport

POST /workspaces/:workspace_id/exports.json Sæt en eksport i kø (bygges i baggrunden) exports_create

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Websted, der skal eksporteres (pa_…)",
      "examples": [
        "pa_7Q2K9XH3AB"
      ]
    },
    "kind": {
      "type": "string",
      "description": "aggregated: målinger pr. tidsinterval og dimensioner. pageviews/events/raw: én række pr. hit (Pro og derover). imported: importerede daglige statistikker. dashboard: ZIP med oversigtspanelerne",
      "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 tidszone",
      "examples": [
        "2026-09-01"
      ]
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Sidste dag, inklusive (maks. 400 dage, raw 93 dage)",
      "examples": [
        "2026-09-28"
      ]
    },
    "timezone": {
      "type": "string",
      "description": "Tidszone for datoer og gruppering, f.eks. America/New_York (standard: webstedets tidszone)"
    },
    "grouping": {
      "type": "string",
      "description": "Tidsinterval for aggregerede eksporter",
      "enum": [
        "hour",
        "day",
        "week",
        "month",
        "quarter",
        "year"
      ],
      "default": "day"
    },
    "dimensions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Besøgsdimensioner at gruppere aggregerede eksporter efter (op til 6), f.eks. country, channel, entry_page. For importerede eksporter: de importerede dimensioner, der skal medtages",
      "default": []
    },
    "metrics": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Målinger for aggregerede eksporter (standard alle): visitors, visits, pageviews, bounce_rate, visit_duration, views_per_visit, revenue",
      "default": []
    },
    "fields": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Kolonner til eksport af pageviews/events/raw (standard er alle undtagen 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 statistik-API'et: [[\"dimension\",\"operator\",\"value\"], …]",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Anvend et gemt segment (seg_…)"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområ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": "Eksporteret websted (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": "Eksportdefinitionen (datoer, tidszone, gruppering, dimensioner, målinger, felter, filtre)"
    },
    "row_count": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Skrevne rækker"
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "anyOf": [
        {
          "type": "string",
          "description": "Hvorfor eksporten mislykkedes"
        },
        {
          "type": "null"
        }
      ]
    },
    "completed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Hvornår filen slettes"
        },
        {
          "type": "null"
        }
      ]
    },
    "download_url": {
      "anyOf": [
        {
          "type": "string",
          "description": "Sti, der returnerer et kortlivet signeret fillink (exports_download)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /exports/:id.json Slet en eksport og dens fil exports_delete

Tilladelse: analytics.export

Eksempel
curl -X DELETE https://privatusanalytics.com/exports/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Input
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Eksport-id, f.eks. exp_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Eksporteret websted (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": "Eksportdefinitionen (datoer, tidszone, gruppering, dimensioner, målinger, felter, filtre)"
    },
    "row_count": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Skrevne rækker"
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "anyOf": [
        {
          "type": "string",
          "description": "Hvorfor eksporten mislykkedes"
        },
        {
          "type": "null"
        }
      ]
    },
    "completed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Hvornår filen slettes"
        },
        {
          "type": "null"
        }
      ]
    },
    "download_url": {
      "anyOf": [
        {
          "type": "string",
          "description": "Sti, der returnerer et kortlivet signeret fillink (exports_download)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /exports/:id/download.json Hent et signeret link til filen (gyldigt i 10 minutter) exports_download

Tilladelse: analytics.export

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

Tilladelse: analytics.export

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/exports.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Kun eksporter for dette websted (pa_…)"
    },
    "status": {
      "type": "string",
      "description": "Kun eksporter med denne status",
      "enum": [
        "queued",
        "running",
        "complete",
        "failed",
        "expired"
      ]
    },
    "kind": {
      "type": "string",
      "description": "Kun eksporter af denne type",
      "enum": [
        "aggregated",
        "pageviews",
        "events",
        "imported",
        "raw",
        "dashboard"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater pr. 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": "Eksporteret websted (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": "Eksportdefinitionen (datoer, tidszone, gruppering, dimensioner, målinger, felter, filtre)"
      },
      "row_count": {
        "anyOf": [
          {
            "type": "integer",
            "description": "Skrevne rækker"
          },
          {
            "type": "null"
          }
        ]
      },
      "error": {
        "anyOf": [
          {
            "type": "string",
            "description": "Hvorfor eksporten mislykkedes"
          },
          {
            "type": "null"
          }
        ]
      },
      "completed_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "expires_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time",
            "description": "Hvornår filen slettes"
          },
          {
            "type": "null"
          }
        ]
      },
      "download_url": {
        "anyOf": [
          {
            "type": "string",
            "description": "Sti, der returnerer et kortlivet signeret fillink (exports_download)"
          },
          {
            "type": "null"
          }
        ]
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
POST /workspaces/:workspace_id/exports/preview.json Få vist en eksport: de første 20 rækker og det anslåede antal rækker exports_preview

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Websted, der skal eksporteres (pa_…)",
      "examples": [
        "pa_7Q2K9XH3AB"
      ]
    },
    "kind": {
      "type": "string",
      "description": "aggregated: målinger pr. tidsinterval og dimensioner. pageviews/events/raw: én række pr. hit (Pro og derover). imported: importerede daglige statistikker. dashboard: ZIP med oversigtspanelerne",
      "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 tidszone",
      "examples": [
        "2026-09-01"
      ]
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Sidste dag, inklusive (maks. 400 dage, raw 93 dage)",
      "examples": [
        "2026-09-28"
      ]
    },
    "timezone": {
      "type": "string",
      "description": "Tidszone for datoer og gruppering, f.eks. America/New_York (standard: webstedets tidszone)"
    },
    "grouping": {
      "type": "string",
      "description": "Tidsinterval for aggregerede eksporter",
      "enum": [
        "hour",
        "day",
        "week",
        "month",
        "quarter",
        "year"
      ],
      "default": "day"
    },
    "dimensions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Besøgsdimensioner at gruppere aggregerede eksporter efter (op til 6), f.eks. country, channel, entry_page. For importerede eksporter: de importerede dimensioner, der skal medtages",
      "default": []
    },
    "metrics": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Målinger for aggregerede eksporter (standard alle): visitors, visits, pageviews, bounce_rate, visit_duration, views_per_visit, revenue",
      "default": []
    },
    "fields": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Kolonner til eksport af pageviews/events/raw (standard er alle undtagen 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 statistik-API'et: [[\"dimension\",\"operator\",\"value\"], …]",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Anvend et gemt segment (seg_…)"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id",
    "from",
    "to",
    "workspace_id"
  ]
}
Svardata
{
  "type": "object"
}
GET /exports/:id.json Hent en eksport og dens status exports_get

Tilladelse: analytics.export

Eksempel
curl https://privatusanalytics.com/exports/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Eksport-id, f.eks. exp_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Eksporteret websted (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": "Eksportdefinitionen (datoer, tidszone, gruppering, dimensioner, målinger, felter, filtre)"
    },
    "row_count": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Skrevne rækker"
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "anyOf": [
        {
          "type": "string",
          "description": "Hvorfor eksporten mislykkedes"
        },
        {
          "type": "null"
        }
      ]
    },
    "completed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Hvornår filen slettes"
        },
        {
          "type": "null"
        }
      ]
    },
    "download_url": {
      "anyOf": [
        {
          "type": "string",
          "description": "Sti, der returnerer et kortlivet signeret fillink (exports_download)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Fakturering

POST /workspaces/:workspace_id/billing/badge.json Til- eller framelding af badge-bonussen (gratis abonnement) billing_badge

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "enabled": {
      "type": "boolean",
      "description": "true for at bekræfte badget og optjene bonussen"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområ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": "Hændelser pr. måned i det betalte niveau"
    },
    "allowance": {
      "type": "integer",
      "description": "Hændelser pr. måned inklusive eventuel badge-bonus"
    },
    "billing_interval": {
      "anyOf": [
        {
          "type": "string",
          "description": "month eller year"
        },
        {
          "type": "null"
        }
      ]
    },
    "price": {
      "anyOf": [
        {
          "type": "integer",
          "description": "USD pr. faktureringsinterval"
        },
        {
          "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 slutter"
        },
        {
          "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 (endnu ikke på abonnementet), active, rejected eller revoked"
            },
            "percent": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Procent i rabat på Pro og Business (null for det gratis open source-program)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "comp_events": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Gratis hændelser pr. måned (kun det gratis open source-program)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "organization_name": {
              "type": "string",
              "description": "Navn på organisation, skole, projekt eller bureau"
            },
            "website": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Websted"
                },
                {
                  "type": "null"
                }
              ]
            },
            "proof_url": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Link til dokumentation eller repositoriets URL"
                },
                {
                  "type": "null"
                }
              ]
            },
            "license": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "OSI-licens (open source)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "note": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Note til vurderingen"
                },
                {
                  "type": "null"
                }
              ]
            },
            "rejection_reason": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Hvorfor ansøgningen ikke blev godkendt"
                },
                {
                  "type": "null"
                }
              ]
            },
            "created_at": {
              "type": "string",
              "format": "date-time",
              "description": "Ansøgt den"
            },
            "reviewed_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Vurderet den"
                },
                {
                  "type": "null"
                }
              ]
            },
            "applied_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Rabat aktiv siden"
                },
                {
                  "type": "null"
                }
              ]
            },
            "revoked_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Program afsluttet den"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Den seneste ansøgning til et rabatprogram, eller null"
        },
        {
          "type": "null"
        }
      ]
    },
    "discount_percent": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Procent i rabat på Pro og Business fra et godkendt program, eller null"
        },
        {
          "type": "null"
        }
      ]
    },
    "billing_emails": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "tax_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "badge": {
      "type": "object",
      "description": "Badge-bonus (gratis abonnement)"
    },
    "usage": {
      "type": "object",
      "properties": {
        "month": {
          "type": "string",
          "format": "date",
          "description": "Første dag i den rapporterede måned"
        },
        "events": {
          "type": "integer",
          "description": "Fakturerbare hændelser (sidevisninger og egne hændelser)"
        },
        "bots": {
          "type": "integer",
          "description": "Bot-hits, der er filtreret fra (faktureres ikke)"
        },
        "allowance": {
          "type": "integer",
          "description": "Inkluderede hændelser, inkl. eventuel badgebonus"
        },
        "percent": {
          "type": "number",
          "description": "Hændelser i procent af kvoten"
        },
        "forecast": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Forventede hændelser ved månedens udgang"
            },
            {
              "type": "null"
            }
          ]
        },
        "forecast_percent": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "days_left": {
          "type": "integer",
          "description": "Dage tilbage af 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 egne hændelser denne måned"
              },
              "share": {
                "type": "number",
                "description": "Procent af arbejdsområdets total"
              }
            }
          },
          "description": "Hændelser pr. websted"
        },
        "history": {
          "type": "array",
          "description": "Tidligere måneder, nyeste først"
        },
        "access_locked_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Dashboards låst af Privatus Analytics-medarbejdere siden"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused": {
          "type": "boolean",
          "description": "True, mens nye hændelser kasseres (den månedlige grænse er nået, eller medarbejdere har sat indsamlingen på pause)"
        },
        "pause_reason": {
          "anyOf": [
            {
              "type": "string",
              "description": "Hvorfor indsamlingen er sat på pause: limit (den månedlige kvote er nået) eller staff. null, når der indsamles"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Hvornår medarbejdere satte indsamlingen på pause"
            },
            {
              "type": "null"
            }
          ]
        },
        "resumes_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Hvornår en pause på grund af grænsen ophører: ved starten af næste måned (UTC) eller tidligere ved en opgradering. Ellers null"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "description": "Denne måned indtil nu"
    }
  }
}
POST /workspaces/:workspace_id/billing/cancel.json Opsig ved udgangen af faktureringsperioden billing_cancel

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "reason": {
      "type": "string",
      "description": "Hovedårsag til opsigelsen (valgfri undersøgelse)",
      "enum": [
        "too_expensive",
        "missing_features",
        "switching_tool",
        "not_using",
        "temporary",
        "other"
      ]
    },
    "comment": {
      "type": "string",
      "description": "Noget, vi kunne gøre bedre"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområ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": "Hændelser pr. måned i det betalte niveau"
    },
    "allowance": {
      "type": "integer",
      "description": "Hændelser pr. måned inklusive eventuel badge-bonus"
    },
    "billing_interval": {
      "anyOf": [
        {
          "type": "string",
          "description": "month eller year"
        },
        {
          "type": "null"
        }
      ]
    },
    "price": {
      "anyOf": [
        {
          "type": "integer",
          "description": "USD pr. faktureringsinterval"
        },
        {
          "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 slutter"
        },
        {
          "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 (endnu ikke på abonnementet), active, rejected eller revoked"
            },
            "percent": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Procent i rabat på Pro og Business (null for det gratis open source-program)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "comp_events": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Gratis hændelser pr. måned (kun det gratis open source-program)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "organization_name": {
              "type": "string",
              "description": "Navn på organisation, skole, projekt eller bureau"
            },
            "website": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Websted"
                },
                {
                  "type": "null"
                }
              ]
            },
            "proof_url": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Link til dokumentation eller repositoriets URL"
                },
                {
                  "type": "null"
                }
              ]
            },
            "license": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "OSI-licens (open source)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "note": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Note til vurderingen"
                },
                {
                  "type": "null"
                }
              ]
            },
            "rejection_reason": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Hvorfor ansøgningen ikke blev godkendt"
                },
                {
                  "type": "null"
                }
              ]
            },
            "created_at": {
              "type": "string",
              "format": "date-time",
              "description": "Ansøgt den"
            },
            "reviewed_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Vurderet den"
                },
                {
                  "type": "null"
                }
              ]
            },
            "applied_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Rabat aktiv siden"
                },
                {
                  "type": "null"
                }
              ]
            },
            "revoked_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Program afsluttet den"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Den seneste ansøgning til et rabatprogram, eller null"
        },
        {
          "type": "null"
        }
      ]
    },
    "discount_percent": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Procent i rabat på Pro og Business fra et godkendt program, eller null"
        },
        {
          "type": "null"
        }
      ]
    },
    "billing_emails": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "tax_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "badge": {
      "type": "object",
      "description": "Badge-bonus (gratis abonnement)"
    },
    "usage": {
      "type": "object",
      "properties": {
        "month": {
          "type": "string",
          "format": "date",
          "description": "Første dag i den rapporterede måned"
        },
        "events": {
          "type": "integer",
          "description": "Fakturerbare hændelser (sidevisninger og egne hændelser)"
        },
        "bots": {
          "type": "integer",
          "description": "Bot-hits, der er filtreret fra (faktureres ikke)"
        },
        "allowance": {
          "type": "integer",
          "description": "Inkluderede hændelser, inkl. eventuel badgebonus"
        },
        "percent": {
          "type": "number",
          "description": "Hændelser i procent af kvoten"
        },
        "forecast": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Forventede hændelser ved månedens udgang"
            },
            {
              "type": "null"
            }
          ]
        },
        "forecast_percent": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "days_left": {
          "type": "integer",
          "description": "Dage tilbage af 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 egne hændelser denne måned"
              },
              "share": {
                "type": "number",
                "description": "Procent af arbejdsområdets total"
              }
            }
          },
          "description": "Hændelser pr. websted"
        },
        "history": {
          "type": "array",
          "description": "Tidligere måneder, nyeste først"
        },
        "access_locked_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Dashboards låst af Privatus Analytics-medarbejdere siden"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused": {
          "type": "boolean",
          "description": "True, mens nye hændelser kasseres (den månedlige grænse er nået, eller medarbejdere har sat indsamlingen på pause)"
        },
        "pause_reason": {
          "anyOf": [
            {
              "type": "string",
              "description": "Hvorfor indsamlingen er sat på pause: limit (den månedlige kvote er nået) eller staff. null, når der indsamles"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Hvornår medarbejdere satte indsamlingen på pause"
            },
            {
              "type": "null"
            }
          ]
        },
        "resumes_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Hvornår en pause på grund af grænsen ophører: ved starten af næste måned (UTC) eller tidligere ved en opgradering. Ellers null"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "description": "Denne måned indtil nu"
    }
  }
}
POST /workspaces/:workspace_id/billing/change_plan.json Skift abonnement, niveau eller interval (forholdsmæssigt) billing_change_plan

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "plan": {
      "type": "string",
      "description": "Abonnement at skifte til: pro eller business",
      "enum": [
        "pro",
        "business"
      ]
    },
    "events": {
      "type": "integer",
      "description": "Hændelser pr. måned for niveauet, fra GET /plans",
      "examples": [
        1000000
      ]
    },
    "interval": {
      "type": "string",
      "description": "Faktureringsinterval. Årligt giver 2 måneder gratis",
      "enum": [
        "month",
        "year"
      ],
      "default": "month"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområ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": "Hændelser pr. måned i det betalte niveau"
    },
    "allowance": {
      "type": "integer",
      "description": "Hændelser pr. måned inklusive eventuel badge-bonus"
    },
    "billing_interval": {
      "anyOf": [
        {
          "type": "string",
          "description": "month eller year"
        },
        {
          "type": "null"
        }
      ]
    },
    "price": {
      "anyOf": [
        {
          "type": "integer",
          "description": "USD pr. faktureringsinterval"
        },
        {
          "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 slutter"
        },
        {
          "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 (endnu ikke på abonnementet), active, rejected eller revoked"
            },
            "percent": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Procent i rabat på Pro og Business (null for det gratis open source-program)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "comp_events": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Gratis hændelser pr. måned (kun det gratis open source-program)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "organization_name": {
              "type": "string",
              "description": "Navn på organisation, skole, projekt eller bureau"
            },
            "website": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Websted"
                },
                {
                  "type": "null"
                }
              ]
            },
            "proof_url": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Link til dokumentation eller repositoriets URL"
                },
                {
                  "type": "null"
                }
              ]
            },
            "license": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "OSI-licens (open source)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "note": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Note til vurderingen"
                },
                {
                  "type": "null"
                }
              ]
            },
            "rejection_reason": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Hvorfor ansøgningen ikke blev godkendt"
                },
                {
                  "type": "null"
                }
              ]
            },
            "created_at": {
              "type": "string",
              "format": "date-time",
              "description": "Ansøgt den"
            },
            "reviewed_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Vurderet den"
                },
                {
                  "type": "null"
                }
              ]
            },
            "applied_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Rabat aktiv siden"
                },
                {
                  "type": "null"
                }
              ]
            },
            "revoked_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Program afsluttet den"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Den seneste ansøgning til et rabatprogram, eller null"
        },
        {
          "type": "null"
        }
      ]
    },
    "discount_percent": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Procent i rabat på Pro og Business fra et godkendt program, eller null"
        },
        {
          "type": "null"
        }
      ]
    },
    "billing_emails": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "tax_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "badge": {
      "type": "object",
      "description": "Badge-bonus (gratis abonnement)"
    },
    "usage": {
      "type": "object",
      "properties": {
        "month": {
          "type": "string",
          "format": "date",
          "description": "Første dag i den rapporterede måned"
        },
        "events": {
          "type": "integer",
          "description": "Fakturerbare hændelser (sidevisninger og egne hændelser)"
        },
        "bots": {
          "type": "integer",
          "description": "Bot-hits, der er filtreret fra (faktureres ikke)"
        },
        "allowance": {
          "type": "integer",
          "description": "Inkluderede hændelser, inkl. eventuel badgebonus"
        },
        "percent": {
          "type": "number",
          "description": "Hændelser i procent af kvoten"
        },
        "forecast": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Forventede hændelser ved månedens udgang"
            },
            {
              "type": "null"
            }
          ]
        },
        "forecast_percent": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "days_left": {
          "type": "integer",
          "description": "Dage tilbage af 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 egne hændelser denne måned"
              },
              "share": {
                "type": "number",
                "description": "Procent af arbejdsområdets total"
              }
            }
          },
          "description": "Hændelser pr. websted"
        },
        "history": {
          "type": "array",
          "description": "Tidligere måneder, nyeste først"
        },
        "access_locked_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Dashboards låst af Privatus Analytics-medarbejdere siden"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused": {
          "type": "boolean",
          "description": "True, mens nye hændelser kasseres (den månedlige grænse er nået, eller medarbejdere har sat indsamlingen på pause)"
        },
        "pause_reason": {
          "anyOf": [
            {
              "type": "string",
              "description": "Hvorfor indsamlingen er sat på pause: limit (den månedlige kvote er nået) eller staff. null, når der indsamles"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Hvornår medarbejdere satte indsamlingen på pause"
            },
            {
              "type": "null"
            }
          ]
        },
        "resumes_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Hvornår en pause på grund af grænsen ophører: ved starten af næste måned (UTC) eller tidligere ved en opgradering. Ellers null"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "description": "Denne måned indtil nu"
    }
  }
}
POST /workspaces/:workspace_id/billing/checkout.json Start en Paddle-betaling for et betalt abonnement billing_checkout

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "plan": {
      "type": "string",
      "description": "Abonnement at skifte til: pro eller business",
      "enum": [
        "pro",
        "business"
      ]
    },
    "events": {
      "type": "integer",
      "description": "Hændelser pr. måned for niveauet, fra GET /plans",
      "examples": [
        1000000
      ]
    },
    "interval": {
      "type": "string",
      "description": "Faktureringsinterval. Årligt giver 2 måneder gratis",
      "enum": [
        "month",
        "year"
      ],
      "default": "month"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "plan",
    "events",
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "transaction_id": {
      "type": "string",
      "description": "Paddle-transaktions-id (txn_...)"
    },
    "url": {
      "anyOf": [
        {
          "type": "string",
          "description": "URL til den hostede betaling"
        },
        {
          "type": "null"
        }
      ]
    },
    "price_id": {
      "type": "string"
    },
    "plan": {
      "type": "string"
    },
    "events": {
      "type": "integer"
    },
    "interval": {
      "type": "string"
    },
    "amount": {
      "type": "integer",
      "description": "USD pr. interval"
    },
    "client_token": {
      "anyOf": [
        {
          "type": "string",
          "description": "Paddle.js-token til klientsiden"
        },
        {
          "type": "null"
        }
      ]
    },
    "environment": {
      "type": "string",
      "description": "sandbox eller production"
    },
    "custom_data": {
      "type": "object",
      "description": "Sendes til Paddle for at knytte abonnementet"
    },
    "discount_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Paddle-rabat-id for et godkendt program, anvendt på denne checkout"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
POST /workspaces/:workspace_id/billing/discount.json Ansøg om rabat for nonprofit, uddannelse eller open source billing_discount

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "program": {
      "type": "string",
      "description": "nonprofit, education, open_source (50% rabat), open_source_free (gratis Pro op til 1M hændelser pr. måned) eller agency (20% rabat på alle arbejdsområder, du ejer)",
      "enum": [
        "nonprofit",
        "education",
        "open_source",
        "open_source_free",
        "agency"
      ]
    },
    "organization_name": {
      "type": "string",
      "description": "Navn på organisationen, skolen, projektet eller bureauet"
    },
    "website": {
      "type": "string",
      "description": "Dens websted"
    },
    "proof_url": {
      "type": "string",
      "description": "Link til dokumentation. For open source er det repositoriets URL"
    },
    "license": {
      "type": "string",
      "description": "Projektets OSI-licens (kun open source)"
    },
    "note": {
      "type": "string",
      "description": "Alt, der kan hjælpe vurderingen, op til 1.000 tegn"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområ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 (endnu ikke på abonnementet), active, rejected eller revoked"
    },
    "percent": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Procent i rabat på Pro og Business (null for det gratis open source-program)"
        },
        {
          "type": "null"
        }
      ]
    },
    "comp_events": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Gratis hændelser pr. måned (kun det gratis open source-program)"
        },
        {
          "type": "null"
        }
      ]
    },
    "organization_name": {
      "type": "string",
      "description": "Navn på organisation, skole, projekt eller bureau"
    },
    "website": {
      "anyOf": [
        {
          "type": "string",
          "description": "Websted"
        },
        {
          "type": "null"
        }
      ]
    },
    "proof_url": {
      "anyOf": [
        {
          "type": "string",
          "description": "Link til dokumentation eller repositoriets URL"
        },
        {
          "type": "null"
        }
      ]
    },
    "license": {
      "anyOf": [
        {
          "type": "string",
          "description": "OSI-licens (open source)"
        },
        {
          "type": "null"
        }
      ]
    },
    "note": {
      "anyOf": [
        {
          "type": "string",
          "description": "Note til vurderingen"
        },
        {
          "type": "null"
        }
      ]
    },
    "rejection_reason": {
      "anyOf": [
        {
          "type": "string",
          "description": "Hvorfor ansøgningen ikke blev godkendt"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Ansøgt den"
    },
    "reviewed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Vurderet den"
        },
        {
          "type": "null"
        }
      ]
    },
    "applied_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Rabat aktiv siden"
        },
        {
          "type": "null"
        }
      ]
    },
    "revoked_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Program afsluttet den"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
POST /workspaces/:workspace_id/billing/payment_method.json Hent et link til at opdatere betalingsmetoden billing_payment_method

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområ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": "Kortlivet Paddle-URL"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
POST /workspaces/:workspace_id/billing/portal.json Hent et link til Paddles kundeportal billing_portal

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområ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": "Kortlivet Paddle-URL"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
GET /workspaces/:workspace_id/billing/preview.json Få vist en ændring af abonnementet med forholdsmæssig afregning billing_preview

Tilladelse: billing.manage

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/billing/preview.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "plan": {
      "type": "string",
      "description": "Abonnement at skifte til: pro eller business",
      "enum": [
        "pro",
        "business"
      ]
    },
    "events": {
      "type": "integer",
      "description": "Hændelser pr. måned for niveauet, fra GET /plans",
      "examples": [
        1000000
      ]
    },
    "interval": {
      "type": "string",
      "description": "Faktureringsinterval. Årligt giver 2 måneder gratis",
      "enum": [
        "month",
        "year"
      ],
      "default": "month"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområ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 pr. interval"
    },
    "currency": {
      "type": "string"
    },
    "charge_minor": {
      "type": "integer",
      "description": "Opkrævet nu, i mindre enheder"
    },
    "credit_minor": {
      "type": "integer",
      "description": "Kredit for ubrugt tid, mindre enheder"
    },
    "result_action": {
      "anyOf": [
        {
          "type": "string",
          "description": "charge eller credit"
        },
        {
          "type": "null"
        }
      ]
    },
    "result_minor": {
      "type": "integer",
      "description": "Nettoopkrævning eller kredit, mindre enheder"
    },
    "next_billed_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Forbrug eller grænser, som det nye abonnement ikke ville dække"
    }
  }
}
POST /workspaces/:workspace_id/billing/resume.json Fortryd en planlagt opsigelse eller genoptag en pause billing_resume

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområ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": "Hændelser pr. måned i det betalte niveau"
    },
    "allowance": {
      "type": "integer",
      "description": "Hændelser pr. måned inklusive eventuel badge-bonus"
    },
    "billing_interval": {
      "anyOf": [
        {
          "type": "string",
          "description": "month eller year"
        },
        {
          "type": "null"
        }
      ]
    },
    "price": {
      "anyOf": [
        {
          "type": "integer",
          "description": "USD pr. faktureringsinterval"
        },
        {
          "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 slutter"
        },
        {
          "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 (endnu ikke på abonnementet), active, rejected eller revoked"
            },
            "percent": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Procent i rabat på Pro og Business (null for det gratis open source-program)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "comp_events": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Gratis hændelser pr. måned (kun det gratis open source-program)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "organization_name": {
              "type": "string",
              "description": "Navn på organisation, skole, projekt eller bureau"
            },
            "website": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Websted"
                },
                {
                  "type": "null"
                }
              ]
            },
            "proof_url": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Link til dokumentation eller repositoriets URL"
                },
                {
                  "type": "null"
                }
              ]
            },
            "license": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "OSI-licens (open source)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "note": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Note til vurderingen"
                },
                {
                  "type": "null"
                }
              ]
            },
            "rejection_reason": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Hvorfor ansøgningen ikke blev godkendt"
                },
                {
                  "type": "null"
                }
              ]
            },
            "created_at": {
              "type": "string",
              "format": "date-time",
              "description": "Ansøgt den"
            },
            "reviewed_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Vurderet den"
                },
                {
                  "type": "null"
                }
              ]
            },
            "applied_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Rabat aktiv siden"
                },
                {
                  "type": "null"
                }
              ]
            },
            "revoked_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Program afsluttet den"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Den seneste ansøgning til et rabatprogram, eller null"
        },
        {
          "type": "null"
        }
      ]
    },
    "discount_percent": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Procent i rabat på Pro og Business fra et godkendt program, eller null"
        },
        {
          "type": "null"
        }
      ]
    },
    "billing_emails": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "tax_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "badge": {
      "type": "object",
      "description": "Badge-bonus (gratis abonnement)"
    },
    "usage": {
      "type": "object",
      "properties": {
        "month": {
          "type": "string",
          "format": "date",
          "description": "Første dag i den rapporterede måned"
        },
        "events": {
          "type": "integer",
          "description": "Fakturerbare hændelser (sidevisninger og egne hændelser)"
        },
        "bots": {
          "type": "integer",
          "description": "Bot-hits, der er filtreret fra (faktureres ikke)"
        },
        "allowance": {
          "type": "integer",
          "description": "Inkluderede hændelser, inkl. eventuel badgebonus"
        },
        "percent": {
          "type": "number",
          "description": "Hændelser i procent af kvoten"
        },
        "forecast": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Forventede hændelser ved månedens udgang"
            },
            {
              "type": "null"
            }
          ]
        },
        "forecast_percent": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "days_left": {
          "type": "integer",
          "description": "Dage tilbage af 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 egne hændelser denne måned"
              },
              "share": {
                "type": "number",
                "description": "Procent af arbejdsområdets total"
              }
            }
          },
          "description": "Hændelser pr. websted"
        },
        "history": {
          "type": "array",
          "description": "Tidligere måneder, nyeste først"
        },
        "access_locked_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Dashboards låst af Privatus Analytics-medarbejdere siden"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused": {
          "type": "boolean",
          "description": "True, mens nye hændelser kasseres (den månedlige grænse er nået, eller medarbejdere har sat indsamlingen på pause)"
        },
        "pause_reason": {
          "anyOf": [
            {
              "type": "string",
              "description": "Hvorfor indsamlingen er sat på pause: limit (den månedlige kvote er nået) eller staff. null, når der indsamles"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Hvornår medarbejdere satte indsamlingen på pause"
            },
            {
              "type": "null"
            }
          ]
        },
        "resumes_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Hvornår en pause på grund af grænsen ophører: ved starten af næste måned (UTC) eller tidligere ved en opgradering. Ellers null"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "description": "Denne måned indtil nu"
    }
  }
}
GET /workspaces/:workspace_id/billing.json Hent abonnement, betaling og forbrug billing_get

Tilladelse: billing.manage

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/billing.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområ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": "Hændelser pr. måned i det betalte niveau"
    },
    "allowance": {
      "type": "integer",
      "description": "Hændelser pr. måned inklusive eventuel badge-bonus"
    },
    "billing_interval": {
      "anyOf": [
        {
          "type": "string",
          "description": "month eller year"
        },
        {
          "type": "null"
        }
      ]
    },
    "price": {
      "anyOf": [
        {
          "type": "integer",
          "description": "USD pr. faktureringsinterval"
        },
        {
          "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 slutter"
        },
        {
          "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 (endnu ikke på abonnementet), active, rejected eller revoked"
            },
            "percent": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Procent i rabat på Pro og Business (null for det gratis open source-program)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "comp_events": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Gratis hændelser pr. måned (kun det gratis open source-program)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "organization_name": {
              "type": "string",
              "description": "Navn på organisation, skole, projekt eller bureau"
            },
            "website": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Websted"
                },
                {
                  "type": "null"
                }
              ]
            },
            "proof_url": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Link til dokumentation eller repositoriets URL"
                },
                {
                  "type": "null"
                }
              ]
            },
            "license": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "OSI-licens (open source)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "note": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Note til vurderingen"
                },
                {
                  "type": "null"
                }
              ]
            },
            "rejection_reason": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Hvorfor ansøgningen ikke blev godkendt"
                },
                {
                  "type": "null"
                }
              ]
            },
            "created_at": {
              "type": "string",
              "format": "date-time",
              "description": "Ansøgt den"
            },
            "reviewed_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Vurderet den"
                },
                {
                  "type": "null"
                }
              ]
            },
            "applied_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Rabat aktiv siden"
                },
                {
                  "type": "null"
                }
              ]
            },
            "revoked_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Program afsluttet den"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Den seneste ansøgning til et rabatprogram, eller null"
        },
        {
          "type": "null"
        }
      ]
    },
    "discount_percent": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Procent i rabat på Pro og Business fra et godkendt program, eller null"
        },
        {
          "type": "null"
        }
      ]
    },
    "billing_emails": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "tax_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "badge": {
      "type": "object",
      "description": "Badge-bonus (gratis abonnement)"
    },
    "usage": {
      "type": "object",
      "properties": {
        "month": {
          "type": "string",
          "format": "date",
          "description": "Første dag i den rapporterede måned"
        },
        "events": {
          "type": "integer",
          "description": "Fakturerbare hændelser (sidevisninger og egne hændelser)"
        },
        "bots": {
          "type": "integer",
          "description": "Bot-hits, der er filtreret fra (faktureres ikke)"
        },
        "allowance": {
          "type": "integer",
          "description": "Inkluderede hændelser, inkl. eventuel badgebonus"
        },
        "percent": {
          "type": "number",
          "description": "Hændelser i procent af kvoten"
        },
        "forecast": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Forventede hændelser ved månedens udgang"
            },
            {
              "type": "null"
            }
          ]
        },
        "forecast_percent": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "days_left": {
          "type": "integer",
          "description": "Dage tilbage af 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 egne hændelser denne måned"
              },
              "share": {
                "type": "number",
                "description": "Procent af arbejdsområdets total"
              }
            }
          },
          "description": "Hændelser pr. websted"
        },
        "history": {
          "type": "array",
          "description": "Tidligere måneder, nyeste først"
        },
        "access_locked_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Dashboards låst af Privatus Analytics-medarbejdere siden"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused": {
          "type": "boolean",
          "description": "True, mens nye hændelser kasseres (den månedlige grænse er nået, eller medarbejdere har sat indsamlingen på pause)"
        },
        "pause_reason": {
          "anyOf": [
            {
              "type": "string",
              "description": "Hvorfor indsamlingen er sat på pause: limit (den månedlige kvote er nået) eller staff. null, når der indsamles"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Hvornår medarbejdere satte indsamlingen på pause"
            },
            {
              "type": "null"
            }
          ]
        },
        "resumes_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Hvornår en pause på grund af grænsen ophører: ved starten af næste måned (UTC) eller tidligere ved en opgradering. Ellers null"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "description": "Denne måned indtil nu"
    }
  }
}
PATCH /workspaces/:workspace_id/billing.json Opdatér faktureringsmails, momsnummer og automatisk opgradering billing_update

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "billing_emails": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Ekstra adresser til fakturaer og faktureringsmeddelelser (op til 5)"
    },
    "tax_id": {
      "type": "string",
      "description": "Moms- eller skattenummer vist på fakturaer"
    },
    "auto_upgrade": {
      "type": "boolean",
      "description": "true for at skifte til næste niveau og opkræve differencen, når den månedlige grænse nås, i stedet for at sætte indsamlingen på pause. Slået fra som standard"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområ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": "Hændelser pr. måned i det betalte niveau"
    },
    "allowance": {
      "type": "integer",
      "description": "Hændelser pr. måned inklusive eventuel badge-bonus"
    },
    "billing_interval": {
      "anyOf": [
        {
          "type": "string",
          "description": "month eller year"
        },
        {
          "type": "null"
        }
      ]
    },
    "price": {
      "anyOf": [
        {
          "type": "integer",
          "description": "USD pr. faktureringsinterval"
        },
        {
          "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 slutter"
        },
        {
          "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 (endnu ikke på abonnementet), active, rejected eller revoked"
            },
            "percent": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Procent i rabat på Pro og Business (null for det gratis open source-program)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "comp_events": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Gratis hændelser pr. måned (kun det gratis open source-program)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "organization_name": {
              "type": "string",
              "description": "Navn på organisation, skole, projekt eller bureau"
            },
            "website": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Websted"
                },
                {
                  "type": "null"
                }
              ]
            },
            "proof_url": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Link til dokumentation eller repositoriets URL"
                },
                {
                  "type": "null"
                }
              ]
            },
            "license": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "OSI-licens (open source)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "note": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Note til vurderingen"
                },
                {
                  "type": "null"
                }
              ]
            },
            "rejection_reason": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Hvorfor ansøgningen ikke blev godkendt"
                },
                {
                  "type": "null"
                }
              ]
            },
            "created_at": {
              "type": "string",
              "format": "date-time",
              "description": "Ansøgt den"
            },
            "reviewed_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Vurderet den"
                },
                {
                  "type": "null"
                }
              ]
            },
            "applied_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Rabat aktiv siden"
                },
                {
                  "type": "null"
                }
              ]
            },
            "revoked_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Program afsluttet den"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Den seneste ansøgning til et rabatprogram, eller null"
        },
        {
          "type": "null"
        }
      ]
    },
    "discount_percent": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Procent i rabat på Pro og Business fra et godkendt program, eller null"
        },
        {
          "type": "null"
        }
      ]
    },
    "billing_emails": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "tax_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "badge": {
      "type": "object",
      "description": "Badge-bonus (gratis abonnement)"
    },
    "usage": {
      "type": "object",
      "properties": {
        "month": {
          "type": "string",
          "format": "date",
          "description": "Første dag i den rapporterede måned"
        },
        "events": {
          "type": "integer",
          "description": "Fakturerbare hændelser (sidevisninger og egne hændelser)"
        },
        "bots": {
          "type": "integer",
          "description": "Bot-hits, der er filtreret fra (faktureres ikke)"
        },
        "allowance": {
          "type": "integer",
          "description": "Inkluderede hændelser, inkl. eventuel badgebonus"
        },
        "percent": {
          "type": "number",
          "description": "Hændelser i procent af kvoten"
        },
        "forecast": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Forventede hændelser ved månedens udgang"
            },
            {
              "type": "null"
            }
          ]
        },
        "forecast_percent": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "days_left": {
          "type": "integer",
          "description": "Dage tilbage af 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 egne hændelser denne måned"
              },
              "share": {
                "type": "number",
                "description": "Procent af arbejdsområdets total"
              }
            }
          },
          "description": "Hændelser pr. websted"
        },
        "history": {
          "type": "array",
          "description": "Tidligere måneder, nyeste først"
        },
        "access_locked_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Dashboards låst af Privatus Analytics-medarbejdere siden"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused": {
          "type": "boolean",
          "description": "True, mens nye hændelser kasseres (den månedlige grænse er nået, eller medarbejdere har sat indsamlingen på pause)"
        },
        "pause_reason": {
          "anyOf": [
            {
              "type": "string",
              "description": "Hvorfor indsamlingen er sat på pause: limit (den månedlige kvote er nået) eller staff. null, når der indsamles"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Hvornår medarbejdere satte indsamlingen på pause"
            },
            {
              "type": "null"
            }
          ]
        },
        "resumes_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Hvornår en pause på grund af grænsen ophører: ved starten af næste måned (UTC) eller tidligere ved en opgradering. Ellers null"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "description": "Denne måned indtil nu"
    }
  }
}
GET /workspaces/:workspace_id/billing/usage.json Hent denne måneds forbrug, prognose og fordeling pr. websted billing_usage

Tilladelse: billing.manage

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/billing/usage.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "month": {
      "type": "string",
      "format": "date",
      "description": "Vilkårlig dag i den måned, der skal rapporteres (standard er denne måned)",
      "examples": [
        "2026-09-01"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "month": {
      "type": "string",
      "format": "date",
      "description": "Første dag i den rapporterede måned"
    },
    "events": {
      "type": "integer",
      "description": "Fakturerbare hændelser (sidevisninger og egne hændelser)"
    },
    "bots": {
      "type": "integer",
      "description": "Bot-hits, der er filtreret fra (faktureres ikke)"
    },
    "allowance": {
      "type": "integer",
      "description": "Inkluderede hændelser, inkl. eventuel badgebonus"
    },
    "percent": {
      "type": "number",
      "description": "Hændelser i procent af kvoten"
    },
    "forecast": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Forventede hændelser ved månedens udgang"
        },
        {
          "type": "null"
        }
      ]
    },
    "forecast_percent": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "days_left": {
      "type": "integer",
      "description": "Dage tilbage af 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 egne hændelser denne måned"
          },
          "share": {
            "type": "number",
            "description": "Procent af arbejdsområdets total"
          }
        }
      },
      "description": "Hændelser pr. websted"
    },
    "history": {
      "type": "array",
      "description": "Tidligere måneder, nyeste først"
    },
    "access_locked_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Dashboards låst af Privatus Analytics-medarbejdere siden"
        },
        {
          "type": "null"
        }
      ]
    },
    "collection_paused": {
      "type": "boolean",
      "description": "True, mens nye hændelser kasseres (den månedlige grænse er nået, eller medarbejdere har sat indsamlingen på pause)"
    },
    "pause_reason": {
      "anyOf": [
        {
          "type": "string",
          "description": "Hvorfor indsamlingen er sat på pause: limit (den månedlige kvote er nået) eller staff. null, når der indsamles"
        },
        {
          "type": "null"
        }
      ]
    },
    "collection_paused_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Hvornår medarbejdere satte indsamlingen på pause"
        },
        {
          "type": "null"
        }
      ]
    },
    "resumes_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Hvornår en pause på grund af grænsen ophører: ved starten af næste måned (UTC) eller tidligere ved en opgradering. Ellers null"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
GET /workspaces/:workspace_id/billing/invoices.json Vis fakturaer billing_invoices_list

Tilladelse: billing.manage

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/billing/invoices.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater pr. side (maks. 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Paddle-transaktions-id"
      },
      "invoice_number": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "status": {
        "type": "string",
        "description": "paid, completed, payment_failed, ..."
      },
      "amount_minor": {
        "type": "integer",
        "description": "Total i mindre enheder (cent)"
      },
      "currency": {
        "type": "string"
      },
      "billed_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      }
    }
  }
}
GET /workspaces/:workspace_id/billing/invoices/:id.json Hent PDF-linket til en faktura billing_invoices_get

Tilladelse: billing.manage

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

Hjælp og feedback

POST /help.json Send et spørgsmål eller feedback til teamet bag Privatus Analytics support_message_send

Beskeden sendes med e-mail til teamet sammen med oplysninger om din konto, dit arbejdsområde og din plan. Svaret og en kvittering sendes til din kontos e-mailadresse. Op til 10 beskeder om dagen.

Tilladelse: member

Eksempel
curl -X POST https://privatusanalytics.com/help.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Input
{
  "type": "object",
  "properties": {
    "subject": {
      "type": "string",
      "description": "Hvad beskeden handler om (op til 150 tegn)",
      "examples": [
        "Funnel shows no data"
      ]
    },
    "message": {
      "type": "string",
      "description": "Dit spørgsmål eller din feedback (10 til 5.000 tegn)"
    }
  },
  "required": [
    "subject",
    "message"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "received": {
      "type": "boolean",
      "description": "Altid true, når indsendelsen blev accepteret"
    },
    "message": {
      "type": "string",
      "description": "Hvad der sker derefter"
    }
  }
}

Hændelser

GET /sites/:site_id/events/properties.json Vis nøgler til hændelsesegenskaber set inden for de seneste 30 dage event_properties_list

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/events/properties.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "event": {
      "type": "string",
      "description": "Kun nøgler set på dette rå hændelsesnavn"
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
PATCH /sites/:site_id/events/properties.json Omdøb eller skjul en nøgle til en hændelsesegenskab event_properties_update

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "key": {
      "type": "string",
      "description": "Egenskabsnøgle som gemt, f.eks. plan"
    },
    "display_name": {
      "type": "string",
      "description": "Etiket, der vises i stedet (tom fjerner den)"
    },
    "hidden": {
      "type": "boolean",
      "description": "Skjul denne nøgle i rapporter"
    },
    "export_safe": {
      "type": "boolean",
      "description": "Nøglen indeholder ingen personoplysninger, så den medtages i rå eksporter og datavarehussynkroniseringer"
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "key",
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
DELETE /sites/:site_id/events.json Slet en hændelse og dens historik (kører i baggrunden, bekræft ved at skrive navnet) events_delete

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Råt hændelsesnavn, der skal slettes"
    },
    "confirm": {
      "type": "string",
      "description": "Skriv hændelsesnavnet igen for at bekræfte"
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "confirm",
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
GET /sites/:site_id/events.json Vis hændelser med gennemførelser, besøg, konverteringsrate og først/sidst set events_list

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/events.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Forudindstilling for datointerval. Brug 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å eget interval (webstedets tidszone)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Slut på eget interval, inklusive"
    },
    "compare": {
      "type": "string",
      "description": "Sammenligningsperiode",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Start på egen sammenligning"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Slut på egen sammenligning"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Afstem ugedage i sammenligningen",
      "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. Pak betingelser ind i {\"any\": [...]} for ELLER.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Anvend et gemt segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Tilføj importerede historiske data (datoer før den første egne hændelse, ignoreres når filtre eller et segment anvendes)",
      "default": false
    },
    "search": {
      "type": "string",
      "description": "Kun hændelser, hvis navn indeholder dette"
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
POST /sites/:site_id/events/merge.json Flet flere hændelser til ét visningsnavn events_merge

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "names": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Rå hændelsesnavne, der skal flettes"
    },
    "into": {
      "type": "string",
      "description": "Visningsnavn for den flettede hændelse",
      "examples": [
        "Signup"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "names",
    "into",
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Råt hændelsesnavn som sendt af trackeren"
    },
    "display_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Navn vist i rapporter"
        },
        {
          "type": "null"
        }
      ]
    },
    "hidden": {
      "type": "boolean",
      "description": "Skjult i rapporter"
    },
    "currency": {
      "anyOf": [
        {
          "type": "string",
          "description": "Valuta for omsætning"
        },
        {
          "type": "null"
        }
      ]
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/events/detail.json Én hændelse: diagram, egenskabspivot, aggregater for talegenskaber, sider og kilder events_get

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/events/detail.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Forudindstilling for datointerval. Brug 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å eget interval (webstedets tidszone)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Slut på eget interval, inklusive"
    },
    "compare": {
      "type": "string",
      "description": "Sammenligningsperiode",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Start på egen sammenligning"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Slut på egen sammenligning"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Afstem ugedage i sammenligningen",
      "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. Pak betingelser ind i {\"any\": [...]} for ELLER.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Anvend et gemt segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Tilføj importerede historiske data (datoer før den første egne hændelse, ignoreres når filtre eller et segment anvendes)",
      "default": false
    },
    "name": {
      "type": "string",
      "description": "Hændelsesnavn som vist (efter omdøbninger)",
      "examples": [
        "Signup"
      ]
    },
    "properties": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Op til 3 egenskabsnøgler at pivotere efter",
      "default": []
    },
    "interval": {
      "type": "string",
      "description": "Størrelse på diagraminterval",
      "enum": [
        "auto",
        "minute",
        "hour",
        "day",
        "week",
        "month",
        "quarter",
        "year"
      ],
      "default": "auto"
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
PATCH /sites/:site_id/events/settings.json Omdøb, skjul eller vis en hændelse, eller angiv dens valuta events_update

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Råt hændelsesnavn som sendt af trackeren",
      "examples": [
        "signup_click"
      ]
    },
    "display_name": {
      "type": "string",
      "description": "Navn, der vises i stedet (tomt fjerner omdøbningen)"
    },
    "hidden": {
      "type": "boolean",
      "description": "Skjul i rapporter (data beholdes)"
    },
    "currency": {
      "type": "string",
      "description": "Valuta for omsætning på denne hændelse (ISO 4217)"
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Råt hændelsesnavn som sendt af trackeren"
    },
    "display_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Navn vist i rapporter"
        },
        {
          "type": "null"
        }
      ]
    },
    "hidden": {
      "type": "boolean",
      "description": "Skjult i rapporter"
    },
    "currency": {
      "anyOf": [
        {
          "type": "string",
          "description": "Valuta for omsætning"
        },
        {
          "type": "null"
        }
      ]
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Importer

GET /sites/:site_id/imports/google/properties.json Vis Google Analytics 4-ejendomme, der kan importeres imports_google_properties

Tilladelse: sites.manage

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

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "source": {
      "type": "string",
      "description": "ga4 (Google Analytics 4 API) eller det værktøj, hvis CSV-eksport du uploader",
      "enum": [
        "ga4",
        "universal_analytics",
        "fathom",
        "simple_analytics",
        "plausible",
        "matomo",
        "umami",
        "clicky"
      ]
    },
    "property_id": {
      "type": "string",
      "description": "GA4-ejendom, f.eks. properties/123 (se imports_google_properties). Påkrævet for ga4",
      "examples": [
        "properties/123456789"
      ]
    },
    "date_from": {
      "type": "string",
      "format": "date",
      "description": "Første dag, der skal importeres. Påkrævet for ga4. For CSV-filer uden datokolonne får hver række denne dato"
    },
    "date_to": {
      "type": "string",
      "format": "date",
      "description": "Sidste dag, der skal importeres (ga4 bruger som standard dagen før din første sporede hændelse, eller i går)"
    },
    "file": {
      "type": "string",
      "format": "binary",
      "description": "CSV-eksport (multipart-upload, maks. 50 MB). Påkrævet for CSV-kilder"
    },
    "dimension": {
      "type": "string",
      "description": "Hvad CSV-rækkerne opdeles efter (tilsidesætter registreringen, nødvendig for Matomo \"Label\"-eksporter)",
      "enum": [
        "total",
        "page",
        "source",
        "country",
        "device",
        "browser",
        "os"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Websted-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 importerede dag"
        },
        {
          "type": "null"
        }
      ]
    },
    "date_to": {
      "anyOf": [
        {
          "type": "string",
          "format": "date",
          "description": "Sidste importerede dag"
        },
        {
          "type": "null"
        }
      ]
    },
    "rows_imported": {
      "type": "integer",
      "description": "Gemte daglige rækker"
    },
    "error": {
      "anyOf": [
        {
          "type": "string",
          "description": "Hvorfor importen mislykkedes"
        },
        {
          "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 Slet en import og alle dens importerede data imports_delete

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "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 importerede dag"
        },
        {
          "type": "null"
        }
      ]
    },
    "date_to": {
      "anyOf": [
        {
          "type": "string",
          "format": "date",
          "description": "Sidste importerede dag"
        },
        {
          "type": "null"
        }
      ]
    },
    "rows_imported": {
      "type": "integer",
      "description": "Gemte daglige rækker"
    },
    "error": {
      "anyOf": [
        {
          "type": "string",
          "description": "Hvorfor importen mislykkedes"
        },
        {
          "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 Vis importer for et websted imports_list

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/imports.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Kun importer med denne status",
      "enum": [
        "queued",
        "running",
        "complete",
        "failed"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater pr. 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 importerede dag"
          },
          {
            "type": "null"
          }
        ]
      },
      "date_to": {
        "anyOf": [
          {
            "type": "string",
            "format": "date",
            "description": "Sidste importerede dag"
          },
          {
            "type": "null"
          }
        ]
      },
      "rows_imported": {
        "type": "integer",
        "description": "Gemte daglige rækker"
      },
      "error": {
        "anyOf": [
          {
            "type": "string",
            "description": "Hvorfor importen mislykkedes"
          },
          {
            "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 dens status imports_get

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/imports/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "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 importerede dag"
        },
        {
          "type": "null"
        }
      ]
    },
    "date_to": {
      "anyOf": [
        {
          "type": "string",
          "format": "date",
          "description": "Sidste importerede dag"
        },
        {
          "type": "null"
        }
      ]
    },
    "rows_imported": {
      "type": "integer",
      "description": "Gemte daglige rækker"
    },
    "error": {
      "anyOf": [
        {
          "type": "string",
          "description": "Hvorfor importen mislykkedes"
        },
        {
          "type": "null"
        }
      ]
    },
    "completed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Indsamling

POST /api/logs.json Send serveradgangslogs til rapportering om AI-crawlere (JSON {lines: [...]} eller kombineret logtekst, med webstedets indlæsningsnøgle som Bearer-token) crawler_logs_create

Tilladelse: public · Kun HTTP (ikke et MCP-værktøj)

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

Tilladelse: public · Kun HTTP (ikke et MCP-værktøj)

Eksempel
curl -X POST https://privatusanalytics.com/api/event.json \
  -H "Content-Type: application/json" -d '{…}'
Input
{
  "type": "object",
  "properties": {
    "site": {
      "type": "string",
      "description": "Webstedets id (pa_…)"
    },
    "type": {
      "type": "string",
      "description": "Type af hit",
      "enum": [
        "pageview",
        "event",
        "engagement",
        "vital",
        "click"
      ]
    },
    "url": {
      "type": "string",
      "description": "Fuld URL for siden"
    },
    "referrer": {
      "type": "string",
      "description": "document.referrer"
    },
    "name": {
      "type": "string",
      "description": "Hændelsesnavn (type=event) eller navn på vital"
    },
    "props": {
      "type": "object",
      "additionalProperties": true,
      "description": "Hændelsesegenskaber: op til 30 værdier af typen streng/tal/boolesk",
      "default": {}
    },
    "screen_width": {
      "type": "integer",
      "description": "Skærmbredde i pixel"
    },
    "language": {
      "type": "string",
      "description": "navigator.language"
    },
    "engaged_ms": {
      "type": "integer",
      "description": "Synlig tid på siden (engagement)"
    },
    "scroll_depth": {
      "type": "integer",
      "description": "Maks. rulledybde i % (engagement)"
    },
    "value": {
      "type": "number",
      "description": "Værdi for Web Vital (type=vital)"
    },
    "selector": {
      "type": "string",
      "description": "Vælger for det klikkede element (type=click)"
    },
    "hash_mode": {
      "type": "boolean",
      "description": "Behold #fragmentet (websteder med hash-routing)",
      "default": false
    },
    "dnt": {
      "type": "boolean",
      "description": "Do Not Track er slået til",
      "default": false
    },
    "gpc": {
      "type": "boolean",
      "description": "Global Privacy Control er slået til",
      "default": false
    },
    "interacted": {
      "type": "boolean",
      "description": "1, når et pålideligt input (markør, tast, berøring eller hjul) er set på siden, 0 før. Ingen koordinater eller tidspunkter"
    },
    "revenue": {
      "type": "number",
      "description": "Omsætning i hovedenheder, f.eks. 49.99"
    },
    "currency": {
      "type": "string",
      "description": "ISO 4217-valuta for omsætning"
    }
  },
  "required": [
    "site",
    "type",
    "url"
  ]
}
Svardata
{
  "type": "object"
}
POST /api/events.json Indsaml hændelser fra serversiden med en indlæsningsnøgle til webstedet ingest_events

Tilladelse: public · Kun HTTP (ikke et MCP-værktøj)

Eksempel
curl -X POST https://privatusanalytics.com/api/events.json \
  -H "Content-Type: application/json" -d '{…}'
Input
{
  "type": "object",
  "properties": {
    "events": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      },
      "description": "Op til 100 hændelser"
    }
  },
  "required": [
    "events"
  ]
}
Svardata
{
  "type": "object"
}
GET /api/pixel.json Indsaml en sidevisning uden JavaScript (1×1 GIF) ingest_pixel

Tilladelse: public · Kun HTTP (ikke et MCP-værktøj)

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

Kampagner

POST /sites/:site_id/campaigns/costs.json Angiv udgiften for en kampagne i en måned campaign_costs_create

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "campaign": {
      "type": "string",
      "description": "Værdi af utm_campaign, som udgiften hører til",
      "examples": [
        "spring_sale"
      ]
    },
    "month": {
      "type": "string",
      "description": "Måned, ÅÅÅÅ-MM",
      "examples": [
        "2026-09"
      ]
    },
    "amount": {
      "type": "number",
      "description": "Udgift i hovedenheder, f.eks. 1250.50"
    },
    "currency": {
      "type": "string",
      "description": "ISO 4217-valuta (standard er webstedets valuta)"
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "campaign",
    "month",
    "amount",
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id for omkostningspost"
    },
    "campaign": {
      "type": "string",
      "description": "Værdi af utm_campaign"
    },
    "month": {
      "type": "string",
      "description": "Måned, ÅÅÅÅ-MM"
    },
    "amount_minor": {
      "type": "integer",
      "description": "Udgift i mindre enheder"
    },
    "currency": {
      "type": "string",
      "description": "ISO 4217-valuta for beløbet"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:site_id/campaigns/costs/:id.json Slet en post for kampagneomkostninger campaign_costs_delete

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id for omkostningspost"
    },
    "campaign": {
      "type": "string",
      "description": "Værdi af utm_campaign"
    },
    "month": {
      "type": "string",
      "description": "Måned, ÅÅÅÅ-MM"
    },
    "amount_minor": {
      "type": "integer",
      "description": "Udgift i mindre enheder"
    },
    "currency": {
      "type": "string",
      "description": "ISO 4217-valuta for beløbet"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /sites/:site_id/campaigns/costs/import.json Importér kampagneomkostninger fra CSV (campaign,month,amount[,currency]) campaign_costs_import

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "file": {
      "type": "string",
      "format": "binary",
      "description": "CSV-filupload (multipart-formularer)"
    },
    "csv": {
      "type": "string",
      "description": "CSV-tekst: campaign,month,amount[,currency]"
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "imported": {
      "type": "integer",
      "description": "Rækker gemt"
    },
    "failed": {
      "type": "integer",
      "description": "Rækker sprunget over"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Hvorfor rækker blev sprunget over (de første 50)"
    }
  }
}
GET /sites/:site_id/campaigns/costs.json Vis poster for kampagneomkostninger campaign_costs_list

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/campaigns/costs.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "campaign": {
      "type": "string",
      "description": "Kun denne kampagne"
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater pr. side (maks. 100)"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "format": "uuid",
        "description": "Id for omkostningspost"
      },
      "campaign": {
        "type": "string",
        "description": "Værdi af utm_campaign"
      },
      "month": {
        "type": "string",
        "description": "Måned, ÅÅÅÅ-MM"
      },
      "amount_minor": {
        "type": "integer",
        "description": "Udgift i mindre enheder"
      },
      "currency": {
        "type": "string",
        "description": "ISO 4217-valuta for beløbet"
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      },
      "updated_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
PATCH /sites/:site_id/campaigns/costs/:id.json Ændr en post for kampagneomkostninger campaign_costs_update

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "campaign": {
      "type": "string",
      "description": "Værdi af utm_campaign"
    },
    "month": {
      "type": "string",
      "description": "Måned, ÅÅÅÅ-MM"
    },
    "amount": {
      "type": "number",
      "description": "Udgift i hovedenheder"
    },
    "currency": {
      "type": "string",
      "description": "ISO 4217-valuta"
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id for omkostningspost"
    },
    "campaign": {
      "type": "string",
      "description": "Værdi af utm_campaign"
    },
    "month": {
      "type": "string",
      "description": "Måned, ÅÅÅÅ-MM"
    },
    "amount_minor": {
      "type": "integer",
      "description": "Udgift i mindre enheder"
    },
    "currency": {
      "type": "string",
      "description": "ISO 4217-valuta for beløbet"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/campaigns/builder.json Opbyg og valider en URL med UTM-tags campaigns_builder

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/campaigns/builder.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "destination": {
      "type": "string",
      "description": "URL til landingssiden (https://…)",
      "examples": [
        "https://example.com/pricing"
      ]
    },
    "preset": {
      "type": "string",
      "description": "Udfyld 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": "Marketingmedium, f.eks. email, cpc"
    },
    "utm_campaign": {
      "type": "string",
      "description": "Kampagnenavn, f.eks. spring_sale"
    },
    "utm_content": {
      "type": "string",
      "description": "Variant, f.eks. header_button"
    },
    "utm_term": {
      "type": "string",
      "description": "Nøgleord til betalt søgning"
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "url": {
      "anyOf": [
        {
          "type": "string",
          "description": "URL med tags (null, mens der er fejl)"
        },
        {
          "type": "null"
        }
      ]
    },
    "valid": {
      "type": "boolean",
      "description": "True, når der ikke er fejl"
    },
    "destination": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "preset": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "utm_source": {
      "anyOf": [
        {
          "type": "string",
          "description": "Normaliseret utm_source"
        },
        {
          "type": "null"
        }
      ]
    },
    "utm_medium": {
      "anyOf": [
        {
          "type": "string",
          "description": "Normaliseret utm_medium"
        },
        {
          "type": "null"
        }
      ]
    },
    "utm_campaign": {
      "anyOf": [
        {
          "type": "string",
          "description": "Normaliseret utm_campaign"
        },
        {
          "type": "null"
        }
      ]
    },
    "utm_content": {
      "anyOf": [
        {
          "type": "string",
          "description": "Normaliseret utm_content"
        },
        {
          "type": "null"
        }
      ]
    },
    "utm_term": {
      "anyOf": [
        {
          "type": "string",
          "description": "Normaliseret utm_term"
        },
        {
          "type": "null"
        }
      ]
    },
    "issues": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "felt, niveau (error eller warning) og besked"
    },
    "presets": {
      "type": "object",
      "description": "Kanalforudindstillinger: utm_source/utm_medium pr. forudindstilling"
    }
  }
}
GET /sites/:site_id/campaigns/hygiene.json UTM-hygiejne: næsten identiske værdier, stilproblemer og ukendte kilder campaigns_hygiene

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/campaigns/hygiene.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Forudindstilling for datointerval. Brug 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å eget interval (webstedets tidszone)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Slut på eget interval, inklusive"
    },
    "compare": {
      "type": "string",
      "description": "Sammenligningsperiode",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Start på egen sammenligning"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Slut på egen sammenligning"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Afstem ugedage i sammenligningen",
      "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. Pak betingelser ind i {\"any\": [...]} for ELLER.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Anvend et gemt segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Tilføj importerede historiske data (datoer før den første egne hændelse, ignoreres når filtre eller et segment anvendes)",
      "default": false
    },
    "site_id": {
      "type": "string",
      "description": "Websted-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": "Næsten identiske værdier: felt, forslag og varianter [{value, visits}]"
    },
    "style_issues": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Værdier, der ikke er med små bogstaver og understregninger: felt, værdi, besøg, forslag"
    },
    "unknown_sources": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "utm_source-værdier, vi ikke genkender: værdi, besøg"
    }
  }
}
GET /sites/:site_id/campaigns.json Kampagneoversigt med konverteringer, omsætning, omkostninger, CPA og ROAS campaigns_list

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/campaigns.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Forudindstilling for datointerval. Brug 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å eget interval (webstedets tidszone)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Slut på eget interval, inklusive"
    },
    "compare": {
      "type": "string",
      "description": "Sammenligningsperiode",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Start på egen sammenligning"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Slut på egen sammenligning"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Afstem ugedage i sammenligningen",
      "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. Pak betingelser ind i {\"any\": [...]} for ELLER.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Anvend et gemt segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Tilføj importerede historiske data (datoer før den første egne hændelse, ignoreres når filtre eller et segment anvendes)",
      "default": false
    },
    "goal_id": {
      "type": "string",
      "description": "Mål (goal_…), hvis konverteringer skal tælles. Standard er det første aktive mål"
    },
    "site_id": {
      "type": "string",
      "description": "Websted-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": "Webstedets valuta for omsætning og omkostninger"
    },
    "goal_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Mål, der tælles som en konvertering"
        },
        {
          "type": "null"
        }
      ]
    },
    "goal_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "campaigns": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Pr. utm_campaign: visitors, visits, conversions, conversion_rate, revenue, cost, cpa (mindre enheder), roas (omsætning ÷ omkostning) og kilder [{source, medium, visitors, visits, conversions, conversion_rate, revenue}]"
    },
    "totals": {
      "type": "object",
      "description": "Summer over alle viste kampagner"
    }
  }
}

Kanalregler

POST /sites/:site_id/channel_rules.json Tilføj en kanalregel channel_rules_create

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "channel": {
      "type": "string",
      "description": "Kanalnavn, der skal tildeles, f.eks. Partnere"
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "operator": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        }
      },
      "description": "Betingelser, der alle skal matche: [{\"field\": \"utm_source\", \"operator\": \"is\", \"value\": \"newsletter\"}]. Felter: referrer_host, utm_source, utm_medium, utm_campaign, ref, path. Operatorer: is, contains, starts_with, regex."
    },
    "site_id": {
      "type": "string",
      "description": "Websted-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 tildelt, når alle betingelser matcher"
    },
    "position": {
      "type": "integer",
      "description": "Rækkefølge for evaluering (første match vinder)"
    },
    "conditions": {
      "type": "array",
      "description": "Betingelser: felt, operator, værdi"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:site_id/channel_rules/:id.json Slet en kanalregel channel_rules_delete

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Regel-id"
    },
    "channel": {
      "type": "string",
      "description": "Kanal tildelt, når alle betingelser matcher"
    },
    "position": {
      "type": "integer",
      "description": "Rækkefølge for evaluering (første match vinder)"
    },
    "conditions": {
      "type": "array",
      "description": "Betingelser: felt, operator, værdi"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/channel_rules.json Vis kanalregler i rækkefølge channel_rules_list

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/channel_rules.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Websted-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 tildelt, når alle betingelser matcher"
    },
    "position": {
      "type": "integer",
      "description": "Rækkefølge for evaluering (første match vinder)"
    },
    "conditions": {
      "type": "array",
      "description": "Betingelser: felt, operator, værdi"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
PATCH /sites/:site_id/channel_rules/:id/move.json Flyt en kanalregel op eller ned channel_rules_move

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "direction": {
      "type": "string",
      "description": "Hvortil reglen skal flyttes",
      "enum": [
        "up",
        "down",
        "top",
        "bottom"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "direction",
    "site_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Regel-id"
    },
    "channel": {
      "type": "string",
      "description": "Kanal tildelt, når alle betingelser matcher"
    },
    "position": {
      "type": "integer",
      "description": "Rækkefølge for evaluering (første match vinder)"
    },
    "conditions": {
      "type": "array",
      "description": "Betingelser: felt, operator, værdi"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /sites/:site_id/channel_rules/preview.json Få vist kanalen for en eksempelhenviser og UTM-tags channel_rules_preview

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "referrer": {
      "type": "string",
      "description": "URL eller værtsnavn for henviseren"
    },
    "utm_source": {
      "type": "string",
      "description": "Værdi af utm_source"
    },
    "utm_medium": {
      "type": "string",
      "description": "Værdi af utm_medium"
    },
    "utm_campaign": {
      "type": "string",
      "description": "Værdi af utm_campaign"
    },
    "ref": {
      "type": "string",
      "description": "Parameteren ref / via / source"
    },
    "path": {
      "type": "string",
      "description": "Sti til landingssiden, f.eks. /pricing"
    },
    "paid_click": {
      "type": "boolean",
      "description": "URL'en havde et klik-id som gclid",
      "default": false
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
PATCH /sites/:site_id/channel_rules/:id.json Ændr en kanalregel channel_rules_update

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "channel": {
      "type": "string",
      "description": "Kanalnavn, der skal tildeles"
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "operator": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        }
      },
      "description": "Betingelser, der alle skal matche: [{\"field\": \"utm_source\", \"operator\": \"is\", \"value\": \"newsletter\"}]. Felter: referrer_host, utm_source, utm_medium, utm_campaign, ref, path. Operatorer: is, contains, starts_with, regex."
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Regel-id"
    },
    "channel": {
      "type": "string",
      "description": "Kanal tildelt, når alle betingelser matcher"
    },
    "position": {
      "type": "integer",
      "description": "Rækkefølge for evaluering (første match vinder)"
    },
    "conditions": {
      "type": "array",
      "description": "Betingelser: felt, operator, værdi"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Konto

GET /account.json Hent din profil og dine indstillinger account_get

Tilladelse: member

Eksempel
curl https://privatusanalytics.com/account.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {},
  "required": []
}
Svardata
{
  "type": "object",
  "properties": {
    "email": {
      "type": "string"
    },
    "unconfirmed_email": {
      "anyOf": [
        {
          "type": "string",
          "description": "Ny e-mailadresse, der afventer bekræftelse"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "theme": {
      "type": "string"
    },
    "default_landing": {
      "type": "string"
    },
    "locale": {
      "type": "string",
      "description": "Sprogkode for appen på denne konto (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 marketing-e-mails (drip-kampagner) må sendes. false efter en afmelding"
    },
    "newsletter": {
      "type": "boolean"
    },
    "two_factor": {
      "type": "boolean"
    },
    "passkeys": {
      "type": "integer"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
PATCH /account.json Opdatér din profil og dine indstillinger account_update

Tilladelse: member

Eksempel
curl -X PATCH https://privatusanalytics.com/account.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Input
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Dit navn"
    },
    "email": {
      "type": "string",
      "description": "Ny e-mailadresse (bekræftes først via e-mail)"
    },
    "theme": {
      "type": "string",
      "description": "Farvetema",
      "enum": [
        "system",
        "light",
        "dark"
      ]
    },
    "default_landing": {
      "type": "string",
      "description": "Side efter login: sites eller last_site",
      "enum": [
        "sites",
        "last_site"
      ]
    },
    "locale": {
      "type": "string",
      "description": "Appens sprog, når du er logget ind, som en sprogkode (en, de, fr og så videre). Offentlige sider og API'et forbliver, 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": "Din tidszone (IANA-navn)"
    },
    "shortcuts_enabled": {
      "type": "boolean",
      "description": "Tastaturgenveje"
    },
    "reduce_motion": {
      "type": "boolean",
      "description": "Reducér animationer"
    },
    "product_emails": {
      "type": "boolean",
      "description": "E-mails med produktopdateringer og tips"
    },
    "marketing_emails": {
      "type": "boolean",
      "description": "Marketing-e-mails, f.eks. onboarding-tips. For at slå dem til igen efter en afmelding kræves en logget ind browser"
    },
    "newsletter": {
      "type": "boolean",
      "description": "Månedligt nyhedsbrev"
    }
  },
  "required": []
}
Svardata
{
  "type": "object",
  "properties": {
    "email": {
      "type": "string"
    },
    "unconfirmed_email": {
      "anyOf": [
        {
          "type": "string",
          "description": "Ny e-mailadresse, der afventer bekræftelse"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "theme": {
      "type": "string"
    },
    "default_landing": {
      "type": "string"
    },
    "locale": {
      "type": "string",
      "description": "Sprogkode for appen på denne konto (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 marketing-e-mails (drip-kampagner) må sendes. false efter en afmelding"
    },
    "newsletter": {
      "type": "boolean"
    },
    "two_factor": {
      "type": "boolean"
    },
    "passkeys": {
      "type": "integer"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Live

GET /sites/:site_id/live.json Live-besøgende, aktivitetsstrøm og hvad der er populært lige nu (de seneste 30 minutter) live_get

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/live.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "feed": {
      "type": "string",
      "description": "Aktivitetsstrøm: alle hits, sidevisninger eller egne hændelser",
      "enum": [
        "all",
        "pageviews",
        "events"
      ],
      "default": "all"
    },
    "limit": {
      "type": "integer",
      "description": "Poster i aktivitetsstrømmen (maks. 100)",
      "default": 50
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
GET /sites/:site_id/live/wallboard.json Wallboard-kort (live og i dag) for ét eller flere websteder live_wallboard

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/live/wallboard.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Websted-id'er at skifte mellem (standard er dette websted)",
      "default": []
    },
    "rotate_seconds": {
      "type": "integer",
      "description": "Sekunder, hvert websted vises på skærmen (5-300)",
      "default": 20
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
GET /wallboard/:token.json Wallboard for et wallboard-token (ingen login nødvendigt) live_public_wallboard

Tilladelse: public · Kun HTTP (ikke et MCP-værktøj)

Eksempel
curl https://privatusanalytics.com/wallboard/:token.json
Input
{
  "type": "object",
  "properties": {
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Websted-id'er at skifte mellem (standard er dette websted)",
      "default": []
    },
    "rotate_seconds": {
      "type": "integer",
      "description": "Sekunder, hvert websted vises på skærmen (5-300)",
      "default": 20
    },
    "token": {
      "type": "string",
      "description": "Token for ressourcen"
    }
  },
  "required": [
    "token"
  ]
}
Svardata
{
  "type": "object"
}

Medlemmer

POST /workspaces/:workspace_id/invitations.json Inviter personer via e-mail invitations_create

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "emails": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "E-mailadresser, der skal inviteres"
    },
    "role": {
      "type": "string",
      "description": "Rolle til de nye medlemmer (custom kræver custom_role_id)",
      "enum": [
        "admin",
        "editor",
        "analyst",
        "viewer",
        "billing",
        "custom"
      ],
      "default": "viewer"
    },
    "custom_role_id": {
      "type": "string",
      "description": "Id for egen rolle (Business)"
    },
    "all_sites": {
      "type": "boolean",
      "description": "Adgang til alle websteder, også fremtidige",
      "default": true
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Websted-id'er (pa_…), når all_sites er false",
      "default": []
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområ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 Tilbagekald en afventende invitation invitations_delete

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "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 Vis afventende invitationer invitations_list

Tilladelse: members.manage

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/invitations.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater pr. 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 forlad arbejdsområdet) members_delete

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Medlems-id (brug det til at opdatere 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å egen rolle"
        },
        {
          "type": "null"
        }
      ]
    },
    "custom_role_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ]
    },
    "all_sites": {
      "type": "boolean",
      "description": "Adgang til alle websteder"
    },
    "include_future_sites": {
      "type": "boolean"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Websted-id'er, når all_sites er false"
    },
    "two_factor": {
      "type": "boolean",
      "description": "Har 2FA eller en adgangsnøgle"
    },
    "last_active_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Tilmeldt"
    }
  }
}
GET /workspaces/:workspace_id/members.json Vis medlemmer af arbejdsområdet members_list

Tilladelse: member

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/members.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "description": "Filtrér efter navn eller e-mail"
    },
    "role": {
      "type": "string",
      "description": "Kun medlemmer med denne rolle",
      "enum": [
        "owner",
        "admin",
        "editor",
        "analyst",
        "viewer",
        "billing",
        "custom"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater pr. side (maks. 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "format": "uuid",
        "description": "Medlems-id (brug det til at opdatere 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å egen rolle"
          },
          {
            "type": "null"
          }
        ]
      },
      "custom_role_id": {
        "anyOf": [
          {
            "type": "string",
            "format": "uuid"
          },
          {
            "type": "null"
          }
        ]
      },
      "all_sites": {
        "type": "boolean",
        "description": "Adgang til alle websteder"
      },
      "include_future_sites": {
        "type": "boolean"
      },
      "site_ids": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Websted-id'er, når all_sites er false"
      },
      "two_factor": {
        "type": "boolean",
        "description": "Har 2FA eller en adgangsnøgle"
      },
      "last_active_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "created_at": {
        "type": "string",
        "format": "date-time",
        "description": "Tilmeldt"
      }
    }
  }
}
PATCH /workspaces/:workspace_id/members/:id.json Ændr et medlems rolle eller adgang til websteder members_update

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "role": {
      "type": "string",
      "description": "Ny rolle (custom kræver custom_role_id)",
      "enum": [
        "admin",
        "editor",
        "analyst",
        "viewer",
        "billing",
        "custom"
      ]
    },
    "custom_role_id": {
      "type": "string",
      "description": "Id for egen rolle (Business)"
    },
    "all_sites": {
      "type": "boolean",
      "description": "Adgang til alle websteder, også fremtidige"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Websted-id'er (pa_…), når all_sites er false"
    },
    "include_future_sites": {
      "type": "boolean",
      "description": "Giv også adgang til websteder, der tilføjes senere"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Medlems-id (brug det til at opdatere 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å egen rolle"
        },
        {
          "type": "null"
        }
      ]
    },
    "custom_role_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ]
    },
    "all_sites": {
      "type": "boolean",
      "description": "Adgang til alle websteder"
    },
    "include_future_sites": {
      "type": "boolean"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Websted-id'er, når all_sites er false"
    },
    "two_factor": {
      "type": "boolean",
      "description": "Har 2FA eller en adgangsnøgle"
    },
    "last_active_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Tilmeldt"
    }
  }
}
POST /workspaces/:workspace_id/ownership_transfer.json Overdrag ejerskabet af arbejdsområdet til et andet medlem (kun ejeren, du bliver administrator) ownership_transfers_create

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "membership_id": {
      "type": "string",
      "description": "Medlems-id for den nye ejer"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "membership_id",
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Medlems-id (brug det til at opdatere 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å egen rolle"
        },
        {
          "type": "null"
        }
      ]
    },
    "custom_role_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ]
    },
    "all_sites": {
      "type": "boolean",
      "description": "Adgang til alle websteder"
    },
    "include_future_sites": {
      "type": "boolean"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Websted-id'er, når all_sites er false"
    },
    "two_factor": {
      "type": "boolean",
      "description": "Har 2FA eller en adgangsnøgle"
    },
    "last_active_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Tilmeldt"
    }
  }
}

Mål

POST /sites/:site_id/goals/:id/archive.json Arkivér et mål (skjult i rapporter) goals_archive

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "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": "Mønster for sti, domæne eller fil"
        },
        {
          "type": "null"
        }
      ]
    },
    "hostname": {
      "anyOf": [
        {
          "type": "string",
          "description": "Begrænsning til værtsnavn (sidemål)"
        },
        {
          "type": "null"
        }
      ]
    },
    "event_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Navn på egen hændelse (hændelsesmål)"
        },
        {
          "type": "null"
        }
      ]
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Betingelser for hændelsesegenskaber"
    },
    "scroll_threshold": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engagement: rulning i %"
        },
        {
          "type": "null"
        }
      ]
    },
    "time_threshold_seconds": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engagement: sekunder på siden"
        },
        {
          "type": "null"
        }
      ]
    },
    "value_mode": {
      "type": "string",
      "description": "none, fixed eller revenue"
    },
    "fixed_value_minor": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Fast værdi i mindre enheder"
        },
        {
          "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": "Matchende hændelser, gentagelser inkluderet"
            },
            "conversions": {
              "type": "integer",
              "description": "Besøg med mindst én gennemførelse"
            },
            "conversion_rate": {
              "type": "number",
              "description": "Konverteringer ÷ besøg (eller ÷ besøgende, efter webstedets indstilling), %"
            },
            "value": {
              "type": "integer",
              "description": "Målets værdi i mindre enheder af webstedets valuta"
            },
            "change": {
              "anyOf": [
                {
                  "type": "number",
                  "description": "Ændring i konverteringer i forhold til den forrige periode, %"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Statistik for perioden (kun i lister)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /sites/:site_id/goals.json Opret et mål goals_create

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Navn på målet",
      "examples": [
        "Signed up"
      ]
    },
    "kind": {
      "type": "string",
      "description": "page (besøg en side), event (egen hændelse), engagement (rulning eller tid på siden), outbound (klik på udgående link) eller download (fildownload)",
      "enum": [
        "page",
        "event",
        "engagement",
        "outbound",
        "download"
      ]
    },
    "match_type": {
      "type": "string",
      "description": "Hvordan pattern matcher stien (page, engagement), linkets domæne (outbound) eller filen (download): exact, prefix, glob (*) eller regex",
      "enum": [
        "exact",
        "prefix",
        "glob",
        "regex"
      ],
      "default": "exact"
    },
    "pattern": {
      "type": "string",
      "description": "Mønster for sti, domæne eller fil, f.eks. /pricing, /blog/*, stripe.com eller *.pdf"
    },
    "hostname": {
      "type": "string",
      "description": "Tæl kun sider på dette værtsnavn (sidemål)"
    },
    "event_name": {
      "type": "string",
      "description": "Navn på egen hændelse (hændelsesmål)"
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      },
      "description": "Betingelser for hændelsesegenskaber: [{\"key\": \"plan\", \"operator\": \"is|is_not|contains|gt|lt\", \"value\": \"pro\"}]",
      "default": []
    },
    "scroll_threshold": {
      "type": "integer",
      "description": "Engagement: rulledybde i %, der skal nås"
    },
    "time_threshold_seconds": {
      "type": "integer",
      "description": "Engagement: sekunder på siden"
    },
    "value_mode": {
      "type": "string",
      "description": "none, fixed (fixed_value pr. konvertering) eller revenue (hændelsens omsætning)",
      "enum": [
        "none",
        "fixed",
        "revenue"
      ],
      "default": "none"
    },
    "fixed_value": {
      "type": "number",
      "description": "Fast værdi pr. konvertering i webstedets valuta, f.eks. 50.0"
    },
    "count_mode": {
      "type": "string",
      "description": "Værdien tælles once_per_visit eller ved hver gennemførelse",
      "enum": [
        "once_per_visit",
        "every"
      ],
      "default": "once_per_visit"
    },
    "site_id": {
      "type": "string",
      "description": "Websted-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": "Mønster for sti, domæne eller fil"
        },
        {
          "type": "null"
        }
      ]
    },
    "hostname": {
      "anyOf": [
        {
          "type": "string",
          "description": "Begrænsning til værtsnavn (sidemål)"
        },
        {
          "type": "null"
        }
      ]
    },
    "event_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Navn på egen hændelse (hændelsesmål)"
        },
        {
          "type": "null"
        }
      ]
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Betingelser for hændelsesegenskaber"
    },
    "scroll_threshold": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engagement: rulning i %"
        },
        {
          "type": "null"
        }
      ]
    },
    "time_threshold_seconds": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engagement: sekunder på siden"
        },
        {
          "type": "null"
        }
      ]
    },
    "value_mode": {
      "type": "string",
      "description": "none, fixed eller revenue"
    },
    "fixed_value_minor": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Fast værdi i mindre enheder"
        },
        {
          "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": "Matchende hændelser, gentagelser inkluderet"
            },
            "conversions": {
              "type": "integer",
              "description": "Besøg med mindst én gennemførelse"
            },
            "conversion_rate": {
              "type": "number",
              "description": "Konverteringer ÷ besøg (eller ÷ besøgende, efter webstedets indstilling), %"
            },
            "value": {
              "type": "integer",
              "description": "Målets værdi i mindre enheder af webstedets valuta"
            },
            "change": {
              "anyOf": [
                {
                  "type": "number",
                  "description": "Ændring i konverteringer i forhold til den forrige periode, %"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Statistik for perioden (kun 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 Slet et mål (data beholdes) goals_delete

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "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": "Mønster for sti, domæne eller fil"
        },
        {
          "type": "null"
        }
      ]
    },
    "hostname": {
      "anyOf": [
        {
          "type": "string",
          "description": "Begrænsning til værtsnavn (sidemål)"
        },
        {
          "type": "null"
        }
      ]
    },
    "event_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Navn på egen hændelse (hændelsesmål)"
        },
        {
          "type": "null"
        }
      ]
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Betingelser for hændelsesegenskaber"
    },
    "scroll_threshold": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engagement: rulning i %"
        },
        {
          "type": "null"
        }
      ]
    },
    "time_threshold_seconds": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engagement: sekunder på siden"
        },
        {
          "type": "null"
        }
      ]
    },
    "value_mode": {
      "type": "string",
      "description": "none, fixed eller revenue"
    },
    "fixed_value_minor": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Fast værdi i mindre enheder"
        },
        {
          "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": "Matchende hændelser, gentagelser inkluderet"
            },
            "conversions": {
              "type": "integer",
              "description": "Besøg med mindst én gennemførelse"
            },
            "conversion_rate": {
              "type": "number",
              "description": "Konverteringer ÷ besøg (eller ÷ besøgende, efter webstedets indstilling), %"
            },
            "value": {
              "type": "integer",
              "description": "Målets værdi i mindre enheder af webstedets valuta"
            },
            "change": {
              "anyOf": [
                {
                  "type": "number",
                  "description": "Ændring i konverteringer i forhold til den forrige periode, %"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Statistik for perioden (kun 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 Kopiér et mål goals_duplicate

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Navn til kopien"
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "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": "Mønster for sti, domæne eller fil"
        },
        {
          "type": "null"
        }
      ]
    },
    "hostname": {
      "anyOf": [
        {
          "type": "string",
          "description": "Begrænsning til værtsnavn (sidemål)"
        },
        {
          "type": "null"
        }
      ]
    },
    "event_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Navn på egen hændelse (hændelsesmål)"
        },
        {
          "type": "null"
        }
      ]
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Betingelser for hændelsesegenskaber"
    },
    "scroll_threshold": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engagement: rulning i %"
        },
        {
          "type": "null"
        }
      ]
    },
    "time_threshold_seconds": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engagement: sekunder på siden"
        },
        {
          "type": "null"
        }
      ]
    },
    "value_mode": {
      "type": "string",
      "description": "none, fixed eller revenue"
    },
    "fixed_value_minor": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Fast værdi i mindre enheder"
        },
        {
          "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": "Matchende hændelser, gentagelser inkluderet"
            },
            "conversions": {
              "type": "integer",
              "description": "Besøg med mindst én gennemførelse"
            },
            "conversion_rate": {
              "type": "number",
              "description": "Konverteringer ÷ besøg (eller ÷ besøgende, efter webstedets indstilling), %"
            },
            "value": {
              "type": "integer",
              "description": "Målets værdi i mindre enheder af webstedets valuta"
            },
            "change": {
              "anyOf": [
                {
                  "type": "number",
                  "description": "Ændring i konverteringer i forhold til den forrige periode, %"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Statistik for perioden (kun i lister)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/goals.json Vis mål med gennemførelser, konverteringer, rate og værdi for en periode goals_list

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/goals.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Forudindstilling for datointerval. Brug 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å eget interval (webstedets tidszone)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Slut på eget interval, inklusive"
    },
    "compare": {
      "type": "string",
      "description": "Sammenligningsperiode",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Start på egen sammenligning"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Slut på egen sammenligning"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Afstem ugedage i sammenligningen",
      "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. Pak betingelser ind i {\"any\": [...]} for ELLER.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Anvend et gemt segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Tilføj importerede historiske data (datoer før den første egne hændelse, ignoreres når filtre eller et segment anvendes)",
      "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 pr. side (maks. 100)",
      "default": 25
    },
    "site_id": {
      "type": "string",
      "description": "Websted-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": "Mønster for sti, domæne eller fil"
          },
          {
            "type": "null"
          }
        ]
      },
      "hostname": {
        "anyOf": [
          {
            "type": "string",
            "description": "Begrænsning til værtsnavn (sidemål)"
          },
          {
            "type": "null"
          }
        ]
      },
      "event_name": {
        "anyOf": [
          {
            "type": "string",
            "description": "Navn på egen hændelse (hændelsesmål)"
          },
          {
            "type": "null"
          }
        ]
      },
      "conditions": {
        "type": "array",
        "items": {
          "type": "object"
        },
        "description": "Betingelser for hændelsesegenskaber"
      },
      "scroll_threshold": {
        "anyOf": [
          {
            "type": "integer",
            "description": "Engagement: rulning i %"
          },
          {
            "type": "null"
          }
        ]
      },
      "time_threshold_seconds": {
        "anyOf": [
          {
            "type": "integer",
            "description": "Engagement: sekunder på siden"
          },
          {
            "type": "null"
          }
        ]
      },
      "value_mode": {
        "type": "string",
        "description": "none, fixed eller revenue"
      },
      "fixed_value_minor": {
        "anyOf": [
          {
            "type": "integer",
            "description": "Fast værdi i mindre enheder"
          },
          {
            "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": "Matchende hændelser, gentagelser inkluderet"
              },
              "conversions": {
                "type": "integer",
                "description": "Besøg med mindst én gennemførelse"
              },
              "conversion_rate": {
                "type": "number",
                "description": "Konverteringer ÷ besøg (eller ÷ besøgende, efter webstedets indstilling), %"
              },
              "value": {
                "type": "integer",
                "description": "Målets værdi i mindre enheder af webstedets valuta"
              },
              "change": {
                "anyOf": [
                  {
                    "type": "number",
                    "description": "Ændring i konverteringer i forhold til den forrige periode, %"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "description": "Statistik for perioden (kun 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, opdelinger og vejen til konvertering goals_get

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/goals/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Forudindstilling for datointerval. Brug 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å eget interval (webstedets tidszone)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Slut på eget interval, inklusive"
    },
    "compare": {
      "type": "string",
      "description": "Sammenligningsperiode",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Start på egen sammenligning"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Slut på egen sammenligning"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Afstem ugedage i sammenligningen",
      "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. Pak betingelser ind i {\"any\": [...]} for ELLER.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Anvend et gemt segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Tilføj importerede historiske data (datoer før den første egne hændelse, ignoreres når filtre eller et segment anvendes)",
      "default": false
    },
    "interval": {
      "type": "string",
      "description": "Størrelse på diagraminterval",
      "enum": [
        "auto",
        "minute",
        "hour",
        "day",
        "week",
        "month",
        "quarter",
        "year"
      ],
      "default": "auto"
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "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": "Mønster for sti, domæne eller fil"
            },
            {
              "type": "null"
            }
          ]
        },
        "hostname": {
          "anyOf": [
            {
              "type": "string",
              "description": "Begrænsning til værtsnavn (sidemål)"
            },
            {
              "type": "null"
            }
          ]
        },
        "event_name": {
          "anyOf": [
            {
              "type": "string",
              "description": "Navn på egen hændelse (hændelsesmål)"
            },
            {
              "type": "null"
            }
          ]
        },
        "conditions": {
          "type": "array",
          "items": {
            "type": "object"
          },
          "description": "Betingelser for hændelsesegenskaber"
        },
        "scroll_threshold": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Engagement: rulning i %"
            },
            {
              "type": "null"
            }
          ]
        },
        "time_threshold_seconds": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Engagement: sekunder på siden"
            },
            {
              "type": "null"
            }
          ]
        },
        "value_mode": {
          "type": "string",
          "description": "none, fixed eller revenue"
        },
        "fixed_value_minor": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Fast værdi i mindre enheder"
            },
            {
              "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": "Matchende hændelser, gentagelser inkluderet"
                },
                "conversions": {
                  "type": "integer",
                  "description": "Besøg med mindst én gennemførelse"
                },
                "conversion_rate": {
                  "type": "number",
                  "description": "Konverteringer ÷ besøg (eller ÷ besøgende, efter webstedets indstilling), %"
                },
                "value": {
                  "type": "integer",
                  "description": "Målets værdi i mindre enheder af webstedets valuta"
                },
                "change": {
                  "anyOf": [
                    {
                      "type": "number",
                      "description": "Ændring i konverteringer i forhold til den forrige periode, %"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "description": "Statistik for perioden (kun i lister)"
            },
            {
              "type": "null"
            }
          ]
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        }
      },
      "description": "Målets definition"
    },
    "metrics": {
      "type": "object",
      "description": "completions, conversions, conversion_rate (%), value (mindre enheder)"
    },
    "comparison_period": {
      "anyOf": [
        {
          "type": "object",
          "description": "Sammenligning from/to"
        },
        {
          "type": "null"
        }
      ]
    },
    "comparison": {
      "anyOf": [
        {
          "type": "object",
          "description": "Målinger for sammenligningsperioden"
        },
        {
          "type": "null"
        }
      ]
    },
    "change": {
      "anyOf": [
        {
          "type": "object",
          "description": "Ændring i forhold til sammenligningen, % pr. måling"
        },
        {
          "type": "null"
        }
      ]
    },
    "interval": {
      "type": "string",
      "description": "Størrelse på diagraminterval"
    },
    "series": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Pr. interval: date, completions, conversions, conversion_rate"
    },
    "breakdowns": {
      "type": "object",
      "description": "Topværdier efter 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 set tidligere i besøget, for konverterende besøg)"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
POST /sites/:site_id/goals/:id/unarchive.json Gendan et arkiveret mål goals_unarchive

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "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": "Mønster for sti, domæne eller fil"
        },
        {
          "type": "null"
        }
      ]
    },
    "hostname": {
      "anyOf": [
        {
          "type": "string",
          "description": "Begrænsning til værtsnavn (sidemål)"
        },
        {
          "type": "null"
        }
      ]
    },
    "event_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Navn på egen hændelse (hændelsesmål)"
        },
        {
          "type": "null"
        }
      ]
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Betingelser for hændelsesegenskaber"
    },
    "scroll_threshold": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engagement: rulning i %"
        },
        {
          "type": "null"
        }
      ]
    },
    "time_threshold_seconds": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engagement: sekunder på siden"
        },
        {
          "type": "null"
        }
      ]
    },
    "value_mode": {
      "type": "string",
      "description": "none, fixed eller revenue"
    },
    "fixed_value_minor": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Fast værdi i mindre enheder"
        },
        {
          "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": "Matchende hændelser, gentagelser inkluderet"
            },
            "conversions": {
              "type": "integer",
              "description": "Besøg med mindst én gennemførelse"
            },
            "conversion_rate": {
              "type": "number",
              "description": "Konverteringer ÷ besøg (eller ÷ besøgende, efter webstedets indstilling), %"
            },
            "value": {
              "type": "integer",
              "description": "Målets værdi i mindre enheder af webstedets valuta"
            },
            "change": {
              "anyOf": [
                {
                  "type": "number",
                  "description": "Ændring i konverteringer i forhold til den forrige periode, %"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Statistik for perioden (kun 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 Opdatér et mål goals_update

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Navn på målet",
      "examples": [
        "Signed up"
      ]
    },
    "kind": {
      "type": "string",
      "description": "page (besøg en side), event (egen hændelse), engagement (rulning eller tid på siden), outbound (klik på udgående link) eller download (fildownload)",
      "enum": [
        "page",
        "event",
        "engagement",
        "outbound",
        "download"
      ]
    },
    "match_type": {
      "type": "string",
      "description": "Hvordan pattern matcher stien (page, engagement), linkets domæne (outbound) eller filen (download): exact, prefix, glob (*) eller regex",
      "enum": [
        "exact",
        "prefix",
        "glob",
        "regex"
      ]
    },
    "pattern": {
      "type": "string",
      "description": "Mønster for sti, domæne eller fil, f.eks. /pricing, /blog/*, stripe.com eller *.pdf"
    },
    "hostname": {
      "type": "string",
      "description": "Tæl kun sider på dette værtsnavn (sidemål)"
    },
    "event_name": {
      "type": "string",
      "description": "Navn på egen hændelse (hændelsesmål)"
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      },
      "description": "Betingelser for hændelsesegenskaber: [{\"key\": \"plan\", \"operator\": \"is|is_not|contains|gt|lt\", \"value\": \"pro\"}]"
    },
    "scroll_threshold": {
      "type": "integer",
      "description": "Engagement: rulledybde i %, der skal nås"
    },
    "time_threshold_seconds": {
      "type": "integer",
      "description": "Engagement: sekunder på siden"
    },
    "value_mode": {
      "type": "string",
      "description": "none, fixed (fixed_value pr. konvertering) eller revenue (hændelsens omsætning)",
      "enum": [
        "none",
        "fixed",
        "revenue"
      ]
    },
    "fixed_value": {
      "type": "number",
      "description": "Fast værdi pr. konvertering i webstedets valuta, f.eks. 50.0"
    },
    "count_mode": {
      "type": "string",
      "description": "Værdien tælles once_per_visit eller ved hver gennemførelse",
      "enum": [
        "once_per_visit",
        "every"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "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": "Mønster for sti, domæne eller fil"
        },
        {
          "type": "null"
        }
      ]
    },
    "hostname": {
      "anyOf": [
        {
          "type": "string",
          "description": "Begrænsning til værtsnavn (sidemål)"
        },
        {
          "type": "null"
        }
      ]
    },
    "event_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Navn på egen hændelse (hændelsesmål)"
        },
        {
          "type": "null"
        }
      ]
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Betingelser for hændelsesegenskaber"
    },
    "scroll_threshold": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engagement: rulning i %"
        },
        {
          "type": "null"
        }
      ]
    },
    "time_threshold_seconds": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engagement: sekunder på siden"
        },
        {
          "type": "null"
        }
      ]
    },
    "value_mode": {
      "type": "string",
      "description": "none, fixed eller revenue"
    },
    "fixed_value_minor": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Fast værdi i mindre enheder"
        },
        {
          "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": "Matchende hændelser, gentagelser inkluderet"
            },
            "conversions": {
              "type": "integer",
              "description": "Besøg med mindst én gennemførelse"
            },
            "conversion_rate": {
              "type": "number",
              "description": "Konverteringer ÷ besøg (eller ÷ besøgende, efter webstedets indstilling), %"
            },
            "value": {
              "type": "integer",
              "description": "Målets værdi i mindre enheder af webstedets valuta"
            },
            "change": {
              "anyOf": [
                {
                  "type": "number",
                  "description": "Ændring i konverteringer i forhold til den forrige periode, %"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Statistik for perioden (kun i lister)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Noter

POST /sites/:site_id/notes.json Tilføj en note til et websted (brug kilden "deploy" til webhooks for udgivelser) notes_create

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "date": {
      "type": "string",
      "format": "date",
      "description": "Notens dag (webstedets tidszone). Standard er i dag"
    },
    "end_date": {
      "type": "string",
      "format": "date",
      "description": "Sidste dag, for et datointerval"
    },
    "title": {
      "type": "string",
      "description": "Kort titel vist på diagrammer",
      "examples": [
        "Launched new pricing"
      ]
    },
    "body": {
      "type": "string",
      "description": "Detaljer (Markdown)"
    },
    "url": {
      "type": "string",
      "description": "Link, f.eks. til en PR eller ændringslog"
    },
    "color": {
      "type": "string",
      "description": "Farve på nålen",
      "enum": [
        "neutral",
        "brand",
        "blue",
        "amber",
        "red",
        "violet"
      ]
    },
    "source": {
      "type": "string",
      "description": "manual eller deploy til webhooks for udgivelser",
      "enum": [
        "manual",
        "deploy",
        "system",
        "import",
        "incident"
      ],
      "default": "manual"
    },
    "version": {
      "type": "string",
      "description": "Deploys: udgivelsesversion eller commit, bruges til standardtitlen"
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Note-id, f.eks. note_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Websted, eller null for noter for hele arbejdsområ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 Slet en note notes_delete

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Note-id, f.eks. note_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Websted, eller null for noter for hele arbejdsområ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 Vis noter for et websted (inklusive noter for hele arbejdsområdet) notes_list

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/notes.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "from": {
      "type": "string",
      "format": "date",
      "description": "Kun noter på eller efter denne dato"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Kun noter på eller før denne dato"
    },
    "source": {
      "type": "string",
      "description": "Kun noter fra denne kilde",
      "enum": [
        "manual",
        "deploy",
        "system",
        "import",
        "incident"
      ]
    },
    "query": {
      "type": "string",
      "description": "Søg i titel, tekst og link"
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater pr. side (maks. 100)"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Note-id, f.eks. note_7Q2K9XH3AB"
      },
      "site_id": {
        "anyOf": [
          {
            "type": "string",
            "description": "Websted, eller null for noter for hele arbejdsområ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 en note notes_get

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/notes/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Note-id, f.eks. note_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Websted, eller null for noter for hele arbejdsområ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 Redigér en note notes_update

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "date": {
      "type": "string",
      "format": "date",
      "description": "Notens dag"
    },
    "end_date": {
      "type": "string",
      "format": "date",
      "description": "Sidste dag, for et datointerval"
    },
    "title": {
      "type": "string",
      "description": "Kort titel vist på diagrammer"
    },
    "body": {
      "type": "string",
      "description": "Detaljer (Markdown)"
    },
    "url": {
      "type": "string",
      "description": "Link"
    },
    "color": {
      "type": "string",
      "description": "Farve på nålen",
      "enum": [
        "neutral",
        "brand",
        "blue",
        "amber",
        "red",
        "violet"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Note-id, f.eks. note_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Websted, eller null for noter for hele arbejdsområ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 Tilføj en note for hele arbejdsområdet (vises på alle websteder) workspace_notes_create

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "date": {
      "type": "string",
      "format": "date",
      "description": "Notens dag (webstedets tidszone). Standard er i dag"
    },
    "end_date": {
      "type": "string",
      "format": "date",
      "description": "Sidste dag, for et datointerval"
    },
    "title": {
      "type": "string",
      "description": "Kort titel vist på diagrammer",
      "examples": [
        "Launched new pricing"
      ]
    },
    "body": {
      "type": "string",
      "description": "Detaljer (Markdown)"
    },
    "url": {
      "type": "string",
      "description": "Link, f.eks. til en PR eller ændringslog"
    },
    "color": {
      "type": "string",
      "description": "Farve på nålen",
      "enum": [
        "neutral",
        "brand",
        "blue",
        "amber",
        "red",
        "violet"
      ]
    },
    "source": {
      "type": "string",
      "description": "manual eller deploy til webhooks for udgivelser",
      "enum": [
        "manual",
        "deploy",
        "system",
        "import",
        "incident"
      ],
      "default": "manual"
    },
    "version": {
      "type": "string",
      "description": "Deploys: udgivelsesversion eller commit, bruges til standardtitlen"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Note-id, f.eks. note_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Websted, eller null for noter for hele arbejdsområ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 Slet en note for arbejdsområdet workspace_notes_delete

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Note-id, f.eks. note_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Websted, eller null for noter for hele arbejdsområ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 Vis noter på tværs af et arbejdsområde workspace_notes_list

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/notes.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "from": {
      "type": "string",
      "format": "date",
      "description": "Kun noter på eller efter denne dato"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Kun noter på eller før denne dato"
    },
    "source": {
      "type": "string",
      "description": "Kun noter fra denne kilde",
      "enum": [
        "manual",
        "deploy",
        "system",
        "import",
        "incident"
      ]
    },
    "query": {
      "type": "string",
      "description": "Søg i titel, tekst og link"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater pr. side (maks. 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Note-id, f.eks. note_7Q2K9XH3AB"
      },
      "site_id": {
        "anyOf": [
          {
            "type": "string",
            "description": "Websted, eller null for noter for hele arbejdsområ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 Redigér en note for arbejdsområdet workspace_notes_update

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "date": {
      "type": "string",
      "format": "date",
      "description": "Notens dag"
    },
    "end_date": {
      "type": "string",
      "format": "date",
      "description": "Sidste dag, for et datointerval"
    },
    "title": {
      "type": "string",
      "description": "Kort titel vist på diagrammer"
    },
    "body": {
      "type": "string",
      "description": "Detaljer (Markdown)"
    },
    "url": {
      "type": "string",
      "description": "Link"
    },
    "color": {
      "type": "string",
      "description": "Farve på nålen",
      "enum": [
        "neutral",
        "brand",
        "blue",
        "amber",
        "red",
        "violet"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Note-id, f.eks. note_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Websted, eller null for noter for hele arbejdsområ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"
    }
  }
}

Notifikationskanaler

POST /workspaces/:workspace_id/channels.json Tilføj en notifikationskanal notification_channels_create

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Webhook-URL (slack, teams, discord, webhook), HTTPS"
    },
    "secret": {
      "type": "string",
      "description": "webhook: HMAC-hemmelighed til X-Privatus-Signature"
    },
    "emails": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "email: modtageradresser (maks. 20)"
    },
    "routing_key": {
      "type": "string",
      "description": "pagerduty: integrationsnøgle til Events API v2"
    },
    "api_key": {
      "type": "string",
      "description": "opsgenie: API-integrationsnøgle"
    },
    "region": {
      "type": "string",
      "description": "opsgenie: kontoens region",
      "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": "Arbejdsområ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": "Maskeret destination"
    },
    "last_used_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /channels/:id.json Slet en notifikationskanal notification_channels_delete

Tilladelse: content.write

Eksempel
curl -X DELETE https://privatusanalytics.com/channels/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Input
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "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": "Maskeret destination"
    },
    "last_used_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /workspaces/:workspace_id/channels.json Vis notifikationskanaler notification_channels_list

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/channels.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "description": "Kun kanaler af denne type",
      "enum": [
        "email",
        "slack",
        "teams",
        "discord",
        "webhook",
        "pagerduty",
        "opsgenie",
        "push"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater pr. 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": "Maskeret destination"
      },
      "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 testbesked gennem en kanal notification_channels_send_test

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "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": "Maskeret destination"
    },
    "last_used_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /channels/:id.json Hent en notifikationskanal notification_channels_get

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/channels/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "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": "Maskeret destination"
    },
    "last_used_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
PATCH /channels/:id.json Opdatér en notifikationskanal notification_channels_update

Tilladelse: content.write

Eksempel
curl -X PATCH https://privatusanalytics.com/channels/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Input
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Webhook-URL (slack, teams, discord, webhook), HTTPS"
    },
    "secret": {
      "type": "string",
      "description": "webhook: HMAC-hemmelighed til X-Privatus-Signature"
    },
    "emails": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "email: modtageradresser (maks. 20)"
    },
    "routing_key": {
      "type": "string",
      "description": "pagerduty: integrationsnøgle til Events API v2"
    },
    "api_key": {
      "type": "string",
      "description": "opsgenie: API-integrationsnøgle"
    },
    "region": {
      "type": "string",
      "description": "opsgenie: kontoens region",
      "enum": [
        "us",
        "eu"
      ]
    },
    "name": {
      "type": "string",
      "description": "Visningsnavn"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "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": "Maskeret destination"
    },
    "last_used_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /push_subscription.json Registrér en browser til push-notifikationer push_subscriptions_create

Tilladelse: member

Eksempel
curl -X POST https://privatusanalytics.com/push_subscription.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Input
{
  "type": "object",
  "properties": {
    "endpoint": {
      "type": "string",
      "description": "PushSubscription.endpoint fra browseren"
    },
    "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": "Vært for pushtjenesten"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /push_subscription.json Fjern en browsers push-registrering push_subscriptions_delete

Tilladelse: member

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

Oppetid

POST /sites/:site_id/uptime.json Tilføj en oppetidskontrol for et websted uptime_checks_create

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Visningsnavn (standard er målet)"
    },
    "kind": {
      "type": "string",
      "description": "http (statuskode), keyword (svartekst indeholder), tcp (vært:port) eller dns (navn kan slås op)",
      "enum": [
        "http",
        "keyword",
        "tcp",
        "dns"
      ],
      "default": "http"
    },
    "url": {
      "type": "string",
      "description": "URL til http/keyword-kontroller",
      "examples": [
        "https://example.com/health"
      ]
    },
    "host": {
      "type": "string",
      "description": "Værtsnavn til tcp/dns-kontroller"
    },
    "port": {
      "type": "integer",
      "description": "TCP-port til tcp-kontroller"
    },
    "keyword": {
      "type": "string",
      "description": "Tekst, svarteksten skal indeholde (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 mellem kontroller (abonnementets minimum gælder, standard er 300 eller minimum)"
    },
    "timeout_seconds": {
      "type": "integer",
      "description": "Sekunder, før en probe udløber (1-30)",
      "default": 20
    },
    "public": {
      "type": "boolean",
      "description": "Må vises på offentlige statussider",
      "default": false
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Kontrol-id (upc_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Webstedet, kontrollen hører til"
        },
        {
          "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": "Må 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 Slet en oppetidskontrol og dens historik uptime_checks_delete

Tilladelse: uptime.manage

Eksempel
curl -X DELETE https://privatusanalytics.com/uptime/checks/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Input
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Kontrol-id (upc_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Webstedet, kontrollen hører til"
        },
        {
          "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": "Må 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 Vis et websteds oppetidskontroller uptime_checks_list

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/uptime.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Kun kontroller i denne tilstand",
      "enum": [
        "up",
        "down",
        "pending",
        "paused"
      ]
    },
    "query": {
      "type": "string",
      "description": "Filtrér efter navn eller mål"
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater pr. side (maks. 100)"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Kontrol-id (upc_…)"
      },
      "workspace_id": {
        "type": "string"
      },
      "site_id": {
        "anyOf": [
          {
            "type": "string",
            "description": "Webstedet, kontrollen hører til"
          },
          {
            "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": "Må 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 Sæt en oppetidskontrol på pause uptime_checks_pause

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Kontrol-id (upc_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Webstedet, kontrollen hører til"
        },
        {
          "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": "Må 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 Genoptag en pauset oppetidskontrol uptime_checks_resume

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Kontrol-id (upc_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Webstedet, kontrollen hører til"
        },
        {
          "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": "Må 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 oppetidskontrol: oppetid 24 t/7 d/30 d, svartider og hændelser uptime_checks_get

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/uptime/checks/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "range": {
      "type": "string",
      "description": "Vindue til diagrammet over svartid",
      "enum": [
        "24h",
        "7d",
        "30d"
      ],
      "default": "24h"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "check": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Kontrol-id (upc_…)"
        },
        "workspace_id": {
          "type": "string"
        },
        "site_id": {
          "anyOf": [
            {
              "type": "string",
              "description": "Webstedet, kontrollen hører til"
            },
            {
              "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": "Må 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": "Vindue for response_times"
    },
    "response_times": {
      "type": "object",
      "description": "Gennemsnitlig svartid i ms pr. interval: {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": "Indtil nu, hvis stadig åben"
          },
          "cause": {
            "anyOf": [
              {
                "type": "string",
                "description": "Mest almindelige fejl, f.eks. timeout eller status_503"
              },
              {
                "type": "null"
              }
            ]
          },
          "failed_locations": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    }
  }
}
PATCH /uptime/checks/:id.json Ændr en oppetidskontrol uptime_checks_update

Tilladelse: uptime.manage

Eksempel
curl -X PATCH https://privatusanalytics.com/uptime/checks/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Input
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Visningsnavn (standard er målet)"
    },
    "kind": {
      "type": "string",
      "description": "http (statuskode), keyword (svartekst indeholder), tcp (vært:port) eller dns (navn kan slås op)",
      "enum": [
        "http",
        "keyword",
        "tcp",
        "dns"
      ]
    },
    "url": {
      "type": "string",
      "description": "URL til http/keyword-kontroller",
      "examples": [
        "https://example.com/health"
      ]
    },
    "host": {
      "type": "string",
      "description": "Værtsnavn til tcp/dns-kontroller"
    },
    "port": {
      "type": "integer",
      "description": "TCP-port til tcp-kontroller"
    },
    "keyword": {
      "type": "string",
      "description": "Tekst, svarteksten skal indeholde (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 mellem kontroller (abonnementets minimum gælder, standard er 300 eller minimum)"
    },
    "timeout_seconds": {
      "type": "integer",
      "description": "Sekunder, før en probe udløber (1-30)"
    },
    "public": {
      "type": "boolean",
      "description": "Må vises på offentlige statussider"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Kontrol-id (upc_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Webstedet, kontrollen hører til"
        },
        {
          "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": "Må 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 Datacenter, User-Agent og IP-områder for udgående trafik fra probes (til tilladelseslister for vores oppetidsprobes) uptime_probes_list

Tilladelse: public · Kun HTTP (ikke et MCP-værktøj)

Eksempel
curl https://privatusanalytics.com/uptime/probes.json
Input
{
  "type": "object",
  "properties": {},
  "required": []
}
Svardata
{
  "type": "object"
}
POST /uptime/probes/results.json Indsend resultater fra en ekstern probe-agent (Bearer-token til oppetidsprobe) uptime_probes_results

Tilladelse: public · Kun HTTP (ikke et MCP-værktøj)

Eksempel
curl -X POST https://privatusanalytics.com/uptime/probes/results.json \
  -H "Content-Type: application/json" -d '{…}'
Input
{
  "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 Tilføj en oppetidskontrol for arbejdsområdet (ikke knyttet til et websted) workspace_uptime_checks_create

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Visningsnavn (standard er målet)"
    },
    "kind": {
      "type": "string",
      "description": "http (statuskode), keyword (svartekst indeholder), tcp (vært:port) eller dns (navn kan slås op)",
      "enum": [
        "http",
        "keyword",
        "tcp",
        "dns"
      ],
      "default": "http"
    },
    "url": {
      "type": "string",
      "description": "URL til http/keyword-kontroller",
      "examples": [
        "https://example.com/health"
      ]
    },
    "host": {
      "type": "string",
      "description": "Værtsnavn til tcp/dns-kontroller"
    },
    "port": {
      "type": "integer",
      "description": "TCP-port til tcp-kontroller"
    },
    "keyword": {
      "type": "string",
      "description": "Tekst, svarteksten skal indeholde (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 mellem kontroller (abonnementets minimum gælder, standard er 300 eller minimum)"
    },
    "timeout_seconds": {
      "type": "integer",
      "description": "Sekunder, før en probe udløber (1-30)",
      "default": 20
    },
    "public": {
      "type": "boolean",
      "description": "Må vises på offentlige statussider",
      "default": false
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Kontrol-id (upc_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Webstedet, kontrollen hører til"
        },
        {
          "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": "Må 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 Vis alle oppetidskontroller i et arbejdsområde workspace_uptime_checks_list

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/uptime.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Kun kontroller i denne tilstand",
      "enum": [
        "up",
        "down",
        "pending",
        "paused"
      ]
    },
    "query": {
      "type": "string",
      "description": "Filtrér efter navn eller mål"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater pr. side (maks. 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Kontrol-id (upc_…)"
      },
      "workspace_id": {
        "type": "string"
      },
      "site_id": {
        "anyOf": [
          {
            "type": "string",
            "description": "Webstedet, kontrollen hører til"
          },
          {
            "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": "Må 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"
      }
    }
  }
}

Revisionslog

GET /workspaces/:workspace_id/audit_log.json Vis poster i revisionsloggen (tilføj .csv for at eksportere) audit_logs_get

Tilladelse: workspace.manage

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/audit_log.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "actor": {
      "type": "string",
      "description": "Kun ændringer foretaget af dette medlem (e-mail)"
    },
    "item_type": {
      "type": "string",
      "description": "Kun denne type post, f.eks. Site"
    },
    "event": {
      "type": "string",
      "description": "Kun denne handling",
      "enum": [
        "create",
        "update",
        "destroy"
      ]
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Fra dato (inklusive)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Til dato (inklusive)"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater pr. 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": "Hvornår"
      },
      "event": {
        "type": "string",
        "description": "create, update eller destroy"
      },
      "item_type": {
        "type": "string",
        "description": "Type af post, f.eks. Site"
      },
      "item_id": {
        "type": "string",
        "format": "uuid"
      },
      "target": {
        "type": "string",
        "description": "Posten, med navn hvor det er kendt"
      },
      "actor_email": {
        "anyOf": [
          {
            "type": "string",
            "description": "Medlem, der foretog ændringen"
          },
          {
            "type": "null"
          }
        ]
      },
      "actor_name": {
        "type": "string"
      },
      "token_name": {
        "anyOf": [
          {
            "type": "string",
            "description": "Anvendt API-token, hvis nogen"
          },
          {
            "type": "null"
          }
        ]
      },
      "changes": {
        "type": "object",
        "description": "Ændrede felter: { field: [before, after] }"
      },
      "ip": {
        "anyOf": [
          {
            "type": "string",
            "description": "Medlemmets IP-adresse"
          },
          {
            "type": "null"
          }
        ]
      }
    }
  }
}

Roller

POST /workspaces/:workspace_id/roles.json Opret en egen rolle roles_create

Tilladelse: 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 '{…}'
Input
{
  "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": "Tilladelser, rollen giver"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "permissions",
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id for egen rolle (custom_role_id på medlemmer)"
    },
    "name": {
      "type": "string"
    },
    "permissions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Tildelte tilladelser"
    },
    "members": {
      "type": "integer",
      "description": "Medlemmer med denne rolle"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /workspaces/:workspace_id/roles/:id.json Slet en egen rolle (må ikke være i brug) roles_delete

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id for egen rolle (custom_role_id på medlemmer)"
    },
    "name": {
      "type": "string"
    },
    "permissions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Tildelte tilladelser"
    },
    "members": {
      "type": "integer",
      "description": "Medlemmer med denne rolle"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /workspaces/:workspace_id/roles.json Vis egne roller roles_list

Tilladelse: member

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

Tilladelse: 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 '{…}'
Input
{
  "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": "Tilladelser, rollen giver"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id for egen rolle (custom_role_id på medlemmer)"
    },
    "name": {
      "type": "string"
    },
    "permissions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Tildelte tilladelser"
    },
    "members": {
      "type": "integer",
      "description": "Medlemmer med denne rolle"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

SCIM

POST /scim/v2/Users.json Opret en bruger scim_users_create

Tilladelse: public · Kun HTTP (ikke et MCP-værktøj)

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

Tilladelse: public · Kun HTTP (ikke et MCP-værktøj)

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

Tilladelse: public · Kun HTTP (ikke et MCP-værktøj)

Eksempel
curl https://privatusanalytics.com/scim/v2/Users.json
Input
{
  "type": "object",
  "properties": {
    "scim_filter": {
      "type": "string",
      "description": "SCIM-filter (forespørgselsparameter `filter`), f.eks. userName eq \"[email protected]\""
    },
    "startIndex": {
      "type": "integer",
      "description": "Indeks for det første resultat, startende fra 1",
      "default": 1
    },
    "count": {
      "type": "integer",
      "description": "Sidestørrelse (maks. 200)",
      "default": 100
    }
  },
  "required": []
}
Svardata
{
  "type": "object"
}
GET /scim/v2/Users/:id.json Hent en oprettet bruger scim_users_get

Tilladelse: public · Kun HTTP (ikke et MCP-værktøj)

Eksempel
curl https://privatusanalytics.com/scim/v2/Users/:id.json
Input
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object"
}
PATCH /scim/v2/Users/:id.json Opdatér en bruger (PATCH active, name) scim_users_update

Tilladelse: public · Kun HTTP (ikke et MCP-værktøj)

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

SSO

POST /workspaces/:workspace_id/sso/activate.json Aktivér en testet SSO-konfiguration sso_activate

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområ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 vej ind (undtagen ejeren)"
    },
    "domains": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Bekræftede e-maildomæner"
    },
    "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å SSO fra (tilbage til kladde) sso_deactivate

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområ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 vej ind (undtagen ejeren)"
    },
    "domains": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Bekræftede e-maildomæner"
    },
    "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 Generér et nyt SCIM-token (vises kun én gang) sso_scim_token

Tilladelse: workspace.manage · Kun HTTP (ikke et MCP-værktøj)

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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "object"
}
GET /workspaces/:workspace_id/sso.json Hent SSO-indstillinger sso_get

Tilladelse: workspace.manage

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/sso.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområ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 vej ind (undtagen ejeren)"
    },
    "domains": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Bekræftede e-maildomæner"
    },
    "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 Opret eller opdatér SSO-indstillinger sso_update

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "protocol": {
      "type": "string",
      "description": "saml eller oidc",
      "enum": [
        "saml",
        "oidc"
      ]
    },
    "idp_sso_url": {
      "type": "string",
      "description": "SAML: IdP's URL til single sign-on"
    },
    "idp_entity_id": {
      "type": "string",
      "description": "SAML: IdP's enheds-id (udsteder)"
    },
    "idp_cert": {
      "type": "string",
      "description": "SAML: IdP's X.509-signeringscertifikat (PEM)"
    },
    "oidc_issuer": {
      "type": "string",
      "description": "OIDC: udsteder-URL (discovery)"
    },
    "oidc_client_id": {
      "type": "string",
      "description": "OIDC: klient-id"
    },
    "oidc_client_secret": {
      "type": "string",
      "description": "OIDC: klienthemmelighed (kun skrivbar)"
    },
    "domains": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Bekræftede e-maildomæner, der bruger denne SSO"
    },
    "default_role": {
      "type": "string",
      "description": "Rolle til medlemmer oprettet via JIT eller SCIM",
      "enum": [
        "admin",
        "editor",
        "analyst",
        "viewer",
        "billing"
      ]
    },
    "jit_provisioning": {
      "type": "boolean",
      "description": "Opret medlemmer ved første SSO-login"
    },
    "enforced": {
      "type": "boolean",
      "description": "Tillad kun SSO-logins (kræver en aktiv konfiguration)"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområ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 vej ind (undtagen ejeren)"
    },
    "domains": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Bekræftede e-maildomæner"
    },
    "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 Gem filtre som et segment segments_create

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Segmentnavn, f.eks. \"Mobilbesøgende fra annoncer\"",
      "examples": [
        "Mobile visitors from ads"
      ]
    },
    "description": {
      "type": "string",
      "description": "Valgfri note om, hvad segmentet bruges til (højst 300 tegn)",
      "examples": [
        "People who might buy the Pro plan"
      ]
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtre, som alle skal matche. Hvert element er en betingelse [\"dimension\", \"operator\", \"value\"] eller {\"any\": [conditions]}, når blot én af flere skal matche. Dimensioner: 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å egen hændelse) og prop:<key> (egenskab på egen hændelse). Operatorer: is, is_not, contains, not_contains, starts_with, regex, not_regex, any_of og none_of (værdien er en liste), gt og lt (et tal), between (en liste med to tal). Rækker fra segmentformularen accepteres også: {\"dimension\", \"operator\", \"value\", \"property\" (for dimensionen prop), \"join\": \"and\" eller \"or\" (or kombinerer rækken 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": "Synligt for alle med adgang til webstedet (false: kun dig)",
      "default": true
    },
    "site_id": {
      "type": "string",
      "description": "Websted-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": "Hvad segmentet bruges til, eller null"
        },
        {
          "type": "null"
        }
      ]
    },
    "filters": {
      "type": "array",
      "description": "Filtre i statistikkens filterformat: betingelser [\"dimension\", \"operator\", \"value\"], som alle skal matche, og grupper af typen {\"any\": [conditions]}"
    },
    "summary": {
      "type": "string",
      "description": "Filtrene i almindeligt sprog, f.eks. \"Besøgende fra USA på mobil, som har set /pricing\""
    },
    "shared": {
      "type": "boolean",
      "description": "Synligt for alle med adgang til webstedet"
    },
    "mine": {
      "type": "boolean",
      "description": "Oprettet af dig"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:site_id/segments/:id.json Slet et segment segments_delete

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "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": "Hvad segmentet bruges til, eller null"
        },
        {
          "type": "null"
        }
      ]
    },
    "filters": {
      "type": "array",
      "description": "Filtre i statistikkens filterformat: betingelser [\"dimension\", \"operator\", \"value\"], som alle skal matche, og grupper af typen {\"any\": [conditions]}"
    },
    "summary": {
      "type": "string",
      "description": "Filtrene i almindeligt sprog, f.eks. \"Besøgende fra USA på mobil, som har set /pricing\""
    },
    "shared": {
      "type": "boolean",
      "description": "Synligt for alle med adgang til webstedet"
    },
    "mine": {
      "type": "boolean",
      "description": "Oprettet af dig"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/segments.json Vis segmenter, du kan bruge på et websted segments_list

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/segments.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater pr. 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": "Hvad segmentet bruges til, eller null"
          },
          {
            "type": "null"
          }
        ]
      },
      "filters": {
        "type": "array",
        "description": "Filtre i statistikkens filterformat: betingelser [\"dimension\", \"operator\", \"value\"], som alle skal matche, og grupper af typen {\"any\": [conditions]}"
      },
      "summary": {
        "type": "string",
        "description": "Filtrene i almindeligt sprog, f.eks. \"Besøgende fra USA på mobil, som har set /pricing\""
      },
      "shared": {
        "type": "boolean",
        "description": "Synligt for alle med adgang til webstedet"
      },
      "mine": {
        "type": "boolean",
        "description": "Oprettet af dig"
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      },
      "updated_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
POST /sites/:site_id/segments/preview.json Beskriv filtre i almindeligt sprog, og tæl de besøgende, de matchede inden for de seneste 30 dage segments_preview

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtre, som alle skal matche. Hvert element er en betingelse [\"dimension\", \"operator\", \"value\"] eller {\"any\": [conditions]}, når blot én af flere skal matche. Dimensioner: 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å egen hændelse) og prop:<key> (egenskab på egen hændelse). Operatorer: is, is_not, contains, not_contains, starts_with, regex, not_regex, any_of og none_of (værdien er en liste), gt og lt (et tal), between (en liste med to tal). Rækker fra segmentformularen accepteres også: {\"dimension\", \"operator\", \"value\", \"property\" (for dimensionen prop), \"join\": \"and\" eller \"or\" (or kombinerer rækken 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": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
GET /sites/:site_id/segments/:id.json Hent et segment segments_get

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/segments/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "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": "Hvad segmentet bruges til, eller null"
        },
        {
          "type": "null"
        }
      ]
    },
    "filters": {
      "type": "array",
      "description": "Filtre i statistikkens filterformat: betingelser [\"dimension\", \"operator\", \"value\"], som alle skal matche, og grupper af typen {\"any\": [conditions]}"
    },
    "summary": {
      "type": "string",
      "description": "Filtrene i almindeligt sprog, f.eks. \"Besøgende fra USA på mobil, som har set /pricing\""
    },
    "shared": {
      "type": "boolean",
      "description": "Synligt for alle med adgang til webstedet"
    },
    "mine": {
      "type": "boolean",
      "description": "Oprettet af dig"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
PATCH /sites/:site_id/segments/:id.json Omdøb et segment eller ændr dets filtre eller deling segments_update

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Navn på segmentet"
    },
    "description": {
      "type": "string",
      "description": "Valgfri note om, hvad segmentet bruges til (højst 300 tegn, tom for at rydde)"
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Erstatningsfiltre i samme format som ved oprettelse. Filtre, som alle skal matche. Hvert element er en betingelse [\"dimension\", \"operator\", \"value\"] eller {\"any\": [conditions]}, når blot én af flere skal matche. Dimensioner: 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å egen hændelse) og prop:<key> (egenskab på egen hændelse). Operatorer: is, is_not, contains, not_contains, starts_with, regex, not_regex, any_of og none_of (værdien er en liste), gt og lt (et tal), between (en liste med to tal). Rækker fra segmentformularen accepteres også: {\"dimension\", \"operator\", \"value\", \"property\" (for dimensionen prop), \"join\": \"and\" eller \"or\" (or kombinerer rækken 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": "Synligt for alle på webstedet"
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "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": "Hvad segmentet bruges til, eller null"
        },
        {
          "type": "null"
        }
      ]
    },
    "filters": {
      "type": "array",
      "description": "Filtre i statistikkens filterformat: betingelser [\"dimension\", \"operator\", \"value\"], som alle skal matche, og grupper af typen {\"any\": [conditions]}"
    },
    "summary": {
      "type": "string",
      "description": "Filtrene i almindeligt sprog, f.eks. \"Besøgende fra USA på mobil, som har set /pricing\""
    },
    "shared": {
      "type": "boolean",
      "description": "Synligt for alle med adgang til webstedet"
    },
    "mine": {
      "type": "boolean",
      "description": "Oprettet af dig"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Sporing

POST /sites/:site_id/tracking/ingest_key.json Opret eller roter indlæsningsnøglen til serveren (vises kun én gang) tracking_ingest_key_rotate

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Websted-id"
    },
    "key": {
      "type": "string",
      "description": "Indlæsningsnøglen. Vises kun én gang: gem den nu. Send den som Bearer-token til POST /api/events"
    },
    "prefix": {
      "type": "string",
      "description": "Nøglepræfiks vist i indstillinger"
    }
  }
}
DELETE /sites/:site_id/tracking/ingest_key.json Tilbagekald indlæsningsnøglen til serveren tracking_ingest_key_revoke

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Websted-id brugt 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": "Begyndelsen af indlæsningsnøglen til 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": "Sporingskode i HTML"
    },
    "favorite": {
      "type": "boolean",
      "description": "Markeret med stjerne af dig"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /sites/:site_id/tracking/verify.json Kontrollér, at trackeren er installeret på webstedet (script-tag, site id, CSP og henviserpolitik) tracking_verify

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Side, der skal kontrolleres (standard er https://<domain>/)"
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
GET /sites/:site_id/tracking/snippet.json Byg sporingskoden ud fra de valgte indstillinger tracking_snippet

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/tracking/snippet.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "modules": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Valgfrie moduler: auto (udgående links, downloads, formularer, 404-fejl), engage (tid og rulning), vitals (Web Vitals), clicks",
      "default": [
        "engage"
      ]
    },
    "manual": {
      "type": "boolean",
      "description": "Slå den automatiske sidevisning fra",
      "default": false
    },
    "spa": {
      "type": "string",
      "description": "Sporing af navigation i enkeltsideapps",
      "enum": [
        "auto",
        "history",
        "hash",
        "off"
      ],
      "default": "auto"
    },
    "domains": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Spor kun på disse værtsnavne",
      "default": []
    },
    "exclude": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Stimønstre, der ikke skal spores, f.eks. /admin/*",
      "default": []
    },
    "query_params": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Ekstra forespørgselsparametre, der beholdes, f.eks. page",
      "default": []
    },
    "mask": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Maskering af stier på klientsiden, f.eks. /u/*->/u/:id",
      "default": []
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}

Statussider

GET /status/:slug/confirm/:token.json Bekræft et abonnement fra linket i e-mailen public_status_pages_confirm

Tilladelse: public · Kun HTTP (ikke et MCP-værktøj)

Eksempel
curl https://privatusanalytics.com/status/:slug/confirm/:token.json
Input
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Token for ressourcen"
    },
    "slug": {
      "type": "string",
      "description": "Slug for ressourcen"
    }
  },
  "required": [
    "token",
    "slug"
  ]
}
Svardata
{
  "type": "object"
}
GET /status/:slug.json Offentlig statusside: aktuel status, oppetidsbjælker for 90 dage, hændelser og opslag public_status_pages_get

Tilladelse: public · Kun HTTP (ikke et MCP-værktøj)

Eksempel
curl https://privatusanalytics.com/status/:slug.json
Input
{
  "type": "object",
  "properties": {
    "slug": {
      "type": "string",
      "description": "Slug for ressourcen"
    }
  },
  "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": "Opslags-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": "Seneste hændelser: {check, started_at, resolved_at, duration_seconds}"
    }
  }
}
POST /status/:slug/subscribers.json Tilmeld en e-mailadresse (dobbelt bekræftelse) public_status_pages_subscribe

Browserklienter sender et Cloudflare Turnstile-token som `cf-turnstile-response`. Forespørgsler med et API-token behøver intet.

Tilladelse: public · Kun HTTP (ikke et MCP-værktøj)

Eksempel
curl -X POST https://privatusanalytics.com/status/:slug/subscribers.json \
  -H "Content-Type: application/json" -d '{…}'
Input
{
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "description": "E-mailadresse, der skal underrettes",
      "examples": [
        "[email protected]"
      ]
    },
    "slug": {
      "type": "string",
      "description": "Slug for ressourcen"
    }
  },
  "required": [
    "email",
    "slug"
  ]
}
Svardata
{
  "type": "object"
}
POST /status/:slug/unsubscribe/:token.json Afmeld med tokenet fra e-mailen public_status_pages_unsubscribe

Tilladelse: public · Kun HTTP (ikke et MCP-værktøj)

Eksempel
curl -X POST https://privatusanalytics.com/status/:slug/unsubscribe/:token.json \
  -H "Content-Type: application/json" -d '{…}'
Input
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Token for ressourcen"
    },
    "slug": {
      "type": "string",
      "description": "Slug for ressourcen"
    }
  },
  "required": [
    "token",
    "slug"
  ]
}
Svardata
{
  "type": "object"
}
POST /status_pages/:status_page_id/posts.json Send en hændelsesopdatering (sender e-mail til abonnenter) status_page_posts_create

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "description": "Overskrift, f.eks. \"Forhøjet fejlrate\""
    },
    "body": {
      "type": "string",
      "description": "Opdateringstekst (almindelig 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": "Hvornår det skete (standard er nu)"
    },
    "notify": {
      "type": "boolean",
      "description": "Send e-mail til bekræftede abonnenter",
      "default": true
    },
    "status_page_id": {
      "type": "string",
      "description": "Status page for ressourcen"
    }
  },
  "required": [
    "title",
    "status_page_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Opslags-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 Slet et opslag på en statusside status_page_posts_delete

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "status_page_id": {
      "type": "string",
      "description": "Status page for ressourcen"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "status_page_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Opslags-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 Vis opslag på en statusside status_page_posts_list

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/status_pages/:status_page_id/posts.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Kun opslag med denne status",
      "enum": [
        "investigating",
        "identified",
        "monitoring",
        "resolved"
      ]
    },
    "status_page_id": {
      "type": "string",
      "description": "Status page for ressourcen"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater pr. side (maks. 100)"
    }
  },
  "required": [
    "status_page_id"
  ]
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Opslags-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 Redigér et opslag på en statusside status_page_posts_update

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "description": "Overskrift"
    },
    "body": {
      "type": "string",
      "description": "Opdateringstekst (almindelig tekst)"
    },
    "status": {
      "type": "string",
      "description": "investigating, identified, monitoring eller resolved",
      "enum": [
        "investigating",
        "identified",
        "monitoring",
        "resolved"
      ]
    },
    "notify": {
      "type": "boolean",
      "description": "Send e-mail til bekræftede abonnenter, hvis statussen ændres",
      "default": true
    },
    "status_page_id": {
      "type": "string",
      "description": "Status page for ressourcen"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "status_page_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Opslags-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

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "status_page_id": {
      "type": "string",
      "description": "Status page for ressourcen"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "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 Vis abonnenter på en statusside status_page_subscribers_list

Tilladelse: uptime.manage

Eksempel
curl https://privatusanalytics.com/status_pages/:status_page_id/subscribers.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "confirmed": {
      "type": "boolean",
      "description": "true: kun bekræftede, false: kun afventende"
    },
    "status_page_id": {
      "type": "string",
      "description": "Status page for ressourcen"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater pr. 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 Opret en statusside status_pages_create

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Sidetitel, f.eks. \"Acme-status\""
    },
    "slug": {
      "type": "string",
      "description": "Slug i den offentlige URL: /status/<slug> (udledes som standard af navnet)"
    },
    "description": {
      "type": "string",
      "description": "Introtekst under titlen"
    },
    "logo_url": {
      "type": "string",
      "description": "HTTPS-URL til et logobillede"
    },
    "brand_color": {
      "type": "string",
      "description": "Accentfarve, f.eks. #06755b"
    },
    "custom_domain": {
      "type": "string",
      "description": "Eget domæne (CNAME til vores vært), f.eks. status.example.com. Tomt for at fjerne"
    },
    "check_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Id'er for oppetidskontroller (upc_…), der skal vises"
    },
    "published": {
      "type": "boolean",
      "description": "Synlig for offentligheden",
      "default": true
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområ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 viste oppetidskontroller"
    },
    "subscribers": {
      "type": "integer",
      "description": "Bekræftede abonnenter"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /status_pages/:id.json Slet en statusside status_pages_delete

Tilladelse: uptime.manage

Eksempel
curl -X DELETE https://privatusanalytics.com/status_pages/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Input
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "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 viste oppetidskontroller"
    },
    "subscribers": {
      "type": "integer",
      "description": "Bekræftede abonnenter"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /workspaces/:workspace_id/status_pages.json Vis statussider status_pages_list

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/status_pages.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "description": "Filtrér efter navn eller slug"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater pr. 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 viste oppetidskontroller"
      },
      "subscribers": {
        "type": "integer",
        "description": "Bekræftede abonnenter"
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
GET /status_pages/:id.json Hent en statusside status_pages_get

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/status_pages/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "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 viste oppetidskontroller"
    },
    "subscribers": {
      "type": "integer",
      "description": "Bekræftede abonnenter"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
PATCH /status_pages/:id.json Ændr en statusside status_pages_update

Tilladelse: uptime.manage

Eksempel
curl -X PATCH https://privatusanalytics.com/status_pages/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Input
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Sidetitel, f.eks. \"Acme-status\""
    },
    "slug": {
      "type": "string",
      "description": "Slug i den offentlige URL: /status/<slug> (udledes som standard af navnet)"
    },
    "description": {
      "type": "string",
      "description": "Introtekst under titlen"
    },
    "logo_url": {
      "type": "string",
      "description": "HTTPS-URL til et logobillede"
    },
    "brand_color": {
      "type": "string",
      "description": "Accentfarve, f.eks. #06755b"
    },
    "custom_domain": {
      "type": "string",
      "description": "Eget domæne (CNAME til vores vært), f.eks. status.example.com. Tomt for at fjerne"
    },
    "check_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Id'er for oppetidskontroller (upc_…), der skal vises"
    },
    "published": {
      "type": "boolean",
      "description": "Synlig for offentligheden"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "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 viste oppetidskontroller"
    },
    "subscribers": {
      "type": "integer",
      "description": "Bekræftede abonnenter"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Søgning

GET /sites/:site_id/search.json Søgerapport: klik, visninger, CTR, position, topsøgninger og topsider, landingssider og muligheder search_report

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/search.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Forudindstilling for datointerval. Brug 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å eget interval (webstedets tidszone)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Slut på eget interval, inklusive"
    },
    "compare": {
      "type": "string",
      "description": "Sammenligningsperiode",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Start på egen sammenligning"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Slut på egen sammenligning"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Afstem ugedage i sammenligningen",
      "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. Pak betingelser ind i {\"any\": [...]} for ELLER.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Anvend et gemt segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Tilføj importerede historiske data (datoer før den første egne hændelse, ignoreres når filtre eller et segment anvendes)",
      "default": false
    },
    "provider": {
      "type": "string",
      "description": "google (Search Console) eller bing",
      "enum": [
        "google",
        "bing"
      ],
      "default": "google"
    },
    "limit": {
      "type": "integer",
      "description": "Rækker pr. tabel (maks. 100)",
      "default": 25
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
POST /sites/:site_id/search/connections.json Forbind en Search Console-ejendom eller et Bing-websted search_connect

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "provider": {
      "type": "string",
      "description": "google eller bing",
      "enum": [
        "google",
        "bing"
      ],
      "default": "google"
    },
    "property": {
      "type": "string",
      "description": "Search Console-ejendom (f.eks. sc-domain:example.com) eller Bing-webstedets URL",
      "examples": [
        "sc-domain:example.com"
      ]
    },
    "bing_api_key": {
      "type": "string",
      "description": "Din egen API-nøgle til Bing Webmaster Tools (Settings > API access). Påkrævet, når provider er bing. Gemmes krypteret og returneres aldrig."
    },
    "site_id": {
      "type": "string",
      "description": "Websted-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-ejendom eller Bing-webstedets 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 Afbryd Search Console eller Bing og slet dets data search_disconnect

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    },
    "provider": {
      "type": "string",
      "description": "Provider for ressourcen"
    }
  },
  "required": [
    "site_id",
    "provider"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "provider": {
      "type": "string",
      "description": "google eller bing"
    },
    "property": {
      "type": "string",
      "description": "Search Console-ejendom eller Bing-webstedets 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 Vis ejendomme, du kan forbinde (Search Console kræver en Google-godkendelse fra browseren) search_properties

Tilladelse: 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 '{…}'
Input
{
  "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øgle til Bing Webmaster Tools (Settings > API access). Påkrævet, når provider er bing. Bruges kun til at vise de websteder, den kan se."
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
POST /sites/:site_id/search/sync.json Importér søgedata nu search_sync

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "provider": {
      "type": "string",
      "description": "google eller bing",
      "enum": [
        "google",
        "bing"
      ],
      "default": "google"
    },
    "site_id": {
      "type": "string",
      "description": "Websted-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-ejendom eller Bing-webstedets 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"
    }
  }
}

Trafikregler

POST /sites/:site_id/traffic_rules.json Tilføj en trafikregel traffic_rules_create

Tilladelse: 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 '{…}'
Input
{
  "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": "Værdi, der skal matches. * er et jokertegn. ip_ranges tager en IP-adresse eller CIDR (v4/v6), countries en ISO-kode",
      "examples": [
        "/admin/*"
      ]
    },
    "label": {
      "type": "string",
      "description": "Valgfri note, f.eks. \"Kontor\""
    },
    "site_id": {
      "type": "string",
      "description": "Websted-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 (tilstanden for dens liste)"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:site_id/traffic_rules/:id.json Slet en trafikregel traffic_rules_delete

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "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 (tilstanden for dens liste)"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/traffic_rules.json Vis trafikregler traffic_rules_list

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/traffic_rules.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "list": {
      "type": "string",
      "description": "Kun regler i denne liste",
      "enum": [
        "hostnames",
        "paths",
        "referrers",
        "countries",
        "ip_ranges",
        "user_agents",
        "events"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Websted-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 (tilstanden for dens liste)"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /sites/:site_id/traffic_rules/test.json Test, om et hit ville blive talt med webstedets nuværende regler traffic_rules_test

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Sidens URL, f.eks. https://example.com/a"
    },
    "referrer": {
      "type": "string",
      "description": "URL eller værtsnavn for henviseren"
    },
    "country": {
      "type": "string",
      "description": "ISO-landekode, f.eks. US"
    },
    "ip": {
      "type": "string",
      "description": "IP-adresse, der skal testes mod ip_ranges (gemmes ikke)"
    },
    "user_agent": {
      "type": "string",
      "description": "User-Agent-streng (reduceret til browser og hovedversion, som ved indlæsning)"
    },
    "event": {
      "type": "string",
      "description": "Navn på egen hændelse"
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
PATCH /sites/:site_id/traffic_rules/:id.json Ændr en trafikregel traffic_rules_update

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "pattern": {
      "type": "string",
      "description": "Nyt mønster"
    },
    "label": {
      "type": "string",
      "description": "Ny etiket"
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "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 (tilstanden for dens liste)"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Tragte

POST /sites/:site_id/funnels.json Opret en tragt funnels_create

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Navn på tragten",
      "examples": [
        "Signup flow"
      ]
    },
    "steps": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      },
      "description": "Trin i rækkefølge (2 til grænsen for dit abonnement): [{\"type\": \"page|event|goal\", \"value\": \"/pricing | Signup | goal_…\", \"match\": \"exact|prefix|glob|regex\" (sidetrin), \"name\": \"valgfri etiket\"}]"
    },
    "order_mode": {
      "type": "string",
      "description": "strict: trin i denne rækkefølge, any: i vilkårlig rækkefølge",
      "enum": [
        "strict",
        "any"
      ],
      "default": "strict"
    },
    "window": {
      "type": "string",
      "description": "Konverteringsvindue: visit eller day (målt inden for et besøg, som aldrig spænder over en UTC-dag)",
      "enum": [
        "visit",
        "day"
      ],
      "default": "visit"
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "steps",
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Tragt-id, f.eks. fun_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "steps": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Trin: {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øg, der nåede trin 1"
            },
            "completed": {
              "type": "integer",
              "description": "Besøg, der nåede det sidste trin"
            },
            "conversion_rate": {
              "type": "number",
              "description": "Gennemført ÷ startet, %"
            }
          },
          "description": "Statistik for perioden (kun 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 Slet en tragt funnels_delete

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Tragt-id, f.eks. fun_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "steps": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Trin: {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øg, der nåede trin 1"
            },
            "completed": {
              "type": "integer",
              "description": "Besøg, der nåede det sidste trin"
            },
            "conversion_rate": {
              "type": "number",
              "description": "Gennemført ÷ startet, %"
            }
          },
          "description": "Statistik for perioden (kun i lister)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/funnels.json Vis tragte med indgange, gennemførelser og rate funnels_list

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/funnels.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Forudindstilling for datointerval. Brug 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å eget interval (webstedets tidszone)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Slut på eget interval, inklusive"
    },
    "compare": {
      "type": "string",
      "description": "Sammenligningsperiode",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Start på egen sammenligning"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Slut på egen sammenligning"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Afstem ugedage i sammenligningen",
      "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. Pak betingelser ind i {\"any\": [...]} for ELLER.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Anvend et gemt segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Tilføj importerede historiske data (datoer før den første egne hændelse, ignoreres når filtre eller et segment anvendes)",
      "default": false
    },
    "page": {
      "type": "integer",
      "description": "Sidenummer",
      "default": 1
    },
    "per_page": {
      "type": "integer",
      "description": "Tragte pr. side (maks. 100)",
      "default": 25
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Tragt-id, f.eks. fun_7Q2K9XH3AB"
      },
      "name": {
        "type": "string"
      },
      "steps": {
        "type": "array",
        "items": {
          "type": "object"
        },
        "description": "Trin: {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øg, der nåede trin 1"
              },
              "completed": {
                "type": "integer",
                "description": "Besøg, der nåede det sidste trin"
              },
              "conversion_rate": {
                "type": "number",
                "description": "Gennemført ÷ startet, %"
              }
            },
            "description": "Statistik for perioden (kun 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 Tragtrapport: trintællinger, konvertering, frafald, tid mellem trin og hvor besøg i stedet gik hen funnels_get

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/funnels/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Forudindstilling for datointerval. Brug 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å eget interval (webstedets tidszone)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Slut på eget interval, inklusive"
    },
    "compare": {
      "type": "string",
      "description": "Sammenligningsperiode",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Start på egen sammenligning"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Slut på egen sammenligning"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Afstem ugedage i sammenligningen",
      "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. Pak betingelser ind i {\"any\": [...]} for ELLER.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Anvend et gemt segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Tilføj importerede historiske data (datoer før den første egne hændelse, ignoreres når filtre eller et segment anvendes)",
      "default": false
    },
    "breakdown": {
      "type": "string",
      "description": "Opdel trintællinger efter en besøgsdimension",
      "enum": [
        "channel",
        "device",
        "country",
        "utm_campaign",
        "utm_source",
        "browser",
        "os"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "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": "Tragt-id, f.eks. fun_7Q2K9XH3AB"
        },
        "name": {
          "type": "string"
        },
        "steps": {
          "type": "array",
          "items": {
            "type": "object"
          },
          "description": "Trin: {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øg, der nåede trin 1"
                },
                "completed": {
                  "type": "integer",
                  "description": "Besøg, der nåede det sidste trin"
                },
                "conversion_rate": {
                  "type": "number",
                  "description": "Gennemført ÷ startet, %"
                }
              },
              "description": "Statistik for perioden (kun i lister)"
            },
            {
              "type": "null"
            }
          ]
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        }
      },
      "description": "Tragtens definition"
    },
    "order_mode": {
      "type": "string",
      "description": "strict eller any"
    },
    "window": {
      "type": "string",
      "description": "visit eller day (day måles inden for et besøg)"
    },
    "steps": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Pr. trin: 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": "Sidste trin ÷ første trin, %"
    },
    "breakdown": {
      "anyOf": [
        {
          "type": "object",
          "description": "dimension, label og rows [{value, counts, overall_conversion_rate}]"
        },
        {
          "type": "null"
        }
      ]
    },
    "comparison": {
      "anyOf": [
        {
          "type": "object",
          "description": "period, tællinger pr. trin, overall_conversion_rate og change (%)"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
PATCH /sites/:site_id/funnels/:id.json Opdatér en tragt funnels_update

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Navn på tragten",
      "examples": [
        "Signup flow"
      ]
    },
    "steps": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      },
      "description": "Trin i rækkefølge (2 til grænsen for dit abonnement): [{\"type\": \"page|event|goal\", \"value\": \"/pricing | Signup | goal_…\", \"match\": \"exact|prefix|glob|regex\" (sidetrin), \"name\": \"valgfri etiket\"}]"
    },
    "order_mode": {
      "type": "string",
      "description": "strict: trin i denne rækkefølge, any: i vilkårlig rækkefølge",
      "enum": [
        "strict",
        "any"
      ]
    },
    "window": {
      "type": "string",
      "description": "Konverteringsvindue: visit eller day (målt inden for et besøg, som aldrig spænder over en UTC-dag)",
      "enum": [
        "visit",
        "day"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Tragt-id, f.eks. fun_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "steps": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Trin: {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øg, der nåede trin 1"
            },
            "completed": {
              "type": "integer",
              "description": "Besøg, der nåede det sidste trin"
            },
            "conversion_rate": {
              "type": "number",
              "description": "Gennemført ÷ startet, %"
            }
          },
          "description": "Statistik for perioden (kun i lister)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Webhooks

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

Tilladelse: workspace.manage

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/webhooks/:webhook_id/deliveries.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Kun vellykkede eller mislykkede leveringer",
      "enum": [
        "succeeded",
        "failed"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    },
    "webhook_id": {
      "type": "string",
      "description": "Webhook for ressourcen"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater pr. 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 seneste forsøg"
          },
          {
            "type": "null"
          }
        ]
      },
      "error": {
        "anyOf": [
          {
            "type": "string",
            "description": "Forbindelsesfejl for det seneste forsøg"
          },
          {
            "type": "null"
          }
        ]
      },
      "attempt": {
        "type": "integer"
      },
      "duration_ms": {
        "anyOf": [
          {
            "type": "integer"
          },
          {
            "type": "null"
          }
        ]
      },
      "payload": {
        "type": "object"
      },
      "response_body": {
        "anyOf": [
          {
            "type": "string",
            "description": "De første 2.000 tegn"
          },
          {
            "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 igen webhook_deliveries_redeliver

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    },
    "webhook_id": {
      "type": "string",
      "description": "Webhook for ressourcen"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "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 seneste forsøg"
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "anyOf": [
        {
          "type": "string",
          "description": "Forbindelsesfejl for det seneste forsøg"
        },
        {
          "type": "null"
        }
      ]
    },
    "attempt": {
      "type": "integer"
    },
    "duration_ms": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "payload": {
      "type": "object"
    },
    "response_body": {
      "anyOf": [
        {
          "type": "string",
          "description": "De første 2.000 tegn"
        },
        {
          "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 Tilføj et webhook-endpoint webhooks_create

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "HTTPS-endpoint, der modtager 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": "Hændelser, der skal sendes"
    },
    "enabled": {
      "type": "boolean",
      "description": "Send leveringer",
      "default": true
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområ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": "Signeringshemmelighed til 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 Slet en webhook webhooks_delete

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "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": "Signeringshemmelighed til 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 Vis webhooks webhooks_list

Tilladelse: workspace.manage

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/webhooks.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater pr. 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": "Signeringshemmelighed til 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

Tilladelse: workspace.manage

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/webhooks/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "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": "Signeringshemmelighed til 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

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "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 seneste forsøg"
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "anyOf": [
        {
          "type": "string",
          "description": "Forbindelsesfejl for det seneste forsøg"
        },
        {
          "type": "null"
        }
      ]
    },
    "attempt": {
      "type": "integer"
    },
    "duration_ms": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "payload": {
      "type": "object"
    },
    "response_body": {
      "anyOf": [
        {
          "type": "string",
          "description": "De første 2.000 tegn"
        },
        {
          "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 Opdatér en webhook (hændelser, URL, aktiveret, roter hemmelighed) webhooks_update

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "HTTPS-endpoint"
    },
    "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": "Hændelser, der skal sendes"
    },
    "enabled": {
      "type": "boolean",
      "description": "Send leveringer"
    },
    "rotate_secret": {
      "type": "boolean",
      "description": "Erstat signeringshemmeligheden",
      "default": false
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "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": "Signeringshemmelighed til 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"
    }
  }
}

Websted

GET /changelog.json Vis poster i ændringsloggen changelog_list

Udgivne produktopdateringer, nyeste først. Også tilgængelig som RSS på /changelog.rss.

Tilladelse: public

Eksempel
curl https://privatusanalytics.com/changelog.json
Input
{
  "type": "object",
  "properties": {
    "area": {
      "type": "string",
      "description": "Kun poster for dette produktområde",
      "enum": [
        "product",
        "dashboard",
        "tracker",
        "privacy",
        "api",
        "integrations",
        "billing",
        "docs"
      ]
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater pr. side (maks. 100)"
    }
  },
  "required": []
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Post-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-indhold"
      },
      "published_at": {
        "type": "string",
        "format": "date-time",
        "description": "Tidspunkt for udgivelse"
      },
      "url": {
        "type": "string",
        "description": "Permanent link"
      }
    }
  }
}
GET /changelog/:id.json Hent en post i ændringsloggen changelog_get

Tilladelse: public

Eksempel
curl https://privatusanalytics.com/changelog/:id.json
Input
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Post-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-indhold"
    },
    "published_at": {
      "type": "string",
      "format": "date-time",
      "description": "Tidspunkt for udgivelse"
    },
    "url": {
      "type": "string",
      "description": "Permanent link"
    }
  }
}
POST /contact.json Send en besked til Privatus Analytics-teamet contact_create

Browserklienter sender et Cloudflare Turnstile-token som `cf-turnstile-response`. Forespørgsler med et API-token behøver intet.

Tilladelse: public · Kun HTTP (ikke et MCP-værktøj)

Eksempel
curl -X POST https://privatusanalytics.com/contact.json \
  -H "Content-Type: application/json" -d '{…}'
Input
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Dit navn",
      "examples": [
        "Ada Lovelace"
      ]
    },
    "email": {
      "type": "string",
      "description": "Hvor vi skal svare",
      "examples": [
        "[email protected]"
      ]
    },
    "company": {
      "type": "string",
      "description": "Virksomhed eller organisation (valgfri)"
    },
    "topic": {
      "type": "string",
      "description": "Hvad beskeden handler om",
      "enum": [
        "general",
        "sales",
        "support",
        "privacy",
        "security",
        "partnerships",
        "press"
      ],
      "default": "general"
    },
    "message": {
      "type": "string",
      "description": "Din besked (10 til 5.000 tegn)"
    },
    "website": {
      "type": "string",
      "description": "Lad stå tomt. Spamfælde til bots. Udfyldte indsendelser kasseres"
    }
  },
  "required": [
    "name",
    "email",
    "message"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "received": {
      "type": "boolean",
      "description": "Altid true, når indsendelsen blev accepteret"
    },
    "message": {
      "type": "string",
      "description": "Hvad der sker derefter"
    }
  }
}
POST /newsletter/confirm.json Bekræft et nyhedsbrevsabonnement (signeret token) newsletter_confirm

Tilladelse: public · Kun HTTP (ikke et MCP-værktøj)

Eksempel
curl -X POST https://privatusanalytics.com/newsletter/confirm.json \
  -H "Content-Type: application/json" -d '{…}'
Input
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Signeret token fra bekræftelsesmailen"
    }
  },
  "required": [
    "token"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "received": {
      "type": "boolean",
      "description": "Altid true, når indsendelsen blev accepteret"
    },
    "message": {
      "type": "string",
      "description": "Hvad der sker derefter"
    }
  }
}
POST /newsletter.json Tilmeld en e-mailadresse til nyhedsbrevet newsletter_subscribe

Browserklienter sender et Cloudflare Turnstile-token som `cf-turnstile-response`. Forespørgsler med et API-token behøver intet.

Tilladelse: public · Kun HTTP (ikke et MCP-værktøj)

Eksempel
curl -X POST https://privatusanalytics.com/newsletter.json \
  -H "Content-Type: application/json" -d '{…}'
Input
{
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "description": "E-mailadresse, der skal tilmeldes. Et bekræftelseslink sendes til den",
      "examples": [
        "[email protected]"
      ]
    },
    "website": {
      "type": "string",
      "description": "Lad stå tomt. Spamfælde til bots. Udfyldte indsendelser kasseres"
    }
  },
  "required": [
    "email"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "received": {
      "type": "boolean",
      "description": "Altid true, når indsendelsen blev accepteret"
    },
    "message": {
      "type": "string",
      "description": "Hvad der sker derefter"
    }
  }
}
POST /newsletter/unsubscribe.json Afmeld med et signeret linktoken newsletter_unsubscribe

Tilladelse: public · Kun HTTP (ikke et MCP-værktøj)

Eksempel
curl -X POST https://privatusanalytics.com/newsletter/unsubscribe.json \
  -H "Content-Type: application/json" -d '{…}'
Input
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Signeret token fra afmeldingslinket"
    },
    "list": {
      "type": "string",
      "description": "newsletter (standard: den liste, linket gjaldt) eller marketing (al marketingmail)",
      "enum": [
        "newsletter",
        "marketing"
      ]
    }
  },
  "required": [
    "token"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "received": {
      "type": "boolean",
      "description": "Altid true, når indsendelsen blev accepteret"
    },
    "message": {
      "type": "string",
      "description": "Hvad der sker derefter"
    }
  }
}
GET /pricing.json Hent abonnementer, priser og abonnementsgrænser pricing_get

Samme data som prissiden: hændelsestrappen, alle abonnementsgrænser og hvad der tæller som en hændelse. Angiv events for at få det matchende niveau.

Tilladelse: public

Eksempel
curl https://privatusanalytics.com/pricing.json
Input
{
  "type": "object",
  "properties": {
    "events": {
      "type": "integer",
      "description": "Forventede sidevisninger plus egne hændelser pr. måned. Returnerer det matchende niveau som `recommendation`",
      "examples": [
        750000
      ]
    },
    "interval": {
      "type": "string",
      "description": "Faktureringsinterval for de viste priser: month eller year (10x 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": "Altid true. Priserne er inkl. moms eller salgsafgift, så den viste pris er den pris, der betales"
    },
    "interval": {
      "type": "string",
      "description": "month eller year. Priserne gælder for dette interval"
    },
    "annual_multiplier": {
      "type": "integer",
      "description": "Årspris = månedspris x dette (to måneder gratis)"
    },
    "free_events": {
      "type": "integer",
      "description": "Hændelser pr. måned inkluderet i det gratis abonnement"
    },
    "badge_bonus": {
      "type": "integer",
      "description": "Ekstra gratis hændelser pr. måned, når det valgfri badge vises"
    },
    "tiers": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Hændelsestrappe: { events, pro, business } priser for intervallet (pro er null, hvor kun Business tilbydes), plus månedspriserne"
    },
    "plans": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Abonnementer med { id, name, from_price, limits }. Grænser på null betyder ubegrænset"
    },
    "counted": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Hvad der tæller som en fakturerbar hændelse"
    },
    "not_counted": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Hvad der aldrig tæller med i forbruget"
    },
    "recommendation": {
      "anyOf": [
        {
          "type": "object",
          "description": "{ events, plan, tier_events, price } for inputtet `events`, eller null, når ingen mængde blev angivet"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
GET /status.json Hent den aktuelle systemstatus status_get

Tilstand for database, Redis og baggrundsjob, kontrolleret højst hvert 15. sekund.

Tilladelse: public

Eksempel
curl https://privatusanalytics.com/status.json
Input
{
  "type": "object",
  "properties": {
    "fresh": {
      "type": "boolean",
      "description": "Spring cachen på 15 sekunder over og kontrollér igen nu",
      "default": false
    }
  },
  "required": []
}
Svardata
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Samlet: operational, degraded eller outage"
    },
    "checked_at": {
      "type": "string",
      "format": "date-time",
      "description": "Hvornår kontrollerne kørte (cachet i op til 15 s)"
    },
    "components": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Pr. komponent: { id, name, status, detail, latency_ms }, plus queue_latency_s og queue_depth for køer"
    }
  }
}
GET /tools/header-checker.json Kontrollér en sides Referrer-Policy og CSP for analyse tools_header_check

Tilladelse: public

Eksempel
curl https://privatusanalytics.com/tools/header-checker.json
Input
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Offentlig side, der skal kontrolleres (http eller https)",
      "examples": [
        "https://example.com"
      ]
    }
  },
  "required": [
    "url"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Endelig URL efter omdirigeringer"
    },
    "status": {
      "type": "integer",
      "description": "HTTP-status for det endelige svar"
    },
    "findings": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Kontroller: { check, value, level (ok, warn, info), note }"
    }
  }
}
GET /tools/privacy-policy-generator.json Skriv et udkast til et afsnit i privatlivspolitikken for Privatus Analytics tools_privacy_policy

Tilladelse: public

Eksempel
curl https://privatusanalytics.com/tools/privacy-policy-generator.json
Input
{
  "type": "object",
  "properties": {
    "site_name": {
      "type": "string",
      "description": "Navnet på dit websted eller din virksomhed",
      "examples": [
        "Example Books"
      ]
    },
    "contact_email": {
      "type": "string",
      "description": "Privatlivskontakt, der skal nævnes (valgfri)"
    },
    "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": "Input: navn på websted eller virksomhed"
    },
    "paragraphs": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Politikteksten, ét afsnit pr. punkt"
    },
    "text": {
      "type": "string",
      "description": "Afsnittene samlet med tomme linjer"
    }
  }
}
GET /tools/qr-code.json Generér en QR-kode som SVG tools_qr_code

Tilladelse: public

Eksempel
curl https://privatusanalytics.com/tools/qr-code.json
Input
{
  "type": "object",
  "properties": {
    "text": {
      "type": "string",
      "description": "URL eller tekst, der skal kodes (op til 1.000 tegn)",
      "examples": [
        "https://example.com/?utm_source=poster"
      ]
    },
    "level": {
      "type": "string",
      "description": "Fejlkorrektion: 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": "Den kodede tekst"
    },
    "level": {
      "type": "string",
      "description": "Niveau for fejlkorrektion"
    },
    "size": {
      "type": "integer",
      "description": "Moduler pr. side"
    },
    "svg": {
      "type": "string",
      "description": "Selvstændigt SVG-dokument"
    }
  }
}
GET /tools/tracker-scanner.json Vis cookies og kendte trackere på en side tools_tracker_scan

Tilladelse: public

Eksempel
curl https://privatusanalytics.com/tools/tracker-scanner.json
Input
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Offentlig side, der skal scannes (http eller https)",
      "examples": [
        "https://example.com"
      ]
    }
  },
  "required": [
    "url"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Endelig URL efter omdirigeringer"
    },
    "status": {
      "type": "integer",
      "description": "HTTP-status for det endelige svar"
    },
    "truncated": {
      "type": "boolean",
      "description": "True, når siden var over 1 MB, og kun de første 1 MB blev scannet"
    },
    "cookies": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Cookies sat af HTTP-svaret: { name, domain, path, expires, secure, http_only, same_site }. Værdier returneres aldrig"
    },
    "trackers": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Kendte værktøjer, som siden henviser til: { name, category, match, evidence }"
    },
    "third_party_hosts": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Andre domæner, siden indlæser ressourcer fra"
    }
  }
}
GET /tools/utm-builder.json Byg en kampagne-URL med UTM-parametre tools_utm_builder

Tilladelse: public

Eksempel
curl https://privatusanalytics.com/tools/utm-builder.json
Input
{
  "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: kampagnens navn",
      "examples": [
        "fall_launch"
      ]
    },
    "term": {
      "type": "string",
      "description": "utm_term: nøgleord til betalt søgning (valgfri)"
    },
    "content": {
      "type": "string",
      "description": "utm_content: hvilket link eller kreativ (valgfri)"
    }
  },
  "required": [
    "url",
    "source",
    "medium",
    "campaign"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "URL til landingssiden med UTM-parametre"
    },
    "params": {
      "type": "object",
      "description": "De UTM-parametre, der blev tilføjet"
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Problemer, der er værd at rette (store bogstaver, mellemrum, personoplysninger)"
    }
  }
}
POST /waitlist.json Kom på en venteliste (hosting i EU) waitlist_join

Browserklienter sender et Cloudflare Turnstile-token som `cf-turnstile-response`. Forespørgsler med et API-token behøver intet.

Tilladelse: public · Kun HTTP (ikke et MCP-værktøj)

Eksempel
curl -X POST https://privatusanalytics.com/waitlist.json \
  -H "Content-Type: application/json" -d '{…}'
Input
{
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "description": "E-mailadresse, der skal underrettes",
      "examples": [
        "[email protected]"
      ]
    },
    "list": {
      "type": "string",
      "description": "Hvilken venteliste der skal tilmeldes",
      "enum": [
        "eu_hosting"
      ],
      "default": "eu_hosting"
    },
    "website": {
      "type": "string",
      "description": "Lad stå tomt. Spamfælde til bots. Udfyldte indsendelser kasseres"
    }
  },
  "required": [
    "email"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "received": {
      "type": "boolean",
      "description": "Altid true, når indsendelsen blev accepteret"
    },
    "message": {
      "type": "string",
      "description": "Hvad der sker derefter"
    }
  }
}

Websteder

POST /sites/:site_id/data_reset.json Slet alle hændelser og besøg i et datointerval (kører i baggrunden, kan ikke fortrydes) sites_reset_data

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "from": {
      "type": "string",
      "format": "date",
      "description": "Første dag, der skal slettes (webstedets tidszone)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Sidste dag, der skal slettes, inklusive"
    },
    "confirm": {
      "type": "string",
      "description": "Skriv domænet for at bekræfte"
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "from",
    "to",
    "confirm",
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
GET /sites/:site_id/filter_stats.json Filtreret trafikoversigt: bots, trafikregler eller PII-redigeringer efter årsag og land (kun tællinger) sites_filter_stats

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/filter_stats.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "description": "bot (filtrerede bots), rule (trafikregler) eller redaction (PII-scrubber)",
      "enum": [
        "bot",
        "rule",
        "redaction"
      ],
      "default": "bot"
    },
    "days": {
      "type": "integer",
      "description": "Dage at se tilbage (1-395)",
      "default": 30
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
GET /sites/:site_id/access.json Vis medlemmer og om de kan se dette websted sites_access_list

Tilladelse: members.manage

Eksempel
curl https://privatusanalytics.com/sites/:site_id/access.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "membership_id": {
      "type": "string",
      "format": "uuid",
      "description": "Medlemskabs-id"
    },
    "email": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "role": {
      "type": "string"
    },
    "access": {
      "type": "boolean",
      "description": "Kan se dette websted"
    },
    "locked": {
      "type": "boolean",
      "description": "Ejere og administratorer har altid adgang"
    }
  }
}
PATCH /sites/:site_id/access.json Giv eller fjern ét medlems adgang til dette websted sites_access_update

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "membership_id": {
      "type": "string",
      "description": "Medlemskabs-id fra sites_access_list"
    },
    "access": {
      "type": "boolean",
      "description": "true for at give adgang, false for at fjerne den"
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "membership_id",
    "access",
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "membership_id": {
      "type": "string",
      "format": "uuid",
      "description": "Medlemskabs-id"
    },
    "email": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "role": {
      "type": "string"
    },
    "access": {
      "type": "boolean",
      "description": "Kan se dette websted"
    },
    "locked": {
      "type": "boolean",
      "description": "Ejere og administratorer har altid adgang"
    }
  }
}
POST /sites/:site_id/favorite.json Markér et websted med stjerne (fastgjort øverst under Alle websteder) sites_favorite

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Websted-id brugt 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": "Begyndelsen af indlæsningsnøglen til 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": "Sporingskode i HTML"
    },
    "favorite": {
      "type": "boolean",
      "description": "Markeret med stjerne af dig"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:site_id/favorite.json Fjern stjernen fra et websted sites_unfavorite

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Websted-id brugt 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": "Begyndelsen af indlæsningsnøglen til 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": "Sporingskode i HTML"
    },
    "favorite": {
      "type": "boolean",
      "description": "Markeret med stjerne af dig"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/setup.json Installationsstatus og kodestump for et websted sites_setup_get

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/setup.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}
POST /transfers/:token/accept.json Acceptér en overdragelse af et websted til et af dine arbejdsområder site_transfers_accept

Tilladelse: public

Eksempel
curl -X POST https://privatusanalytics.com/transfers/:token/accept.json \
  -H "Content-Type: application/json" -d '{…}'
Input
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde, webstedet skal flyttes til (ws_…)"
    },
    "token": {
      "type": "string",
      "description": "Token for ressourcen"
    }
  },
  "required": [
    "workspace_id",
    "token"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Websted, der overdrages"
    },
    "site_domain": {
      "type": "string"
    },
    "from_workspace": {
      "type": "string",
      "description": "Navn på det nuværende arbejdsområde"
    },
    "to_workspace_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Modtagende arbejdsområde"
        },
        {
          "type": "null"
        }
      ]
    },
    "to_email": {
      "type": "string",
      "description": "Modtagerens e-mailadresse"
    },
    "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 overdragelse af et websted til et andet arbejdsområde (sender en e-mail til modtageren) sites_transfer_start

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "description": "E-mailadressen på den person, der modtager webstedet (vedkommende vælger et af sine arbejdsområder)"
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "email",
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Websted, der overdrages"
    },
    "site_domain": {
      "type": "string"
    },
    "from_workspace": {
      "type": "string",
      "description": "Navn på det nuværende arbejdsområde"
    },
    "to_workspace_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Modtagende arbejdsområde"
        },
        {
          "type": "null"
        }
      ]
    },
    "to_email": {
      "type": "string",
      "description": "Modtagerens e-mailadresse"
    },
    "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 Annullér en afventende overdragelse af et websted sites_transfer_cancel

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Websted, der overdrages"
    },
    "site_domain": {
      "type": "string"
    },
    "from_workspace": {
      "type": "string",
      "description": "Navn på det nuværende arbejdsområde"
    },
    "to_workspace_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Modtagende arbejdsområde"
        },
        {
          "type": "null"
        }
      ]
    },
    "to_email": {
      "type": "string",
      "description": "Modtagerens e-mailadresse"
    },
    "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 afventende overdragelse ud fra dens token fra e-mailen site_transfers_get

Tilladelse: public

Eksempel
curl https://privatusanalytics.com/transfers/:token.json
Input
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Token for ressourcen"
    }
  },
  "required": [
    "token"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Websted, der overdrages"
    },
    "site_domain": {
      "type": "string"
    },
    "from_workspace": {
      "type": "string",
      "description": "Navn på det nuværende arbejdsområde"
    },
    "to_workspace_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Modtagende arbejdsområde"
        },
        {
          "type": "null"
        }
      ]
    },
    "to_email": {
      "type": "string",
      "description": "Modtagerens e-mailadresse"
    },
    "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 Tilføj et websted sites_create

Tilladelse: 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 '{…}'
Input
{
  "type": "object",
  "properties": {
    "domain": {
      "type": "string",
      "description": "Primært domæne, f.eks. example.com",
      "examples": [
        "example.com"
      ]
    },
    "name": {
      "type": "string",
      "description": "Visningsnavn (standard er domænet)"
    },
    "timezone": {
      "type": "string",
      "description": "Tidszone for rapportering"
    },
    "currency": {
      "type": "string",
      "description": "Valuta for omsætning (ISO 4217)"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "domain",
    "workspace_id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Websted-id brugt 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": "Begyndelsen af indlæsningsnøglen til 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": "Sporingskode i HTML"
    },
    "favorite": {
      "type": "boolean",
      "description": "Markeret med stjerne af dig"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:id.json Slet et websted (ryddes efter 7 dage) sites_delete

Tilladelse: sites.manage

Eksempel
curl -X DELETE https://privatusanalytics.com/sites/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Input
{
  "type": "object",
  "properties": {
    "confirm": {
      "type": "string",
      "description": "Skriv domænet for at bekræfte"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "confirm",
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Websted-id brugt 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": "Begyndelsen af indlæsningsnøglen til 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": "Sporingskode i HTML"
    },
    "favorite": {
      "type": "boolean",
      "description": "Markeret med stjerne af dig"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /workspaces/:workspace_id/sites.json Vis websteder i et arbejdsområde sites_list

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/workspaces/:workspace_id/sites.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "description": "Filtrér efter domæne eller navn"
    },
    "label": {
      "type": "string",
      "description": "Kun websteder med denne etiket"
    },
    "sort": {
      "type": "string",
      "description": "position (din rækkefølge), name eller visitors de seneste 30 dage (flest først)",
      "enum": [
        "position",
        "name",
        "visitors"
      ],
      "default": "position"
    },
    "workspace_id": {
      "type": "string",
      "description": "Arbejdsområde-id, f.eks. ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Side (fra 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultater pr. side (maks. 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Svardata
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Websted-id brugt 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": "Begyndelsen af indlæsningsnøglen til 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": "Sporingskode i HTML"
      },
      "favorite": {
        "type": "boolean",
        "description": "Markeret med stjerne af dig"
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
GET /sites/:id.json Hent et websted og alle dets indstillinger sites_get

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Websted-id brugt 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": "Begyndelsen af indlæsningsnøglen til 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": "Sporingskode i HTML"
    },
    "favorite": {
      "type": "boolean",
      "description": "Markeret med stjerne af dig"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
PATCH /sites/:id.json Opdatér webstedsindstillinger sites_update

Tilladelse: sites.manage

Eksempel
curl -X PATCH https://privatusanalytics.com/sites/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Input
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Visningsnavn"
    },
    "domain": {
      "type": "string",
      "description": "Primært domæne"
    },
    "extra_domains": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Yderligere værtsnavne"
    },
    "multi_domain_mode": {
      "type": "string",
      "description": "combined: én besøgende på tværs af domæner",
      "enum": [
        "combined",
        "separate"
      ]
    },
    "timezone": {
      "type": "string",
      "description": "Tidszone for rapportering"
    },
    "currency": {
      "type": "string",
      "description": "Valuta for omsætning (ISO 4217)"
    },
    "week_start": {
      "type": "integer",
      "description": "0 = søndag, 1 = mandag"
    },
    "labels": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Etiketter til gruppering af websteder"
    },
    "honor_dnt": {
      "type": "boolean",
      "description": "Spring besøgende over, der sender DNT"
    },
    "honor_gpc": {
      "type": "boolean",
      "description": "Spring besøgende over, der sender GPC"
    },
    "pii_scrubber": {
      "type": "boolean",
      "description": "Redigér e-mails, tokens og id'er ud"
    },
    "redaction_rules": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "pattern": {
            "type": "string"
          }
        }
      },
      "description": "Egne regulære udtryk til redigering"
    },
    "allowed_params": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Forespørgselsparametre, der beholdes på stier"
    },
    "path_masks": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "pattern": {
            "type": "string"
          },
          "replacement": {
            "type": "string"
          }
        }
      },
      "description": "Regler for maskering af stier, f.eks. /u/* -> /u/:id"
    },
    "retention_months": {
      "type": "integer",
      "description": "Slet data, der er ældre end dette"
    },
    "bot_filtering": {
      "type": "boolean",
      "description": "Filtrér bottrafik"
    },
    "traffic_rule_modes": {
      "type": "object",
      "additionalProperties": true,
      "description": "block eller allow pr. liste med trafikregler"
    },
    "vitals_sample_rate": {
      "type": "integer",
      "description": "Stikprøve for Web Vitals i %"
    },
    "conversion_denominator": {
      "type": "string",
      "description": "Konverteringsrate i forhold til besøg eller besøgende",
      "enum": [
        "visits",
        "visitors"
      ]
    },
    "public_dashboard": {
      "type": "boolean",
      "description": "Alle med linket kan se statistikken"
    },
    "public_indexable": {
      "type": "boolean",
      "description": "Lad søgemaskiner indeksere den offentlige side"
    },
    "id": {
      "type": "string",
      "description": "Id for ressourcen"
    }
  },
  "required": [
    "id"
  ]
}
Svardata
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Websted-id brugt 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": "Begyndelsen af indlæsningsnøglen til 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": "Sporingskode i HTML"
    },
    "favorite": {
      "type": "boolean",
      "description": "Markeret med stjerne af dig"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Ydeevne

GET /sites/:site_id/performance.json Web Vitals: p75-resultatkort, daglig udvikling og opdelinger efter side, enhed, browser og land performance_report

Tilladelse: analytics.read

Eksempel
curl https://privatusanalytics.com/sites/:site_id/performance.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Input
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Forudindstilling for datointerval. Brug 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å eget interval (webstedets tidszone)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Slut på eget interval, inklusive"
    },
    "compare": {
      "type": "string",
      "description": "Sammenligningsperiode",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Start på egen sammenligning"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Slut på egen sammenligning"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Afstem ugedage i sammenligningen",
      "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. Pak betingelser ind i {\"any\": [...]} for ELLER.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Anvend et gemt segment (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Tilføj importerede historiske data (datoer før den første egne hændelse, ignoreres når filtre eller et segment anvendes)",
      "default": false
    },
    "metric": {
      "type": "string",
      "description": "Måling til udviklingen og opdelingerne",
      "enum": [
        "LCP",
        "INP",
        "CLS",
        "FCP",
        "TTFB"
      ],
      "default": "LCP"
    },
    "limit": {
      "type": "integer",
      "description": "Rækker pr. opdeling (maks. 100)",
      "default": 10
    },
    "site_id": {
      "type": "string",
      "description": "Websted-id, f.eks. pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Svardata
{
  "type": "object"
}