Docs
Navegar pela documentação

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.

Ver como 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.

Todas as operações

Autenticação

Envie Authorization: Bearer pat_…. Crie tokens em Configurações do espaço de trabalho, Tokens de API. Guia de autenticação.

JSON em todo lugar

Adicione .json a qualquer caminho. As respostas são { "data": … } e os erros são { "error": { "code", "message" } }. Erros.

MCP

Envie um POST JSON-RPC para https://privatusanalytics.com/mcp com o mesmo token. Cada operação abaixo é uma ferramenta. Guia do MCP.

Baixar openapi.json · 285 operações

Ajuda e feedback

POST /help.json Enviar uma pergunta ou feedback para a equipe do Privatus Analytics support_message_send

A mensagem é enviada por e-mail à equipe com os dados da sua conta, do espaço de trabalho e do plano anexados. A resposta e um recibo vão para o e-mail da sua conta. Até 10 mensagens por dia.

Permissão: member

Exemplo
curl -X POST https://privatusanalytics.com/help.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "subject": {
      "type": "string",
      "description": "Assunto da mensagem (até 150 caracteres)",
      "examples": [
        "Funnel shows no data"
      ]
    },
    "message": {
      "type": "string",
      "description": "Sua pergunta ou feedback (10 a 5.000 caracteres)"
    }
  },
  "required": [
    "subject",
    "message"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "received": {
      "type": "boolean",
      "description": "Sempre true quando o envio foi aceito"
    },
    "message": {
      "type": "string",
      "description": "O que acontece a seguir"
    }
  }
}

Alertas

POST /alerts/:id/acknowledge.json Reconhecer o incidente mais recente alerts_acknowledge

Permissão: analytics.read

Exemplo
curl -X POST https://privatusanalytics.com/alerts/:id/acknowledge.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do alerta, por exemplo alr_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Id do site (null para alertas de uso)"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "threshold, anomaly, goal, no_data, usage, uptime, ssl ou vitals"
    },
    "metric": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "operator": {
      "anyOf": [
        {
          "type": "string",
          "description": "gt, gte, lt ou lte"
        },
        {
          "type": "null"
        }
      ]
    },
    "threshold": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "window_minutes": {
      "type": "integer"
    },
    "sensitivity": {
      "type": "string",
      "description": "sensibilidade da anomalia"
    },
    "goal_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "channel_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Ids dos canais de notificação"
    },
    "state": {
      "type": "string",
      "description": "ok ou 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 Criar um alerta alerts_create

Permissão: content.write

Exemplo
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/alerts.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Id do site (pa_…). Obrigatório, exceto para alertas de uso"
    },
    "metric": {
      "type": "string",
      "description": "threshold/anomaly: visitors, visits, pageviews, bounce_rate ou conversion. vitals: lcp, inp, cls, fcp ou ttfb"
    },
    "operator": {
      "type": "string",
      "description": "Comparação (gt, gte, lt, lte). anomaly: lt apenas quedas, gt apenas picos, vazio ambos",
      "enum": [
        "gt",
        "gte",
        "lt",
        "lte"
      ]
    },
    "threshold": {
      "type": "number",
      "description": "threshold: valor da métrica, goal: conclusões, no_data: horas, usage: porcentagem, ssl: dias, vitals: ms (CLS: pontuação)"
    },
    "window_minutes": {
      "type": "integer",
      "description": "Janela de avaliação em minutos (5 a 10080)"
    },
    "sensitivity": {
      "type": "string",
      "description": "anomaly: low, medium ou high",
      "enum": [
        "low",
        "medium",
        "high"
      ]
    },
    "goal_id": {
      "type": "string",
      "description": "alertas de meta e de conversão: id da meta (goal_…)"
    },
    "uptime_check_id": {
      "type": "string",
      "description": "uptime/ssl: id da verificação (padrão: todas as verificações do site)"
    },
    "channel_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Ids dos canais de notificação (nch_…)"
    },
    "enabled": {
      "type": "boolean",
      "description": "Avaliar este alerta"
    },
    "name": {
      "type": "string",
      "description": "Nome do alerta",
      "examples": [
        "Traffic dropped"
      ]
    },
    "kind": {
      "type": "string",
      "description": "threshold, anomaly, goal, no_data, usage, uptime, ssl ou vitals",
      "enum": [
        "threshold",
        "anomaly",
        "goal",
        "no_data",
        "usage",
        "uptime",
        "ssl",
        "vitals"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "kind",
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do alerta, por exemplo alr_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Id do site (null para alertas de uso)"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "threshold, anomaly, goal, no_data, usage, uptime, ssl ou vitals"
    },
    "metric": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "operator": {
      "anyOf": [
        {
          "type": "string",
          "description": "gt, gte, lt ou lte"
        },
        {
          "type": "null"
        }
      ]
    },
    "threshold": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "window_minutes": {
      "type": "integer"
    },
    "sensitivity": {
      "type": "string",
      "description": "sensibilidade da anomalia"
    },
    "goal_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "channel_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Ids dos canais de notificação"
    },
    "state": {
      "type": "string",
      "description": "ok ou 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 Excluir um alerta alerts_delete

Permissão: content.write

Exemplo
curl -X DELETE https://privatusanalytics.com/alerts/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do alerta, por exemplo alr_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Id do site (null para alertas de uso)"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "threshold, anomaly, goal, no_data, usage, uptime, ssl ou vitals"
    },
    "metric": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "operator": {
      "anyOf": [
        {
          "type": "string",
          "description": "gt, gte, lt ou lte"
        },
        {
          "type": "null"
        }
      ]
    },
    "threshold": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "window_minutes": {
      "type": "integer"
    },
    "sensitivity": {
      "type": "string",
      "description": "sensibilidade da anomalia"
    },
    "goal_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "channel_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Ids dos canais de notificação"
    },
    "state": {
      "type": "string",
      "description": "ok ou 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 Histórico de incidentes de um alerta alerts_history

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/alerts/:id/history.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "open": {
      "type": "boolean",
      "description": "Somente incidentes não resolvidos",
      "default": false
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    },
    "page": {
      "type": "integer",
      "description": "Página (a partir de 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultados por página (máx. 100)"
    }
  },
  "required": [
    "id"
  ]
}
Dados da resposta
{
  "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": "Valor medido quando disparou"
          },
          {
            "type": "null"
          }
        ]
      },
      "message": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "acknowledged_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "acknowledged_by": {
        "anyOf": [
          {
            "type": "string",
            "description": "Nome do membro que reconheceu"
          },
          {
            "type": "null"
          }
        ]
      }
    }
  }
}
GET /workspaces/:workspace_id/alerts.json Listar alertas alerts_list

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/workspaces/:workspace_id/alerts.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Somente alertas deste site (pa_…)"
    },
    "state": {
      "type": "string",
      "description": "Somente alertas ok ou triggered",
      "enum": [
        "ok",
        "triggered"
      ]
    },
    "kind": {
      "type": "string",
      "description": "Somente este tipo",
      "enum": [
        "threshold",
        "anomaly",
        "goal",
        "no_data",
        "usage",
        "uptime",
        "ssl",
        "vitals"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Página (a partir de 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultados por página (máx. 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Id do alerta, por exemplo alr_7Q2K9XH3AB"
      },
      "site_id": {
        "anyOf": [
          {
            "type": "string",
            "description": "Id do site (null para alertas de uso)"
          },
          {
            "type": "null"
          }
        ]
      },
      "name": {
        "type": "string"
      },
      "kind": {
        "type": "string",
        "description": "threshold, anomaly, goal, no_data, usage, uptime, ssl ou vitals"
      },
      "metric": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "operator": {
        "anyOf": [
          {
            "type": "string",
            "description": "gt, gte, lt ou lte"
          },
          {
            "type": "null"
          }
        ]
      },
      "threshold": {
        "anyOf": [
          {
            "type": "number"
          },
          {
            "type": "null"
          }
        ]
      },
      "window_minutes": {
        "type": "integer"
      },
      "sensitivity": {
        "type": "string",
        "description": "sensibilidade da anomalia"
      },
      "goal_id": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "channel_ids": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Ids dos canais de notificação"
      },
      "state": {
        "type": "string",
        "description": "ok ou 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 Silenciar (ou reativar) as notificações de um alerta alerts_mute

Permissão: content.write

Exemplo
curl -X POST https://privatusanalytics.com/alerts/:id/mute.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "minutes": {
      "type": "integer",
      "description": "Silenciar por esta quantidade de minutos (0 reativa, máximo de 30 dias)",
      "default": 60
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do alerta, por exemplo alr_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Id do site (null para alertas de uso)"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "threshold, anomaly, goal, no_data, usage, uptime, ssl ou vitals"
    },
    "metric": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "operator": {
      "anyOf": [
        {
          "type": "string",
          "description": "gt, gte, lt ou lte"
        },
        {
          "type": "null"
        }
      ]
    },
    "threshold": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "window_minutes": {
      "type": "integer"
    },
    "sensitivity": {
      "type": "string",
      "description": "sensibilidade da anomalia"
    },
    "goal_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "channel_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Ids dos canais de notificação"
    },
    "state": {
      "type": "string",
      "description": "ok ou 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 Obter um alerta alerts_get

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/alerts/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do alerta, por exemplo alr_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Id do site (null para alertas de uso)"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "threshold, anomaly, goal, no_data, usage, uptime, ssl ou vitals"
    },
    "metric": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "operator": {
      "anyOf": [
        {
          "type": "string",
          "description": "gt, gte, lt ou lte"
        },
        {
          "type": "null"
        }
      ]
    },
    "threshold": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "window_minutes": {
      "type": "integer"
    },
    "sensitivity": {
      "type": "string",
      "description": "sensibilidade da anomalia"
    },
    "goal_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "channel_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Ids dos canais de notificação"
    },
    "state": {
      "type": "string",
      "description": "ok ou 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 Atualizar um alerta alerts_update

Permissão: content.write

Exemplo
curl -X PATCH https://privatusanalytics.com/alerts/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Id do site (pa_…). Obrigatório, exceto para alertas de uso"
    },
    "metric": {
      "type": "string",
      "description": "threshold/anomaly: visitors, visits, pageviews, bounce_rate ou conversion. vitals: lcp, inp, cls, fcp ou ttfb"
    },
    "operator": {
      "type": "string",
      "description": "Comparação (gt, gte, lt, lte). anomaly: lt apenas quedas, gt apenas picos, vazio ambos",
      "enum": [
        "gt",
        "gte",
        "lt",
        "lte"
      ]
    },
    "threshold": {
      "type": "number",
      "description": "threshold: valor da métrica, goal: conclusões, no_data: horas, usage: porcentagem, ssl: dias, vitals: ms (CLS: pontuação)"
    },
    "window_minutes": {
      "type": "integer",
      "description": "Janela de avaliação em minutos (5 a 10080)"
    },
    "sensitivity": {
      "type": "string",
      "description": "anomaly: low, medium ou high",
      "enum": [
        "low",
        "medium",
        "high"
      ]
    },
    "goal_id": {
      "type": "string",
      "description": "alertas de meta e de conversão: id da meta (goal_…)"
    },
    "uptime_check_id": {
      "type": "string",
      "description": "uptime/ssl: id da verificação (padrão: todas as verificações do site)"
    },
    "channel_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Ids dos canais de notificação (nch_…)"
    },
    "enabled": {
      "type": "boolean",
      "description": "Avaliar este alerta"
    },
    "name": {
      "type": "string",
      "description": "Nome do alerta"
    },
    "kind": {
      "type": "string",
      "description": "Tipo de alerta",
      "enum": [
        "threshold",
        "anomaly",
        "goal",
        "no_data",
        "usage",
        "uptime",
        "ssl",
        "vitals"
      ]
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do alerta, por exemplo alr_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Id do site (null para alertas de uso)"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "threshold, anomaly, goal, no_data, usage, uptime, ssl ou vitals"
    },
    "metric": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "operator": {
      "anyOf": [
        {
          "type": "string",
          "description": "gt, gte, lt ou lte"
        },
        {
          "type": "null"
        }
      ]
    },
    "threshold": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "window_minutes": {
      "type": "integer"
    },
    "sensitivity": {
      "type": "string",
      "description": "sensibilidade da anomalia"
    },
    "goal_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "channel_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Ids dos canais de notificação"
    },
    "state": {
      "type": "string",
      "description": "ok ou 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 Listar alertas de um site site_alerts_list

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/sites/:site_id/alerts.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "state": {
      "type": "string",
      "description": "Somente alertas ok ou triggered",
      "enum": [
        "ok",
        "triggered"
      ]
    },
    "kind": {
      "type": "string",
      "description": "Somente este tipo",
      "enum": [
        "threshold",
        "anomaly",
        "goal",
        "no_data",
        "usage",
        "uptime",
        "ssl",
        "vitals"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Página (a partir de 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultados por página (máx. 100)"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Id do alerta, por exemplo alr_7Q2K9XH3AB"
      },
      "site_id": {
        "anyOf": [
          {
            "type": "string",
            "description": "Id do site (null para alertas de uso)"
          },
          {
            "type": "null"
          }
        ]
      },
      "name": {
        "type": "string"
      },
      "kind": {
        "type": "string",
        "description": "threshold, anomaly, goal, no_data, usage, uptime, ssl ou vitals"
      },
      "metric": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "operator": {
        "anyOf": [
          {
            "type": "string",
            "description": "gt, gte, lt ou lte"
          },
          {
            "type": "null"
          }
        ]
      },
      "threshold": {
        "anyOf": [
          {
            "type": "number"
          },
          {
            "type": "null"
          }
        ]
      },
      "window_minutes": {
        "type": "integer"
      },
      "sensitivity": {
        "type": "string",
        "description": "sensibilidade da anomalia"
      },
      "goal_id": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "channel_ids": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Ids dos canais de notificação"
      },
      "state": {
        "type": "string",
        "description": "ok ou 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"
      }
    }
  }
}

Análises

GET /sites/:site_id/overview.json Visão geral do site: métricas, séries do gráfico, painéis principais, visitantes ao vivo e notas stats_overview

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/sites/:site_id/overview.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Predefinição de intervalo de datas. Use custom com 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": "Início do intervalo personalizado (fuso horário do site)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Fim do intervalo personalizado, inclusive"
    },
    "compare": {
      "type": "string",
      "description": "Período de comparação",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Início da comparação personalizada"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Fim da comparação personalizada"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Alinhar os dias da semana na comparação",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtros: [[\"dimension\",\"operator\",\"value\"], …]. Operadores: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Envolva as condições em {\"any\": [...]} para OU.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Aplicar um segmento salvo (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Adicionar dados históricos importados (datas anteriores ao primeiro evento nativo, ignorado quando filtros ou um segmento são aplicados)",
      "default": false
    },
    "interval": {
      "type": "string",
      "description": "Tamanho do intervalo do gráfico",
      "enum": [
        "auto",
        "minute",
        "hour",
        "day",
        "week",
        "month",
        "quarter",
        "year"
      ],
      "default": "auto"
    },
    "panels": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Dimensões para as quais incluir os principais valores",
      "default": [
        "channel",
        "referrer",
        "page",
        "entry_page",
        "country",
        "device",
        "browser",
        "os",
        "utm_campaign",
        "event",
        "goal"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object"
}
GET /sites/:site_id/experiments.json Relatório de experimento: taxa de conversão por variante, ganho em relação ao controle e significância (teste z de duas proporções) experiments_report

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/sites/:site_id/experiments.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Predefinição de intervalo de datas. Use custom com 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": "Início do intervalo personalizado (fuso horário do site)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Fim do intervalo personalizado, inclusive"
    },
    "compare": {
      "type": "string",
      "description": "Período de comparação",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Início da comparação personalizada"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Fim da comparação personalizada"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Alinhar os dias da semana na comparação",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtros: [[\"dimension\",\"operator\",\"value\"], …]. Operadores: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Envolva as condições em {\"any\": [...]} para OU.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Aplicar um segmento salvo (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Adicionar dados históricos importados (datas anteriores ao primeiro evento nativo, ignorado quando filtros ou um segmento são aplicados)",
      "default": false
    },
    "property": {
      "type": "string",
      "description": "Propriedade do evento que guarda a variante, por exemplo variant",
      "examples": [
        "variant"
      ]
    },
    "goal_id": {
      "type": "string",
      "description": "Meta contada como conversão (goal_…)"
    },
    "control": {
      "type": "string",
      "description": "Variante de controle (o padrão é \"control\" se existir, senão a variante com mais visitas)"
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "property",
    "goal_id",
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object"
}
GET /sites/:site_id/insights.json Mudanças notáveis em relação ao período anterior, em linguagem natural (maiores variações, mudanças de conversão de metas) insights_get

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/sites/:site_id/insights.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Dias completos até ontem, comparados com o mesmo número de dias anteriores",
      "enum": [
        "7d",
        "14d",
        "28d",
        "30d"
      ],
      "default": "7d"
    },
    "limit": {
      "type": "integer",
      "description": "Número máximo de insights (1 a 20)",
      "default": 8
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object"
}
GET /sites/:site_id/journeys.json Jornadas: os 3 principais caminhos de 3 etapas depois de uma página (ou qualquer entrada), ou antes de uma página ou meta journeys_explore

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/sites/:site_id/journeys.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Predefinição de intervalo de datas. Use custom com 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": "Início do intervalo personalizado (fuso horário do site)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Fim do intervalo personalizado, inclusive"
    },
    "compare": {
      "type": "string",
      "description": "Período de comparação",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Início da comparação personalizada"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Fim da comparação personalizada"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Alinhar os dias da semana na comparação",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtros: [[\"dimension\",\"operator\",\"value\"], …]. Operadores: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Envolva as condições em {\"any\": [...]} para OU.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Aplicar um segmento salvo (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Adicionar dados históricos importados (datas anteriores ao primeiro evento nativo, ignorado quando filtros ou um segmento são aplicados)",
      "default": false
    },
    "mode": {
      "type": "string",
      "description": "forward: páginas depois da página inicial, reverse: páginas que levam à página final ou meta",
      "enum": [
        "forward",
        "reverse"
      ],
      "default": "forward"
    },
    "path": {
      "type": "string",
      "description": "Página inicial (forward) ou página final (reverse). Vazio significa qualquer entrada (somente forward)"
    },
    "goal_id": {
      "type": "string",
      "description": "Modo reverse: terminar nesta meta (goal_…) em vez de uma página"
    },
    "limit": {
      "type": "integer",
      "description": "Páginas exibidas por etapa (máx. 12)",
      "default": 6
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object"
}
GET /sites/:site_id/pages/detail.json Detalhes da página: métricas, páginas anteriores e seguintes, origens, Web Vitals, eventos e mapa de cliques de um caminho pages_detail

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/sites/:site_id/pages/detail.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Predefinição de intervalo de datas. Use custom com 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": "Início do intervalo personalizado (fuso horário do site)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Fim do intervalo personalizado, inclusive"
    },
    "compare": {
      "type": "string",
      "description": "Período de comparação",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Início da comparação personalizada"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Fim da comparação personalizada"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Alinhar os dias da semana na comparação",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtros: [[\"dimension\",\"operator\",\"value\"], …]. Operadores: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Envolva as condições em {\"any\": [...]} para OU.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Aplicar um segmento salvo (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Adicionar dados históricos importados (datas anteriores ao primeiro evento nativo, ignorado quando filtros ou um segmento são aplicados)",
      "default": false
    },
    "path": {
      "type": "string",
      "description": "Caminho da página, por exemplo /pricing",
      "examples": [
        "/pricing"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "path",
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object"
}
GET /sites/:site_id/stats/aggregate.json Métricas principais de um período (com comparação) stats_aggregate

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/sites/:site_id/stats/aggregate.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Predefinição de intervalo de datas. Use custom com 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": "Início do intervalo personalizado (fuso horário do site)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Fim do intervalo personalizado, inclusive"
    },
    "compare": {
      "type": "string",
      "description": "Período de comparação",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Início da comparação personalizada"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Fim da comparação personalizada"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Alinhar os dias da semana na comparação",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtros: [[\"dimension\",\"operator\",\"value\"], …]. Operadores: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Envolva as condições em {\"any\": [...]} para OU.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Aplicar um segmento salvo (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Adicionar dados históricos importados (datas anteriores ao primeiro evento nativo, ignorado quando filtros ou um segmento são aplicados)",
      "default": false
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object"
}
GET /sites/:site_id/breakdown/:dimension.json Principais valores de uma dimensão (páginas, origens, países…) stats_breakdown

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/sites/:site_id/breakdown/:dimension.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Predefinição de intervalo de datas. Use custom com 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": "Início do intervalo personalizado (fuso horário do site)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Fim do intervalo personalizado, inclusive"
    },
    "compare": {
      "type": "string",
      "description": "Período de comparação",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Início da comparação personalizada"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Fim da comparação personalizada"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Alinhar os dias da semana na comparação",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtros: [[\"dimension\",\"operator\",\"value\"], …]. Operadores: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Envolva as condições em {\"any\": [...]} para OU.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Aplicar um segmento salvo (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Adicionar dados históricos importados (datas anteriores ao primeiro evento nativo, ignorado quando filtros ou um segmento são aplicados)",
      "default": false
    },
    "dimension": {
      "type": "string",
      "description": "Dimension do recurso"
    },
    "limit": {
      "type": "integer",
      "description": "Linhas por página (máx. 1000)",
      "default": 10
    },
    "page": {
      "type": "integer",
      "description": "Número da página",
      "default": 1
    },
    "sort": {
      "type": "string",
      "description": "Métrica de ordenação",
      "enum": [
        "visitors",
        "visits",
        "pageviews",
        "revenue"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "dimension",
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object"
}
GET /sites/:site_id/stats/timeseries.json Métricas por intervalo de tempo para gráficos stats_timeseries

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/sites/:site_id/stats/timeseries.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Predefinição de intervalo de datas. Use custom com 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": "Início do intervalo personalizado (fuso horário do site)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Fim do intervalo personalizado, inclusive"
    },
    "compare": {
      "type": "string",
      "description": "Período de comparação",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Início da comparação personalizada"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Fim da comparação personalizada"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Alinhar os dias da semana na comparação",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtros: [[\"dimension\",\"operator\",\"value\"], …]. Operadores: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Envolva as condições em {\"any\": [...]} para OU.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Aplicar um segmento salvo (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Adicionar dados históricos importados (datas anteriores ao primeiro evento nativo, ignorado quando filtros ou um segmento são aplicados)",
      "default": false
    },
    "interval": {
      "type": "string",
      "description": "Tamanho do intervalo. auto escolhe um para o período",
      "enum": [
        "auto",
        "minute",
        "hour",
        "day",
        "week",
        "month",
        "quarter",
        "year"
      ],
      "default": "auto"
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object"
}

Ao vivo

GET /sites/:site_id/live.json Visitantes ao vivo, fluxo de atividade e o que está popular agora (últimos 30 minutos) live_get

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/sites/:site_id/live.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "feed": {
      "type": "string",
      "description": "Fluxo de atividade: todos os hits, visualizações de página ou eventos personalizados",
      "enum": [
        "all",
        "pageviews",
        "events"
      ],
      "default": "all"
    },
    "limit": {
      "type": "integer",
      "description": "Entradas do fluxo de atividade (máx. 100)",
      "default": 50
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object"
}
GET /sites/:site_id/live/wallboard.json Cartões do wallboard (ao vivo e hoje) de um ou mais sites live_wallboard

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/sites/:site_id/live/wallboard.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Ids dos sites para alternar (o padrão é este site)",
      "default": []
    },
    "rotate_seconds": {
      "type": "integer",
      "description": "Segundos que cada site fica na tela (5-300)",
      "default": 20
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object"
}
GET /wallboard/:token.json Wallboard para um token de wallboard (sem necessidade de login) live_public_wallboard

Permissão: public · Somente HTTP (não é uma ferramenta MCP)

Exemplo
curl https://privatusanalytics.com/wallboard/:token.json
Entradas
{
  "type": "object",
  "properties": {
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Ids dos sites para alternar (o padrão é este site)",
      "default": []
    },
    "rotate_seconds": {
      "type": "integer",
      "description": "Segundos que cada site fica na tela (5-300)",
      "default": 20
    },
    "token": {
      "type": "string",
      "description": "Token do recurso"
    }
  },
  "required": [
    "token"
  ]
}
Dados da resposta
{
  "type": "object"
}

Assistente

POST /sites/:site_id/ask.json Fazer uma pergunta em uma nova conversa (conta para o limite mensal de perguntas de IA) assistant_ask

Permissão: analytics.read

Exemplo
curl -X POST https://privatusanalytics.com/sites/:site_id/ask.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "question": {
      "type": "string",
      "description": "Sua primeira pergunta em linguagem natural",
      "examples": [
        "How many visitors did we have last week?"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "question",
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id da conversa, por exemplo ask_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Id do site"
        },
        {
          "type": "null"
        }
      ]
    },
    "title": {
      "anyOf": [
        {
          "type": "string",
          "description": "A primeira pergunta, abreviada"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Hora da última mensagem"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time",
      "description": "Excluída automaticamente após este momento (30 dias após a última mensagem)"
    },
    "messages": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Id da mensagem dentro da conversa"
        },
        "role": {
          "type": "string",
          "description": "user (a pergunta) ou assistant (a resposta)"
        },
        "content": {
          "type": "string",
          "description": "A pergunta, ou a resposta em Markdown"
        },
        "queries": {
          "type": "array",
          "items": {
            "type": "object"
          },
          "description": "Como cheguei a isso: as consultas exatas da API por trás da resposta, como [{tool, input, status, error}]"
        },
        "chart": {
          "anyOf": [
            {
              "type": "object",
              "description": "Gráfico da resposta: {type: line, labels, series, comparison, metric, format} ou {type: table, columns, rows}"
            },
            {
              "type": "null"
            }
          ]
        },
        "goal_draft": {
          "anyOf": [
            {
              "type": "object",
              "description": "Uma meta proposta pelo assistente, para confirmar com goals_create"
            },
            {
              "type": "null"
            }
          ]
        },
        "input_tokens": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Tokens de entrada do modelo usados"
            },
            {
              "type": "null"
            }
          ]
        },
        "output_tokens": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Tokens de saída do modelo usados"
            },
            {
              "type": "null"
            }
          ]
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        }
      },
      "description": "Perguntas e respostas, das mais antigas para as mais recentes"
    }
  }
}
DELETE /sites/:site_id/ask/:id.json Excluir uma conversa do Ask e suas mensagens assistant_conversations_delete

Permissão: analytics.read

Exemplo
curl -X DELETE https://privatusanalytics.com/sites/:site_id/ask/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id da conversa, por exemplo ask_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Id do site"
        },
        {
          "type": "null"
        }
      ]
    },
    "title": {
      "anyOf": [
        {
          "type": "string",
          "description": "A primeira pergunta, abreviada"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Hora da última mensagem"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time",
      "description": "Excluída automaticamente após este momento (30 dias após a última mensagem)"
    }
  }
}
GET /sites/:site_id/ask.json Listar suas conversas do Ask de um site assistant_conversations_list

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/sites/:site_id/ask.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Página (a partir de 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultados por página (máx. 100)"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Id da conversa, por exemplo ask_7Q2K9XH3AB"
      },
      "site_id": {
        "anyOf": [
          {
            "type": "string",
            "description": "Id do site"
          },
          {
            "type": "null"
          }
        ]
      },
      "title": {
        "anyOf": [
          {
            "type": "string",
            "description": "A primeira pergunta, abreviada"
          },
          {
            "type": "null"
          }
        ]
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      },
      "updated_at": {
        "type": "string",
        "format": "date-time",
        "description": "Hora da última mensagem"
      },
      "expires_at": {
        "type": "string",
        "format": "date-time",
        "description": "Excluída automaticamente após este momento (30 dias após a última mensagem)"
      }
    }
  }
}
GET /sites/:site_id/ask/:id.json Uma conversa do Ask: perguntas, respostas, as consultas por trás delas e gráficos assistant_conversations_get

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/sites/:site_id/ask/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id da conversa, por exemplo ask_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Id do site"
        },
        {
          "type": "null"
        }
      ]
    },
    "title": {
      "anyOf": [
        {
          "type": "string",
          "description": "A primeira pergunta, abreviada"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Hora da última mensagem"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time",
      "description": "Excluída automaticamente após este momento (30 dias após a última mensagem)"
    },
    "messages": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Id da mensagem dentro da conversa"
        },
        "role": {
          "type": "string",
          "description": "user (a pergunta) ou assistant (a resposta)"
        },
        "content": {
          "type": "string",
          "description": "A pergunta, ou a resposta em Markdown"
        },
        "queries": {
          "type": "array",
          "items": {
            "type": "object"
          },
          "description": "Como cheguei a isso: as consultas exatas da API por trás da resposta, como [{tool, input, status, error}]"
        },
        "chart": {
          "anyOf": [
            {
              "type": "object",
              "description": "Gráfico da resposta: {type: line, labels, series, comparison, metric, format} ou {type: table, columns, rows}"
            },
            {
              "type": "null"
            }
          ]
        },
        "goal_draft": {
          "anyOf": [
            {
              "type": "object",
              "description": "Uma meta proposta pelo assistente, para confirmar com goals_create"
            },
            {
              "type": "null"
            }
          ]
        },
        "input_tokens": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Tokens de entrada do modelo usados"
            },
            {
              "type": "null"
            }
          ]
        },
        "output_tokens": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Tokens de saída do modelo usados"
            },
            {
              "type": "null"
            }
          ]
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        }
      },
      "description": "Perguntas e respostas, das mais antigas para as mais recentes"
    }
  }
}
POST /sites/:site_id/ask/:ask_conversation_id/messages.json Fazer uma pergunta de acompanhamento em uma conversa (conta para o limite mensal de perguntas de IA). Retorna a resposta. assistant_ask_followup

Permissão: analytics.read

Exemplo
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 '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "question": {
      "type": "string",
      "description": "Sua pergunta em linguagem natural",
      "examples": [
        "Which pages had the most visitors last week?"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    },
    "ask_conversation_id": {
      "type": "string",
      "description": "Ask conversation do recurso"
    }
  },
  "required": [
    "question",
    "site_id",
    "ask_conversation_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id da mensagem dentro da conversa"
    },
    "role": {
      "type": "string",
      "description": "user (a pergunta) ou assistant (a resposta)"
    },
    "content": {
      "type": "string",
      "description": "A pergunta, ou a resposta em Markdown"
    },
    "queries": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Como cheguei a isso: as consultas exatas da API por trás da resposta, como [{tool, input, status, error}]"
    },
    "chart": {
      "anyOf": [
        {
          "type": "object",
          "description": "Gráfico da resposta: {type: line, labels, series, comparison, metric, format} ou {type: table, columns, rows}"
        },
        {
          "type": "null"
        }
      ]
    },
    "goal_draft": {
      "anyOf": [
        {
          "type": "object",
          "description": "Uma meta proposta pelo assistente, para confirmar com goals_create"
        },
        {
          "type": "null"
        }
      ]
    },
    "input_tokens": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Tokens de entrada do modelo usados"
        },
        {
          "type": "null"
        }
      ]
    },
    "output_tokens": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Tokens de saída do modelo usados"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Busca

GET /sites/:site_id/search.json Relatório de busca: cliques, impressões, CTR, posição, principais consultas/páginas, páginas de destino e oportunidades search_report

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/sites/:site_id/search.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Predefinição de intervalo de datas. Use custom com 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": "Início do intervalo personalizado (fuso horário do site)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Fim do intervalo personalizado, inclusive"
    },
    "compare": {
      "type": "string",
      "description": "Período de comparação",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Início da comparação personalizada"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Fim da comparação personalizada"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Alinhar os dias da semana na comparação",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtros: [[\"dimension\",\"operator\",\"value\"], …]. Operadores: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Envolva as condições em {\"any\": [...]} para OU.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Aplicar um segmento salvo (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Adicionar dados históricos importados (datas anteriores ao primeiro evento nativo, ignorado quando filtros ou um segmento são aplicados)",
      "default": false
    },
    "provider": {
      "type": "string",
      "description": "google (Search Console) ou bing",
      "enum": [
        "google",
        "bing"
      ],
      "default": "google"
    },
    "limit": {
      "type": "integer",
      "description": "Linhas por tabela (máx. 100)",
      "default": 25
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object"
}
POST /sites/:site_id/search/connections.json Conectar uma propriedade do Search Console ou um site do Bing search_connect

Permissão: sites.manage

Exemplo
curl -X POST https://privatusanalytics.com/sites/:site_id/search/connections.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "provider": {
      "type": "string",
      "description": "google ou bing",
      "enum": [
        "google",
        "bing"
      ],
      "default": "google"
    },
    "property": {
      "type": "string",
      "description": "Propriedade do Search Console (por exemplo sc-domain:example.com) ou URL do site no Bing",
      "examples": [
        "sc-domain:example.com"
      ]
    },
    "bing_api_key": {
      "type": "string",
      "description": "Sua própria chave de API do Bing Webmaster Tools (Settings > API access). Obrigatória quando provider é bing. Armazenada com criptografia e nunca retornada."
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "property",
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "provider": {
      "type": "string",
      "description": "google ou bing"
    },
    "property": {
      "type": "string",
      "description": "Propriedade do Search Console ou URL do site no Bing"
    },
    "status": {
      "type": "string",
      "description": "active ou 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 Desconectar o Search Console ou o Bing e excluir seus dados search_disconnect

Permissão: sites.manage

Exemplo
curl -X DELETE https://privatusanalytics.com/sites/:site_id/search/connections/:provider.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    },
    "provider": {
      "type": "string",
      "description": "Provider do recurso"
    }
  },
  "required": [
    "site_id",
    "provider"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "provider": {
      "type": "string",
      "description": "google ou bing"
    },
    "property": {
      "type": "string",
      "description": "Propriedade do Search Console ou URL do site no Bing"
    },
    "status": {
      "type": "string",
      "description": "active ou 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 Listar propriedades que você pode conectar (o Search Console exige uma autorização do Google pelo navegador) search_properties

Permissão: sites.manage

Exemplo
curl -X POST https://privatusanalytics.com/sites/:site_id/search/properties.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "provider": {
      "type": "string",
      "description": "google ou bing",
      "enum": [
        "google",
        "bing"
      ],
      "default": "google"
    },
    "bing_api_key": {
      "type": "string",
      "description": "Sua própria chave de API do Bing Webmaster Tools (Settings > API access). Obrigatória quando provider é bing. Usada apenas para listar os sites que ela consegue ver."
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object"
}
POST /sites/:site_id/search/sync.json Importar dados de busca agora search_sync

Permissão: sites.manage

Exemplo
curl -X POST https://privatusanalytics.com/sites/:site_id/search/sync.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "provider": {
      "type": "string",
      "description": "google ou bing",
      "enum": [
        "google",
        "bing"
      ],
      "default": "google"
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "provider": {
      "type": "string",
      "description": "google ou bing"
    },
    "property": {
      "type": "string",
      "description": "Propriedade do Search Console ou URL do site no Bing"
    },
    "status": {
      "type": "string",
      "description": "active ou error"
    },
    "last_synced_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Campanhas

POST /sites/:site_id/campaigns/costs.json Definir o gasto de uma campanha em um mês campaign_costs_create

Permissão: content.write

Exemplo
curl -X POST https://privatusanalytics.com/sites/:site_id/campaigns/costs.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "campaign": {
      "type": "string",
      "description": "Valor de utm_campaign ao qual o gasto pertence",
      "examples": [
        "spring_sale"
      ]
    },
    "month": {
      "type": "string",
      "description": "Mês, AAAA-MM",
      "examples": [
        "2026-09"
      ]
    },
    "amount": {
      "type": "number",
      "description": "Gasto em unidades principais, por exemplo 1250.50"
    },
    "currency": {
      "type": "string",
      "description": "Moeda ISO 4217 (padrão: a moeda do site)"
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "campaign",
    "month",
    "amount",
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id do lançamento de custo"
    },
    "campaign": {
      "type": "string",
      "description": "Valor de utm_campaign"
    },
    "month": {
      "type": "string",
      "description": "Mês, AAAA-MM"
    },
    "amount_minor": {
      "type": "integer",
      "description": "Gasto em unidades menores"
    },
    "currency": {
      "type": "string",
      "description": "Moeda ISO 4217 do valor"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:site_id/campaigns/costs/:id.json Excluir um lançamento de custo de campanha campaign_costs_delete

Permissão: content.write

Exemplo
curl -X DELETE https://privatusanalytics.com/sites/:site_id/campaigns/costs/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id do lançamento de custo"
    },
    "campaign": {
      "type": "string",
      "description": "Valor de utm_campaign"
    },
    "month": {
      "type": "string",
      "description": "Mês, AAAA-MM"
    },
    "amount_minor": {
      "type": "integer",
      "description": "Gasto em unidades menores"
    },
    "currency": {
      "type": "string",
      "description": "Moeda ISO 4217 do valor"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /sites/:site_id/campaigns/costs/import.json Importar custos de campanha de um CSV (campaign,month,amount[,currency]) campaign_costs_import

Permissão: content.write

Exemplo
curl -X POST https://privatusanalytics.com/sites/:site_id/campaigns/costs/import.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "file": {
      "type": "string",
      "format": "binary",
      "description": "Upload de arquivo CSV (formulários multipart)"
    },
    "csv": {
      "type": "string",
      "description": "Texto CSV: campaign,month,amount[,currency]"
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "imported": {
      "type": "integer",
      "description": "Linhas salvas"
    },
    "failed": {
      "type": "integer",
      "description": "Linhas ignoradas"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Por que as linhas foram ignoradas (as primeiras 50)"
    }
  }
}
GET /sites/:site_id/campaigns/costs.json Listar lançamentos de custo de campanha campaign_costs_list

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/sites/:site_id/campaigns/costs.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "campaign": {
      "type": "string",
      "description": "Somente esta campanha"
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Página (a partir de 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultados por página (máx. 100)"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "format": "uuid",
        "description": "Id do lançamento de custo"
      },
      "campaign": {
        "type": "string",
        "description": "Valor de utm_campaign"
      },
      "month": {
        "type": "string",
        "description": "Mês, AAAA-MM"
      },
      "amount_minor": {
        "type": "integer",
        "description": "Gasto em unidades menores"
      },
      "currency": {
        "type": "string",
        "description": "Moeda ISO 4217 do valor"
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      },
      "updated_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
PATCH /sites/:site_id/campaigns/costs/:id.json Alterar um lançamento de custo de campanha campaign_costs_update

Permissão: content.write

Exemplo
curl -X PATCH https://privatusanalytics.com/sites/:site_id/campaigns/costs/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "campaign": {
      "type": "string",
      "description": "Valor de utm_campaign"
    },
    "month": {
      "type": "string",
      "description": "Mês, AAAA-MM"
    },
    "amount": {
      "type": "number",
      "description": "Gasto em unidades principais"
    },
    "currency": {
      "type": "string",
      "description": "Moeda ISO 4217"
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id do lançamento de custo"
    },
    "campaign": {
      "type": "string",
      "description": "Valor de utm_campaign"
    },
    "month": {
      "type": "string",
      "description": "Mês, AAAA-MM"
    },
    "amount_minor": {
      "type": "integer",
      "description": "Gasto em unidades menores"
    },
    "currency": {
      "type": "string",
      "description": "Moeda ISO 4217 do valor"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/campaigns/builder.json Montar e validar uma URL com tags UTM campaigns_builder

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/sites/:site_id/campaigns/builder.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "destination": {
      "type": "string",
      "description": "URL da página de destino (https://…)",
      "examples": [
        "https://example.com/pricing"
      ]
    },
    "preset": {
      "type": "string",
      "description": "Preencher utm_source/utm_medium para um canal quando estiverem em branco",
      "enum": [
        "newsletter",
        "social",
        "paid_search",
        "paid_social",
        "print",
        "partner"
      ]
    },
    "utm_source": {
      "type": "string",
      "description": "De onde vem o tráfego"
    },
    "utm_medium": {
      "type": "string",
      "description": "Meio de marketing, por exemplo email, cpc"
    },
    "utm_campaign": {
      "type": "string",
      "description": "Nome da campanha, por exemplo spring_sale"
    },
    "utm_content": {
      "type": "string",
      "description": "Variante, por exemplo header_button"
    },
    "utm_term": {
      "type": "string",
      "description": "Palavra-chave de busca paga"
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "url": {
      "anyOf": [
        {
          "type": "string",
          "description": "URL com tags (null enquanto houver erros)"
        },
        {
          "type": "null"
        }
      ]
    },
    "valid": {
      "type": "boolean",
      "description": "True quando não há erros"
    },
    "destination": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "preset": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "utm_source": {
      "anyOf": [
        {
          "type": "string",
          "description": "utm_source normalizado"
        },
        {
          "type": "null"
        }
      ]
    },
    "utm_medium": {
      "anyOf": [
        {
          "type": "string",
          "description": "utm_medium normalizado"
        },
        {
          "type": "null"
        }
      ]
    },
    "utm_campaign": {
      "anyOf": [
        {
          "type": "string",
          "description": "utm_campaign normalizado"
        },
        {
          "type": "null"
        }
      ]
    },
    "utm_content": {
      "anyOf": [
        {
          "type": "string",
          "description": "utm_content normalizado"
        },
        {
          "type": "null"
        }
      ]
    },
    "utm_term": {
      "anyOf": [
        {
          "type": "string",
          "description": "utm_term normalizado"
        },
        {
          "type": "null"
        }
      ]
    },
    "issues": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "field, level (error ou warning) e message"
    },
    "presets": {
      "type": "object",
      "description": "Predefinições de canal: utm_source/utm_medium por predefinição"
    }
  }
}
GET /sites/:site_id/campaigns/hygiene.json Higiene de UTM: valores quase duplicados, problemas de estilo e origens desconhecidas campaigns_hygiene

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/sites/:site_id/campaigns/hygiene.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Predefinição de intervalo de datas. Use custom com 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": "Início do intervalo personalizado (fuso horário do site)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Fim do intervalo personalizado, inclusive"
    },
    "compare": {
      "type": "string",
      "description": "Período de comparação",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Início da comparação personalizada"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Fim da comparação personalizada"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Alinhar os dias da semana na comparação",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtros: [[\"dimension\",\"operator\",\"value\"], …]. Operadores: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Envolva as condições em {\"any\": [...]} para OU.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Aplicar um segmento salvo (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Adicionar dados históricos importados (datas anteriores ao primeiro evento nativo, ignorado quando filtros ou um segmento são aplicados)",
      "default": false
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "period": {
      "type": "object",
      "description": "from/to do período (UTC)"
    },
    "duplicates": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Valores quase duplicados: field, suggestion e variantes [{value, visits}]"
    },
    "style_issues": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Valores que não estão em minúsculas com sublinhados: field, value, visits, suggestion"
    },
    "unknown_sources": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Valores de utm_source que não reconhecemos: value, visits"
    }
  }
}
GET /sites/:site_id/campaigns.json Resumo de campanhas com conversões, receita, custo, CPA e ROAS campaigns_list

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/sites/:site_id/campaigns.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Predefinição de intervalo de datas. Use custom com 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": "Início do intervalo personalizado (fuso horário do site)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Fim do intervalo personalizado, inclusive"
    },
    "compare": {
      "type": "string",
      "description": "Período de comparação",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Início da comparação personalizada"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Fim da comparação personalizada"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Alinhar os dias da semana na comparação",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtros: [[\"dimension\",\"operator\",\"value\"], …]. Operadores: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Envolva as condições em {\"any\": [...]} para OU.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Aplicar um segmento salvo (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Adicionar dados históricos importados (datas anteriores ao primeiro evento nativo, ignorado quando filtros ou um segmento são aplicados)",
      "default": false
    },
    "goal_id": {
      "type": "string",
      "description": "Meta (goal_…) cujas conversões serão contadas. O padrão é a primeira meta ativa"
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "period": {
      "type": "object",
      "description": "from/to do período (UTC)"
    },
    "currency": {
      "type": "string",
      "description": "Moeda do site para receita e custo"
    },
    "goal_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Meta contada como conversão"
        },
        {
          "type": "null"
        }
      ]
    },
    "goal_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "campaigns": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Por utm_campaign: visitors, visits, conversions, conversion_rate, revenue, cost, cpa (unidades menores), roas (receita ÷ custo) e sources [{source, medium, visitors, visits, conversions, conversion_rate, revenue}]"
    },
    "totals": {
      "type": "object",
      "description": "Somas de todas as campanhas listadas"
    }
  }
}

Canais de notificação

POST /workspaces/:workspace_id/channels.json Adicionar um canal de notificação notification_channels_create

Permissão: content.write

Exemplo
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/channels.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "URL do webhook (slack, teams, discord, webhook), HTTPS"
    },
    "secret": {
      "type": "string",
      "description": "webhook: segredo HMAC para X-Privatus-Signature"
    },
    "emails": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "email: endereços dos destinatários (máx. 20)"
    },
    "routing_key": {
      "type": "string",
      "description": "pagerduty: chave de integração da Events API v2"
    },
    "api_key": {
      "type": "string",
      "description": "opsgenie: chave de integração da API"
    },
    "region": {
      "type": "string",
      "description": "opsgenie: região da conta",
      "enum": [
        "us",
        "eu"
      ]
    },
    "kind": {
      "type": "string",
      "description": "email, slack, teams, discord, webhook, pagerduty, opsgenie ou push",
      "enum": [
        "email",
        "slack",
        "teams",
        "discord",
        "webhook",
        "pagerduty",
        "opsgenie",
        "push"
      ]
    },
    "name": {
      "type": "string",
      "description": "Nome de exibição",
      "examples": [
        "#alerts"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "kind",
    "name",
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do canal, por exemplo nch_7Q2K9XH3AB"
    },
    "kind": {
      "type": "string",
      "description": "email, slack, teams, discord, webhook, pagerduty, opsgenie ou push"
    },
    "name": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "Destino mascarado"
    },
    "last_used_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /channels/:id.json Excluir um canal de notificação notification_channels_delete

Permissão: content.write

Exemplo
curl -X DELETE https://privatusanalytics.com/channels/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do canal, por exemplo nch_7Q2K9XH3AB"
    },
    "kind": {
      "type": "string",
      "description": "email, slack, teams, discord, webhook, pagerduty, opsgenie ou push"
    },
    "name": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "Destino mascarado"
    },
    "last_used_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /workspaces/:workspace_id/channels.json Listar canais de notificação notification_channels_list

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/workspaces/:workspace_id/channels.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "description": "Somente canais deste tipo",
      "enum": [
        "email",
        "slack",
        "teams",
        "discord",
        "webhook",
        "pagerduty",
        "opsgenie",
        "push"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Página (a partir de 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultados por página (máx. 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Id do canal, por exemplo nch_7Q2K9XH3AB"
      },
      "kind": {
        "type": "string",
        "description": "email, slack, teams, discord, webhook, pagerduty, opsgenie ou push"
      },
      "name": {
        "type": "string"
      },
      "target": {
        "type": "string",
        "description": "Destino mascarado"
      },
      "last_used_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
POST /channels/:id/send_test.json Enviar uma mensagem de teste por um canal notification_channels_send_test

Permissão: content.write

Exemplo
curl -X POST https://privatusanalytics.com/channels/:id/send_test.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do canal, por exemplo nch_7Q2K9XH3AB"
    },
    "kind": {
      "type": "string",
      "description": "email, slack, teams, discord, webhook, pagerduty, opsgenie ou push"
    },
    "name": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "Destino mascarado"
    },
    "last_used_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /channels/:id.json Obter um canal de notificação notification_channels_get

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/channels/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do canal, por exemplo nch_7Q2K9XH3AB"
    },
    "kind": {
      "type": "string",
      "description": "email, slack, teams, discord, webhook, pagerduty, opsgenie ou push"
    },
    "name": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "Destino mascarado"
    },
    "last_used_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
PATCH /channels/:id.json Atualizar um canal de notificação notification_channels_update

Permissão: content.write

Exemplo
curl -X PATCH https://privatusanalytics.com/channels/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "URL do webhook (slack, teams, discord, webhook), HTTPS"
    },
    "secret": {
      "type": "string",
      "description": "webhook: segredo HMAC para X-Privatus-Signature"
    },
    "emails": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "email: endereços dos destinatários (máx. 20)"
    },
    "routing_key": {
      "type": "string",
      "description": "pagerduty: chave de integração da Events API v2"
    },
    "api_key": {
      "type": "string",
      "description": "opsgenie: chave de integração da API"
    },
    "region": {
      "type": "string",
      "description": "opsgenie: região da conta",
      "enum": [
        "us",
        "eu"
      ]
    },
    "name": {
      "type": "string",
      "description": "Nome de exibição"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do canal, por exemplo nch_7Q2K9XH3AB"
    },
    "kind": {
      "type": "string",
      "description": "email, slack, teams, discord, webhook, pagerduty, opsgenie ou push"
    },
    "name": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "Destino mascarado"
    },
    "last_used_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /push_subscription.json Registrar um navegador para notificações push push_subscriptions_create

Permissão: member

Exemplo
curl -X POST https://privatusanalytics.com/push_subscription.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "endpoint": {
      "type": "string",
      "description": "PushSubscription.endpoint do navegador"
    },
    "p256dh": {
      "type": "string",
      "description": "PushSubscription keys.p256dh (base64url)"
    },
    "auth": {
      "type": "string",
      "description": "PushSubscription keys.auth (base64url)"
    }
  },
  "required": [
    "endpoint",
    "p256dh",
    "auth"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "endpoint_host": {
      "type": "string",
      "description": "Host do serviço de push"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /push_subscription.json Remover o registro push de um navegador push_subscriptions_delete

Permissão: member

Exemplo
curl -X DELETE https://privatusanalytics.com/push_subscription.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "endpoint": {
      "type": "string",
      "description": "PushSubscription.endpoint a remover"
    }
  },
  "required": [
    "endpoint"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "endpoint_host": {
      "type": "string",
      "description": "Host do serviço de push"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Cobrança

POST /workspaces/:workspace_id/billing/badge.json Aderir ou não ao bônus do selo (plano gratuito) billing_badge

Permissão: billing.manage

Exemplo
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/billing/badge.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "enabled": {
      "type": "boolean",
      "description": "true para verificar o selo e ganhar o bônus"
    },
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "enabled",
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string"
    },
    "plan": {
      "type": "string",
      "description": "free, pro, business ou enterprise"
    },
    "plan_events": {
      "type": "integer",
      "description": "Eventos ao mês na faixa paga"
    },
    "allowance": {
      "type": "integer",
      "description": "Eventos ao mês incluindo qualquer bônus do selo"
    },
    "billing_interval": {
      "anyOf": [
        {
          "type": "string",
          "description": "month ou year"
        },
        {
          "type": "null"
        }
      ]
    },
    "price": {
      "anyOf": [
        {
          "type": "integer",
          "description": "USD por intervalo de cobrança"
        },
        {
          "type": "null"
        }
      ]
    },
    "subscription_status": {
      "type": "string",
      "description": "none, trialing, active, past_due, paused ou canceled"
    },
    "current_period_ends_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Renova ou termina em"
        },
        {
          "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 ou agency"
            },
            "status": {
              "type": "string",
              "description": "pending, approved (ainda não aplicado à assinatura), active, rejected ou revoked"
            },
            "percent": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Percentual de desconto no Pro e no Business (null no programa gratuito de código aberto)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "comp_events": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Eventos grátis por mês (apenas no programa gratuito de código aberto)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "organization_name": {
              "type": "string",
              "description": "Nome da organização, escola, projeto ou agência"
            },
            "website": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Site"
                },
                {
                  "type": "null"
                }
              ]
            },
            "proof_url": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Link de comprovação ou URL do repositório"
                },
                {
                  "type": "null"
                }
              ]
            },
            "license": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Licença OSI (código aberto)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "note": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Nota para a análise"
                },
                {
                  "type": "null"
                }
              ]
            },
            "rejection_reason": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Por que a solicitação não foi aprovada"
                },
                {
                  "type": "null"
                }
              ]
            },
            "created_at": {
              "type": "string",
              "format": "date-time",
              "description": "Solicitado em"
            },
            "reviewed_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Analisado em"
                },
                {
                  "type": "null"
                }
              ]
            },
            "applied_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Desconto ativo desde"
                },
                {
                  "type": "null"
                }
              ]
            },
            "revoked_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Programa encerrado em"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "A solicitação mais recente de programa de desconto, ou null"
        },
        {
          "type": "null"
        }
      ]
    },
    "discount_percent": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Percentual de desconto no Pro e no Business de um programa aprovado, ou null"
        },
        {
          "type": "null"
        }
      ]
    },
    "billing_emails": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "tax_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "badge": {
      "type": "object",
      "description": "Bônus do selo (plano gratuito)"
    },
    "usage": {
      "type": "object",
      "properties": {
        "month": {
          "type": "string",
          "format": "date",
          "description": "Primeiro dia do mês informado"
        },
        "events": {
          "type": "integer",
          "description": "Eventos faturáveis (visualizações de página e eventos personalizados)"
        },
        "bots": {
          "type": "integer",
          "description": "Hits de bots filtrados (não cobrados)"
        },
        "allowance": {
          "type": "integer",
          "description": "Eventos incluídos, com o bônus do selo, se houver"
        },
        "percent": {
          "type": "number",
          "description": "Eventos como percentual da franquia"
        },
        "forecast": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Eventos projetados para o fim do mês"
            },
            {
              "type": "null"
            }
          ]
        },
        "forecast_percent": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "days_left": {
          "type": "integer",
          "description": "Dias restantes no mês"
        },
        "status": {
          "type": "string",
          "description": "ok, warning (80% ou mais), over (um mês passado que atingiu ou superou a franquia), locked ou paused"
        },
        "sites": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "site_id": {
                "type": "string"
              },
              "domain": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "events": {
                "type": "integer",
                "description": "Visualizações de página e eventos personalizados neste mês"
              },
              "share": {
                "type": "number",
                "description": "Porcentagem do total do espaço de trabalho"
              }
            }
          },
          "description": "Eventos por site"
        },
        "history": {
          "type": "array",
          "description": "Meses anteriores, do mais recente para o mais antigo"
        },
        "access_locked_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Painéis bloqueados pela equipe do Privatus Analytics desde"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused": {
          "type": "boolean",
          "description": "True enquanto novos eventos são descartados (o limite mensal foi atingido ou a equipe pausou a coleta)"
        },
        "pause_reason": {
          "anyOf": [
            {
              "type": "string",
              "description": "Por que a coleta está pausada: limit (a franquia mensal foi atingida) ou staff. null quando está coletando"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Quando a equipe pausou a coleta"
            },
            {
              "type": "null"
            }
          ]
        },
        "resumes_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Quando termina uma pausa por limite: no início do mês seguinte (UTC), ou antes em caso de upgrade. null nos demais casos"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "description": "Este mês até agora"
    }
  }
}
POST /workspaces/:workspace_id/billing/cancel.json Cancelar no fim do período de cobrança billing_cancel

Permissão: billing.manage

Exemplo
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/billing/cancel.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "reason": {
      "type": "string",
      "description": "Principal motivo do cancelamento (pesquisa opcional)",
      "enum": [
        "too_expensive",
        "missing_features",
        "switching_tool",
        "not_using",
        "temporary",
        "other"
      ]
    },
    "comment": {
      "type": "string",
      "description": "Algo que poderíamos fazer melhor"
    },
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string"
    },
    "plan": {
      "type": "string",
      "description": "free, pro, business ou enterprise"
    },
    "plan_events": {
      "type": "integer",
      "description": "Eventos ao mês na faixa paga"
    },
    "allowance": {
      "type": "integer",
      "description": "Eventos ao mês incluindo qualquer bônus do selo"
    },
    "billing_interval": {
      "anyOf": [
        {
          "type": "string",
          "description": "month ou year"
        },
        {
          "type": "null"
        }
      ]
    },
    "price": {
      "anyOf": [
        {
          "type": "integer",
          "description": "USD por intervalo de cobrança"
        },
        {
          "type": "null"
        }
      ]
    },
    "subscription_status": {
      "type": "string",
      "description": "none, trialing, active, past_due, paused ou canceled"
    },
    "current_period_ends_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Renova ou termina em"
        },
        {
          "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 ou agency"
            },
            "status": {
              "type": "string",
              "description": "pending, approved (ainda não aplicado à assinatura), active, rejected ou revoked"
            },
            "percent": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Percentual de desconto no Pro e no Business (null no programa gratuito de código aberto)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "comp_events": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Eventos grátis por mês (apenas no programa gratuito de código aberto)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "organization_name": {
              "type": "string",
              "description": "Nome da organização, escola, projeto ou agência"
            },
            "website": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Site"
                },
                {
                  "type": "null"
                }
              ]
            },
            "proof_url": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Link de comprovação ou URL do repositório"
                },
                {
                  "type": "null"
                }
              ]
            },
            "license": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Licença OSI (código aberto)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "note": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Nota para a análise"
                },
                {
                  "type": "null"
                }
              ]
            },
            "rejection_reason": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Por que a solicitação não foi aprovada"
                },
                {
                  "type": "null"
                }
              ]
            },
            "created_at": {
              "type": "string",
              "format": "date-time",
              "description": "Solicitado em"
            },
            "reviewed_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Analisado em"
                },
                {
                  "type": "null"
                }
              ]
            },
            "applied_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Desconto ativo desde"
                },
                {
                  "type": "null"
                }
              ]
            },
            "revoked_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Programa encerrado em"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "A solicitação mais recente de programa de desconto, ou null"
        },
        {
          "type": "null"
        }
      ]
    },
    "discount_percent": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Percentual de desconto no Pro e no Business de um programa aprovado, ou null"
        },
        {
          "type": "null"
        }
      ]
    },
    "billing_emails": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "tax_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "badge": {
      "type": "object",
      "description": "Bônus do selo (plano gratuito)"
    },
    "usage": {
      "type": "object",
      "properties": {
        "month": {
          "type": "string",
          "format": "date",
          "description": "Primeiro dia do mês informado"
        },
        "events": {
          "type": "integer",
          "description": "Eventos faturáveis (visualizações de página e eventos personalizados)"
        },
        "bots": {
          "type": "integer",
          "description": "Hits de bots filtrados (não cobrados)"
        },
        "allowance": {
          "type": "integer",
          "description": "Eventos incluídos, com o bônus do selo, se houver"
        },
        "percent": {
          "type": "number",
          "description": "Eventos como percentual da franquia"
        },
        "forecast": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Eventos projetados para o fim do mês"
            },
            {
              "type": "null"
            }
          ]
        },
        "forecast_percent": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "days_left": {
          "type": "integer",
          "description": "Dias restantes no mês"
        },
        "status": {
          "type": "string",
          "description": "ok, warning (80% ou mais), over (um mês passado que atingiu ou superou a franquia), locked ou paused"
        },
        "sites": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "site_id": {
                "type": "string"
              },
              "domain": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "events": {
                "type": "integer",
                "description": "Visualizações de página e eventos personalizados neste mês"
              },
              "share": {
                "type": "number",
                "description": "Porcentagem do total do espaço de trabalho"
              }
            }
          },
          "description": "Eventos por site"
        },
        "history": {
          "type": "array",
          "description": "Meses anteriores, do mais recente para o mais antigo"
        },
        "access_locked_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Painéis bloqueados pela equipe do Privatus Analytics desde"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused": {
          "type": "boolean",
          "description": "True enquanto novos eventos são descartados (o limite mensal foi atingido ou a equipe pausou a coleta)"
        },
        "pause_reason": {
          "anyOf": [
            {
              "type": "string",
              "description": "Por que a coleta está pausada: limit (a franquia mensal foi atingida) ou staff. null quando está coletando"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Quando a equipe pausou a coleta"
            },
            {
              "type": "null"
            }
          ]
        },
        "resumes_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Quando termina uma pausa por limite: no início do mês seguinte (UTC), ou antes em caso de upgrade. null nos demais casos"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "description": "Este mês até agora"
    }
  }
}
POST /workspaces/:workspace_id/billing/change_plan.json Alterar plano, faixa ou intervalo (proporcional) billing_change_plan

Permissão: billing.manage

Exemplo
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/billing/change_plan.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "plan": {
      "type": "string",
      "description": "Plano para o qual mudar: pro ou business",
      "enum": [
        "pro",
        "business"
      ]
    },
    "events": {
      "type": "integer",
      "description": "Eventos ao mês da faixa, de GET /plans",
      "examples": [
        1000000
      ]
    },
    "interval": {
      "type": "string",
      "description": "Intervalo de cobrança. O anual tem 2 meses grátis",
      "enum": [
        "month",
        "year"
      ],
      "default": "month"
    },
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "plan",
    "events",
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string"
    },
    "plan": {
      "type": "string",
      "description": "free, pro, business ou enterprise"
    },
    "plan_events": {
      "type": "integer",
      "description": "Eventos ao mês na faixa paga"
    },
    "allowance": {
      "type": "integer",
      "description": "Eventos ao mês incluindo qualquer bônus do selo"
    },
    "billing_interval": {
      "anyOf": [
        {
          "type": "string",
          "description": "month ou year"
        },
        {
          "type": "null"
        }
      ]
    },
    "price": {
      "anyOf": [
        {
          "type": "integer",
          "description": "USD por intervalo de cobrança"
        },
        {
          "type": "null"
        }
      ]
    },
    "subscription_status": {
      "type": "string",
      "description": "none, trialing, active, past_due, paused ou canceled"
    },
    "current_period_ends_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Renova ou termina em"
        },
        {
          "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 ou agency"
            },
            "status": {
              "type": "string",
              "description": "pending, approved (ainda não aplicado à assinatura), active, rejected ou revoked"
            },
            "percent": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Percentual de desconto no Pro e no Business (null no programa gratuito de código aberto)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "comp_events": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Eventos grátis por mês (apenas no programa gratuito de código aberto)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "organization_name": {
              "type": "string",
              "description": "Nome da organização, escola, projeto ou agência"
            },
            "website": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Site"
                },
                {
                  "type": "null"
                }
              ]
            },
            "proof_url": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Link de comprovação ou URL do repositório"
                },
                {
                  "type": "null"
                }
              ]
            },
            "license": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Licença OSI (código aberto)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "note": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Nota para a análise"
                },
                {
                  "type": "null"
                }
              ]
            },
            "rejection_reason": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Por que a solicitação não foi aprovada"
                },
                {
                  "type": "null"
                }
              ]
            },
            "created_at": {
              "type": "string",
              "format": "date-time",
              "description": "Solicitado em"
            },
            "reviewed_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Analisado em"
                },
                {
                  "type": "null"
                }
              ]
            },
            "applied_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Desconto ativo desde"
                },
                {
                  "type": "null"
                }
              ]
            },
            "revoked_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Programa encerrado em"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "A solicitação mais recente de programa de desconto, ou null"
        },
        {
          "type": "null"
        }
      ]
    },
    "discount_percent": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Percentual de desconto no Pro e no Business de um programa aprovado, ou null"
        },
        {
          "type": "null"
        }
      ]
    },
    "billing_emails": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "tax_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "badge": {
      "type": "object",
      "description": "Bônus do selo (plano gratuito)"
    },
    "usage": {
      "type": "object",
      "properties": {
        "month": {
          "type": "string",
          "format": "date",
          "description": "Primeiro dia do mês informado"
        },
        "events": {
          "type": "integer",
          "description": "Eventos faturáveis (visualizações de página e eventos personalizados)"
        },
        "bots": {
          "type": "integer",
          "description": "Hits de bots filtrados (não cobrados)"
        },
        "allowance": {
          "type": "integer",
          "description": "Eventos incluídos, com o bônus do selo, se houver"
        },
        "percent": {
          "type": "number",
          "description": "Eventos como percentual da franquia"
        },
        "forecast": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Eventos projetados para o fim do mês"
            },
            {
              "type": "null"
            }
          ]
        },
        "forecast_percent": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "days_left": {
          "type": "integer",
          "description": "Dias restantes no mês"
        },
        "status": {
          "type": "string",
          "description": "ok, warning (80% ou mais), over (um mês passado que atingiu ou superou a franquia), locked ou paused"
        },
        "sites": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "site_id": {
                "type": "string"
              },
              "domain": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "events": {
                "type": "integer",
                "description": "Visualizações de página e eventos personalizados neste mês"
              },
              "share": {
                "type": "number",
                "description": "Porcentagem do total do espaço de trabalho"
              }
            }
          },
          "description": "Eventos por site"
        },
        "history": {
          "type": "array",
          "description": "Meses anteriores, do mais recente para o mais antigo"
        },
        "access_locked_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Painéis bloqueados pela equipe do Privatus Analytics desde"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused": {
          "type": "boolean",
          "description": "True enquanto novos eventos são descartados (o limite mensal foi atingido ou a equipe pausou a coleta)"
        },
        "pause_reason": {
          "anyOf": [
            {
              "type": "string",
              "description": "Por que a coleta está pausada: limit (a franquia mensal foi atingida) ou staff. null quando está coletando"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Quando a equipe pausou a coleta"
            },
            {
              "type": "null"
            }
          ]
        },
        "resumes_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Quando termina uma pausa por limite: no início do mês seguinte (UTC), ou antes em caso de upgrade. null nos demais casos"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "description": "Este mês até agora"
    }
  }
}
POST /workspaces/:workspace_id/billing/checkout.json Iniciar um checkout Paddle para um plano pago billing_checkout

Permissão: billing.manage

Exemplo
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/billing/checkout.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "plan": {
      "type": "string",
      "description": "Plano para o qual mudar: pro ou business",
      "enum": [
        "pro",
        "business"
      ]
    },
    "events": {
      "type": "integer",
      "description": "Eventos ao mês da faixa, de GET /plans",
      "examples": [
        1000000
      ]
    },
    "interval": {
      "type": "string",
      "description": "Intervalo de cobrança. O anual tem 2 meses grátis",
      "enum": [
        "month",
        "year"
      ],
      "default": "month"
    },
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "plan",
    "events",
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "transaction_id": {
      "type": "string",
      "description": "Id da transação Paddle (txn_...)"
    },
    "url": {
      "anyOf": [
        {
          "type": "string",
          "description": "URL do checkout hospedado"
        },
        {
          "type": "null"
        }
      ]
    },
    "price_id": {
      "type": "string"
    },
    "plan": {
      "type": "string"
    },
    "events": {
      "type": "integer"
    },
    "interval": {
      "type": "string"
    },
    "amount": {
      "type": "integer",
      "description": "USD por intervalo"
    },
    "client_token": {
      "anyOf": [
        {
          "type": "string",
          "description": "Token do lado do cliente do Paddle.js"
        },
        {
          "type": "null"
        }
      ]
    },
    "environment": {
      "type": "string",
      "description": "sandbox ou production"
    },
    "custom_data": {
      "type": "object",
      "description": "Enviado ao Paddle para vincular a assinatura"
    },
    "discount_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Id de desconto Paddle de um programa aprovado, aplicado a este checkout"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
POST /workspaces/:workspace_id/billing/discount.json Solicitar um desconto para organizações sem fins lucrativos, educação ou código aberto billing_discount

Permissão: billing.manage

Exemplo
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/billing/discount.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "program": {
      "type": "string",
      "description": "nonprofit, education, open_source (50% de desconto), open_source_free (Pro grátis até 1M de eventos por mês) ou agency (20% de desconto em todos os espaços de trabalho que você possui)",
      "enum": [
        "nonprofit",
        "education",
        "open_source",
        "open_source_free",
        "agency"
      ]
    },
    "organization_name": {
      "type": "string",
      "description": "Nome da organização, escola, projeto ou agência"
    },
    "website": {
      "type": "string",
      "description": "O site dela"
    },
    "proof_url": {
      "type": "string",
      "description": "Link de comprovação. Para código aberto, a URL do repositório"
    },
    "license": {
      "type": "string",
      "description": "Licença OSI do projeto (apenas código aberto)"
    },
    "note": {
      "type": "string",
      "description": "Qualquer informação que ajude na análise, até 1.000 caracteres"
    },
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "program",
    "organization_name",
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "program": {
      "type": "string",
      "description": "nonprofit, education, open_source, open_source_free ou agency"
    },
    "status": {
      "type": "string",
      "description": "pending, approved (ainda não aplicado à assinatura), active, rejected ou revoked"
    },
    "percent": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Percentual de desconto no Pro e no Business (null no programa gratuito de código aberto)"
        },
        {
          "type": "null"
        }
      ]
    },
    "comp_events": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Eventos grátis por mês (apenas no programa gratuito de código aberto)"
        },
        {
          "type": "null"
        }
      ]
    },
    "organization_name": {
      "type": "string",
      "description": "Nome da organização, escola, projeto ou agência"
    },
    "website": {
      "anyOf": [
        {
          "type": "string",
          "description": "Site"
        },
        {
          "type": "null"
        }
      ]
    },
    "proof_url": {
      "anyOf": [
        {
          "type": "string",
          "description": "Link de comprovação ou URL do repositório"
        },
        {
          "type": "null"
        }
      ]
    },
    "license": {
      "anyOf": [
        {
          "type": "string",
          "description": "Licença OSI (código aberto)"
        },
        {
          "type": "null"
        }
      ]
    },
    "note": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nota para a análise"
        },
        {
          "type": "null"
        }
      ]
    },
    "rejection_reason": {
      "anyOf": [
        {
          "type": "string",
          "description": "Por que a solicitação não foi aprovada"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Solicitado em"
    },
    "reviewed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Analisado em"
        },
        {
          "type": "null"
        }
      ]
    },
    "applied_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Desconto ativo desde"
        },
        {
          "type": "null"
        }
      ]
    },
    "revoked_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Programa encerrado em"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
POST /workspaces/:workspace_id/billing/payment_method.json Obter um link para atualizar a forma de pagamento billing_payment_method

Permissão: billing.manage

Exemplo
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/billing/payment_method.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "description": "portal, payment_method ou invoice"
    },
    "url": {
      "anyOf": [
        {
          "type": "string",
          "description": "URL do Paddle de curta duração"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
POST /workspaces/:workspace_id/billing/portal.json Obter um link do portal do cliente Paddle billing_portal

Permissão: billing.manage

Exemplo
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/billing/portal.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "description": "portal, payment_method ou invoice"
    },
    "url": {
      "anyOf": [
        {
          "type": "string",
          "description": "URL do Paddle de curta duração"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
GET /workspaces/:workspace_id/billing/preview.json Pré-visualizar uma mudança de plano com valor proporcional billing_preview

Permissão: billing.manage

Exemplo
curl https://privatusanalytics.com/workspaces/:workspace_id/billing/preview.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "plan": {
      "type": "string",
      "description": "Plano para o qual mudar: pro ou business",
      "enum": [
        "pro",
        "business"
      ]
    },
    "events": {
      "type": "integer",
      "description": "Eventos ao mês da faixa, de GET /plans",
      "examples": [
        1000000
      ]
    },
    "interval": {
      "type": "string",
      "description": "Intervalo de cobrança. O anual tem 2 meses grátis",
      "enum": [
        "month",
        "year"
      ],
      "default": "month"
    },
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "plan",
    "events",
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "plan": {
      "type": "string"
    },
    "events": {
      "type": "integer"
    },
    "interval": {
      "type": "string"
    },
    "price_id": {
      "type": "string"
    },
    "amount": {
      "type": "integer",
      "description": "Novo preço em USD por intervalo"
    },
    "currency": {
      "type": "string"
    },
    "charge_minor": {
      "type": "integer",
      "description": "Cobrado agora, em unidades menores"
    },
    "credit_minor": {
      "type": "integer",
      "description": "Crédito pelo tempo não usado, em unidades menores"
    },
    "result_action": {
      "anyOf": [
        {
          "type": "string",
          "description": "charge ou credit"
        },
        {
          "type": "null"
        }
      ]
    },
    "result_minor": {
      "type": "integer",
      "description": "Cobrança ou crédito líquido, em unidades menores"
    },
    "next_billed_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Uso ou limites que o novo plano não cobriria"
    }
  }
}
POST /workspaces/:workspace_id/billing/resume.json Desfazer um cancelamento agendado ou retomar uma pausa billing_resume

Permissão: billing.manage

Exemplo
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/billing/resume.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string"
    },
    "plan": {
      "type": "string",
      "description": "free, pro, business ou enterprise"
    },
    "plan_events": {
      "type": "integer",
      "description": "Eventos ao mês na faixa paga"
    },
    "allowance": {
      "type": "integer",
      "description": "Eventos ao mês incluindo qualquer bônus do selo"
    },
    "billing_interval": {
      "anyOf": [
        {
          "type": "string",
          "description": "month ou year"
        },
        {
          "type": "null"
        }
      ]
    },
    "price": {
      "anyOf": [
        {
          "type": "integer",
          "description": "USD por intervalo de cobrança"
        },
        {
          "type": "null"
        }
      ]
    },
    "subscription_status": {
      "type": "string",
      "description": "none, trialing, active, past_due, paused ou canceled"
    },
    "current_period_ends_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Renova ou termina em"
        },
        {
          "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 ou agency"
            },
            "status": {
              "type": "string",
              "description": "pending, approved (ainda não aplicado à assinatura), active, rejected ou revoked"
            },
            "percent": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Percentual de desconto no Pro e no Business (null no programa gratuito de código aberto)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "comp_events": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Eventos grátis por mês (apenas no programa gratuito de código aberto)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "organization_name": {
              "type": "string",
              "description": "Nome da organização, escola, projeto ou agência"
            },
            "website": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Site"
                },
                {
                  "type": "null"
                }
              ]
            },
            "proof_url": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Link de comprovação ou URL do repositório"
                },
                {
                  "type": "null"
                }
              ]
            },
            "license": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Licença OSI (código aberto)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "note": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Nota para a análise"
                },
                {
                  "type": "null"
                }
              ]
            },
            "rejection_reason": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Por que a solicitação não foi aprovada"
                },
                {
                  "type": "null"
                }
              ]
            },
            "created_at": {
              "type": "string",
              "format": "date-time",
              "description": "Solicitado em"
            },
            "reviewed_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Analisado em"
                },
                {
                  "type": "null"
                }
              ]
            },
            "applied_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Desconto ativo desde"
                },
                {
                  "type": "null"
                }
              ]
            },
            "revoked_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Programa encerrado em"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "A solicitação mais recente de programa de desconto, ou null"
        },
        {
          "type": "null"
        }
      ]
    },
    "discount_percent": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Percentual de desconto no Pro e no Business de um programa aprovado, ou null"
        },
        {
          "type": "null"
        }
      ]
    },
    "billing_emails": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "tax_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "badge": {
      "type": "object",
      "description": "Bônus do selo (plano gratuito)"
    },
    "usage": {
      "type": "object",
      "properties": {
        "month": {
          "type": "string",
          "format": "date",
          "description": "Primeiro dia do mês informado"
        },
        "events": {
          "type": "integer",
          "description": "Eventos faturáveis (visualizações de página e eventos personalizados)"
        },
        "bots": {
          "type": "integer",
          "description": "Hits de bots filtrados (não cobrados)"
        },
        "allowance": {
          "type": "integer",
          "description": "Eventos incluídos, com o bônus do selo, se houver"
        },
        "percent": {
          "type": "number",
          "description": "Eventos como percentual da franquia"
        },
        "forecast": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Eventos projetados para o fim do mês"
            },
            {
              "type": "null"
            }
          ]
        },
        "forecast_percent": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "days_left": {
          "type": "integer",
          "description": "Dias restantes no mês"
        },
        "status": {
          "type": "string",
          "description": "ok, warning (80% ou mais), over (um mês passado que atingiu ou superou a franquia), locked ou paused"
        },
        "sites": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "site_id": {
                "type": "string"
              },
              "domain": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "events": {
                "type": "integer",
                "description": "Visualizações de página e eventos personalizados neste mês"
              },
              "share": {
                "type": "number",
                "description": "Porcentagem do total do espaço de trabalho"
              }
            }
          },
          "description": "Eventos por site"
        },
        "history": {
          "type": "array",
          "description": "Meses anteriores, do mais recente para o mais antigo"
        },
        "access_locked_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Painéis bloqueados pela equipe do Privatus Analytics desde"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused": {
          "type": "boolean",
          "description": "True enquanto novos eventos são descartados (o limite mensal foi atingido ou a equipe pausou a coleta)"
        },
        "pause_reason": {
          "anyOf": [
            {
              "type": "string",
              "description": "Por que a coleta está pausada: limit (a franquia mensal foi atingida) ou staff. null quando está coletando"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Quando a equipe pausou a coleta"
            },
            {
              "type": "null"
            }
          ]
        },
        "resumes_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Quando termina uma pausa por limite: no início do mês seguinte (UTC), ou antes em caso de upgrade. null nos demais casos"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "description": "Este mês até agora"
    }
  }
}
GET /workspaces/:workspace_id/billing.json Obter o plano, a assinatura e o uso billing_get

Permissão: billing.manage

Exemplo
curl https://privatusanalytics.com/workspaces/:workspace_id/billing.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string"
    },
    "plan": {
      "type": "string",
      "description": "free, pro, business ou enterprise"
    },
    "plan_events": {
      "type": "integer",
      "description": "Eventos ao mês na faixa paga"
    },
    "allowance": {
      "type": "integer",
      "description": "Eventos ao mês incluindo qualquer bônus do selo"
    },
    "billing_interval": {
      "anyOf": [
        {
          "type": "string",
          "description": "month ou year"
        },
        {
          "type": "null"
        }
      ]
    },
    "price": {
      "anyOf": [
        {
          "type": "integer",
          "description": "USD por intervalo de cobrança"
        },
        {
          "type": "null"
        }
      ]
    },
    "subscription_status": {
      "type": "string",
      "description": "none, trialing, active, past_due, paused ou canceled"
    },
    "current_period_ends_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Renova ou termina em"
        },
        {
          "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 ou agency"
            },
            "status": {
              "type": "string",
              "description": "pending, approved (ainda não aplicado à assinatura), active, rejected ou revoked"
            },
            "percent": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Percentual de desconto no Pro e no Business (null no programa gratuito de código aberto)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "comp_events": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Eventos grátis por mês (apenas no programa gratuito de código aberto)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "organization_name": {
              "type": "string",
              "description": "Nome da organização, escola, projeto ou agência"
            },
            "website": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Site"
                },
                {
                  "type": "null"
                }
              ]
            },
            "proof_url": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Link de comprovação ou URL do repositório"
                },
                {
                  "type": "null"
                }
              ]
            },
            "license": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Licença OSI (código aberto)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "note": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Nota para a análise"
                },
                {
                  "type": "null"
                }
              ]
            },
            "rejection_reason": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Por que a solicitação não foi aprovada"
                },
                {
                  "type": "null"
                }
              ]
            },
            "created_at": {
              "type": "string",
              "format": "date-time",
              "description": "Solicitado em"
            },
            "reviewed_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Analisado em"
                },
                {
                  "type": "null"
                }
              ]
            },
            "applied_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Desconto ativo desde"
                },
                {
                  "type": "null"
                }
              ]
            },
            "revoked_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Programa encerrado em"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "A solicitação mais recente de programa de desconto, ou null"
        },
        {
          "type": "null"
        }
      ]
    },
    "discount_percent": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Percentual de desconto no Pro e no Business de um programa aprovado, ou null"
        },
        {
          "type": "null"
        }
      ]
    },
    "billing_emails": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "tax_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "badge": {
      "type": "object",
      "description": "Bônus do selo (plano gratuito)"
    },
    "usage": {
      "type": "object",
      "properties": {
        "month": {
          "type": "string",
          "format": "date",
          "description": "Primeiro dia do mês informado"
        },
        "events": {
          "type": "integer",
          "description": "Eventos faturáveis (visualizações de página e eventos personalizados)"
        },
        "bots": {
          "type": "integer",
          "description": "Hits de bots filtrados (não cobrados)"
        },
        "allowance": {
          "type": "integer",
          "description": "Eventos incluídos, com o bônus do selo, se houver"
        },
        "percent": {
          "type": "number",
          "description": "Eventos como percentual da franquia"
        },
        "forecast": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Eventos projetados para o fim do mês"
            },
            {
              "type": "null"
            }
          ]
        },
        "forecast_percent": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "days_left": {
          "type": "integer",
          "description": "Dias restantes no mês"
        },
        "status": {
          "type": "string",
          "description": "ok, warning (80% ou mais), over (um mês passado que atingiu ou superou a franquia), locked ou paused"
        },
        "sites": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "site_id": {
                "type": "string"
              },
              "domain": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "events": {
                "type": "integer",
                "description": "Visualizações de página e eventos personalizados neste mês"
              },
              "share": {
                "type": "number",
                "description": "Porcentagem do total do espaço de trabalho"
              }
            }
          },
          "description": "Eventos por site"
        },
        "history": {
          "type": "array",
          "description": "Meses anteriores, do mais recente para o mais antigo"
        },
        "access_locked_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Painéis bloqueados pela equipe do Privatus Analytics desde"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused": {
          "type": "boolean",
          "description": "True enquanto novos eventos são descartados (o limite mensal foi atingido ou a equipe pausou a coleta)"
        },
        "pause_reason": {
          "anyOf": [
            {
              "type": "string",
              "description": "Por que a coleta está pausada: limit (a franquia mensal foi atingida) ou staff. null quando está coletando"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Quando a equipe pausou a coleta"
            },
            {
              "type": "null"
            }
          ]
        },
        "resumes_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Quando termina uma pausa por limite: no início do mês seguinte (UTC), ou antes em caso de upgrade. null nos demais casos"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "description": "Este mês até agora"
    }
  }
}
PATCH /workspaces/:workspace_id/billing.json Atualizar e-mails de cobrança, id fiscal e upgrade automático billing_update

Permissão: billing.manage

Exemplo
curl -X PATCH https://privatusanalytics.com/workspaces/:workspace_id/billing.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "billing_emails": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Endereços extras para faturas e avisos de cobrança (até 5)"
    },
    "tax_id": {
      "type": "string",
      "description": "Id fiscal (VAT/GST/CNPJ etc.) exibido nas faturas"
    },
    "auto_upgrade": {
      "type": "boolean",
      "description": "true para passar à próxima faixa e cobrar a diferença quando o limite mensal for atingido, em vez de pausar a coleta. Desativado por padrão"
    },
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string"
    },
    "plan": {
      "type": "string",
      "description": "free, pro, business ou enterprise"
    },
    "plan_events": {
      "type": "integer",
      "description": "Eventos ao mês na faixa paga"
    },
    "allowance": {
      "type": "integer",
      "description": "Eventos ao mês incluindo qualquer bônus do selo"
    },
    "billing_interval": {
      "anyOf": [
        {
          "type": "string",
          "description": "month ou year"
        },
        {
          "type": "null"
        }
      ]
    },
    "price": {
      "anyOf": [
        {
          "type": "integer",
          "description": "USD por intervalo de cobrança"
        },
        {
          "type": "null"
        }
      ]
    },
    "subscription_status": {
      "type": "string",
      "description": "none, trialing, active, past_due, paused ou canceled"
    },
    "current_period_ends_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Renova ou termina em"
        },
        {
          "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 ou agency"
            },
            "status": {
              "type": "string",
              "description": "pending, approved (ainda não aplicado à assinatura), active, rejected ou revoked"
            },
            "percent": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Percentual de desconto no Pro e no Business (null no programa gratuito de código aberto)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "comp_events": {
              "anyOf": [
                {
                  "type": "integer",
                  "description": "Eventos grátis por mês (apenas no programa gratuito de código aberto)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "organization_name": {
              "type": "string",
              "description": "Nome da organização, escola, projeto ou agência"
            },
            "website": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Site"
                },
                {
                  "type": "null"
                }
              ]
            },
            "proof_url": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Link de comprovação ou URL do repositório"
                },
                {
                  "type": "null"
                }
              ]
            },
            "license": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Licença OSI (código aberto)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "note": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Nota para a análise"
                },
                {
                  "type": "null"
                }
              ]
            },
            "rejection_reason": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Por que a solicitação não foi aprovada"
                },
                {
                  "type": "null"
                }
              ]
            },
            "created_at": {
              "type": "string",
              "format": "date-time",
              "description": "Solicitado em"
            },
            "reviewed_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Analisado em"
                },
                {
                  "type": "null"
                }
              ]
            },
            "applied_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Desconto ativo desde"
                },
                {
                  "type": "null"
                }
              ]
            },
            "revoked_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Programa encerrado em"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "A solicitação mais recente de programa de desconto, ou null"
        },
        {
          "type": "null"
        }
      ]
    },
    "discount_percent": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Percentual de desconto no Pro e no Business de um programa aprovado, ou null"
        },
        {
          "type": "null"
        }
      ]
    },
    "billing_emails": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "tax_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "badge": {
      "type": "object",
      "description": "Bônus do selo (plano gratuito)"
    },
    "usage": {
      "type": "object",
      "properties": {
        "month": {
          "type": "string",
          "format": "date",
          "description": "Primeiro dia do mês informado"
        },
        "events": {
          "type": "integer",
          "description": "Eventos faturáveis (visualizações de página e eventos personalizados)"
        },
        "bots": {
          "type": "integer",
          "description": "Hits de bots filtrados (não cobrados)"
        },
        "allowance": {
          "type": "integer",
          "description": "Eventos incluídos, com o bônus do selo, se houver"
        },
        "percent": {
          "type": "number",
          "description": "Eventos como percentual da franquia"
        },
        "forecast": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Eventos projetados para o fim do mês"
            },
            {
              "type": "null"
            }
          ]
        },
        "forecast_percent": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "days_left": {
          "type": "integer",
          "description": "Dias restantes no mês"
        },
        "status": {
          "type": "string",
          "description": "ok, warning (80% ou mais), over (um mês passado que atingiu ou superou a franquia), locked ou paused"
        },
        "sites": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "site_id": {
                "type": "string"
              },
              "domain": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "events": {
                "type": "integer",
                "description": "Visualizações de página e eventos personalizados neste mês"
              },
              "share": {
                "type": "number",
                "description": "Porcentagem do total do espaço de trabalho"
              }
            }
          },
          "description": "Eventos por site"
        },
        "history": {
          "type": "array",
          "description": "Meses anteriores, do mais recente para o mais antigo"
        },
        "access_locked_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Painéis bloqueados pela equipe do Privatus Analytics desde"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused": {
          "type": "boolean",
          "description": "True enquanto novos eventos são descartados (o limite mensal foi atingido ou a equipe pausou a coleta)"
        },
        "pause_reason": {
          "anyOf": [
            {
              "type": "string",
              "description": "Por que a coleta está pausada: limit (a franquia mensal foi atingida) ou staff. null quando está coletando"
            },
            {
              "type": "null"
            }
          ]
        },
        "collection_paused_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Quando a equipe pausou a coleta"
            },
            {
              "type": "null"
            }
          ]
        },
        "resumes_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "description": "Quando termina uma pausa por limite: no início do mês seguinte (UTC), ou antes em caso de upgrade. null nos demais casos"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "description": "Este mês até agora"
    }
  }
}
GET /workspaces/:workspace_id/billing/usage.json Obter o uso deste mês, a previsão e a divisão por site billing_usage

Permissão: billing.manage

Exemplo
curl https://privatusanalytics.com/workspaces/:workspace_id/billing/usage.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "month": {
      "type": "string",
      "format": "date",
      "description": "Qualquer dia do mês a relatar (o padrão é este mês)",
      "examples": [
        "2026-09-01"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "month": {
      "type": "string",
      "format": "date",
      "description": "Primeiro dia do mês informado"
    },
    "events": {
      "type": "integer",
      "description": "Eventos faturáveis (visualizações de página e eventos personalizados)"
    },
    "bots": {
      "type": "integer",
      "description": "Hits de bots filtrados (não cobrados)"
    },
    "allowance": {
      "type": "integer",
      "description": "Eventos incluídos, com o bônus do selo, se houver"
    },
    "percent": {
      "type": "number",
      "description": "Eventos como percentual da franquia"
    },
    "forecast": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Eventos projetados para o fim do mês"
        },
        {
          "type": "null"
        }
      ]
    },
    "forecast_percent": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "days_left": {
      "type": "integer",
      "description": "Dias restantes no mês"
    },
    "status": {
      "type": "string",
      "description": "ok, warning (80% ou mais), over (um mês passado que atingiu ou superou a franquia), locked ou paused"
    },
    "sites": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "site_id": {
            "type": "string"
          },
          "domain": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "events": {
            "type": "integer",
            "description": "Visualizações de página e eventos personalizados neste mês"
          },
          "share": {
            "type": "number",
            "description": "Porcentagem do total do espaço de trabalho"
          }
        }
      },
      "description": "Eventos por site"
    },
    "history": {
      "type": "array",
      "description": "Meses anteriores, do mais recente para o mais antigo"
    },
    "access_locked_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Painéis bloqueados pela equipe do Privatus Analytics desde"
        },
        {
          "type": "null"
        }
      ]
    },
    "collection_paused": {
      "type": "boolean",
      "description": "True enquanto novos eventos são descartados (o limite mensal foi atingido ou a equipe pausou a coleta)"
    },
    "pause_reason": {
      "anyOf": [
        {
          "type": "string",
          "description": "Por que a coleta está pausada: limit (a franquia mensal foi atingida) ou staff. null quando está coletando"
        },
        {
          "type": "null"
        }
      ]
    },
    "collection_paused_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Quando a equipe pausou a coleta"
        },
        {
          "type": "null"
        }
      ]
    },
    "resumes_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Quando termina uma pausa por limite: no início do mês seguinte (UTC), ou antes em caso de upgrade. null nos demais casos"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
GET /workspaces/:workspace_id/billing/invoices.json Listar faturas billing_invoices_list

Permissão: billing.manage

Exemplo
curl https://privatusanalytics.com/workspaces/:workspace_id/billing/invoices.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Página (a partir de 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultados por página (máx. 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Id da transação Paddle"
      },
      "invoice_number": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "status": {
        "type": "string",
        "description": "paid, completed, payment_failed, ..."
      },
      "amount_minor": {
        "type": "integer",
        "description": "Total em unidades menores (centavos)"
      },
      "currency": {
        "type": "string"
      },
      "billed_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      }
    }
  }
}
GET /workspaces/:workspace_id/billing/invoices/:id.json Obter o link do PDF de uma fatura billing_invoices_get

Permissão: billing.manage

Exemplo
curl https://privatusanalytics.com/workspaces/:workspace_id/billing/invoices/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "description": "portal, payment_method ou invoice"
    },
    "url": {
      "anyOf": [
        {
          "type": "string",
          "description": "URL do Paddle de curta duração"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}

Coleta

POST /api/logs.json Enviar logs de acesso do servidor para relatórios de crawlers de IA (JSON {lines: [...]} ou texto de log combinado, com a chave de ingestão do site como Bearer token) crawler_logs_create

Permissão: public · Somente HTTP (não é uma ferramenta MCP)

Exemplo
curl -X POST https://privatusanalytics.com/api/logs.json \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "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": "Linhas de log: [{ts, path, status, user_agent}] (máx. 1000)"
    }
  },
  "required": [
    "lines"
  ]
}
Dados da resposta
{
  "type": "object"
}
POST /api/event.json Coletar um hit do navegador (usado por /js/pa.js) ingest_event

Permissão: public · Somente HTTP (não é uma ferramenta MCP)

Exemplo
curl -X POST https://privatusanalytics.com/api/event.json \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "site": {
      "type": "string",
      "description": "Id do site (pa_…)"
    },
    "type": {
      "type": "string",
      "description": "Tipo de hit",
      "enum": [
        "pageview",
        "event",
        "engagement",
        "vital",
        "click"
      ]
    },
    "url": {
      "type": "string",
      "description": "URL completa da página"
    },
    "referrer": {
      "type": "string",
      "description": "document.referrer"
    },
    "name": {
      "type": "string",
      "description": "Nome do evento (type=event) ou nome do vital"
    },
    "props": {
      "type": "object",
      "additionalProperties": true,
      "description": "Propriedades do evento: até 30 valores string/number/boolean",
      "default": {}
    },
    "screen_width": {
      "type": "integer",
      "description": "Largura da tela em pixels"
    },
    "language": {
      "type": "string",
      "description": "navigator.language"
    },
    "engaged_ms": {
      "type": "integer",
      "description": "Tempo visível na página (engajamento)"
    },
    "scroll_depth": {
      "type": "integer",
      "description": "Profundidade máxima de rolagem em % (engajamento)"
    },
    "value": {
      "type": "number",
      "description": "Valor do Web Vital (type=vital)"
    },
    "selector": {
      "type": "string",
      "description": "Seletor do elemento clicado (type=click)"
    },
    "hash_mode": {
      "type": "boolean",
      "description": "Manter o #fragmento (sites com rotas por hash)",
      "default": false
    },
    "dnt": {
      "type": "boolean",
      "description": "Do Not Track está ativado",
      "default": false
    },
    "gpc": {
      "type": "boolean",
      "description": "Global Privacy Control está ativado",
      "default": false
    },
    "interacted": {
      "type": "boolean",
      "description": "1 quando uma entrada confiável (ponteiro, tecla, toque ou roda do mouse) foi detectada na página, 0 caso contrário. Sem coordenadas nem tempos"
    },
    "revenue": {
      "type": "number",
      "description": "Receita em unidades principais, por exemplo 49.99"
    },
    "currency": {
      "type": "string",
      "description": "Moeda ISO 4217 da receita"
    }
  },
  "required": [
    "site",
    "type",
    "url"
  ]
}
Dados da resposta
{
  "type": "object"
}
POST /api/events.json Coletar eventos do lado do servidor com uma chave de ingestão do site ingest_events

Permissão: public · Somente HTTP (não é uma ferramenta MCP)

Exemplo
curl -X POST https://privatusanalytics.com/api/events.json \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "events": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      },
      "description": "Até 100 eventos"
    }
  },
  "required": [
    "events"
  ]
}
Dados da resposta
{
  "type": "object"
}
GET /api/pixel.json Coletar uma visualização de página sem JavaScript (GIF 1×1) ingest_pixel

Permissão: public · Somente HTTP (não é uma ferramenta MCP)

Exemplo
curl https://privatusanalytics.com/api/pixel.json
Entradas
{
  "type": "object",
  "properties": {},
  "required": []
}
Dados da resposta
{
  "type": "object"
}

Compartilhamento

GET /badge/:site_id.json Selo contador de visitantes (SVG) de um site público badges_get

Permissão: public · Somente HTTP (não é uma ferramenta MCP)

Exemplo
curl https://privatusanalytics.com/badge/:site_id.json
Entradas
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object"
}
GET /share/:token/breakdown/:dimension.json Principais valores de uma dimensão compartilhada shares_breakdown

Permissão: public

Exemplo
curl https://privatusanalytics.com/share/:token/breakdown/:dimension.json
Entradas
{
  "type": "object",
  "properties": {
    "dimension": {
      "type": "string",
      "description": "Dimension do recurso"
    },
    "period": {
      "type": "string",
      "description": "Predefinição de intervalo de datas (ignorada se o link a fixa)",
      "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": "Início do intervalo personalizado"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Fim do intervalo personalizado, inclusive"
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtros extras, se o link permitir",
      "default": []
    },
    "limit": {
      "type": "integer",
      "description": "Linhas (máx. 100)",
      "default": 10
    },
    "token": {
      "type": "string",
      "description": "Token do recurso"
    }
  },
  "required": [
    "dimension",
    "token"
  ]
}
Dados da resposta
{
  "type": "object"
}
GET /share/:token.json Visão geral do painel compartilhado para um token de compartilhamento shares_overview

Permissão: public

Exemplo
curl https://privatusanalytics.com/share/:token.json
Entradas
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Predefinição de intervalo de datas (ignorada se o link a fixa)",
      "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": "Início do intervalo personalizado"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Fim do intervalo personalizado, inclusive"
    },
    "compare": {
      "type": "string",
      "description": "Período de comparação",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtros extras, se o link permitir: [[\"dimension\",\"operator\",\"value\"], …]",
      "default": []
    },
    "interval": {
      "type": "string",
      "description": "Tamanho do intervalo do gráfico",
      "enum": [
        "auto",
        "minute",
        "hour",
        "day",
        "week",
        "month",
        "quarter",
        "year"
      ],
      "default": "auto"
    },
    "token": {
      "type": "string",
      "description": "Token do recurso"
    }
  },
  "required": [
    "token"
  ]
}
Dados da resposta
{
  "type": "object"
}

Conta

GET /account.json Obter seu perfil e preferências account_get

Permissão: member

Exemplo
curl https://privatusanalytics.com/account.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {},
  "required": []
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "email": {
      "type": "string"
    },
    "unconfirmed_email": {
      "anyOf": [
        {
          "type": "string",
          "description": "Novo e-mail aguardando confirmação"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "theme": {
      "type": "string"
    },
    "default_landing": {
      "type": "string"
    },
    "locale": {
      "type": "string",
      "description": "Código do idioma do app para esta conta (en por padrão)"
    },
    "timezone": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "shortcuts_enabled": {
      "type": "boolean"
    },
    "reduce_motion": {
      "type": "boolean"
    },
    "product_emails": {
      "type": "boolean"
    },
    "marketing_emails": {
      "type": "boolean",
      "description": "Se e-mails de marketing (campanhas de gotejamento) podem ser enviados. false após um cancelamento de inscrição"
    },
    "newsletter": {
      "type": "boolean"
    },
    "two_factor": {
      "type": "boolean"
    },
    "passkeys": {
      "type": "integer"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
PATCH /account.json Atualizar seu perfil e preferências account_update

Permissão: member

Exemplo
curl -X PATCH https://privatusanalytics.com/account.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Seu nome"
    },
    "email": {
      "type": "string",
      "description": "Novo endereço de e-mail (confirmado antes por e-mail)"
    },
    "theme": {
      "type": "string",
      "description": "Tema de cores",
      "enum": [
        "system",
        "light",
        "dark"
      ]
    },
    "default_landing": {
      "type": "string",
      "description": "Página após o login: sites ou last_site",
      "enum": [
        "sites",
        "last_site"
      ]
    },
    "locale": {
      "type": "string",
      "description": "Idioma do app quando você está conectado, como código de idioma (en, de, fr e assim por diante). As páginas públicas e a API continuam como estão",
      "enum": [
        "en",
        "de",
        "es",
        "fr",
        "it",
        "nl",
        "pt",
        "pl",
        "sv",
        "da",
        "no",
        "fi",
        "ja",
        "ko",
        "zh-CN",
        "zh-TW"
      ]
    },
    "timezone": {
      "type": "string",
      "description": "Seu fuso horário (nome IANA)"
    },
    "shortcuts_enabled": {
      "type": "boolean",
      "description": "Atalhos de teclado"
    },
    "reduce_motion": {
      "type": "boolean",
      "description": "Reduzir animações"
    },
    "product_emails": {
      "type": "boolean",
      "description": "E-mails de novidades e dicas do produto"
    },
    "marketing_emails": {
      "type": "boolean",
      "description": "E-mails de marketing, como dicas de primeiros passos. Reativá-los após um cancelamento exige um navegador com sessão iniciada"
    },
    "newsletter": {
      "type": "boolean",
      "description": "Newsletter mensal"
    }
  },
  "required": []
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "email": {
      "type": "string"
    },
    "unconfirmed_email": {
      "anyOf": [
        {
          "type": "string",
          "description": "Novo e-mail aguardando confirmação"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "theme": {
      "type": "string"
    },
    "default_landing": {
      "type": "string"
    },
    "locale": {
      "type": "string",
      "description": "Código do idioma do app para esta conta (en por padrão)"
    },
    "timezone": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "shortcuts_enabled": {
      "type": "boolean"
    },
    "reduce_motion": {
      "type": "boolean"
    },
    "product_emails": {
      "type": "boolean"
    },
    "marketing_emails": {
      "type": "boolean",
      "description": "Se e-mails de marketing (campanhas de gotejamento) podem ser enviados. false após um cancelamento de inscrição"
    },
    "newsletter": {
      "type": "boolean"
    },
    "two_factor": {
      "type": "boolean"
    },
    "passkeys": {
      "type": "integer"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Crawlers

POST /sites/:site_id/crawlers/connection.json Sincronizar acessos de crawlers de IA de uma zona do Cloudflare (requer uma autorização do Cloudflare pelo navegador) crawlers_cloudflare_connect

Permissão: sites.manage

Exemplo
curl -X POST https://privatusanalytics.com/sites/:site_id/crawlers/connection.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "zone_id": {
      "type": "string",
      "description": "Id da zona do Cloudflare, de crawlers_cloudflare_zones",
      "examples": [
        "023e105f4ecef8ad9ca31a8372d0c353"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "zone_id",
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "zone_id": {
      "type": "string",
      "description": "Id da zona do Cloudflare"
    },
    "zone_name": {
      "type": "string",
      "description": "Nome da zona do Cloudflare, por exemplo example.com"
    },
    "status": {
      "type": "string",
      "description": "active ou error"
    },
    "last_synced_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Quando os acessos de crawlers foram importados pela última vez, ou null antes da primeira importação"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:site_id/crawlers/connection.json Desconectar o Cloudflare e excluir os acessos de crawlers que ele importou crawlers_cloudflare_disconnect

Permissão: sites.manage

Exemplo
curl -X DELETE https://privatusanalytics.com/sites/:site_id/crawlers/connection.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "zone_id": {
      "type": "string",
      "description": "Id da zona do Cloudflare"
    },
    "zone_name": {
      "type": "string",
      "description": "Nome da zona do Cloudflare, por exemplo example.com"
    },
    "status": {
      "type": "string",
      "description": "active ou error"
    },
    "last_synced_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Quando os acessos de crawlers foram importados pela última vez, ou null antes da primeira importação"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /sites/:site_id/crawlers/sync.json Importar agora os acessos de crawlers do Cloudflare crawlers_cloudflare_sync

Permissão: sites.manage

Exemplo
curl -X POST https://privatusanalytics.com/sites/:site_id/crawlers/sync.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "zone_id": {
      "type": "string",
      "description": "Id da zona do Cloudflare"
    },
    "zone_name": {
      "type": "string",
      "description": "Nome da zona do Cloudflare, por exemplo example.com"
    },
    "status": {
      "type": "string",
      "description": "active ou error"
    },
    "last_synced_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Quando os acessos de crawlers foram importados pela última vez, ou null antes da primeira importação"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/crawlers/zones.json Listar as zonas do Cloudflare que você pode conectar (requer uma autorização do Cloudflare pelo navegador) crawlers_cloudflare_zones

Permissão: sites.manage

Exemplo
curl https://privatusanalytics.com/sites/:site_id/crawlers/zones.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object"
}
GET /sites/:site_id/crawlers.json Relatório de crawlers de IA: hits por crawler ao longo do tempo, principais caminhos por crawler, por categoria crawlers_report

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/sites/:site_id/crawlers.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Predefinição de intervalo de datas. Use custom com 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": "Início do intervalo personalizado (fuso horário do site)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Fim do intervalo personalizado, inclusive"
    },
    "category": {
      "type": "string",
      "description": "ai, search, seo, other ou all",
      "enum": [
        "all",
        "ai",
        "search",
        "seo",
        "other"
      ],
      "default": "ai"
    },
    "crawler": {
      "type": "string",
      "description": "Somente este crawler, por exemplo GPTBot"
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object"
}

Desempenho

GET /sites/:site_id/performance.json Web Vitals: painel de p75, tendência diária e detalhamentos por página, dispositivo, navegador e país performance_report

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/sites/:site_id/performance.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Predefinição de intervalo de datas. Use custom com 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": "Início do intervalo personalizado (fuso horário do site)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Fim do intervalo personalizado, inclusive"
    },
    "compare": {
      "type": "string",
      "description": "Período de comparação",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Início da comparação personalizada"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Fim da comparação personalizada"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Alinhar os dias da semana na comparação",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtros: [[\"dimension\",\"operator\",\"value\"], …]. Operadores: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Envolva as condições em {\"any\": [...]} para OU.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Aplicar um segmento salvo (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Adicionar dados históricos importados (datas anteriores ao primeiro evento nativo, ignorado quando filtros ou um segmento são aplicados)",
      "default": false
    },
    "metric": {
      "type": "string",
      "description": "Métrica da tendência e dos detalhamentos",
      "enum": [
        "LCP",
        "INP",
        "CLS",
        "FCP",
        "TTFB"
      ],
      "default": "LCP"
    },
    "limit": {
      "type": "integer",
      "description": "Linhas por detalhamento (máx. 100)",
      "default": 10
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object"
}

Disponibilidade

POST /sites/:site_id/uptime.json Adicionar uma verificação de disponibilidade para um site uptime_checks_create

Permissão: uptime.manage

Exemplo
curl -X POST https://privatusanalytics.com/sites/:site_id/uptime.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nome de exibição (o padrão é o alvo)"
    },
    "kind": {
      "type": "string",
      "description": "http (código de status), keyword (o corpo contém), tcp (host:porta) ou dns (o nome resolve)",
      "enum": [
        "http",
        "keyword",
        "tcp",
        "dns"
      ],
      "default": "http"
    },
    "url": {
      "type": "string",
      "description": "URL para verificações http/keyword",
      "examples": [
        "https://example.com/health"
      ]
    },
    "host": {
      "type": "string",
      "description": "Hostname para verificações tcp/dns"
    },
    "port": {
      "type": "integer",
      "description": "Porta TCP para verificações tcp"
    },
    "keyword": {
      "type": "string",
      "description": "Texto que o corpo da resposta deve conter (keyword)"
    },
    "expected_status": {
      "type": "integer",
      "description": "Código de status HTTP esperado",
      "default": 200
    },
    "http_method": {
      "type": "string",
      "description": "Método HTTP",
      "enum": [
        "GET",
        "HEAD"
      ],
      "default": "GET"
    },
    "interval_seconds": {
      "type": "integer",
      "description": "Segundos entre verificações (vale o mínimo do plano, padrão 300 ou o mínimo)"
    },
    "timeout_seconds": {
      "type": "integer",
      "description": "Segundos antes de uma sonda expirar (1-30)",
      "default": 20
    },
    "public": {
      "type": "boolean",
      "description": "Pode aparecer em páginas de status públicas",
      "default": false
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id da verificação (upc_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Site ao qual a verificação pertence"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "http, keyword, tcp ou 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 ou paused"
    },
    "enabled": {
      "type": "boolean"
    },
    "public": {
      "type": "boolean",
      "description": "Pode aparecer em páginas de status"
    },
    "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 Excluir uma verificação de disponibilidade e seu histórico uptime_checks_delete

Permissão: uptime.manage

Exemplo
curl -X DELETE https://privatusanalytics.com/uptime/checks/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id da verificação (upc_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Site ao qual a verificação pertence"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "http, keyword, tcp ou 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 ou paused"
    },
    "enabled": {
      "type": "boolean"
    },
    "public": {
      "type": "boolean",
      "description": "Pode aparecer em páginas de status"
    },
    "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 Listar as verificações de disponibilidade de um site uptime_checks_list

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/sites/:site_id/uptime.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Somente verificações neste estado",
      "enum": [
        "up",
        "down",
        "pending",
        "paused"
      ]
    },
    "query": {
      "type": "string",
      "description": "Filtrar por nome ou alvo"
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Página (a partir de 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultados por página (máx. 100)"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Id da verificação (upc_…)"
      },
      "workspace_id": {
        "type": "string"
      },
      "site_id": {
        "anyOf": [
          {
            "type": "string",
            "description": "Site ao qual a verificação pertence"
          },
          {
            "type": "null"
          }
        ]
      },
      "name": {
        "type": "string"
      },
      "kind": {
        "type": "string",
        "description": "http, keyword, tcp ou 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 ou paused"
      },
      "enabled": {
        "type": "boolean"
      },
      "public": {
        "type": "boolean",
        "description": "Pode aparecer em páginas de status"
      },
      "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 Pausar uma verificação de disponibilidade uptime_checks_pause

Permissão: uptime.manage

Exemplo
curl -X POST https://privatusanalytics.com/uptime/checks/:id/pause.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id da verificação (upc_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Site ao qual a verificação pertence"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "http, keyword, tcp ou 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 ou paused"
    },
    "enabled": {
      "type": "boolean"
    },
    "public": {
      "type": "boolean",
      "description": "Pode aparecer em páginas de status"
    },
    "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 Retomar uma verificação de disponibilidade pausada uptime_checks_resume

Permissão: uptime.manage

Exemplo
curl -X POST https://privatusanalytics.com/uptime/checks/:id/resume.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id da verificação (upc_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Site ao qual a verificação pertence"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "http, keyword, tcp ou 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 ou paused"
    },
    "enabled": {
      "type": "boolean"
    },
    "public": {
      "type": "boolean",
      "description": "Pode aparecer em páginas de status"
    },
    "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 Obter uma verificação de disponibilidade: disponibilidade de 24h/7d/30d, tempos de resposta e incidentes uptime_checks_get

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/uptime/checks/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "range": {
      "type": "string",
      "description": "Janela do gráfico de tempo de resposta",
      "enum": [
        "24h",
        "7d",
        "30d"
      ],
      "default": "24h"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "check": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Id da verificação (upc_…)"
        },
        "workspace_id": {
          "type": "string"
        },
        "site_id": {
          "anyOf": [
            {
              "type": "string",
              "description": "Site ao qual a verificação pertence"
            },
            {
              "type": "null"
            }
          ]
        },
        "name": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "description": "http, keyword, tcp ou 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 ou paused"
        },
        "enabled": {
          "type": "boolean"
        },
        "public": {
          "type": "boolean",
          "description": "Pode aparecer em páginas de status"
        },
        "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": "% de disponibilidade em 24h, 7d e 30d"
    },
    "range": {
      "type": "string",
      "description": "Janela de response_times"
    },
    "response_times": {
      "type": "object",
      "description": "Tempo médio de resposta em ms por intervalo: {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": "Até agora, se ainda estiver aberto"
          },
          "cause": {
            "anyOf": [
              {
                "type": "string",
                "description": "Erro mais comum, por exemplo timeout ou status_503"
              },
              {
                "type": "null"
              }
            ]
          },
          "failed_locations": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    }
  }
}
PATCH /uptime/checks/:id.json Alterar uma verificação de disponibilidade uptime_checks_update

Permissão: uptime.manage

Exemplo
curl -X PATCH https://privatusanalytics.com/uptime/checks/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nome de exibição (o padrão é o alvo)"
    },
    "kind": {
      "type": "string",
      "description": "http (código de status), keyword (o corpo contém), tcp (host:porta) ou dns (o nome resolve)",
      "enum": [
        "http",
        "keyword",
        "tcp",
        "dns"
      ]
    },
    "url": {
      "type": "string",
      "description": "URL para verificações http/keyword",
      "examples": [
        "https://example.com/health"
      ]
    },
    "host": {
      "type": "string",
      "description": "Hostname para verificações tcp/dns"
    },
    "port": {
      "type": "integer",
      "description": "Porta TCP para verificações tcp"
    },
    "keyword": {
      "type": "string",
      "description": "Texto que o corpo da resposta deve conter (keyword)"
    },
    "expected_status": {
      "type": "integer",
      "description": "Código de status HTTP esperado"
    },
    "http_method": {
      "type": "string",
      "description": "Método HTTP",
      "enum": [
        "GET",
        "HEAD"
      ]
    },
    "interval_seconds": {
      "type": "integer",
      "description": "Segundos entre verificações (vale o mínimo do plano, padrão 300 ou o mínimo)"
    },
    "timeout_seconds": {
      "type": "integer",
      "description": "Segundos antes de uma sonda expirar (1-30)"
    },
    "public": {
      "type": "boolean",
      "description": "Pode aparecer em páginas de status públicas"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id da verificação (upc_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Site ao qual a verificação pertence"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "http, keyword, tcp ou 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 ou paused"
    },
    "enabled": {
      "type": "boolean"
    },
    "public": {
      "type": "boolean",
      "description": "Pode aparecer em páginas de status"
    },
    "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 das sondas, User-Agent e intervalos de IP de saída (para liberar nossas sondas de disponibilidade) uptime_probes_list

Permissão: public · Somente HTTP (não é uma ferramenta MCP)

Exemplo
curl https://privatusanalytics.com/uptime/probes.json
Entradas
{
  "type": "object",
  "properties": {},
  "required": []
}
Dados da resposta
{
  "type": "object"
}
POST /uptime/probes/results.json Enviar resultados de um agente de sonda externo (Bearer token de sonda de disponibilidade) uptime_probes_results

Permissão: public · Somente HTTP (não é uma ferramenta MCP)

Exemplo
curl -X POST https://privatusanalytics.com/uptime/probes/results.json \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "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": "Resultados da sonda: [{check_id, location, ok, status_code, response_ms, error, checked_at}]"
    }
  },
  "required": [
    "results"
  ]
}
Dados da resposta
{
  "type": "object"
}
POST /workspaces/:workspace_id/uptime.json Adicionar uma verificação de disponibilidade do espaço de trabalho (sem vínculo com um site) workspace_uptime_checks_create

Permissão: uptime.manage

Exemplo
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/uptime.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nome de exibição (o padrão é o alvo)"
    },
    "kind": {
      "type": "string",
      "description": "http (código de status), keyword (o corpo contém), tcp (host:porta) ou dns (o nome resolve)",
      "enum": [
        "http",
        "keyword",
        "tcp",
        "dns"
      ],
      "default": "http"
    },
    "url": {
      "type": "string",
      "description": "URL para verificações http/keyword",
      "examples": [
        "https://example.com/health"
      ]
    },
    "host": {
      "type": "string",
      "description": "Hostname para verificações tcp/dns"
    },
    "port": {
      "type": "integer",
      "description": "Porta TCP para verificações tcp"
    },
    "keyword": {
      "type": "string",
      "description": "Texto que o corpo da resposta deve conter (keyword)"
    },
    "expected_status": {
      "type": "integer",
      "description": "Código de status HTTP esperado",
      "default": 200
    },
    "http_method": {
      "type": "string",
      "description": "Método HTTP",
      "enum": [
        "GET",
        "HEAD"
      ],
      "default": "GET"
    },
    "interval_seconds": {
      "type": "integer",
      "description": "Segundos entre verificações (vale o mínimo do plano, padrão 300 ou o mínimo)"
    },
    "timeout_seconds": {
      "type": "integer",
      "description": "Segundos antes de uma sonda expirar (1-30)",
      "default": 20
    },
    "public": {
      "type": "boolean",
      "description": "Pode aparecer em páginas de status públicas",
      "default": false
    },
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id da verificação (upc_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Site ao qual a verificação pertence"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "http, keyword, tcp ou 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 ou paused"
    },
    "enabled": {
      "type": "boolean"
    },
    "public": {
      "type": "boolean",
      "description": "Pode aparecer em páginas de status"
    },
    "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 Listar todas as verificações de disponibilidade de um espaço de trabalho workspace_uptime_checks_list

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/workspaces/:workspace_id/uptime.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Somente verificações neste estado",
      "enum": [
        "up",
        "down",
        "pending",
        "paused"
      ]
    },
    "query": {
      "type": "string",
      "description": "Filtrar por nome ou alvo"
    },
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Página (a partir de 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultados por página (máx. 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Id da verificação (upc_…)"
      },
      "workspace_id": {
        "type": "string"
      },
      "site_id": {
        "anyOf": [
          {
            "type": "string",
            "description": "Site ao qual a verificação pertence"
          },
          {
            "type": "null"
          }
        ]
      },
      "name": {
        "type": "string"
      },
      "kind": {
        "type": "string",
        "description": "http, keyword, tcp ou 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 ou paused"
      },
      "enabled": {
        "type": "boolean"
      },
      "public": {
        "type": "boolean",
        "description": "Pode aparecer em páginas de status"
      },
      "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"
      }
    }
  }
}

Documentação

GET /docs/api.json Listar todas as operações da API e ferramentas MCP docs_api

Permissão: public

Exemplo
curl https://privatusanalytics.com/docs/api.json
Entradas
{
  "type": "object",
  "properties": {
    "page": {
      "type": "integer",
      "description": "Página (a partir de 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultados por página (máx. 100)"
    }
  },
  "required": []
}
Dados da resposta
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "tool_name": {
        "type": "string",
        "description": "Nome da ferramenta MCP e operationId do OpenAPI"
      },
      "summary": {
        "type": "string"
      },
      "description": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "group": {
        "type": "string"
      },
      "verb": {
        "type": "string",
        "description": "Método HTTP"
      },
      "path": {
        "type": "string",
        "description": "Modelo de caminho. Adicione .json para JSON"
      },
      "permission": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "input_schema": {
        "type": "object",
        "description": "JSON Schema das entradas"
      },
      "response_schema": {
        "type": "object",
        "description": "JSON Schema de `data`"
      }
    }
  }
}
GET /docs.json Listar páginas da documentação docs_list

Permissão: public

Exemplo
curl https://privatusanalytics.com/docs.json
Entradas
{
  "type": "object",
  "properties": {
    "page": {
      "type": "integer",
      "description": "Página (a partir de 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultados por página (máx. 100)"
    }
  },
  "required": []
}
Dados da resposta
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "title": {
        "type": "string",
        "description": "Título da página"
      },
      "description": {
        "type": "string",
        "description": "Resumo de uma linha"
      },
      "path": {
        "type": "string",
        "description": "Caminho da página. Adicione .md para Markdown ou .json para JSON"
      },
      "section": {
        "type": "string",
        "description": "Slug da seção, por exemplo tracker"
      }
    }
  }
}
GET /openapi.json Documento OpenAPI 3.1 de toda a API docs_openapi

Permissão: public

Exemplo
curl https://privatusanalytics.com/openapi.json
Entradas
{
  "type": "object",
  "properties": {},
  "required": []
}
Dados da resposta
{
  "type": "object"
}
GET /docs/:section/:page.json Ler uma página da documentação (Markdown e HTML) docs_get

section e page vêm do caminho da página /docs/<section>/<page>. Use a página "index" para a visão geral de uma seção.

Permissão: public

Exemplo
curl https://privatusanalytics.com/docs/:section/:page.json
Entradas
{
  "type": "object",
  "properties": {
    "section": {
      "type": "string",
      "description": "Section do recurso"
    },
    "page": {
      "type": "string",
      "description": "Page do recurso"
    }
  },
  "required": [
    "section",
    "page"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "description": "Título da página"
    },
    "description": {
      "type": "string",
      "description": "Resumo de uma linha"
    },
    "path": {
      "type": "string",
      "description": "Caminho da página. Adicione .md para Markdown ou .json para JSON"
    },
    "section": {
      "type": "string",
      "description": "Slug da seção, por exemplo tracker"
    },
    "headings": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Seções da página (id e texto)"
    },
    "full_markdown": {
      "type": "string",
      "description": "A página em Markdown (título incluído)"
    },
    "html": {
      "type": "string",
      "description": "O corpo da página renderizado em HTML"
    }
  }
}

Espaços de trabalho

GET /workspaces/:workspace_id/white_label.json Obter a marca white label white_label_get

Permissão: workspace.manage

Exemplo
curl https://privatusanalytics.com/workspaces/:workspace_id/white_label.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string"
    },
    "brand_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nome exibido no lugar de Privatus Analytics"
        },
        {
          "type": "null"
        }
      ]
    },
    "brand_logo_url": {
      "anyOf": [
        {
          "type": "string",
          "description": "URL da imagem do logotipo"
        },
        {
          "type": "null"
        }
      ]
    },
    "brand_color": {
      "anyOf": [
        {
          "type": "string",
          "description": "Cor de destaque"
        },
        {
          "type": "null"
        }
      ]
    },
    "hide_branding": {
      "type": "boolean",
      "description": "A marca Privatus Analytics está oculta"
    },
    "available": {
      "type": "boolean",
      "description": "O plano inclui white label"
    },
    "active": {
      "type": "boolean",
      "description": "A marca está aplicada no momento"
    }
  }
}
PATCH /workspaces/:workspace_id/white_label.json Definir a marca white label para painéis compartilhados e relatórios por e-mail (Business) white_label_update

Permissão: workspace.manage

Exemplo
curl -X PATCH https://privatusanalytics.com/workspaces/:workspace_id/white_label.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "brand_name": {
      "type": "string",
      "description": "Nome exibido no lugar de Privatus Analytics (vazio remove)"
    },
    "brand_logo_url": {
      "type": "string",
      "description": "URL https de uma imagem de logotipo (vazio remove)"
    },
    "brand_color": {
      "type": "string",
      "description": "Cor de destaque, por exemplo #06755b"
    },
    "hide_branding": {
      "type": "boolean",
      "description": "Ocultar \"Privatus Analytics\" em painéis compartilhados e relatórios por e-mail"
    },
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string"
    },
    "brand_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nome exibido no lugar de Privatus Analytics"
        },
        {
          "type": "null"
        }
      ]
    },
    "brand_logo_url": {
      "anyOf": [
        {
          "type": "string",
          "description": "URL da imagem do logotipo"
        },
        {
          "type": "null"
        }
      ]
    },
    "brand_color": {
      "anyOf": [
        {
          "type": "string",
          "description": "Cor de destaque"
        },
        {
          "type": "null"
        }
      ]
    },
    "hide_branding": {
      "type": "boolean",
      "description": "A marca Privatus Analytics está oculta"
    },
    "available": {
      "type": "boolean",
      "description": "O plano inclui white label"
    },
    "active": {
      "type": "boolean",
      "description": "A marca está aplicada no momento"
    }
  }
}
GET /workspaces/:workspace_id/security.json Obter as configurações de segurança do espaço de trabalho workspace_security_get

Permissão: workspace.manage

Exemplo
curl https://privatusanalytics.com/workspaces/:workspace_id/security.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string"
    },
    "enforce_2fa": {
      "type": "boolean",
      "description": "Os membros devem configurar a 2FA"
    },
    "login_methods": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Métodos de login permitidos"
    },
    "session_ttl_hours": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Duração da sessão (null = nenhuma)"
        },
        {
          "type": "null"
        }
      ]
    },
    "app_ip_allowlist": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "IPs/CIDRs permitidos (vazio = qualquer lugar)"
    },
    "support_access_until": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "O suporte do Privatus Analytics pode ver o espaço de trabalho até"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
PATCH /workspaces/:workspace_id/security.json Atualizar as configurações de segurança do espaço de trabalho (2FA, métodos de login, duração da sessão, lista de IPs permitidos, acesso do suporte) workspace_security_update

Permissão: workspace.manage

Exemplo
curl -X PATCH https://privatusanalytics.com/workspaces/:workspace_id/security.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "enforce_2fa": {
      "type": "boolean",
      "description": "Exigir que os membros configurem a 2FA"
    },
    "login_methods": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "password",
          "magic_link",
          "passkey",
          "google",
          "github",
          "sso"
        ]
      },
      "description": "Métodos de login permitidos"
    },
    "session_ttl_hours": {
      "type": "integer",
      "description": "Desconectar os membros após esta quantidade de horas (0 = sem limite)"
    },
    "app_ip_allowlist": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Permitir acesso ao app e à API somente a partir destes IPs/CIDRs (Business). Vazio = de qualquer lugar"
    },
    "support_access": {
      "type": "boolean",
      "description": "Permitir que o suporte do Privatus Analytics veja o espaço de trabalho por 7 dias"
    },
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string"
    },
    "enforce_2fa": {
      "type": "boolean",
      "description": "Os membros devem configurar a 2FA"
    },
    "login_methods": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Métodos de login permitidos"
    },
    "session_ttl_hours": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Duração da sessão (null = nenhuma)"
        },
        {
          "type": "null"
        }
      ]
    },
    "app_ip_allowlist": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "IPs/CIDRs permitidos (vazio = qualquer lugar)"
    },
    "support_access_until": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "O suporte do Privatus Analytics pode ver o espaço de trabalho até"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
POST /workspaces.json Criar um espaço de trabalho (você se torna o proprietário) workspaces_create

Permissão: member · Somente HTTP (não é uma ferramenta MCP)

Exemplo
curl -X POST https://privatusanalytics.com/workspaces.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nome do espaço de trabalho",
      "examples": [
        "Acme Inc"
      ]
    },
    "timezone": {
      "type": "string",
      "description": "Fuso horário padrão dos relatórios (o padrão é o do usuário)"
    },
    "currency": {
      "type": "string",
      "description": "Moeda padrão (ISO 4217)",
      "default": "USD"
    },
    "how_heard": {
      "type": "string",
      "description": "Como você nos conheceu"
    }
  },
  "required": [
    "name"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "timezone": {
      "type": "string",
      "description": "Fuso horário padrão dos relatórios"
    },
    "currency": {
      "type": "string",
      "description": "Moeda padrão"
    },
    "plan": {
      "type": "string",
      "description": "free, pro, business ou enterprise"
    },
    "plan_events": {
      "type": "integer",
      "description": "Eventos por mês incluídos no plano"
    },
    "subscription_status": {
      "type": "string"
    },
    "role": {
      "type": "string",
      "description": "Sua função neste espaço de trabalho"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /workspaces/:id.json Excluir um espaço de trabalho e todos os seus sites (somente o proprietário, cancela qualquer assinatura) workspaces_delete

Permissão: workspace.manage

Exemplo
curl -X DELETE https://privatusanalytics.com/workspaces/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "confirm": {
      "type": "string",
      "description": "Digite o nome do espaço de trabalho para confirmar"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "confirm",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "timezone": {
      "type": "string",
      "description": "Fuso horário padrão dos relatórios"
    },
    "currency": {
      "type": "string",
      "description": "Moeda padrão"
    },
    "plan": {
      "type": "string",
      "description": "free, pro, business ou enterprise"
    },
    "plan_events": {
      "type": "integer",
      "description": "Eventos por mês incluídos no plano"
    },
    "subscription_status": {
      "type": "string"
    },
    "role": {
      "type": "string",
      "description": "Sua função neste espaço de trabalho"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /workspaces.json Listar seus espaços de trabalho workspaces_list

Permissão: member

Exemplo
curl https://privatusanalytics.com/workspaces.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "page": {
      "type": "integer",
      "description": "Página (a partir de 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultados por página (máx. 100)"
    }
  },
  "required": []
}
Dados da resposta
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
      },
      "name": {
        "type": "string"
      },
      "timezone": {
        "type": "string",
        "description": "Fuso horário padrão dos relatórios"
      },
      "currency": {
        "type": "string",
        "description": "Moeda padrão"
      },
      "plan": {
        "type": "string",
        "description": "free, pro, business ou enterprise"
      },
      "plan_events": {
        "type": "integer",
        "description": "Eventos por mês incluídos no plano"
      },
      "subscription_status": {
        "type": "string"
      },
      "role": {
        "type": "string",
        "description": "Sua função neste espaço de trabalho"
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
GET /workspaces/:id.json Obter um espaço de trabalho workspaces_get

Permissão: member

Exemplo
curl https://privatusanalytics.com/workspaces/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "timezone": {
      "type": "string",
      "description": "Fuso horário padrão dos relatórios"
    },
    "currency": {
      "type": "string",
      "description": "Moeda padrão"
    },
    "plan": {
      "type": "string",
      "description": "free, pro, business ou enterprise"
    },
    "plan_events": {
      "type": "integer",
      "description": "Eventos por mês incluídos no plano"
    },
    "subscription_status": {
      "type": "string"
    },
    "role": {
      "type": "string",
      "description": "Sua função neste espaço de trabalho"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
PATCH /workspaces/:id.json Atualizar as configurações do espaço de trabalho workspaces_update

Permissão: workspace.manage

Exemplo
curl -X PATCH https://privatusanalytics.com/workspaces/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nome do espaço de trabalho"
    },
    "timezone": {
      "type": "string",
      "description": "Fuso horário padrão dos relatórios"
    },
    "currency": {
      "type": "string",
      "description": "Moeda padrão (ISO 4217)"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "timezone": {
      "type": "string",
      "description": "Fuso horário padrão dos relatórios"
    },
    "currency": {
      "type": "string",
      "description": "Moeda padrão"
    },
    "plan": {
      "type": "string",
      "description": "free, pro, business ou enterprise"
    },
    "plan_events": {
      "type": "integer",
      "description": "Eventos por mês incluídos no plano"
    },
    "subscription_status": {
      "type": "string"
    },
    "role": {
      "type": "string",
      "description": "Sua função neste espaço de trabalho"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Eventos

GET /sites/:site_id/events/properties.json Listar chaves de propriedades de eventos vistas nos últimos 30 dias event_properties_list

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/sites/:site_id/events/properties.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "event": {
      "type": "string",
      "description": "Somente chaves vistas neste nome de evento bruto"
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object"
}
PATCH /sites/:site_id/events/properties.json Renomear ou ocultar uma chave de propriedade de evento event_properties_update

Permissão: sites.manage

Exemplo
curl -X PATCH https://privatusanalytics.com/sites/:site_id/events/properties.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "key": {
      "type": "string",
      "description": "Chave da propriedade como armazenada, por exemplo plan"
    },
    "display_name": {
      "type": "string",
      "description": "Rótulo a exibir no lugar (vazio remove)"
    },
    "hidden": {
      "type": "boolean",
      "description": "Ocultar esta chave dos relatórios"
    },
    "export_safe": {
      "type": "boolean",
      "description": "A chave não contém dados pessoais, então é incluída em exportações brutas e sincronizações com data warehouse"
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "key",
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object"
}
DELETE /sites/:site_id/events.json Excluir um evento e seu histórico (roda em segundo plano, confirme digitando o nome) events_delete

Permissão: sites.manage

Exemplo
curl -X DELETE https://privatusanalytics.com/sites/:site_id/events.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nome do evento bruto a excluir"
    },
    "confirm": {
      "type": "string",
      "description": "Digite o nome do evento novamente para confirmar"
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "confirm",
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object"
}
GET /sites/:site_id/events.json Listar eventos com conclusões, visitas, taxa de conversão e primeira/última ocorrência events_list

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/sites/:site_id/events.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Predefinição de intervalo de datas. Use custom com 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": "Início do intervalo personalizado (fuso horário do site)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Fim do intervalo personalizado, inclusive"
    },
    "compare": {
      "type": "string",
      "description": "Período de comparação",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Início da comparação personalizada"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Fim da comparação personalizada"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Alinhar os dias da semana na comparação",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtros: [[\"dimension\",\"operator\",\"value\"], …]. Operadores: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Envolva as condições em {\"any\": [...]} para OU.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Aplicar um segmento salvo (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Adicionar dados históricos importados (datas anteriores ao primeiro evento nativo, ignorado quando filtros ou um segmento são aplicados)",
      "default": false
    },
    "search": {
      "type": "string",
      "description": "Somente eventos cujo nome contém isto"
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object"
}
POST /sites/:site_id/events/merge.json Mesclar vários eventos em um único nome de exibição events_merge

Permissão: sites.manage

Exemplo
curl -X POST https://privatusanalytics.com/sites/:site_id/events/merge.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "names": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Nomes de eventos brutos a mesclar"
    },
    "into": {
      "type": "string",
      "description": "Nome de exibição do evento mesclado",
      "examples": [
        "Signup"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "names",
    "into",
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nome do evento bruto como enviado pelo rastreador"
    },
    "display_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nome exibido nos relatórios"
        },
        {
          "type": "null"
        }
      ]
    },
    "hidden": {
      "type": "boolean",
      "description": "Oculto dos relatórios"
    },
    "currency": {
      "anyOf": [
        {
          "type": "string",
          "description": "Moeda da receita"
        },
        {
          "type": "null"
        }
      ]
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/events/detail.json Um evento: gráfico, tabela dinâmica de propriedades, agregados de propriedades numéricas, páginas e origens events_get

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/sites/:site_id/events/detail.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Predefinição de intervalo de datas. Use custom com 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": "Início do intervalo personalizado (fuso horário do site)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Fim do intervalo personalizado, inclusive"
    },
    "compare": {
      "type": "string",
      "description": "Período de comparação",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Início da comparação personalizada"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Fim da comparação personalizada"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Alinhar os dias da semana na comparação",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtros: [[\"dimension\",\"operator\",\"value\"], …]. Operadores: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Envolva as condições em {\"any\": [...]} para OU.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Aplicar um segmento salvo (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Adicionar dados históricos importados (datas anteriores ao primeiro evento nativo, ignorado quando filtros ou um segmento são aplicados)",
      "default": false
    },
    "name": {
      "type": "string",
      "description": "Nome do evento como exibido (após renomeações)",
      "examples": [
        "Signup"
      ]
    },
    "properties": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Até 3 chaves de propriedades para pivotar",
      "default": []
    },
    "interval": {
      "type": "string",
      "description": "Tamanho do intervalo do gráfico",
      "enum": [
        "auto",
        "minute",
        "hour",
        "day",
        "week",
        "month",
        "quarter",
        "year"
      ],
      "default": "auto"
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object"
}
PATCH /sites/:site_id/events/settings.json Renomear, ocultar ou reexibir um evento, ou definir sua moeda events_update

Permissão: sites.manage

Exemplo
curl -X PATCH https://privatusanalytics.com/sites/:site_id/events/settings.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nome do evento bruto como enviado pelo rastreador",
      "examples": [
        "signup_click"
      ]
    },
    "display_name": {
      "type": "string",
      "description": "Nome a exibir no lugar (vazio remove a renomeação)"
    },
    "hidden": {
      "type": "boolean",
      "description": "Ocultar dos relatórios (os dados são mantidos)"
    },
    "currency": {
      "type": "string",
      "description": "Moeda da receita deste evento (ISO 4217)"
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nome do evento bruto como enviado pelo rastreador"
    },
    "display_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nome exibido nos relatórios"
        },
        {
          "type": "null"
        }
      ]
    },
    "hidden": {
      "type": "boolean",
      "description": "Oculto dos relatórios"
    },
    "currency": {
      "anyOf": [
        {
          "type": "string",
          "description": "Moeda da receita"
        },
        {
          "type": "null"
        }
      ]
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Exportações

POST /workspaces/:workspace_id/exports.json Enfileirar uma exportação (gerada em segundo plano) exports_create

Permissão: analytics.export

Exemplo
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/exports.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Site a exportar (pa_…)",
      "examples": [
        "pa_7Q2K9XH3AB"
      ]
    },
    "kind": {
      "type": "string",
      "description": "aggregated: métricas por intervalo de tempo e dimensões. pageviews/events/raw: uma linha por hit (Pro e superiores). imported: estatísticas diárias importadas. dashboard: ZIP dos painéis da visão geral",
      "enum": [
        "aggregated",
        "pageviews",
        "events",
        "imported",
        "raw",
        "dashboard"
      ],
      "default": "aggregated"
    },
    "file_format": {
      "type": "string",
      "description": "csv, json ou xlsx (aggregated, pageviews, events, imported), csv ou ndjson (raw), zip (dashboard)",
      "enum": [
        "csv",
        "json",
        "xlsx",
        "ndjson",
        "zip"
      ],
      "default": "csv"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Primeiro dia, no fuso horário da exportação",
      "examples": [
        "2026-09-01"
      ]
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Último dia, inclusive (máx. 400 dias, raw 93 dias)",
      "examples": [
        "2026-09-28"
      ]
    },
    "timezone": {
      "type": "string",
      "description": "Fuso horário para datas e agrupamento, por exemplo America/New_York (padrão: o fuso horário do site)"
    },
    "grouping": {
      "type": "string",
      "description": "Intervalo de tempo das exportações agregadas",
      "enum": [
        "hour",
        "day",
        "week",
        "month",
        "quarter",
        "year"
      ],
      "default": "day"
    },
    "dimensions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Dimensões de visita para agrupar as exportações agregadas (até 6), por exemplo country, channel, entry_page. Para exportações importadas: as dimensões importadas a incluir",
      "default": []
    },
    "metrics": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Métricas das exportações agregadas (padrão todas): visitors, visits, pageviews, bounce_rate, visit_duration, views_per_visit, revenue",
      "default": []
    },
    "fields": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Colunas para exportações de pageviews/events/raw (por padrão todas, menos 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": "Filtros, mesmo formato da API de estatísticas: [[\"dimension\",\"operator\",\"value\"], …]",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Aplicar um segmento salvo (seg_…)"
    },
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id",
    "from",
    "to",
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id da exportação, por exemplo exp_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Site exportado (pa_…)"
        },
        {
          "type": "null"
        }
      ]
    },
    "kind": {
      "type": "string",
      "description": "aggregated, pageviews, events, imported, raw ou dashboard"
    },
    "format": {
      "type": "string",
      "description": "csv, json, xlsx, ndjson ou zip"
    },
    "status": {
      "type": "string",
      "description": "queued, running, complete, failed ou expired"
    },
    "params": {
      "type": "object",
      "description": "A definição da exportação (datas, fuso horário, agrupamento, dimensões, métricas, campos, filtros)"
    },
    "row_count": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Linhas gravadas"
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "anyOf": [
        {
          "type": "string",
          "description": "Por que a exportação falhou"
        },
        {
          "type": "null"
        }
      ]
    },
    "completed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Quando o arquivo é excluído"
        },
        {
          "type": "null"
        }
      ]
    },
    "download_url": {
      "anyOf": [
        {
          "type": "string",
          "description": "Caminho que retorna um link de arquivo assinado de curta duração (exports_download)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /exports/:id.json Excluir uma exportação e seu arquivo exports_delete

Permissão: analytics.export

Exemplo
curl -X DELETE https://privatusanalytics.com/exports/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id da exportação, por exemplo exp_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Site exportado (pa_…)"
        },
        {
          "type": "null"
        }
      ]
    },
    "kind": {
      "type": "string",
      "description": "aggregated, pageviews, events, imported, raw ou dashboard"
    },
    "format": {
      "type": "string",
      "description": "csv, json, xlsx, ndjson ou zip"
    },
    "status": {
      "type": "string",
      "description": "queued, running, complete, failed ou expired"
    },
    "params": {
      "type": "object",
      "description": "A definição da exportação (datas, fuso horário, agrupamento, dimensões, métricas, campos, filtros)"
    },
    "row_count": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Linhas gravadas"
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "anyOf": [
        {
          "type": "string",
          "description": "Por que a exportação falhou"
        },
        {
          "type": "null"
        }
      ]
    },
    "completed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Quando o arquivo é excluído"
        },
        {
          "type": "null"
        }
      ]
    },
    "download_url": {
      "anyOf": [
        {
          "type": "string",
          "description": "Caminho que retorna um link de arquivo assinado de curta duração (exports_download)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /exports/:id/download.json Obter um link assinado para o arquivo (válido por 10 minutos) exports_download

Permissão: analytics.export

Exemplo
curl https://privatusanalytics.com/exports/:id/download.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "id"
  ]
}
Dados da resposta
{
  "type": "object"
}
GET /workspaces/:workspace_id/exports.json Listar exportações (a fila de tarefas) exports_list

Permissão: analytics.export

Exemplo
curl https://privatusanalytics.com/workspaces/:workspace_id/exports.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Somente exportações deste site (pa_…)"
    },
    "status": {
      "type": "string",
      "description": "Somente exportações com este status",
      "enum": [
        "queued",
        "running",
        "complete",
        "failed",
        "expired"
      ]
    },
    "kind": {
      "type": "string",
      "description": "Somente exportações deste tipo",
      "enum": [
        "aggregated",
        "pageviews",
        "events",
        "imported",
        "raw",
        "dashboard"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Página (a partir de 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultados por página (máx. 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Id da exportação, por exemplo exp_7Q2K9XH3AB"
      },
      "site_id": {
        "anyOf": [
          {
            "type": "string",
            "description": "Site exportado (pa_…)"
          },
          {
            "type": "null"
          }
        ]
      },
      "kind": {
        "type": "string",
        "description": "aggregated, pageviews, events, imported, raw ou dashboard"
      },
      "format": {
        "type": "string",
        "description": "csv, json, xlsx, ndjson ou zip"
      },
      "status": {
        "type": "string",
        "description": "queued, running, complete, failed ou expired"
      },
      "params": {
        "type": "object",
        "description": "A definição da exportação (datas, fuso horário, agrupamento, dimensões, métricas, campos, filtros)"
      },
      "row_count": {
        "anyOf": [
          {
            "type": "integer",
            "description": "Linhas gravadas"
          },
          {
            "type": "null"
          }
        ]
      },
      "error": {
        "anyOf": [
          {
            "type": "string",
            "description": "Por que a exportação falhou"
          },
          {
            "type": "null"
          }
        ]
      },
      "completed_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "expires_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time",
            "description": "Quando o arquivo é excluído"
          },
          {
            "type": "null"
          }
        ]
      },
      "download_url": {
        "anyOf": [
          {
            "type": "string",
            "description": "Caminho que retorna um link de arquivo assinado de curta duração (exports_download)"
          },
          {
            "type": "null"
          }
        ]
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
POST /workspaces/:workspace_id/exports/preview.json Pré-visualizar uma exportação: as primeiras 20 linhas e a contagem estimada de linhas exports_preview

Permissão: analytics.export

Exemplo
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/exports/preview.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Site a exportar (pa_…)",
      "examples": [
        "pa_7Q2K9XH3AB"
      ]
    },
    "kind": {
      "type": "string",
      "description": "aggregated: métricas por intervalo de tempo e dimensões. pageviews/events/raw: uma linha por hit (Pro e superiores). imported: estatísticas diárias importadas. dashboard: ZIP dos painéis da visão geral",
      "enum": [
        "aggregated",
        "pageviews",
        "events",
        "imported",
        "raw",
        "dashboard"
      ],
      "default": "aggregated"
    },
    "file_format": {
      "type": "string",
      "description": "csv, json ou xlsx (aggregated, pageviews, events, imported), csv ou ndjson (raw), zip (dashboard)",
      "enum": [
        "csv",
        "json",
        "xlsx",
        "ndjson",
        "zip"
      ],
      "default": "csv"
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "Primeiro dia, no fuso horário da exportação",
      "examples": [
        "2026-09-01"
      ]
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Último dia, inclusive (máx. 400 dias, raw 93 dias)",
      "examples": [
        "2026-09-28"
      ]
    },
    "timezone": {
      "type": "string",
      "description": "Fuso horário para datas e agrupamento, por exemplo America/New_York (padrão: o fuso horário do site)"
    },
    "grouping": {
      "type": "string",
      "description": "Intervalo de tempo das exportações agregadas",
      "enum": [
        "hour",
        "day",
        "week",
        "month",
        "quarter",
        "year"
      ],
      "default": "day"
    },
    "dimensions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Dimensões de visita para agrupar as exportações agregadas (até 6), por exemplo country, channel, entry_page. Para exportações importadas: as dimensões importadas a incluir",
      "default": []
    },
    "metrics": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Métricas das exportações agregadas (padrão todas): visitors, visits, pageviews, bounce_rate, visit_duration, views_per_visit, revenue",
      "default": []
    },
    "fields": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Colunas para exportações de pageviews/events/raw (por padrão todas, menos 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": "Filtros, mesmo formato da API de estatísticas: [[\"dimension\",\"operator\",\"value\"], …]",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Aplicar um segmento salvo (seg_…)"
    },
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id",
    "from",
    "to",
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "object"
}
GET /exports/:id.json Obter uma exportação e seu status exports_get

Permissão: analytics.export

Exemplo
curl https://privatusanalytics.com/exports/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id da exportação, por exemplo exp_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Site exportado (pa_…)"
        },
        {
          "type": "null"
        }
      ]
    },
    "kind": {
      "type": "string",
      "description": "aggregated, pageviews, events, imported, raw ou dashboard"
    },
    "format": {
      "type": "string",
      "description": "csv, json, xlsx, ndjson ou zip"
    },
    "status": {
      "type": "string",
      "description": "queued, running, complete, failed ou expired"
    },
    "params": {
      "type": "object",
      "description": "A definição da exportação (datas, fuso horário, agrupamento, dimensões, métricas, campos, filtros)"
    },
    "row_count": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Linhas gravadas"
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "anyOf": [
        {
          "type": "string",
          "description": "Por que a exportação falhou"
        },
        {
          "type": "null"
        }
      ]
    },
    "completed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Quando o arquivo é excluído"
        },
        {
          "type": "null"
        }
      ]
    },
    "download_url": {
      "anyOf": [
        {
          "type": "string",
          "description": "Caminho que retorna um link de arquivo assinado de curta duração (exports_download)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Funis

POST /sites/:site_id/funnels.json Criar um funil funnels_create

Permissão: content.write

Exemplo
curl -X POST https://privatusanalytics.com/sites/:site_id/funnels.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nome do funil",
      "examples": [
        "Signup flow"
      ]
    },
    "steps": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      },
      "description": "Etapas em ordem (2 até o limite do seu plano): [{\"type\": \"page|event|goal\", \"value\": \"/pricing | Signup | goal_…\", \"match\": \"exact|prefix|glob|regex\" (etapas de página), \"name\": \"rótulo opcional\"}]"
    },
    "order_mode": {
      "type": "string",
      "description": "strict: etapas nesta ordem, any: em qualquer ordem",
      "enum": [
        "strict",
        "any"
      ],
      "default": "strict"
    },
    "window": {
      "type": "string",
      "description": "Janela de conversão: visit, ou day (medido dentro de uma visita, que nunca atravessa um dia UTC)",
      "enum": [
        "visit",
        "day"
      ],
      "default": "visit"
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "steps",
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do funil, por exemplo fun_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "steps": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Etapas: {type: page|event|goal, value, match, name}"
    },
    "order_mode": {
      "type": "string",
      "description": "strict ou any"
    },
    "window": {
      "type": "string",
      "description": "visit ou day"
    },
    "stats": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "entered": {
              "type": "integer",
              "description": "Visitas que chegaram à etapa 1"
            },
            "completed": {
              "type": "integer",
              "description": "Visitas que chegaram à última etapa"
            },
            "conversion_rate": {
              "type": "number",
              "description": "Concluídas ÷ entradas, %"
            }
          },
          "description": "Estatísticas do período (somente na listagem)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:site_id/funnels/:id.json Excluir um funil funnels_delete

Permissão: content.write

Exemplo
curl -X DELETE https://privatusanalytics.com/sites/:site_id/funnels/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do funil, por exemplo fun_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "steps": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Etapas: {type: page|event|goal, value, match, name}"
    },
    "order_mode": {
      "type": "string",
      "description": "strict ou any"
    },
    "window": {
      "type": "string",
      "description": "visit ou day"
    },
    "stats": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "entered": {
              "type": "integer",
              "description": "Visitas que chegaram à etapa 1"
            },
            "completed": {
              "type": "integer",
              "description": "Visitas que chegaram à última etapa"
            },
            "conversion_rate": {
              "type": "number",
              "description": "Concluídas ÷ entradas, %"
            }
          },
          "description": "Estatísticas do período (somente na listagem)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/funnels.json Listar funis com entradas, conclusões e taxa funnels_list

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/sites/:site_id/funnels.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Predefinição de intervalo de datas. Use custom com 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": "Início do intervalo personalizado (fuso horário do site)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Fim do intervalo personalizado, inclusive"
    },
    "compare": {
      "type": "string",
      "description": "Período de comparação",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Início da comparação personalizada"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Fim da comparação personalizada"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Alinhar os dias da semana na comparação",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtros: [[\"dimension\",\"operator\",\"value\"], …]. Operadores: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Envolva as condições em {\"any\": [...]} para OU.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Aplicar um segmento salvo (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Adicionar dados históricos importados (datas anteriores ao primeiro evento nativo, ignorado quando filtros ou um segmento são aplicados)",
      "default": false
    },
    "page": {
      "type": "integer",
      "description": "Número da página",
      "default": 1
    },
    "per_page": {
      "type": "integer",
      "description": "Funis por página (máx. 100)",
      "default": 25
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Id do funil, por exemplo fun_7Q2K9XH3AB"
      },
      "name": {
        "type": "string"
      },
      "steps": {
        "type": "array",
        "items": {
          "type": "object"
        },
        "description": "Etapas: {type: page|event|goal, value, match, name}"
      },
      "order_mode": {
        "type": "string",
        "description": "strict ou any"
      },
      "window": {
        "type": "string",
        "description": "visit ou day"
      },
      "stats": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "entered": {
                "type": "integer",
                "description": "Visitas que chegaram à etapa 1"
              },
              "completed": {
                "type": "integer",
                "description": "Visitas que chegaram à última etapa"
              },
              "conversion_rate": {
                "type": "number",
                "description": "Concluídas ÷ entradas, %"
              }
            },
            "description": "Estatísticas do período (somente na listagem)"
          },
          {
            "type": "null"
          }
        ]
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      },
      "updated_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
GET /sites/:site_id/funnels/:id.json Relatório do funil: contagem por etapa, conversão, abandono, tempo entre etapas e para onde as visitas foram em vez disso funnels_get

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/sites/:site_id/funnels/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Predefinição de intervalo de datas. Use custom com 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": "Início do intervalo personalizado (fuso horário do site)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Fim do intervalo personalizado, inclusive"
    },
    "compare": {
      "type": "string",
      "description": "Período de comparação",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Início da comparação personalizada"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Fim da comparação personalizada"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Alinhar os dias da semana na comparação",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtros: [[\"dimension\",\"operator\",\"value\"], …]. Operadores: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Envolva as condições em {\"any\": [...]} para OU.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Aplicar um segmento salvo (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Adicionar dados históricos importados (datas anteriores ao primeiro evento nativo, ignorado quando filtros ou um segmento são aplicados)",
      "default": false
    },
    "breakdown": {
      "type": "string",
      "description": "Dividir a contagem das etapas por uma dimensão da visita",
      "enum": [
        "channel",
        "device",
        "country",
        "utm_campaign",
        "utm_source",
        "browser",
        "os"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "period": {
      "type": "object",
      "description": "from/to do período (UTC)"
    },
    "funnel": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Id do funil, por exemplo fun_7Q2K9XH3AB"
        },
        "name": {
          "type": "string"
        },
        "steps": {
          "type": "array",
          "items": {
            "type": "object"
          },
          "description": "Etapas: {type: page|event|goal, value, match, name}"
        },
        "order_mode": {
          "type": "string",
          "description": "strict ou any"
        },
        "window": {
          "type": "string",
          "description": "visit ou day"
        },
        "stats": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "entered": {
                  "type": "integer",
                  "description": "Visitas que chegaram à etapa 1"
                },
                "completed": {
                  "type": "integer",
                  "description": "Visitas que chegaram à última etapa"
                },
                "conversion_rate": {
                  "type": "number",
                  "description": "Concluídas ÷ entradas, %"
                }
              },
              "description": "Estatísticas do período (somente na listagem)"
            },
            {
              "type": "null"
            }
          ]
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        }
      },
      "description": "A definição do funil"
    },
    "order_mode": {
      "type": "string",
      "description": "strict ou any"
    },
    "window": {
      "type": "string",
      "description": "visit ou day (day é medido dentro de uma visita)"
    },
    "steps": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Por etapa: 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": "Última etapa ÷ primeira etapa, %"
    },
    "breakdown": {
      "anyOf": [
        {
          "type": "object",
          "description": "dimension, label e linhas [{value, counts, overall_conversion_rate}]"
        },
        {
          "type": "null"
        }
      ]
    },
    "comparison": {
      "anyOf": [
        {
          "type": "object",
          "description": "período, contagens por etapa, overall_conversion_rate e variação (%)"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
PATCH /sites/:site_id/funnels/:id.json Atualizar um funil funnels_update

Permissão: content.write

Exemplo
curl -X PATCH https://privatusanalytics.com/sites/:site_id/funnels/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nome do funil",
      "examples": [
        "Signup flow"
      ]
    },
    "steps": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      },
      "description": "Etapas em ordem (2 até o limite do seu plano): [{\"type\": \"page|event|goal\", \"value\": \"/pricing | Signup | goal_…\", \"match\": \"exact|prefix|glob|regex\" (etapas de página), \"name\": \"rótulo opcional\"}]"
    },
    "order_mode": {
      "type": "string",
      "description": "strict: etapas nesta ordem, any: em qualquer ordem",
      "enum": [
        "strict",
        "any"
      ]
    },
    "window": {
      "type": "string",
      "description": "Janela de conversão: visit, ou day (medido dentro de uma visita, que nunca atravessa um dia UTC)",
      "enum": [
        "visit",
        "day"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do funil, por exemplo fun_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "steps": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Etapas: {type: page|event|goal, value, match, name}"
    },
    "order_mode": {
      "type": "string",
      "description": "strict ou any"
    },
    "window": {
      "type": "string",
      "description": "visit ou day"
    },
    "stats": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "entered": {
              "type": "integer",
              "description": "Visitas que chegaram à etapa 1"
            },
            "completed": {
              "type": "integer",
              "description": "Visitas que chegaram à última etapa"
            },
            "conversion_rate": {
              "type": "number",
              "description": "Concluídas ÷ entradas, %"
            }
          },
          "description": "Estatísticas do período (somente na listagem)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Funções

POST /workspaces/:workspace_id/roles.json Criar uma função personalizada roles_create

Permissão: members.manage

Exemplo
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/roles.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nome da função",
      "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": "Permissões concedidas pela função"
    },
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "permissions",
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id da função personalizada (custom_role_id nos membros)"
    },
    "name": {
      "type": "string"
    },
    "permissions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Permissões concedidas"
    },
    "members": {
      "type": "integer",
      "description": "Membros com esta função"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /workspaces/:workspace_id/roles/:id.json Excluir uma função personalizada (não pode estar em uso) roles_delete

Permissão: members.manage

Exemplo
curl -X DELETE https://privatusanalytics.com/workspaces/:workspace_id/roles/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id da função personalizada (custom_role_id nos membros)"
    },
    "name": {
      "type": "string"
    },
    "permissions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Permissões concedidas"
    },
    "members": {
      "type": "integer",
      "description": "Membros com esta função"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /workspaces/:workspace_id/roles.json Listar funções personalizadas roles_list

Permissão: member

Exemplo
curl https://privatusanalytics.com/workspaces/:workspace_id/roles.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Página (a partir de 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultados por página (máx. 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "format": "uuid",
        "description": "Id da função personalizada (custom_role_id nos membros)"
      },
      "name": {
        "type": "string"
      },
      "permissions": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Permissões concedidas"
      },
      "members": {
        "type": "integer",
        "description": "Membros com esta função"
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
PATCH /workspaces/:workspace_id/roles/:id.json Atualizar uma função personalizada roles_update

Permissão: members.manage

Exemplo
curl -X PATCH https://privatusanalytics.com/workspaces/:workspace_id/roles/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nome da função"
    },
    "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": "Permissões concedidas pela função"
    },
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id da função personalizada (custom_role_id nos membros)"
    },
    "name": {
      "type": "string"
    },
    "permissions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Permissões concedidas"
    },
    "members": {
      "type": "integer",
      "description": "Membros com esta função"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Importações

GET /sites/:site_id/imports/google/properties.json Listar propriedades do Google Analytics 4 para importar imports_google_properties

Permissão: sites.manage

Exemplo
curl https://privatusanalytics.com/sites/:site_id/imports/google/properties.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object"
}
POST /sites/:site_id/imports.json Iniciar uma importação (propriedade GA4 ou upload de CSV) imports_create

Permissão: sites.manage

Exemplo
curl -X POST https://privatusanalytics.com/sites/:site_id/imports.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "source": {
      "type": "string",
      "description": "ga4 (API do Google Analytics 4) ou a ferramenta cuja exportação CSV você envia",
      "enum": [
        "ga4",
        "universal_analytics",
        "fathom",
        "simple_analytics",
        "plausible",
        "matomo",
        "umami",
        "clicky"
      ]
    },
    "property_id": {
      "type": "string",
      "description": "Propriedade GA4, por exemplo properties/123 (veja imports_google_properties). Obrigatório para ga4",
      "examples": [
        "properties/123456789"
      ]
    },
    "date_from": {
      "type": "string",
      "format": "date",
      "description": "Primeiro dia a importar. Obrigatório para ga4. Para arquivos CSV sem coluna de data, todas as linhas recebem este dia"
    },
    "date_to": {
      "type": "string",
      "format": "date",
      "description": "Último dia a importar (ga4 usa por padrão o dia anterior ao seu primeiro evento rastreado, ou ontem)"
    },
    "file": {
      "type": "string",
      "format": "binary",
      "description": "Exportação CSV (upload multipart, máx. 50 MB). Obrigatório para origens CSV"
    },
    "dimension": {
      "type": "string",
      "description": "O que as linhas do CSV detalham (substitui a detecção, necessário para exportações \"Label\" do Matomo)",
      "enum": [
        "total",
        "page",
        "source",
        "country",
        "device",
        "browser",
        "os"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "source",
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id da importação"
    },
    "site_id": {
      "type": "string"
    },
    "source": {
      "type": "string",
      "description": "ga4, universal_analytics, fathom, simple_analytics, plausible, matomo, umami ou clicky"
    },
    "status": {
      "type": "string",
      "description": "queued, running, complete ou failed"
    },
    "date_from": {
      "anyOf": [
        {
          "type": "string",
          "format": "date",
          "description": "Primeiro dia importado"
        },
        {
          "type": "null"
        }
      ]
    },
    "date_to": {
      "anyOf": [
        {
          "type": "string",
          "format": "date",
          "description": "Último dia importado"
        },
        {
          "type": "null"
        }
      ]
    },
    "rows_imported": {
      "type": "integer",
      "description": "Linhas diárias armazenadas"
    },
    "error": {
      "anyOf": [
        {
          "type": "string",
          "description": "Por que a importação falhou"
        },
        {
          "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 Excluir uma importação e todos os seus dados importados imports_delete

Permissão: sites.manage

Exemplo
curl -X DELETE https://privatusanalytics.com/sites/:site_id/imports/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id da importação"
    },
    "site_id": {
      "type": "string"
    },
    "source": {
      "type": "string",
      "description": "ga4, universal_analytics, fathom, simple_analytics, plausible, matomo, umami ou clicky"
    },
    "status": {
      "type": "string",
      "description": "queued, running, complete ou failed"
    },
    "date_from": {
      "anyOf": [
        {
          "type": "string",
          "format": "date",
          "description": "Primeiro dia importado"
        },
        {
          "type": "null"
        }
      ]
    },
    "date_to": {
      "anyOf": [
        {
          "type": "string",
          "format": "date",
          "description": "Último dia importado"
        },
        {
          "type": "null"
        }
      ]
    },
    "rows_imported": {
      "type": "integer",
      "description": "Linhas diárias armazenadas"
    },
    "error": {
      "anyOf": [
        {
          "type": "string",
          "description": "Por que a importação falhou"
        },
        {
          "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 Listar importações de um site imports_list

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/sites/:site_id/imports.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Somente importações com este status",
      "enum": [
        "queued",
        "running",
        "complete",
        "failed"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Página (a partir de 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultados por página (máx. 100)"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Id da importação"
      },
      "site_id": {
        "type": "string"
      },
      "source": {
        "type": "string",
        "description": "ga4, universal_analytics, fathom, simple_analytics, plausible, matomo, umami ou clicky"
      },
      "status": {
        "type": "string",
        "description": "queued, running, complete ou failed"
      },
      "date_from": {
        "anyOf": [
          {
            "type": "string",
            "format": "date",
            "description": "Primeiro dia importado"
          },
          {
            "type": "null"
          }
        ]
      },
      "date_to": {
        "anyOf": [
          {
            "type": "string",
            "format": "date",
            "description": "Último dia importado"
          },
          {
            "type": "null"
          }
        ]
      },
      "rows_imported": {
        "type": "integer",
        "description": "Linhas diárias armazenadas"
      },
      "error": {
        "anyOf": [
          {
            "type": "string",
            "description": "Por que a importação falhou"
          },
          {
            "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 Obter uma importação e seu status imports_get

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/sites/:site_id/imports/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id da importação"
    },
    "site_id": {
      "type": "string"
    },
    "source": {
      "type": "string",
      "description": "ga4, universal_analytics, fathom, simple_analytics, plausible, matomo, umami ou clicky"
    },
    "status": {
      "type": "string",
      "description": "queued, running, complete ou failed"
    },
    "date_from": {
      "anyOf": [
        {
          "type": "string",
          "format": "date",
          "description": "Primeiro dia importado"
        },
        {
          "type": "null"
        }
      ]
    },
    "date_to": {
      "anyOf": [
        {
          "type": "string",
          "format": "date",
          "description": "Último dia importado"
        },
        {
          "type": "null"
        }
      ]
    },
    "rows_imported": {
      "type": "integer",
      "description": "Linhas diárias armazenadas"
    },
    "error": {
      "anyOf": [
        {
          "type": "string",
          "description": "Por que a importação falhou"
        },
        {
          "type": "null"
        }
      ]
    },
    "completed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Log de auditoria

GET /workspaces/:workspace_id/audit_log.json Listar entradas do log de auditoria (adicione .csv para exportar) audit_logs_get

Permissão: workspace.manage

Exemplo
curl https://privatusanalytics.com/workspaces/:workspace_id/audit_log.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "actor": {
      "type": "string",
      "description": "Somente alterações deste membro (e-mail)"
    },
    "item_type": {
      "type": "string",
      "description": "Somente este tipo de registro, por exemplo Site"
    },
    "event": {
      "type": "string",
      "description": "Somente esta ação",
      "enum": [
        "create",
        "update",
        "destroy"
      ]
    },
    "from": {
      "type": "string",
      "format": "date",
      "description": "A partir da data (inclusive)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Até a data (inclusive)"
    },
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Página (a partir de 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultados por página (máx. 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "format": "uuid"
      },
      "created_at": {
        "type": "string",
        "format": "date-time",
        "description": "Quando"
      },
      "event": {
        "type": "string",
        "description": "create, update ou destroy"
      },
      "item_type": {
        "type": "string",
        "description": "Tipo de registro, por exemplo Site"
      },
      "item_id": {
        "type": "string",
        "format": "uuid"
      },
      "target": {
        "type": "string",
        "description": "O registro, pelo nome quando conhecido"
      },
      "actor_email": {
        "anyOf": [
          {
            "type": "string",
            "description": "Membro que fez a alteração"
          },
          {
            "type": "null"
          }
        ]
      },
      "actor_name": {
        "type": "string"
      },
      "token_name": {
        "anyOf": [
          {
            "type": "string",
            "description": "Token de API usado, se houver"
          },
          {
            "type": "null"
          }
        ]
      },
      "changes": {
        "type": "object",
        "description": "Campos alterados: { field: [antes, depois] }"
      },
      "ip": {
        "anyOf": [
          {
            "type": "string",
            "description": "O endereço IP do membro"
          },
          {
            "type": "null"
          }
        ]
      }
    }
  }
}

Membros

POST /workspaces/:workspace_id/invitations.json Convidar pessoas por e-mail invitations_create

Permissão: members.manage

Exemplo
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/invitations.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "emails": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Endereços de e-mail a convidar"
    },
    "role": {
      "type": "string",
      "description": "Função dos novos membros (custom precisa de custom_role_id)",
      "enum": [
        "admin",
        "editor",
        "analyst",
        "viewer",
        "billing",
        "custom"
      ],
      "default": "viewer"
    },
    "custom_role_id": {
      "type": "string",
      "description": "Id da função personalizada (Business)"
    },
    "all_sites": {
      "type": "boolean",
      "description": "Acesso a todos os sites, incluindo os futuros",
      "default": true
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Ids dos sites (pa_…) quando all_sites é false",
      "default": []
    },
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "emails",
    "workspace_id"
  ]
}
Dados da resposta
{
  "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 Revogar um convite pendente invitations_delete

Permissão: members.manage

Exemplo
curl -X DELETE https://privatusanalytics.com/workspaces/:workspace_id/invitations/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Dados da resposta
{
  "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 Listar convites pendentes invitations_list

Permissão: members.manage

Exemplo
curl https://privatusanalytics.com/workspaces/:workspace_id/invitations.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Página (a partir de 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultados por página (máx. 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dados da resposta
{
  "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 Remover um membro (ou sair do espaço de trabalho) members_delete

Permissão: member

Exemplo
curl -X DELETE https://privatusanalytics.com/workspaces/:workspace_id/members/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id do membro (use-o para atualizar ou remover o membro)"
    },
    "email": {
      "type": "string"
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "role": {
      "type": "string",
      "description": "owner, admin, editor, analyst, viewer, billing ou custom"
    },
    "custom_role": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nome da função personalizada"
        },
        {
          "type": "null"
        }
      ]
    },
    "custom_role_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ]
    },
    "all_sites": {
      "type": "boolean",
      "description": "Acesso a todos os sites"
    },
    "include_future_sites": {
      "type": "boolean"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Ids dos sites quando all_sites é false"
    },
    "two_factor": {
      "type": "boolean",
      "description": "Tem 2FA ou uma passkey"
    },
    "last_active_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Entrou em"
    }
  }
}
GET /workspaces/:workspace_id/members.json Listar membros do espaço de trabalho members_list

Permissão: member

Exemplo
curl https://privatusanalytics.com/workspaces/:workspace_id/members.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "description": "Filtrar por nome ou e-mail"
    },
    "role": {
      "type": "string",
      "description": "Somente membros com esta função",
      "enum": [
        "owner",
        "admin",
        "editor",
        "analyst",
        "viewer",
        "billing",
        "custom"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Página (a partir de 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultados por página (máx. 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "format": "uuid",
        "description": "Id do membro (use-o para atualizar ou remover o membro)"
      },
      "email": {
        "type": "string"
      },
      "name": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "role": {
        "type": "string",
        "description": "owner, admin, editor, analyst, viewer, billing ou custom"
      },
      "custom_role": {
        "anyOf": [
          {
            "type": "string",
            "description": "Nome da função personalizada"
          },
          {
            "type": "null"
          }
        ]
      },
      "custom_role_id": {
        "anyOf": [
          {
            "type": "string",
            "format": "uuid"
          },
          {
            "type": "null"
          }
        ]
      },
      "all_sites": {
        "type": "boolean",
        "description": "Acesso a todos os sites"
      },
      "include_future_sites": {
        "type": "boolean"
      },
      "site_ids": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Ids dos sites quando all_sites é false"
      },
      "two_factor": {
        "type": "boolean",
        "description": "Tem 2FA ou uma passkey"
      },
      "last_active_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "created_at": {
        "type": "string",
        "format": "date-time",
        "description": "Entrou em"
      }
    }
  }
}
PATCH /workspaces/:workspace_id/members/:id.json Alterar a função ou o acesso a sites de um membro members_update

Permissão: members.manage

Exemplo
curl -X PATCH https://privatusanalytics.com/workspaces/:workspace_id/members/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "role": {
      "type": "string",
      "description": "Nova função (custom precisa de custom_role_id)",
      "enum": [
        "admin",
        "editor",
        "analyst",
        "viewer",
        "billing",
        "custom"
      ]
    },
    "custom_role_id": {
      "type": "string",
      "description": "Id da função personalizada (Business)"
    },
    "all_sites": {
      "type": "boolean",
      "description": "Acesso a todos os sites, incluindo os futuros"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Ids dos sites (pa_…) quando all_sites é false"
    },
    "include_future_sites": {
      "type": "boolean",
      "description": "Conceder também os sites adicionados depois"
    },
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id do membro (use-o para atualizar ou remover o membro)"
    },
    "email": {
      "type": "string"
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "role": {
      "type": "string",
      "description": "owner, admin, editor, analyst, viewer, billing ou custom"
    },
    "custom_role": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nome da função personalizada"
        },
        {
          "type": "null"
        }
      ]
    },
    "custom_role_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ]
    },
    "all_sites": {
      "type": "boolean",
      "description": "Acesso a todos os sites"
    },
    "include_future_sites": {
      "type": "boolean"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Ids dos sites quando all_sites é false"
    },
    "two_factor": {
      "type": "boolean",
      "description": "Tem 2FA ou uma passkey"
    },
    "last_active_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Entrou em"
    }
  }
}
POST /workspaces/:workspace_id/ownership_transfer.json Transferir a propriedade do espaço de trabalho para outro membro (somente o proprietário, você passa a ser administrador) ownership_transfers_create

Permissão: member

Exemplo
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/ownership_transfer.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "membership_id": {
      "type": "string",
      "description": "Id do membro que será o novo proprietário"
    },
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "membership_id",
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id do membro (use-o para atualizar ou remover o membro)"
    },
    "email": {
      "type": "string"
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "role": {
      "type": "string",
      "description": "owner, admin, editor, analyst, viewer, billing ou custom"
    },
    "custom_role": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nome da função personalizada"
        },
        {
          "type": "null"
        }
      ]
    },
    "custom_role_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ]
    },
    "all_sites": {
      "type": "boolean",
      "description": "Acesso a todos os sites"
    },
    "include_future_sites": {
      "type": "boolean"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Ids dos sites quando all_sites é false"
    },
    "two_factor": {
      "type": "boolean",
      "description": "Tem 2FA ou uma passkey"
    },
    "last_active_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Entrou em"
    }
  }
}

Metas

POST /sites/:site_id/goals/:id/archive.json Arquivar uma meta (oculta dos relatórios) goals_archive

Permissão: content.write

Exemplo
curl -X POST https://privatusanalytics.com/sites/:site_id/goals/:id/archive.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id da meta, por exemplo goal_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "page, event, engagement, outbound ou download"
    },
    "match_type": {
      "type": "string",
      "description": "exact, prefix, glob ou regex"
    },
    "pattern": {
      "anyOf": [
        {
          "type": "string",
          "description": "Padrão de caminho, domínio ou arquivo"
        },
        {
          "type": "null"
        }
      ]
    },
    "hostname": {
      "anyOf": [
        {
          "type": "string",
          "description": "Restrição de hostname (metas de página)"
        },
        {
          "type": "null"
        }
      ]
    },
    "event_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nome do evento personalizado (metas de evento)"
        },
        {
          "type": "null"
        }
      ]
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Condições de propriedades do evento"
    },
    "scroll_threshold": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engajamento: % de rolagem"
        },
        {
          "type": "null"
        }
      ]
    },
    "time_threshold_seconds": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engajamento: segundos na página"
        },
        {
          "type": "null"
        }
      ]
    },
    "value_mode": {
      "type": "string",
      "description": "none, fixed ou revenue"
    },
    "fixed_value_minor": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Valor fixo em unidades menores"
        },
        {
          "type": "null"
        }
      ]
    },
    "count_mode": {
      "type": "string",
      "description": "once_per_visit ou every"
    },
    "archived": {
      "type": "boolean"
    },
    "archived_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "stats": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "completions": {
              "type": "integer",
              "description": "Eventos correspondentes, repetições incluídas"
            },
            "conversions": {
              "type": "integer",
              "description": "Visitas com pelo menos uma conclusão"
            },
            "conversion_rate": {
              "type": "number",
              "description": "Conversões ÷ visitas (ou ÷ visitantes, conforme a configuração do site), %"
            },
            "value": {
              "type": "integer",
              "description": "Valor da meta em unidades menores da moeda do site"
            },
            "change": {
              "anyOf": [
                {
                  "type": "number",
                  "description": "Variação das conversões em relação ao período anterior, %"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Estatísticas do período (somente na listagem)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /sites/:site_id/goals.json Criar uma meta goals_create

Permissão: content.write

Exemplo
curl -X POST https://privatusanalytics.com/sites/:site_id/goals.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nome da meta",
      "examples": [
        "Signed up"
      ]
    },
    "kind": {
      "type": "string",
      "description": "page (visitar uma página), event (evento personalizado), engagement (rolagem ou tempo na página), outbound (clique em link externo) ou download (download de arquivo)",
      "enum": [
        "page",
        "event",
        "engagement",
        "outbound",
        "download"
      ]
    },
    "match_type": {
      "type": "string",
      "description": "Como o pattern corresponde ao caminho (page, engagement), ao domínio do link (outbound) ou ao arquivo (download): exact, prefix, glob (*) ou regex",
      "enum": [
        "exact",
        "prefix",
        "glob",
        "regex"
      ],
      "default": "exact"
    },
    "pattern": {
      "type": "string",
      "description": "Padrão de caminho, domínio ou arquivo, por exemplo /pricing, /blog/*, stripe.com ou *.pdf"
    },
    "hostname": {
      "type": "string",
      "description": "Contar somente páginas neste hostname (metas de página)"
    },
    "event_name": {
      "type": "string",
      "description": "Nome do evento personalizado (metas de evento)"
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      },
      "description": "Condições de propriedades do evento: [{\"key\": \"plan\", \"operator\": \"is|is_not|contains|gt|lt\", \"value\": \"pro\"}]",
      "default": []
    },
    "scroll_threshold": {
      "type": "integer",
      "description": "Engajamento: % de profundidade de rolagem a atingir"
    },
    "time_threshold_seconds": {
      "type": "integer",
      "description": "Engajamento: segundos na página"
    },
    "value_mode": {
      "type": "string",
      "description": "none, fixed (fixed_value por conversão) ou revenue (a receita do evento)",
      "enum": [
        "none",
        "fixed",
        "revenue"
      ],
      "default": "none"
    },
    "fixed_value": {
      "type": "number",
      "description": "Valor fixo por conversão na moeda do site, por exemplo 50.0"
    },
    "count_mode": {
      "type": "string",
      "description": "O valor conta once_per_visit ou every completion",
      "enum": [
        "once_per_visit",
        "every"
      ],
      "default": "once_per_visit"
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "kind",
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id da meta, por exemplo goal_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "page, event, engagement, outbound ou download"
    },
    "match_type": {
      "type": "string",
      "description": "exact, prefix, glob ou regex"
    },
    "pattern": {
      "anyOf": [
        {
          "type": "string",
          "description": "Padrão de caminho, domínio ou arquivo"
        },
        {
          "type": "null"
        }
      ]
    },
    "hostname": {
      "anyOf": [
        {
          "type": "string",
          "description": "Restrição de hostname (metas de página)"
        },
        {
          "type": "null"
        }
      ]
    },
    "event_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nome do evento personalizado (metas de evento)"
        },
        {
          "type": "null"
        }
      ]
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Condições de propriedades do evento"
    },
    "scroll_threshold": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engajamento: % de rolagem"
        },
        {
          "type": "null"
        }
      ]
    },
    "time_threshold_seconds": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engajamento: segundos na página"
        },
        {
          "type": "null"
        }
      ]
    },
    "value_mode": {
      "type": "string",
      "description": "none, fixed ou revenue"
    },
    "fixed_value_minor": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Valor fixo em unidades menores"
        },
        {
          "type": "null"
        }
      ]
    },
    "count_mode": {
      "type": "string",
      "description": "once_per_visit ou every"
    },
    "archived": {
      "type": "boolean"
    },
    "archived_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "stats": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "completions": {
              "type": "integer",
              "description": "Eventos correspondentes, repetições incluídas"
            },
            "conversions": {
              "type": "integer",
              "description": "Visitas com pelo menos uma conclusão"
            },
            "conversion_rate": {
              "type": "number",
              "description": "Conversões ÷ visitas (ou ÷ visitantes, conforme a configuração do site), %"
            },
            "value": {
              "type": "integer",
              "description": "Valor da meta em unidades menores da moeda do site"
            },
            "change": {
              "anyOf": [
                {
                  "type": "number",
                  "description": "Variação das conversões em relação ao período anterior, %"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Estatísticas do período (somente na listagem)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:site_id/goals/:id.json Excluir uma meta (os dados são mantidos) goals_delete

Permissão: content.write

Exemplo
curl -X DELETE https://privatusanalytics.com/sites/:site_id/goals/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id da meta, por exemplo goal_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "page, event, engagement, outbound ou download"
    },
    "match_type": {
      "type": "string",
      "description": "exact, prefix, glob ou regex"
    },
    "pattern": {
      "anyOf": [
        {
          "type": "string",
          "description": "Padrão de caminho, domínio ou arquivo"
        },
        {
          "type": "null"
        }
      ]
    },
    "hostname": {
      "anyOf": [
        {
          "type": "string",
          "description": "Restrição de hostname (metas de página)"
        },
        {
          "type": "null"
        }
      ]
    },
    "event_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nome do evento personalizado (metas de evento)"
        },
        {
          "type": "null"
        }
      ]
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Condições de propriedades do evento"
    },
    "scroll_threshold": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engajamento: % de rolagem"
        },
        {
          "type": "null"
        }
      ]
    },
    "time_threshold_seconds": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engajamento: segundos na página"
        },
        {
          "type": "null"
        }
      ]
    },
    "value_mode": {
      "type": "string",
      "description": "none, fixed ou revenue"
    },
    "fixed_value_minor": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Valor fixo em unidades menores"
        },
        {
          "type": "null"
        }
      ]
    },
    "count_mode": {
      "type": "string",
      "description": "once_per_visit ou every"
    },
    "archived": {
      "type": "boolean"
    },
    "archived_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "stats": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "completions": {
              "type": "integer",
              "description": "Eventos correspondentes, repetições incluídas"
            },
            "conversions": {
              "type": "integer",
              "description": "Visitas com pelo menos uma conclusão"
            },
            "conversion_rate": {
              "type": "number",
              "description": "Conversões ÷ visitas (ou ÷ visitantes, conforme a configuração do site), %"
            },
            "value": {
              "type": "integer",
              "description": "Valor da meta em unidades menores da moeda do site"
            },
            "change": {
              "anyOf": [
                {
                  "type": "number",
                  "description": "Variação das conversões em relação ao período anterior, %"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Estatísticas do período (somente na listagem)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /sites/:site_id/goals/:id/duplicate.json Copiar uma meta goals_duplicate

Permissão: content.write

Exemplo
curl -X POST https://privatusanalytics.com/sites/:site_id/goals/:id/duplicate.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nome da cópia"
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id da meta, por exemplo goal_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "page, event, engagement, outbound ou download"
    },
    "match_type": {
      "type": "string",
      "description": "exact, prefix, glob ou regex"
    },
    "pattern": {
      "anyOf": [
        {
          "type": "string",
          "description": "Padrão de caminho, domínio ou arquivo"
        },
        {
          "type": "null"
        }
      ]
    },
    "hostname": {
      "anyOf": [
        {
          "type": "string",
          "description": "Restrição de hostname (metas de página)"
        },
        {
          "type": "null"
        }
      ]
    },
    "event_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nome do evento personalizado (metas de evento)"
        },
        {
          "type": "null"
        }
      ]
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Condições de propriedades do evento"
    },
    "scroll_threshold": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engajamento: % de rolagem"
        },
        {
          "type": "null"
        }
      ]
    },
    "time_threshold_seconds": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engajamento: segundos na página"
        },
        {
          "type": "null"
        }
      ]
    },
    "value_mode": {
      "type": "string",
      "description": "none, fixed ou revenue"
    },
    "fixed_value_minor": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Valor fixo em unidades menores"
        },
        {
          "type": "null"
        }
      ]
    },
    "count_mode": {
      "type": "string",
      "description": "once_per_visit ou every"
    },
    "archived": {
      "type": "boolean"
    },
    "archived_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "stats": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "completions": {
              "type": "integer",
              "description": "Eventos correspondentes, repetições incluídas"
            },
            "conversions": {
              "type": "integer",
              "description": "Visitas com pelo menos uma conclusão"
            },
            "conversion_rate": {
              "type": "number",
              "description": "Conversões ÷ visitas (ou ÷ visitantes, conforme a configuração do site), %"
            },
            "value": {
              "type": "integer",
              "description": "Valor da meta em unidades menores da moeda do site"
            },
            "change": {
              "anyOf": [
                {
                  "type": "number",
                  "description": "Variação das conversões em relação ao período anterior, %"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Estatísticas do período (somente na listagem)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/goals.json Listar metas com conclusões, conversões, taxa e valor de um período goals_list

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/sites/:site_id/goals.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Predefinição de intervalo de datas. Use custom com 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": "Início do intervalo personalizado (fuso horário do site)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Fim do intervalo personalizado, inclusive"
    },
    "compare": {
      "type": "string",
      "description": "Período de comparação",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Início da comparação personalizada"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Fim da comparação personalizada"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Alinhar os dias da semana na comparação",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtros: [[\"dimension\",\"operator\",\"value\"], …]. Operadores: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Envolva as condições em {\"any\": [...]} para OU.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Aplicar um segmento salvo (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Adicionar dados históricos importados (datas anteriores ao primeiro evento nativo, ignorado quando filtros ou um segmento são aplicados)",
      "default": false
    },
    "status": {
      "type": "string",
      "description": "Metas active, archived ou all",
      "enum": [
        "active",
        "archived",
        "all"
      ],
      "default": "active"
    },
    "page": {
      "type": "integer",
      "description": "Número da página",
      "default": 1
    },
    "per_page": {
      "type": "integer",
      "description": "Metas por página (máx. 100)",
      "default": 25
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Id da meta, por exemplo goal_7Q2K9XH3AB"
      },
      "name": {
        "type": "string"
      },
      "kind": {
        "type": "string",
        "description": "page, event, engagement, outbound ou download"
      },
      "match_type": {
        "type": "string",
        "description": "exact, prefix, glob ou regex"
      },
      "pattern": {
        "anyOf": [
          {
            "type": "string",
            "description": "Padrão de caminho, domínio ou arquivo"
          },
          {
            "type": "null"
          }
        ]
      },
      "hostname": {
        "anyOf": [
          {
            "type": "string",
            "description": "Restrição de hostname (metas de página)"
          },
          {
            "type": "null"
          }
        ]
      },
      "event_name": {
        "anyOf": [
          {
            "type": "string",
            "description": "Nome do evento personalizado (metas de evento)"
          },
          {
            "type": "null"
          }
        ]
      },
      "conditions": {
        "type": "array",
        "items": {
          "type": "object"
        },
        "description": "Condições de propriedades do evento"
      },
      "scroll_threshold": {
        "anyOf": [
          {
            "type": "integer",
            "description": "Engajamento: % de rolagem"
          },
          {
            "type": "null"
          }
        ]
      },
      "time_threshold_seconds": {
        "anyOf": [
          {
            "type": "integer",
            "description": "Engajamento: segundos na página"
          },
          {
            "type": "null"
          }
        ]
      },
      "value_mode": {
        "type": "string",
        "description": "none, fixed ou revenue"
      },
      "fixed_value_minor": {
        "anyOf": [
          {
            "type": "integer",
            "description": "Valor fixo em unidades menores"
          },
          {
            "type": "null"
          }
        ]
      },
      "count_mode": {
        "type": "string",
        "description": "once_per_visit ou every"
      },
      "archived": {
        "type": "boolean"
      },
      "archived_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time"
          },
          {
            "type": "null"
          }
        ]
      },
      "stats": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "completions": {
                "type": "integer",
                "description": "Eventos correspondentes, repetições incluídas"
              },
              "conversions": {
                "type": "integer",
                "description": "Visitas com pelo menos uma conclusão"
              },
              "conversion_rate": {
                "type": "number",
                "description": "Conversões ÷ visitas (ou ÷ visitantes, conforme a configuração do site), %"
              },
              "value": {
                "type": "integer",
                "description": "Valor da meta em unidades menores da moeda do site"
              },
              "change": {
                "anyOf": [
                  {
                    "type": "number",
                    "description": "Variação das conversões em relação ao período anterior, %"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "description": "Estatísticas do período (somente na listagem)"
          },
          {
            "type": "null"
          }
        ]
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      },
      "updated_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
GET /sites/:site_id/goals/:id.json Relatório da meta: métricas, gráfico, detalhamentos e a jornada até a conversão goals_get

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/sites/:site_id/goals/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Predefinição de intervalo de datas. Use custom com 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": "Início do intervalo personalizado (fuso horário do site)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Fim do intervalo personalizado, inclusive"
    },
    "compare": {
      "type": "string",
      "description": "Período de comparação",
      "enum": [
        "none",
        "previous_period",
        "previous_year",
        "custom"
      ],
      "default": "none"
    },
    "compare_from": {
      "type": "string",
      "format": "date",
      "description": "Início da comparação personalizada"
    },
    "compare_to": {
      "type": "string",
      "format": "date",
      "description": "Fim da comparação personalizada"
    },
    "match_weekday": {
      "type": "boolean",
      "description": "Alinhar os dias da semana na comparação",
      "default": false
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtros: [[\"dimension\",\"operator\",\"value\"], …]. Operadores: is, is_not, any_of, none_of, contains, not_contains, starts_with, regex, not_regex, gt, lt, between. Envolva as condições em {\"any\": [...]} para OU.",
      "default": []
    },
    "segment_id": {
      "type": "string",
      "description": "Aplicar um segmento salvo (seg_…)"
    },
    "include_imported": {
      "type": "boolean",
      "description": "Adicionar dados históricos importados (datas anteriores ao primeiro evento nativo, ignorado quando filtros ou um segmento são aplicados)",
      "default": false
    },
    "interval": {
      "type": "string",
      "description": "Tamanho do intervalo do gráfico",
      "enum": [
        "auto",
        "minute",
        "hour",
        "day",
        "week",
        "month",
        "quarter",
        "year"
      ],
      "default": "auto"
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "period": {
      "type": "object",
      "description": "from/to do período (UTC)"
    },
    "goal": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Id da meta, por exemplo goal_7Q2K9XH3AB"
        },
        "name": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "description": "page, event, engagement, outbound ou download"
        },
        "match_type": {
          "type": "string",
          "description": "exact, prefix, glob ou regex"
        },
        "pattern": {
          "anyOf": [
            {
              "type": "string",
              "description": "Padrão de caminho, domínio ou arquivo"
            },
            {
              "type": "null"
            }
          ]
        },
        "hostname": {
          "anyOf": [
            {
              "type": "string",
              "description": "Restrição de hostname (metas de página)"
            },
            {
              "type": "null"
            }
          ]
        },
        "event_name": {
          "anyOf": [
            {
              "type": "string",
              "description": "Nome do evento personalizado (metas de evento)"
            },
            {
              "type": "null"
            }
          ]
        },
        "conditions": {
          "type": "array",
          "items": {
            "type": "object"
          },
          "description": "Condições de propriedades do evento"
        },
        "scroll_threshold": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Engajamento: % de rolagem"
            },
            {
              "type": "null"
            }
          ]
        },
        "time_threshold_seconds": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Engajamento: segundos na página"
            },
            {
              "type": "null"
            }
          ]
        },
        "value_mode": {
          "type": "string",
          "description": "none, fixed ou revenue"
        },
        "fixed_value_minor": {
          "anyOf": [
            {
              "type": "integer",
              "description": "Valor fixo em unidades menores"
            },
            {
              "type": "null"
            }
          ]
        },
        "count_mode": {
          "type": "string",
          "description": "once_per_visit ou every"
        },
        "archived": {
          "type": "boolean"
        },
        "archived_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "stats": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "completions": {
                  "type": "integer",
                  "description": "Eventos correspondentes, repetições incluídas"
                },
                "conversions": {
                  "type": "integer",
                  "description": "Visitas com pelo menos uma conclusão"
                },
                "conversion_rate": {
                  "type": "number",
                  "description": "Conversões ÷ visitas (ou ÷ visitantes, conforme a configuração do site), %"
                },
                "value": {
                  "type": "integer",
                  "description": "Valor da meta em unidades menores da moeda do site"
                },
                "change": {
                  "anyOf": [
                    {
                      "type": "number",
                      "description": "Variação das conversões em relação ao período anterior, %"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "description": "Estatísticas do período (somente na listagem)"
            },
            {
              "type": "null"
            }
          ]
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        }
      },
      "description": "A definição da meta"
    },
    "metrics": {
      "type": "object",
      "description": "completions, conversions, conversion_rate (%), value (unidades menores)"
    },
    "comparison_period": {
      "anyOf": [
        {
          "type": "object",
          "description": "from/to da comparação"
        },
        {
          "type": "null"
        }
      ]
    },
    "comparison": {
      "anyOf": [
        {
          "type": "object",
          "description": "Métricas do período de comparação"
        },
        {
          "type": "null"
        }
      ]
    },
    "change": {
      "anyOf": [
        {
          "type": "object",
          "description": "Variação em relação à comparação, % por métrica"
        },
        {
          "type": "null"
        }
      ]
    },
    "interval": {
      "type": "string",
      "description": "Tamanho do intervalo do gráfico"
    },
    "series": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Por intervalo: date, completions, conversions, conversion_rate"
    },
    "breakdowns": {
      "type": "object",
      "description": "Principais valores por conversões para channel, utm_campaign, entry_page, country e device: value, completions, conversions, conversion_rate"
    },
    "journey": {
      "anyOf": [
        {
          "type": "object",
          "description": "converting_visits, median_seconds_to_convert, median_pages_before e pages_before (páginas vistas antes na visita, por visitas que converteram)"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
POST /sites/:site_id/goals/:id/unarchive.json Restaurar uma meta arquivada goals_unarchive

Permissão: content.write

Exemplo
curl -X POST https://privatusanalytics.com/sites/:site_id/goals/:id/unarchive.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id da meta, por exemplo goal_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "page, event, engagement, outbound ou download"
    },
    "match_type": {
      "type": "string",
      "description": "exact, prefix, glob ou regex"
    },
    "pattern": {
      "anyOf": [
        {
          "type": "string",
          "description": "Padrão de caminho, domínio ou arquivo"
        },
        {
          "type": "null"
        }
      ]
    },
    "hostname": {
      "anyOf": [
        {
          "type": "string",
          "description": "Restrição de hostname (metas de página)"
        },
        {
          "type": "null"
        }
      ]
    },
    "event_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nome do evento personalizado (metas de evento)"
        },
        {
          "type": "null"
        }
      ]
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Condições de propriedades do evento"
    },
    "scroll_threshold": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engajamento: % de rolagem"
        },
        {
          "type": "null"
        }
      ]
    },
    "time_threshold_seconds": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engajamento: segundos na página"
        },
        {
          "type": "null"
        }
      ]
    },
    "value_mode": {
      "type": "string",
      "description": "none, fixed ou revenue"
    },
    "fixed_value_minor": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Valor fixo em unidades menores"
        },
        {
          "type": "null"
        }
      ]
    },
    "count_mode": {
      "type": "string",
      "description": "once_per_visit ou every"
    },
    "archived": {
      "type": "boolean"
    },
    "archived_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "stats": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "completions": {
              "type": "integer",
              "description": "Eventos correspondentes, repetições incluídas"
            },
            "conversions": {
              "type": "integer",
              "description": "Visitas com pelo menos uma conclusão"
            },
            "conversion_rate": {
              "type": "number",
              "description": "Conversões ÷ visitas (ou ÷ visitantes, conforme a configuração do site), %"
            },
            "value": {
              "type": "integer",
              "description": "Valor da meta em unidades menores da moeda do site"
            },
            "change": {
              "anyOf": [
                {
                  "type": "number",
                  "description": "Variação das conversões em relação ao período anterior, %"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Estatísticas do período (somente na listagem)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
PATCH /sites/:site_id/goals/:id.json Atualizar uma meta goals_update

Permissão: content.write

Exemplo
curl -X PATCH https://privatusanalytics.com/sites/:site_id/goals/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nome da meta",
      "examples": [
        "Signed up"
      ]
    },
    "kind": {
      "type": "string",
      "description": "page (visitar uma página), event (evento personalizado), engagement (rolagem ou tempo na página), outbound (clique em link externo) ou download (download de arquivo)",
      "enum": [
        "page",
        "event",
        "engagement",
        "outbound",
        "download"
      ]
    },
    "match_type": {
      "type": "string",
      "description": "Como o pattern corresponde ao caminho (page, engagement), ao domínio do link (outbound) ou ao arquivo (download): exact, prefix, glob (*) ou regex",
      "enum": [
        "exact",
        "prefix",
        "glob",
        "regex"
      ]
    },
    "pattern": {
      "type": "string",
      "description": "Padrão de caminho, domínio ou arquivo, por exemplo /pricing, /blog/*, stripe.com ou *.pdf"
    },
    "hostname": {
      "type": "string",
      "description": "Contar somente páginas neste hostname (metas de página)"
    },
    "event_name": {
      "type": "string",
      "description": "Nome do evento personalizado (metas de evento)"
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      },
      "description": "Condições de propriedades do evento: [{\"key\": \"plan\", \"operator\": \"is|is_not|contains|gt|lt\", \"value\": \"pro\"}]"
    },
    "scroll_threshold": {
      "type": "integer",
      "description": "Engajamento: % de profundidade de rolagem a atingir"
    },
    "time_threshold_seconds": {
      "type": "integer",
      "description": "Engajamento: segundos na página"
    },
    "value_mode": {
      "type": "string",
      "description": "none, fixed (fixed_value por conversão) ou revenue (a receita do evento)",
      "enum": [
        "none",
        "fixed",
        "revenue"
      ]
    },
    "fixed_value": {
      "type": "number",
      "description": "Valor fixo por conversão na moeda do site, por exemplo 50.0"
    },
    "count_mode": {
      "type": "string",
      "description": "O valor conta once_per_visit ou every completion",
      "enum": [
        "once_per_visit",
        "every"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id da meta, por exemplo goal_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "description": "page, event, engagement, outbound ou download"
    },
    "match_type": {
      "type": "string",
      "description": "exact, prefix, glob ou regex"
    },
    "pattern": {
      "anyOf": [
        {
          "type": "string",
          "description": "Padrão de caminho, domínio ou arquivo"
        },
        {
          "type": "null"
        }
      ]
    },
    "hostname": {
      "anyOf": [
        {
          "type": "string",
          "description": "Restrição de hostname (metas de página)"
        },
        {
          "type": "null"
        }
      ]
    },
    "event_name": {
      "anyOf": [
        {
          "type": "string",
          "description": "Nome do evento personalizado (metas de evento)"
        },
        {
          "type": "null"
        }
      ]
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Condições de propriedades do evento"
    },
    "scroll_threshold": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engajamento: % de rolagem"
        },
        {
          "type": "null"
        }
      ]
    },
    "time_threshold_seconds": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Engajamento: segundos na página"
        },
        {
          "type": "null"
        }
      ]
    },
    "value_mode": {
      "type": "string",
      "description": "none, fixed ou revenue"
    },
    "fixed_value_minor": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Valor fixo em unidades menores"
        },
        {
          "type": "null"
        }
      ]
    },
    "count_mode": {
      "type": "string",
      "description": "once_per_visit ou every"
    },
    "archived": {
      "type": "boolean"
    },
    "archived_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "stats": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "completions": {
              "type": "integer",
              "description": "Eventos correspondentes, repetições incluídas"
            },
            "conversions": {
              "type": "integer",
              "description": "Visitas com pelo menos uma conclusão"
            },
            "conversion_rate": {
              "type": "number",
              "description": "Conversões ÷ visitas (ou ÷ visitantes, conforme a configuração do site), %"
            },
            "value": {
              "type": "integer",
              "description": "Valor da meta em unidades menores da moeda do site"
            },
            "change": {
              "anyOf": [
                {
                  "type": "number",
                  "description": "Variação das conversões em relação ao período anterior, %"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "description": "Estatísticas do período (somente na listagem)"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Notas

POST /sites/:site_id/notes.json Adicionar uma nota a um site (use a origem "deploy" para webhooks de lançamento) notes_create

Permissão: content.write

Exemplo
curl -X POST https://privatusanalytics.com/sites/:site_id/notes.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "date": {
      "type": "string",
      "format": "date",
      "description": "Dia da nota (fuso horário do site). O padrão é hoje"
    },
    "end_date": {
      "type": "string",
      "format": "date",
      "description": "Último dia, para um intervalo de datas"
    },
    "title": {
      "type": "string",
      "description": "Título curto exibido nos gráficos",
      "examples": [
        "Launched new pricing"
      ]
    },
    "body": {
      "type": "string",
      "description": "Detalhes (Markdown)"
    },
    "url": {
      "type": "string",
      "description": "Link, por exemplo um PR ou o changelog"
    },
    "color": {
      "type": "string",
      "description": "Cor do marcador",
      "enum": [
        "neutral",
        "brand",
        "blue",
        "amber",
        "red",
        "violet"
      ]
    },
    "source": {
      "type": "string",
      "description": "manual, ou deploy para webhooks de lançamento",
      "enum": [
        "manual",
        "deploy",
        "system",
        "import",
        "incident"
      ],
      "default": "manual"
    },
    "version": {
      "type": "string",
      "description": "Deploys: versão de lançamento ou commit, usada para o título padrão"
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id da nota, por exemplo note_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Site, ou null para notas de todo o espaço de trabalho"
        },
        {
          "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 Excluir uma nota notes_delete

Permissão: content.write

Exemplo
curl -X DELETE https://privatusanalytics.com/sites/:site_id/notes/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id da nota, por exemplo note_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Site, ou null para notas de todo o espaço de trabalho"
        },
        {
          "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 Listar notas de um site (incluindo notas de todo o espaço de trabalho) notes_list

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/sites/:site_id/notes.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "from": {
      "type": "string",
      "format": "date",
      "description": "Somente notas nesta data ou depois"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Somente notas nesta data ou antes"
    },
    "source": {
      "type": "string",
      "description": "Somente notas desta origem",
      "enum": [
        "manual",
        "deploy",
        "system",
        "import",
        "incident"
      ]
    },
    "query": {
      "type": "string",
      "description": "Pesquisar título, corpo e link"
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Página (a partir de 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultados por página (máx. 100)"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Id da nota, por exemplo note_7Q2K9XH3AB"
      },
      "site_id": {
        "anyOf": [
          {
            "type": "string",
            "description": "Site, ou null para notas de todo o espaço de trabalho"
          },
          {
            "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 Obter uma nota notes_get

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/sites/:site_id/notes/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id da nota, por exemplo note_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Site, ou null para notas de todo o espaço de trabalho"
        },
        {
          "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 Editar uma nota notes_update

Permissão: content.write

Exemplo
curl -X PATCH https://privatusanalytics.com/sites/:site_id/notes/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "date": {
      "type": "string",
      "format": "date",
      "description": "Dia da nota"
    },
    "end_date": {
      "type": "string",
      "format": "date",
      "description": "Último dia, para um intervalo de datas"
    },
    "title": {
      "type": "string",
      "description": "Título curto exibido nos gráficos"
    },
    "body": {
      "type": "string",
      "description": "Detalhes (Markdown)"
    },
    "url": {
      "type": "string",
      "description": "Link"
    },
    "color": {
      "type": "string",
      "description": "Cor do marcador",
      "enum": [
        "neutral",
        "brand",
        "blue",
        "amber",
        "red",
        "violet"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id da nota, por exemplo note_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Site, ou null para notas de todo o espaço de trabalho"
        },
        {
          "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 Adicionar uma nota de todo o espaço de trabalho (exibida em todos os sites) workspace_notes_create

Permissão: content.write

Exemplo
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/notes.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "date": {
      "type": "string",
      "format": "date",
      "description": "Dia da nota (fuso horário do site). O padrão é hoje"
    },
    "end_date": {
      "type": "string",
      "format": "date",
      "description": "Último dia, para um intervalo de datas"
    },
    "title": {
      "type": "string",
      "description": "Título curto exibido nos gráficos",
      "examples": [
        "Launched new pricing"
      ]
    },
    "body": {
      "type": "string",
      "description": "Detalhes (Markdown)"
    },
    "url": {
      "type": "string",
      "description": "Link, por exemplo um PR ou o changelog"
    },
    "color": {
      "type": "string",
      "description": "Cor do marcador",
      "enum": [
        "neutral",
        "brand",
        "blue",
        "amber",
        "red",
        "violet"
      ]
    },
    "source": {
      "type": "string",
      "description": "manual, ou deploy para webhooks de lançamento",
      "enum": [
        "manual",
        "deploy",
        "system",
        "import",
        "incident"
      ],
      "default": "manual"
    },
    "version": {
      "type": "string",
      "description": "Deploys: versão de lançamento ou commit, usada para o título padrão"
    },
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id da nota, por exemplo note_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Site, ou null para notas de todo o espaço de trabalho"
        },
        {
          "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 Excluir uma nota do espaço de trabalho workspace_notes_delete

Permissão: content.write

Exemplo
curl -X DELETE https://privatusanalytics.com/workspaces/:workspace_id/notes/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id da nota, por exemplo note_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Site, ou null para notas de todo o espaço de trabalho"
        },
        {
          "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 Listar notas de um espaço de trabalho workspace_notes_list

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/workspaces/:workspace_id/notes.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "from": {
      "type": "string",
      "format": "date",
      "description": "Somente notas nesta data ou depois"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Somente notas nesta data ou antes"
    },
    "source": {
      "type": "string",
      "description": "Somente notas desta origem",
      "enum": [
        "manual",
        "deploy",
        "system",
        "import",
        "incident"
      ]
    },
    "query": {
      "type": "string",
      "description": "Pesquisar título, corpo e link"
    },
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Página (a partir de 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultados por página (máx. 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Id da nota, por exemplo note_7Q2K9XH3AB"
      },
      "site_id": {
        "anyOf": [
          {
            "type": "string",
            "description": "Site, ou null para notas de todo o espaço de trabalho"
          },
          {
            "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 Editar uma nota do espaço de trabalho workspace_notes_update

Permissão: content.write

Exemplo
curl -X PATCH https://privatusanalytics.com/workspaces/:workspace_id/notes/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "date": {
      "type": "string",
      "format": "date",
      "description": "Dia da nota"
    },
    "end_date": {
      "type": "string",
      "format": "date",
      "description": "Último dia, para um intervalo de datas"
    },
    "title": {
      "type": "string",
      "description": "Título curto exibido nos gráficos"
    },
    "body": {
      "type": "string",
      "description": "Detalhes (Markdown)"
    },
    "url": {
      "type": "string",
      "description": "Link"
    },
    "color": {
      "type": "string",
      "description": "Cor do marcador",
      "enum": [
        "neutral",
        "brand",
        "blue",
        "amber",
        "red",
        "violet"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id da nota, por exemplo note_7Q2K9XH3AB"
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Site, ou null para notas de todo o espaço de trabalho"
        },
        {
          "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"
    }
  }
}

Painéis

GET /workspaces/:workspace_id/dashboards/:id/cards/:index.json Dados de um cartão de um painel personalizado dashboards_card

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/workspaces/:workspace_id/dashboards/:id/cards/:index.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    },
    "index": {
      "type": "string",
      "description": "Index do recurso"
    }
  },
  "required": [
    "workspace_id",
    "id",
    "index"
  ]
}
Dados da resposta
{
  "type": "object"
}
POST /workspaces/:workspace_id/dashboards.json Criar um painel personalizado dashboards_create

Permissão: content.write

Exemplo
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/dashboards.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nome do painel",
      "examples": [
        "Client: Acme"
      ]
    },
    "cards": {
      "type": "array",
      "items": {},
      "description": "Cartões em ordem (máx. 40): [{\"type\": \"metric|chart|breakdown|goal|live|funnel|uptime|vitals\", \"site_id\": \"pa_…\", \"title\": \"opcional\", \"params\": {\"period\": \"30d\", \"metric\": \"visitors\", \"dimension\": \"page\", \"funnel_id\": \"fun_…\"}}]. Parâmetros que um tipo não usa são ignorados",
      "default": []
    },
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do painel, por exemplo dash_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "cards": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Cartões em ordem: [{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 Excluir um painel personalizado dashboards_delete

Permissão: content.write

Exemplo
curl -X DELETE https://privatusanalytics.com/workspaces/:workspace_id/dashboards/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do painel, por exemplo dash_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "cards": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Cartões em ordem: [{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 Listar painéis personalizados dashboards_list

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/workspaces/:workspace_id/dashboards.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Página (a partir de 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultados por página (máx. 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Id do painel, por exemplo dash_7Q2K9XH3AB"
      },
      "name": {
        "type": "string"
      },
      "cards": {
        "type": "array",
        "items": {
          "type": "object"
        },
        "description": "Cartões em ordem: [{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 Obter um painel personalizado e seus cartões dashboards_get

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/workspaces/:workspace_id/dashboards/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do painel, por exemplo dash_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "cards": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Cartões em ordem: [{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 Renomear um painel personalizado ou substituir seus cartões dashboards_update

Permissão: content.write

Exemplo
curl -X PATCH https://privatusanalytics.com/workspaces/:workspace_id/dashboards/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Novo nome (inalterado quando vazio)"
    },
    "cards": {
      "type": "array",
      "items": {},
      "description": "Substitui todos os cartões. Cartões em ordem (máx. 40): [{\"type\": \"metric|chart|breakdown|goal|live|funnel|uptime|vitals\", \"site_id\": \"pa_…\", \"title\": \"opcional\", \"params\": {\"period\": \"30d\", \"metric\": \"visitors\", \"dimension\": \"page\", \"funnel_id\": \"fun_…\"}}]. Parâmetros que um tipo não usa são ignorados"
    },
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do painel, por exemplo dash_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "cards": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Cartões em ordem: [{type, site_id, title, params}]"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Planos

GET /plans.json Listar planos, preços e limites plans_list

Permissão: public

Exemplo
curl https://privatusanalytics.com/plans.json
Entradas
{
  "type": "object",
  "properties": {
    "page": {
      "type": "integer",
      "description": "Página (a partir de 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultados por página (máx. 100)"
    }
  },
  "required": []
}
Dados da resposta
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "name": {
        "type": "string",
        "description": "free, pro, business ou enterprise"
      },
      "events": {
        "anyOf": [
          {
            "type": "integer",
            "description": "Eventos incluídos ao mês (somente plano gratuito)"
          },
          {
            "type": "null"
          }
        ]
      },
      "badge_bonus": {
        "anyOf": [
          {
            "type": "integer",
            "description": "Eventos extras ao mês por exibir o selo (plano gratuito)"
          },
          {
            "type": "null"
          }
        ]
      },
      "limits": {
        "type": "object",
        "description": "Limites do plano. Null significa ilimitado"
      },
      "tiers": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "events": {
              "type": "integer",
              "description": "Eventos ao mês incluídos"
            },
            "monthly": {
              "type": "integer",
              "description": "USD ao mês, cobrado mensalmente"
            },
            "yearly": {
              "type": "integer",
              "description": "USD ao ano, cobrado anualmente (2 meses grátis)"
            },
            "monthly_price_id": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Id do preço no Paddle (mensal)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "yearly_price_id": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Id do preço no Paddle (anual)"
                },
                {
                  "type": "null"
                }
              ]
            }
          }
        },
        "description": "Escada de preços por eventos ao mês"
      },
      "contact_sales": {
        "type": "boolean",
        "description": "Preço por contrato"
      }
    }
  }
}

Programa de afiliados

GET /account/affiliate/commissions.json Listar suas comissões de afiliado affiliate_commissions_list

Comissões, estornos por reembolso e chargeback e reversões, das mais recentes para as mais antigas. Os valores estão em centavos.

Permissão: member

Exemplo
curl https://privatusanalytics.com/account/affiliate/commissions.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Apenas comissões com este status",
      "enum": [
        "pending",
        "approved",
        "paid",
        "void"
      ]
    },
    "page": {
      "type": "integer",
      "description": "Página (a partir de 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultados por página (máx. 100)"
    }
  },
  "required": []
}
Dados da resposta
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "format": "uuid",
        "description": "Id da comissão"
      },
      "kind": {
        "type": "string",
        "description": "commission, clawback (reembolso ou chargeback) ou reversal"
      },
      "status": {
        "type": "string",
        "description": "pending (em retenção), approved (a pagar), paid ou void"
      },
      "amount_cents": {
        "type": "integer",
        "description": "Sua parte em centavos (negativa em um estorno)"
      },
      "basis_cents": {
        "type": "integer",
        "description": "O pagamento líquido (sem impostos) usado como base de cálculo, em centavos"
      },
      "currency": {
        "type": "string",
        "description": "Código ISO da moeda"
      },
      "earned_at": {
        "type": "string",
        "format": "date-time",
        "description": "Quando o pagamento (ou reembolso) ocorreu"
      },
      "approved_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time",
            "description": "Quando ela passou a ser pagável"
          },
          {
            "type": "null"
          }
        ]
      },
      "paid_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time",
            "description": "Quando ela foi paga"
          },
          {
            "type": "null"
          }
        ]
      }
    }
  }
}
GET /account/affiliate/signup-box.json Obter o código da sua caixa de cadastro de afiliado e os resultados affiliate_signup_box_get

O código de incorporação da sua caixa de cadastro (um script e um iframe simples) para o tema escolhido, os atributos que preenchem o formulário, os eventos que o script dispara na sua página e os números da caixa: cadastros aguardando confirmação, cadastros confirmados e clientes pagantes. available é false até a sua candidatura de afiliado ser aprovada.

Permissão: member

Exemplo
curl https://privatusanalytics.com/account/affiliate/signup-box.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "theme": {
      "type": "string",
      "description": "Tema da caixa: auto (acompanha o dispositivo do visitante), light ou dark",
      "enum": [
        "auto",
        "light",
        "dark"
      ],
      "examples": [
        "auto"
      ],
      "default": "auto"
    }
  },
  "required": []
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "available": {
      "type": "boolean",
      "description": "Se você tem uma caixa de cadastro (somente afiliados aprovados)"
    },
    "theme": {
      "type": "string",
      "description": "O tema para o qual o código foi gerado"
    },
    "frame_url": {
      "anyOf": [
        {
          "type": "string",
          "description": "O endereço da caixa, para um iframe simples"
        },
        {
          "type": "null"
        }
      ]
    },
    "script": {
      "anyOf": [
        {
          "type": "string",
          "description": "O código de incorporação do script: um elemento e o script de carregamento"
        },
        {
          "type": "null"
        }
      ]
    },
    "iframe": {
      "anyOf": [
        {
          "type": "string",
          "description": "O código de incorporação do iframe simples"
        },
        {
          "type": "null"
        }
      ]
    },
    "prefill_attributes": {
      "type": "array",
      "description": "Atributos no elemento que preenchem o formulário para visitantes conectados"
    },
    "events": {
      "type": "array",
      "description": "Eventos do DOM que o script dispara no elemento"
    },
    "waiting": {
      "type": "integer",
      "description": "Cadastros cujo link enviado por e-mail ainda não foi aberto"
    },
    "signups": {
      "type": "integer",
      "description": "Cadastros confirmados que vieram pela caixa"
    },
    "customers": {
      "type": "integer",
      "description": "Os que se tornaram clientes pagantes"
    }
  }
}
GET /account/affiliate.json Obter seu status de afiliado, link de indicação e estatísticas affiliate_get

O status da sua candidatura de afiliado, o link de indicação, os cadastros e clientes pagantes que você indicou e os saldos por moeda (em retenção, a pagar, pago). status é none quando você ainda não se candidatou.

Permissão: member

Exemplo
curl https://privatusanalytics.com/account/affiliate.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {},
  "required": []
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "none (não se candidatou), pending, approved, rejected ou suspended"
    },
    "code": {
      "anyOf": [
        {
          "type": "string",
          "description": "Seu código de indicação"
        },
        {
          "type": "null"
        }
      ]
    },
    "referral_url": {
      "anyOf": [
        {
          "type": "string",
          "description": "O link para compartilhar (apenas afiliados aprovados)"
        },
        {
          "type": "null"
        }
      ]
    },
    "payout_method": {
      "anyOf": [
        {
          "type": "string",
          "description": "wise ou credit"
        },
        {
          "type": "null"
        }
      ]
    },
    "rejection_reason": {
      "anyOf": [
        {
          "type": "string",
          "description": "Por que a última candidatura foi rejeitada"
        },
        {
          "type": "null"
        }
      ]
    },
    "applied_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Quando você se candidatou"
        },
        {
          "type": "null"
        }
      ]
    },
    "approved_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Quando a candidatura foi aprovada"
        },
        {
          "type": "null"
        }
      ]
    },
    "credit_blocked": {
      "anyOf": [
        {
          "type": "string",
          "description": "Por que o crédito em conta está aguardando: program (o espaço de trabalho está em um programa de desconto), no_subscription ou no_workspace. null quando nada o bloqueia"
        },
        {
          "type": "null"
        }
      ]
    },
    "signups": {
      "type": "integer",
      "description": "Contas criadas pelo seu link ou código"
    },
    "customers": {
      "type": "integer",
      "description": "Espaços de trabalho indicados que já pagaram"
    },
    "balances": {
      "type": "array",
      "description": "Por moeda: pending_cents (em retenção), approved_cents (a pagar) e paid_cents"
    },
    "payouts": {
      "type": "array",
      "description": "Pagamentos recentes com amount_cents, currency, payout_method, status (applied: crédito em conta aguardando a sua próxima renovação, ou paid), applied_at e paid_at"
    },
    "terms": {
      "type": "object",
      "description": "Percentual de comissão, meses, dias de retenção e o valor mínimo de pagamento via Wise em centavos"
    }
  }
}

Páginas de status

GET /status/:slug/confirm/:token.json Confirmar uma inscrição pelo link enviado por e-mail public_status_pages_confirm

Permissão: public · Somente HTTP (não é uma ferramenta MCP)

Exemplo
curl https://privatusanalytics.com/status/:slug/confirm/:token.json
Entradas
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Token do recurso"
    },
    "slug": {
      "type": "string",
      "description": "Slug do recurso"
    }
  },
  "required": [
    "token",
    "slug"
  ]
}
Dados da resposta
{
  "type": "object"
}
GET /status/:slug.json Página de status pública: status atual, barras de disponibilidade de 90 dias, incidentes e publicações public_status_pages_get

Permissão: public · Somente HTTP (não é uma ferramenta MCP)

Exemplo
curl https://privatusanalytics.com/status/:slug.json
Entradas
{
  "type": "object",
  "properties": {
    "slug": {
      "type": "string",
      "description": "Slug do recurso"
    }
  },
  "required": [
    "slug"
  ]
}
Dados da resposta
{
  "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 ou outage"
    },
    "checks": {
      "type": "array",
      "description": "Cada uma: {name, status, uptime_90d, days: [{date, uptime, downtime_seconds}]}"
    },
    "posts": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Id da publicação (spp_…)"
          },
          "title": {
            "type": "string"
          },
          "body": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "description": "investigating, identified, monitoring ou resolved"
          },
          "posted_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
    },
    "incidents": {
      "type": "array",
      "description": "Incidentes recentes: {check, started_at, resolved_at, duration_seconds}"
    }
  }
}
POST /status/:slug/subscribers.json Inscrever um endereço de e-mail (confirmação dupla) public_status_pages_subscribe

Os clientes de navegador enviam um token do Cloudflare Turnstile como `cf-turnstile-response`. As requisições com um token de API não precisam dele.

Permissão: public · Somente HTTP (não é uma ferramenta MCP)

Exemplo
curl -X POST https://privatusanalytics.com/status/:slug/subscribers.json \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "description": "Endereço de e-mail a notificar",
      "examples": [
        "[email protected]"
      ]
    },
    "slug": {
      "type": "string",
      "description": "Slug do recurso"
    }
  },
  "required": [
    "email",
    "slug"
  ]
}
Dados da resposta
{
  "type": "object"
}
POST /status/:slug/unsubscribe/:token.json Cancelar a inscrição com o token enviado por e-mail public_status_pages_unsubscribe

Permissão: public · Somente HTTP (não é uma ferramenta MCP)

Exemplo
curl -X POST https://privatusanalytics.com/status/:slug/unsubscribe/:token.json \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Token do recurso"
    },
    "slug": {
      "type": "string",
      "description": "Slug do recurso"
    }
  },
  "required": [
    "token",
    "slug"
  ]
}
Dados da resposta
{
  "type": "object"
}
POST /status_pages/:status_page_id/posts.json Publicar uma atualização de incidente (envia e-mail aos assinantes) status_page_posts_create

Permissão: uptime.manage

Exemplo
curl -X POST https://privatusanalytics.com/status_pages/:status_page_id/posts.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "description": "Título, por exemplo \"Taxas de erro elevadas\""
    },
    "body": {
      "type": "string",
      "description": "Texto da atualização (texto simples)"
    },
    "status": {
      "type": "string",
      "description": "investigating, identified, monitoring ou resolved",
      "enum": [
        "investigating",
        "identified",
        "monitoring",
        "resolved"
      ],
      "default": "investigating"
    },
    "posted_at": {
      "type": "string",
      "format": "date-time",
      "description": "Quando aconteceu (o padrão é agora)"
    },
    "notify": {
      "type": "boolean",
      "description": "Enviar e-mail aos assinantes confirmados",
      "default": true
    },
    "status_page_id": {
      "type": "string",
      "description": "Status page do recurso"
    }
  },
  "required": [
    "title",
    "status_page_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id da publicação (spp_…)"
    },
    "title": {
      "type": "string"
    },
    "body": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "status": {
      "type": "string",
      "description": "investigating, identified, monitoring ou resolved"
    },
    "posted_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /status_pages/:status_page_id/posts/:id.json Excluir uma publicação da página de status status_page_posts_delete

Permissão: uptime.manage

Exemplo
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 '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "status_page_id": {
      "type": "string",
      "description": "Status page do recurso"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "status_page_id",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id da publicação (spp_…)"
    },
    "title": {
      "type": "string"
    },
    "body": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "status": {
      "type": "string",
      "description": "investigating, identified, monitoring ou resolved"
    },
    "posted_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /status_pages/:status_page_id/posts.json Listar publicações de uma página de status status_page_posts_list

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/status_pages/:status_page_id/posts.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Somente publicações com este status",
      "enum": [
        "investigating",
        "identified",
        "monitoring",
        "resolved"
      ]
    },
    "status_page_id": {
      "type": "string",
      "description": "Status page do recurso"
    },
    "page": {
      "type": "integer",
      "description": "Página (a partir de 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultados por página (máx. 100)"
    }
  },
  "required": [
    "status_page_id"
  ]
}
Dados da resposta
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Id da publicação (spp_…)"
      },
      "title": {
        "type": "string"
      },
      "body": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "status": {
        "type": "string",
        "description": "investigating, identified, monitoring ou resolved"
      },
      "posted_at": {
        "type": "string",
        "format": "date-time"
      },
      "updated_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
PATCH /status_pages/:status_page_id/posts/:id.json Editar uma publicação da página de status status_page_posts_update

Permissão: uptime.manage

Exemplo
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 '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "description": "Título"
    },
    "body": {
      "type": "string",
      "description": "Texto da atualização (texto simples)"
    },
    "status": {
      "type": "string",
      "description": "investigating, identified, monitoring ou resolved",
      "enum": [
        "investigating",
        "identified",
        "monitoring",
        "resolved"
      ]
    },
    "notify": {
      "type": "boolean",
      "description": "Enviar e-mail aos assinantes confirmados se o status mudar",
      "default": true
    },
    "status_page_id": {
      "type": "string",
      "description": "Status page do recurso"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "status_page_id",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id da publicação (spp_…)"
    },
    "title": {
      "type": "string"
    },
    "body": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "status": {
      "type": "string",
      "description": "investigating, identified, monitoring ou resolved"
    },
    "posted_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /status_pages/:status_page_id/subscribers/:id.json Remover um assinante status_page_subscribers_delete

Permissão: uptime.manage

Exemplo
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 '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "status_page_id": {
      "type": "string",
      "description": "Status page do recurso"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "status_page_id",
    "id"
  ]
}
Dados da resposta
{
  "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 Listar assinantes de uma página de status status_page_subscribers_list

Permissão: uptime.manage

Exemplo
curl https://privatusanalytics.com/status_pages/:status_page_id/subscribers.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "confirmed": {
      "type": "boolean",
      "description": "true: somente confirmados, false: somente pendentes"
    },
    "status_page_id": {
      "type": "string",
      "description": "Status page do recurso"
    },
    "page": {
      "type": "integer",
      "description": "Página (a partir de 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultados por página (máx. 100)"
    }
  },
  "required": [
    "status_page_id"
  ]
}
Dados da resposta
{
  "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 Criar uma página de status status_pages_create

Permissão: uptime.manage

Exemplo
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/status_pages.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Título da página, por exemplo \"Status da Acme\""
    },
    "slug": {
      "type": "string",
      "description": "Slug da URL pública: /status/<slug> (o padrão vem do nome)"
    },
    "description": {
      "type": "string",
      "description": "Texto de introdução abaixo do título"
    },
    "logo_url": {
      "type": "string",
      "description": "URL HTTPS de uma imagem de logotipo"
    },
    "brand_color": {
      "type": "string",
      "description": "Cor de destaque, por exemplo #06755b"
    },
    "custom_domain": {
      "type": "string",
      "description": "Domínio personalizado (CNAME para o nosso host), por exemplo status.example.com. Vazio para remover"
    },
    "check_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Ids das verificações de disponibilidade (upc_…) a exibir"
    },
    "published": {
      "type": "boolean",
      "description": "Visível ao público",
      "default": true
    },
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id da página de status (sp_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "slug": {
      "type": "string",
      "description": "URL pública: /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": "Ids das verificações de disponibilidade exibidas"
    },
    "subscribers": {
      "type": "integer",
      "description": "Assinantes confirmados"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /status_pages/:id.json Excluir uma página de status status_pages_delete

Permissão: uptime.manage

Exemplo
curl -X DELETE https://privatusanalytics.com/status_pages/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id da página de status (sp_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "slug": {
      "type": "string",
      "description": "URL pública: /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": "Ids das verificações de disponibilidade exibidas"
    },
    "subscribers": {
      "type": "integer",
      "description": "Assinantes confirmados"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /workspaces/:workspace_id/status_pages.json Listar páginas de status status_pages_list

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/workspaces/:workspace_id/status_pages.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "description": "Filtrar por nome ou slug"
    },
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Página (a partir de 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultados por página (máx. 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Id da página de status (sp_…)"
      },
      "workspace_id": {
        "type": "string"
      },
      "name": {
        "type": "string"
      },
      "slug": {
        "type": "string",
        "description": "URL pública: /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": "Ids das verificações de disponibilidade exibidas"
      },
      "subscribers": {
        "type": "integer",
        "description": "Assinantes confirmados"
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
GET /status_pages/:id.json Obter uma página de status status_pages_get

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/status_pages/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id da página de status (sp_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "slug": {
      "type": "string",
      "description": "URL pública: /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": "Ids das verificações de disponibilidade exibidas"
    },
    "subscribers": {
      "type": "integer",
      "description": "Assinantes confirmados"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
PATCH /status_pages/:id.json Alterar uma página de status status_pages_update

Permissão: uptime.manage

Exemplo
curl -X PATCH https://privatusanalytics.com/status_pages/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Título da página, por exemplo \"Status da Acme\""
    },
    "slug": {
      "type": "string",
      "description": "Slug da URL pública: /status/<slug> (o padrão vem do nome)"
    },
    "description": {
      "type": "string",
      "description": "Texto de introdução abaixo do título"
    },
    "logo_url": {
      "type": "string",
      "description": "URL HTTPS de uma imagem de logotipo"
    },
    "brand_color": {
      "type": "string",
      "description": "Cor de destaque, por exemplo #06755b"
    },
    "custom_domain": {
      "type": "string",
      "description": "Domínio personalizado (CNAME para o nosso host), por exemplo status.example.com. Vazio para remover"
    },
    "check_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Ids das verificações de disponibilidade (upc_…) a exibir"
    },
    "published": {
      "type": "boolean",
      "description": "Visível ao público"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id da página de status (sp_…)"
    },
    "workspace_id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "slug": {
      "type": "string",
      "description": "URL pública: /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": "Ids das verificações de disponibilidade exibidas"
    },
    "subscribers": {
      "type": "integer",
      "description": "Assinantes confirmados"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Rastreamento

POST /sites/:site_id/tracking/ingest_key.json Criar ou trocar a chave de ingestão do servidor (exibida uma única vez) tracking_ingest_key_rotate

Permissão: sites.manage

Exemplo
curl -X POST https://privatusanalytics.com/sites/:site_id/tracking/ingest_key.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Id do site"
    },
    "key": {
      "type": "string",
      "description": "A chave de ingestão. Exibida uma única vez: guarde-a agora. Envie-a como Bearer token para POST /api/events"
    },
    "prefix": {
      "type": "string",
      "description": "Prefixo da chave exibido nas configurações"
    }
  }
}
DELETE /sites/:site_id/tracking/ingest_key.json Revogar a chave de ingestão do servidor tracking_ingest_key_revoke

Permissão: sites.manage

Exemplo
curl -X DELETE https://privatusanalytics.com/sites/:site_id/tracking/ingest_key.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do site usado no snippet de rastreamento"
    },
    "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": "Início da chave de ingestão do servidor"
        },
        {
          "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": "Snippet de rastreamento em HTML"
    },
    "favorite": {
      "type": "boolean",
      "description": "Marcado com estrela por você"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /sites/:site_id/tracking/verify.json Verificar se o rastreador está instalado no site (tag de script, id do site, CSP e política de referenciador) tracking_verify

Permissão: sites.manage

Exemplo
curl -X POST https://privatusanalytics.com/sites/:site_id/tracking/verify.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Página a verificar (o padrão é https://<domain>/)"
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object"
}
GET /sites/:site_id/tracking/snippet.json Montar o snippet de rastreamento para as opções escolhidas tracking_snippet

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/sites/:site_id/tracking/snippet.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "modules": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Módulos opcionais: auto (links externos, downloads, formulários, erros 404), engage (tempo e rolagem), vitals (Web Vitals), clicks",
      "default": [
        "engage"
      ]
    },
    "manual": {
      "type": "boolean",
      "description": "Desativar a visualização de página automática",
      "default": false
    },
    "spa": {
      "type": "string",
      "description": "Rastreamento de navegação em aplicativos de página única",
      "enum": [
        "auto",
        "history",
        "hash",
        "off"
      ],
      "default": "auto"
    },
    "domains": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Rastrear somente nestes hostnames",
      "default": []
    },
    "exclude": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Globs de caminhos a não rastrear, por exemplo /admin/*",
      "default": []
    },
    "query_params": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Parâmetros de consulta extras a manter, por exemplo page",
      "default": []
    },
    "mask": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Máscaras de caminho no cliente, por exemplo /u/*->/u/:id",
      "default": []
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object"
}

Regras de canal

POST /sites/:site_id/channel_rules.json Adicionar uma regra de canal channel_rules_create

Permissão: sites.manage

Exemplo
curl -X POST https://privatusanalytics.com/sites/:site_id/channel_rules.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "channel": {
      "type": "string",
      "description": "Nome do canal a atribuir, por exemplo Parceiros"
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "operator": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        }
      },
      "description": "Condições que devem todas corresponder: [{\"field\": \"utm_source\", \"operator\": \"is\", \"value\": \"newsletter\"}]. Campos: referrer_host, utm_source, utm_medium, utm_campaign, ref, path. Operadores: is, contains, starts_with, regex."
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "channel",
    "conditions",
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id da regra"
    },
    "channel": {
      "type": "string",
      "description": "Canal atribuído quando todas as condições correspondem"
    },
    "position": {
      "type": "integer",
      "description": "Ordem de avaliação (a primeira correspondência vence)"
    },
    "conditions": {
      "type": "array",
      "description": "Condições: field, operator, value"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:site_id/channel_rules/:id.json Excluir uma regra de canal channel_rules_delete

Permissão: sites.manage

Exemplo
curl -X DELETE https://privatusanalytics.com/sites/:site_id/channel_rules/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id da regra"
    },
    "channel": {
      "type": "string",
      "description": "Canal atribuído quando todas as condições correspondem"
    },
    "position": {
      "type": "integer",
      "description": "Ordem de avaliação (a primeira correspondência vence)"
    },
    "conditions": {
      "type": "array",
      "description": "Condições: field, operator, value"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/channel_rules.json Listar regras de canal em ordem channel_rules_list

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/sites/:site_id/channel_rules.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id da regra"
    },
    "channel": {
      "type": "string",
      "description": "Canal atribuído quando todas as condições correspondem"
    },
    "position": {
      "type": "integer",
      "description": "Ordem de avaliação (a primeira correspondência vence)"
    },
    "conditions": {
      "type": "array",
      "description": "Condições: field, operator, value"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
PATCH /sites/:site_id/channel_rules/:id/move.json Mover uma regra de canal para cima ou para baixo channel_rules_move

Permissão: sites.manage

Exemplo
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 '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "direction": {
      "type": "string",
      "description": "Para onde mover a regra",
      "enum": [
        "up",
        "down",
        "top",
        "bottom"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "direction",
    "site_id",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id da regra"
    },
    "channel": {
      "type": "string",
      "description": "Canal atribuído quando todas as condições correspondem"
    },
    "position": {
      "type": "integer",
      "description": "Ordem de avaliação (a primeira correspondência vence)"
    },
    "conditions": {
      "type": "array",
      "description": "Condições: field, operator, value"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /sites/:site_id/channel_rules/preview.json Pré-visualizar o canal para um referenciador e tags UTM de exemplo channel_rules_preview

Permissão: analytics.read

Exemplo
curl -X POST https://privatusanalytics.com/sites/:site_id/channel_rules/preview.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "referrer": {
      "type": "string",
      "description": "URL ou hostname do referenciador"
    },
    "utm_source": {
      "type": "string",
      "description": "Valor de utm_source"
    },
    "utm_medium": {
      "type": "string",
      "description": "Valor de utm_medium"
    },
    "utm_campaign": {
      "type": "string",
      "description": "Valor de utm_campaign"
    },
    "ref": {
      "type": "string",
      "description": "Parâmetro ref / via / source"
    },
    "path": {
      "type": "string",
      "description": "Caminho da página de destino, por exemplo /pricing"
    },
    "paid_click": {
      "type": "boolean",
      "description": "A URL tinha um id de clique, como gclid",
      "default": false
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object"
}
PATCH /sites/:site_id/channel_rules/:id.json Alterar uma regra de canal channel_rules_update

Permissão: sites.manage

Exemplo
curl -X PATCH https://privatusanalytics.com/sites/:site_id/channel_rules/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "channel": {
      "type": "string",
      "description": "Nome do canal a atribuir"
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "operator": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        }
      },
      "description": "Condições que devem todas corresponder: [{\"field\": \"utm_source\", \"operator\": \"is\", \"value\": \"newsletter\"}]. Campos: referrer_host, utm_source, utm_medium, utm_campaign, ref, path. Operadores: is, contains, starts_with, regex."
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id da regra"
    },
    "channel": {
      "type": "string",
      "description": "Canal atribuído quando todas as condições correspondem"
    },
    "position": {
      "type": "integer",
      "description": "Ordem de avaliação (a primeira correspondência vence)"
    },
    "conditions": {
      "type": "array",
      "description": "Condições: field, operator, value"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Regras de tráfego

POST /sites/:site_id/traffic_rules.json Adicionar uma regra de tráfego traffic_rules_create

Permissão: sites.manage

Exemplo
curl -X POST https://privatusanalytics.com/sites/:site_id/traffic_rules.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "list": {
      "type": "string",
      "description": "hostnames, paths, referrers, countries, ip_ranges, user_agents ou events",
      "enum": [
        "hostnames",
        "paths",
        "referrers",
        "countries",
        "ip_ranges",
        "user_agents",
        "events"
      ]
    },
    "pattern": {
      "type": "string",
      "description": "Valor a corresponder. * é um curinga. ip_ranges aceitam um IP ou CIDR (v4/v6), countries um código ISO",
      "examples": [
        "/admin/*"
      ]
    },
    "label": {
      "type": "string",
      "description": "Nota opcional, por exemplo \"Escritório\""
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "list",
    "pattern",
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id da regra"
    },
    "list": {
      "type": "string",
      "description": "hostnames, paths, referrers, countries, ip_ranges, user_agents ou events"
    },
    "pattern": {
      "type": "string",
      "description": "Padrão (curingas *, CIDR para ip_ranges)"
    },
    "label": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "mode": {
      "type": "string",
      "description": "block ou allow (o modo da sua lista)"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:site_id/traffic_rules/:id.json Excluir uma regra de tráfego traffic_rules_delete

Permissão: sites.manage

Exemplo
curl -X DELETE https://privatusanalytics.com/sites/:site_id/traffic_rules/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id da regra"
    },
    "list": {
      "type": "string",
      "description": "hostnames, paths, referrers, countries, ip_ranges, user_agents ou events"
    },
    "pattern": {
      "type": "string",
      "description": "Padrão (curingas *, CIDR para ip_ranges)"
    },
    "label": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "mode": {
      "type": "string",
      "description": "block ou allow (o modo da sua lista)"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/traffic_rules.json Listar regras de tráfego traffic_rules_list

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/sites/:site_id/traffic_rules.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "list": {
      "type": "string",
      "description": "Somente regras desta lista",
      "enum": [
        "hostnames",
        "paths",
        "referrers",
        "countries",
        "ip_ranges",
        "user_agents",
        "events"
      ]
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id da regra"
    },
    "list": {
      "type": "string",
      "description": "hostnames, paths, referrers, countries, ip_ranges, user_agents ou events"
    },
    "pattern": {
      "type": "string",
      "description": "Padrão (curingas *, CIDR para ip_ranges)"
    },
    "label": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "mode": {
      "type": "string",
      "description": "block ou allow (o modo da sua lista)"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /sites/:site_id/traffic_rules/test.json Testar se um hit seria contado com as regras atuais do site traffic_rules_test

Permissão: analytics.read

Exemplo
curl -X POST https://privatusanalytics.com/sites/:site_id/traffic_rules/test.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "URL da página, por exemplo https://example.com/a"
    },
    "referrer": {
      "type": "string",
      "description": "URL ou hostname do referenciador"
    },
    "country": {
      "type": "string",
      "description": "Código ISO do país, por exemplo US"
    },
    "ip": {
      "type": "string",
      "description": "Endereço IP a testar contra ip_ranges (não é armazenado)"
    },
    "user_agent": {
      "type": "string",
      "description": "String User-Agent (reduzida ao navegador e à versão principal, como na ingestão)"
    },
    "event": {
      "type": "string",
      "description": "Nome do evento personalizado"
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object"
}
PATCH /sites/:site_id/traffic_rules/:id.json Alterar uma regra de tráfego traffic_rules_update

Permissão: sites.manage

Exemplo
curl -X PATCH https://privatusanalytics.com/sites/:site_id/traffic_rules/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "pattern": {
      "type": "string",
      "description": "Novo padrão"
    },
    "label": {
      "type": "string",
      "description": "Novo rótulo"
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id da regra"
    },
    "list": {
      "type": "string",
      "description": "hostnames, paths, referrers, countries, ip_ranges, user_agents ou events"
    },
    "pattern": {
      "type": "string",
      "description": "Padrão (curingas *, CIDR para ip_ranges)"
    },
    "label": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "mode": {
      "type": "string",
      "description": "block ou allow (o modo da sua lista)"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Relatórios por e-mail

DELETE /recipients/:id.json Remover um destinatário de um relatório por e-mail email_report_recipients_delete

Permissão: content.write

Exemplo
curl -X DELETE https://privatusanalytics.com/recipients/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do destinatário, por exemplo rcp_7Q2K9XH3AB"
    },
    "email": {
      "type": "string",
      "description": "O endereço"
    },
    "status": {
      "type": "string",
      "description": "active, pending, declined ou unsubscribed"
    },
    "invited_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Quando o último convite foi enviado"
        },
        {
          "type": "null"
        }
      ]
    },
    "expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Quando um convite pendente expira"
        },
        {
          "type": "null"
        }
      ]
    },
    "confirmed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Quando o endereço ficou ativo"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
GET /reports/:report_id/recipients.json Listar os destinatários de um relatório por e-mail com o status de cada um email_report_recipients_list

Status: active (recebe relatórios), pending (convidado, ainda não aceitou), declined ou unsubscribed. Adicione ou remova endereços pela lista de destinatários do relatório.

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/reports/:report_id/recipients.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Apenas destinatários com este status",
      "enum": [
        "pending",
        "active",
        "declined",
        "unsubscribed"
      ]
    },
    "report_id": {
      "type": "string",
      "description": "Report do recurso"
    },
    "page": {
      "type": "integer",
      "description": "Página (a partir de 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultados por página (máx. 100)"
    }
  },
  "required": [
    "report_id"
  ]
}
Dados da resposta
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Id do destinatário, por exemplo rcp_7Q2K9XH3AB"
      },
      "email": {
        "type": "string",
        "description": "O endereço"
      },
      "status": {
        "type": "string",
        "description": "active, pending, declined ou unsubscribed"
      },
      "invited_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time",
            "description": "Quando o último convite foi enviado"
          },
          {
            "type": "null"
          }
        ]
      },
      "expires_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time",
            "description": "Quando um convite pendente expira"
          },
          {
            "type": "null"
          }
        ]
      },
      "confirmed_at": {
        "anyOf": [
          {
            "type": "string",
            "format": "date-time",
            "description": "Quando o endereço ficou ativo"
          },
          {
            "type": "null"
          }
        ]
      }
    }
  }
}
POST /recipients/:id/resend.json Reenviar um convite de relatório pendente email_report_recipients_resend

Envia o convite de novo com links novos. Permitido uma vez a cada 7 dias por endereço e por relatório.

Permissão: content.write

Exemplo
curl -X POST https://privatusanalytics.com/recipients/:id/resend.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do destinatário, por exemplo rcp_7Q2K9XH3AB"
    },
    "email": {
      "type": "string",
      "description": "O endereço"
    },
    "status": {
      "type": "string",
      "description": "active, pending, declined ou unsubscribed"
    },
    "invited_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Quando o último convite foi enviado"
        },
        {
          "type": "null"
        }
      ]
    },
    "expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Quando um convite pendente expira"
        },
        {
          "type": "null"
        }
      ]
    },
    "confirmed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Quando o endereço ficou ativo"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
POST /workspaces/:workspace_id/reports.json Criar um relatório por e-mail email_reports_create

Permissão: content.write

Exemplo
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/reports.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Ids dos sites (pa_…) incluídos no relatório"
    },
    "frequency": {
      "type": "string",
      "description": "daily, weekly (em um dia da semana) ou monthly (no dia 1)",
      "enum": [
        "daily",
        "weekly",
        "monthly"
      ]
    },
    "hour": {
      "type": "integer",
      "description": "Hora do dia do envio (0 a 23, fuso horário do espaço de trabalho)"
    },
    "weekday": {
      "type": "integer",
      "description": "Relatórios semanais: 0 = domingo … 6 = sábado"
    },
    "recipients": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Endereços de e-mail (não é preciso ter conta). As entradas podem ser separadas por vírgula ou quebra de linha. Membros do espaço de trabalho são adicionados na hora. Os demais recebem um convite e só recebem relatórios depois de aceitá-lo. Endereços que cancelaram a inscrição nos relatórios são recusados"
    },
    "blocks": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Conteúdo: kpis, chart, pages, sources, goals, campaigns, vitals, uptime"
    },
    "attach_pdf": {
      "type": "boolean",
      "description": "Anexar uma versão em PDF"
    },
    "intro": {
      "type": "string",
      "description": "Texto de introdução personalizado (máx. 2000 caracteres)"
    },
    "enabled": {
      "type": "boolean",
      "description": "Enviar conforme o agendamento"
    },
    "name": {
      "type": "string",
      "description": "Nome do relatório",
      "examples": [
        "Weekly traffic"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do relatório, por exemplo rep_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Ids dos sites no relatório"
    },
    "frequency": {
      "type": "string",
      "description": "daily, weekly ou monthly"
    },
    "hour": {
      "type": "integer",
      "description": "Hora do envio (fuso horário do espaço de trabalho)"
    },
    "weekday": {
      "type": "integer",
      "description": "Semanal: 0 = domingo … 6 = sábado"
    },
    "recipients": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Todos os endereços do relatório, seja qual for o status"
    },
    "recipient_details": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Id do destinatário, por exemplo rcp_7Q2K9XH3AB"
          },
          "email": {
            "type": "string",
            "description": "O endereço"
          },
          "status": {
            "type": "string",
            "description": "active, pending, declined ou unsubscribed"
          },
          "invited_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Quando o último convite foi enviado"
              },
              {
                "type": "null"
              }
            ]
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Quando um convite pendente expira"
              },
              {
                "type": "null"
              }
            ]
          },
          "confirmed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Quando o endereço ficou ativo"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "description": "Cada destinatário com o status de adesão (apenas destinatários ativos recebem relatórios)"
    },
    "blocks": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Blocos de conteúdo"
    },
    "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 Log de entregas de um relatório por e-mail email_reports_deliveries

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/reports/:id/deliveries.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Somente entregas com este status",
      "enum": [
        "sent",
        "test",
        "failed",
        "skipped"
      ]
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    },
    "page": {
      "type": "integer",
      "description": "Página (a partir de 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultados por página (máx. 100)"
    }
  },
  "required": [
    "id"
  ]
}
Dados da resposta
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "status": {
        "type": "string",
        "description": "sent, test, failed ou skipped"
      },
      "recipients_count": {
        "type": "integer"
      },
      "error": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "sent_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
DELETE /reports/:id.json Excluir um relatório por e-mail email_reports_delete

Permissão: content.write

Exemplo
curl -X DELETE https://privatusanalytics.com/reports/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do relatório, por exemplo rep_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Ids dos sites no relatório"
    },
    "frequency": {
      "type": "string",
      "description": "daily, weekly ou monthly"
    },
    "hour": {
      "type": "integer",
      "description": "Hora do envio (fuso horário do espaço de trabalho)"
    },
    "weekday": {
      "type": "integer",
      "description": "Semanal: 0 = domingo … 6 = sábado"
    },
    "recipients": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Todos os endereços do relatório, seja qual for o status"
    },
    "recipient_details": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Id do destinatário, por exemplo rcp_7Q2K9XH3AB"
          },
          "email": {
            "type": "string",
            "description": "O endereço"
          },
          "status": {
            "type": "string",
            "description": "active, pending, declined ou unsubscribed"
          },
          "invited_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Quando o último convite foi enviado"
              },
              {
                "type": "null"
              }
            ]
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Quando um convite pendente expira"
              },
              {
                "type": "null"
              }
            ]
          },
          "confirmed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Quando o endereço ficou ativo"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "description": "Cada destinatário com o status de adesão (apenas destinatários ativos recebem relatórios)"
    },
    "blocks": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Blocos de conteúdo"
    },
    "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 Listar relatórios por e-mail email_reports_list

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/workspaces/:workspace_id/reports.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "frequency": {
      "type": "string",
      "description": "Somente relatórios com esta frequência",
      "enum": [
        "daily",
        "weekly",
        "monthly"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Página (a partir de 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultados por página (máx. 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Id do relatório, por exemplo rep_7Q2K9XH3AB"
      },
      "name": {
        "type": "string"
      },
      "site_ids": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Ids dos sites no relatório"
      },
      "frequency": {
        "type": "string",
        "description": "daily, weekly ou monthly"
      },
      "hour": {
        "type": "integer",
        "description": "Hora do envio (fuso horário do espaço de trabalho)"
      },
      "weekday": {
        "type": "integer",
        "description": "Semanal: 0 = domingo … 6 = sábado"
      },
      "recipients": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Todos os endereços do relatório, seja qual for o status"
      },
      "recipient_details": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "description": "Id do destinatário, por exemplo rcp_7Q2K9XH3AB"
            },
            "email": {
              "type": "string",
              "description": "O endereço"
            },
            "status": {
              "type": "string",
              "description": "active, pending, declined ou unsubscribed"
            },
            "invited_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Quando o último convite foi enviado"
                },
                {
                  "type": "null"
                }
              ]
            },
            "expires_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Quando um convite pendente expira"
                },
                {
                  "type": "null"
                }
              ]
            },
            "confirmed_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "description": "Quando o endereço ficou ativo"
                },
                {
                  "type": "null"
                }
              ]
            }
          }
        },
        "description": "Cada destinatário com o status de adesão (apenas destinatários ativos recebem relatórios)"
      },
      "blocks": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Blocos de conteúdo"
      },
      "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 Enviar um relatório por e-mail agora como teste email_reports_send_test

Permissão: content.write

Exemplo
curl -X POST https://privatusanalytics.com/reports/:id/send_test.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "recipient": {
      "type": "string",
      "description": "Enviar o teste para este endereço (padrão: seu e-mail)"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "sent, test, failed ou skipped"
    },
    "recipients_count": {
      "type": "integer"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "sent_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /reports/:id.json Obter um relatório por e-mail email_reports_get

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/reports/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do relatório, por exemplo rep_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Ids dos sites no relatório"
    },
    "frequency": {
      "type": "string",
      "description": "daily, weekly ou monthly"
    },
    "hour": {
      "type": "integer",
      "description": "Hora do envio (fuso horário do espaço de trabalho)"
    },
    "weekday": {
      "type": "integer",
      "description": "Semanal: 0 = domingo … 6 = sábado"
    },
    "recipients": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Todos os endereços do relatório, seja qual for o status"
    },
    "recipient_details": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Id do destinatário, por exemplo rcp_7Q2K9XH3AB"
          },
          "email": {
            "type": "string",
            "description": "O endereço"
          },
          "status": {
            "type": "string",
            "description": "active, pending, declined ou unsubscribed"
          },
          "invited_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Quando o último convite foi enviado"
              },
              {
                "type": "null"
              }
            ]
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Quando um convite pendente expira"
              },
              {
                "type": "null"
              }
            ]
          },
          "confirmed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Quando o endereço ficou ativo"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "description": "Cada destinatário com o status de adesão (apenas destinatários ativos recebem relatórios)"
    },
    "blocks": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Blocos de conteúdo"
    },
    "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 Atualizar um relatório por e-mail email_reports_update

Permissão: content.write

Exemplo
curl -X PATCH https://privatusanalytics.com/reports/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Ids dos sites (pa_…) incluídos no relatório"
    },
    "frequency": {
      "type": "string",
      "description": "daily, weekly (em um dia da semana) ou monthly (no dia 1)",
      "enum": [
        "daily",
        "weekly",
        "monthly"
      ]
    },
    "hour": {
      "type": "integer",
      "description": "Hora do dia do envio (0 a 23, fuso horário do espaço de trabalho)"
    },
    "weekday": {
      "type": "integer",
      "description": "Relatórios semanais: 0 = domingo … 6 = sábado"
    },
    "recipients": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Endereços de e-mail (não é preciso ter conta). As entradas podem ser separadas por vírgula ou quebra de linha. Membros do espaço de trabalho são adicionados na hora. Os demais recebem um convite e só recebem relatórios depois de aceitá-lo. Endereços que cancelaram a inscrição nos relatórios são recusados"
    },
    "blocks": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Conteúdo: kpis, chart, pages, sources, goals, campaigns, vitals, uptime"
    },
    "attach_pdf": {
      "type": "boolean",
      "description": "Anexar uma versão em PDF"
    },
    "intro": {
      "type": "string",
      "description": "Texto de introdução personalizado (máx. 2000 caracteres)"
    },
    "enabled": {
      "type": "boolean",
      "description": "Enviar conforme o agendamento"
    },
    "name": {
      "type": "string",
      "description": "Nome do relatório"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do relatório, por exemplo rep_7Q2K9XH3AB"
    },
    "name": {
      "type": "string"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Ids dos sites no relatório"
    },
    "frequency": {
      "type": "string",
      "description": "daily, weekly ou monthly"
    },
    "hour": {
      "type": "integer",
      "description": "Hora do envio (fuso horário do espaço de trabalho)"
    },
    "weekday": {
      "type": "integer",
      "description": "Semanal: 0 = domingo … 6 = sábado"
    },
    "recipients": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Todos os endereços do relatório, seja qual for o status"
    },
    "recipient_details": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Id do destinatário, por exemplo rcp_7Q2K9XH3AB"
          },
          "email": {
            "type": "string",
            "description": "O endereço"
          },
          "status": {
            "type": "string",
            "description": "active, pending, declined ou unsubscribed"
          },
          "invited_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Quando o último convite foi enviado"
              },
              {
                "type": "null"
              }
            ]
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Quando um convite pendente expira"
              },
              {
                "type": "null"
              }
            ]
          },
          "confirmed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Quando o endereço ficou ativo"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "description": "Cada destinatário com o status de adesão (apenas destinatários ativos recebem relatórios)"
    },
    "blocks": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Blocos de conteúdo"
    },
    "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 Aceitar um convite de relatório report_invites_accept

Permissão: public · Somente HTTP (não é uma ferramenta MCP)

Exemplo
curl -X POST https://privatusanalytics.com/reports/invites/:token/accept.json \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Token do recurso"
    }
  },
  "required": [
    "token"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do destinatário, por exemplo rcp_7Q2K9XH3AB"
    },
    "email": {
      "type": "string",
      "description": "O endereço"
    },
    "status": {
      "type": "string",
      "description": "active, pending, declined ou unsubscribed"
    },
    "invited_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Quando o último convite foi enviado"
        },
        {
          "type": "null"
        }
      ]
    },
    "expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Quando um convite pendente expira"
        },
        {
          "type": "null"
        }
      ]
    },
    "confirmed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Quando o endereço ficou ativo"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
POST /reports/invites/:token/decline.json Recusar um convite de relatório report_invites_decline

Permissão: public · Somente HTTP (não é uma ferramenta MCP)

Exemplo
curl -X POST https://privatusanalytics.com/reports/invites/:token/decline.json \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Token do recurso"
    }
  },
  "required": [
    "token"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do destinatário, por exemplo rcp_7Q2K9XH3AB"
    },
    "email": {
      "type": "string",
      "description": "O endereço"
    },
    "status": {
      "type": "string",
      "description": "active, pending, declined ou unsubscribed"
    },
    "invited_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Quando o último convite foi enviado"
        },
        {
          "type": "null"
        }
      ]
    },
    "expires_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Quando um convite pendente expira"
        },
        {
          "type": "null"
        }
      ]
    },
    "confirmed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "description": "Quando o endereço ficou ativo"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
POST /reports/resubscribe/:token.json Voltar a receber relatórios depois de cancelar a inscrição report_resubscribes_confirm

Permissão: public · Somente HTTP (não é uma ferramenta MCP)

Exemplo
curl -X POST https://privatusanalytics.com/reports/resubscribe/:token.json \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Token do recurso"
    }
  },
  "required": [
    "token"
  ]
}
Dados da resposta
{
  "type": "object"
}
POST /reports/unsubscribe/:token/resubscribe.json Enviar a um endereço um link para voltar a receber relatórios report_resubscribes_create

Permissão: public · Somente HTTP (não é uma ferramenta MCP)

Exemplo
curl -X POST https://privatusanalytics.com/reports/unsubscribe/:token/resubscribe.json \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Token do recurso"
    }
  },
  "required": [
    "token"
  ]
}
Dados da resposta
{
  "type": "object"
}
POST /reports/unsubscribe/:token.json Cancelar a inscrição de um endereço em um relatório por e-mail report_unsubscribes_create

Permissão: public · Somente HTTP (não é uma ferramenta MCP)

Exemplo
curl -X POST https://privatusanalytics.com/reports/unsubscribe/:token.json \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Token do recurso"
    }
  },
  "required": [
    "token"
  ]
}
Dados da resposta
{
  "type": "object"
}

SCIM

POST /scim/v2/Users.json Provisionar um usuário scim_users_create

Permissão: public · Somente HTTP (não é uma ferramenta MCP)

Exemplo
curl -X POST https://privatusanalytics.com/scim/v2/Users.json \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "userName": {
      "type": "string",
      "description": "Endereço de e-mail"
    },
    "name": {
      "type": "object",
      "additionalProperties": true,
      "description": "givenName, familyName, formatted",
      "default": {}
    },
    "active": {
      "type": "boolean",
      "description": "Membro do espaço de trabalho",
      "default": true
    }
  },
  "required": [
    "userName"
  ]
}
Dados da resposta
{
  "type": "object"
}
DELETE /scim/v2/Users/:id.json Desprovisionar um usuário scim_users_delete

Permissão: public · Somente HTTP (não é uma ferramenta MCP)

Exemplo
curl -X DELETE https://privatusanalytics.com/scim/v2/Users/:id.json \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "id"
  ]
}
Dados da resposta
{
  "type": "object"
}
GET /scim/v2/Users.json Listar usuários provisionados scim_users_list

Permissão: public · Somente HTTP (não é uma ferramenta MCP)

Exemplo
curl https://privatusanalytics.com/scim/v2/Users.json
Entradas
{
  "type": "object",
  "properties": {
    "scim_filter": {
      "type": "string",
      "description": "Filtro SCIM (parâmetro de consulta `filter`), por exemplo userName eq \"[email protected]\""
    },
    "startIndex": {
      "type": "integer",
      "description": "Índice do primeiro resultado, começando em 1",
      "default": 1
    },
    "count": {
      "type": "integer",
      "description": "Tamanho da página (máx. 200)",
      "default": 100
    }
  },
  "required": []
}
Dados da resposta
{
  "type": "object"
}
GET /scim/v2/Users/:id.json Obter um usuário provisionado scim_users_get

Permissão: public · Somente HTTP (não é uma ferramenta MCP)

Exemplo
curl https://privatusanalytics.com/scim/v2/Users/:id.json
Entradas
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "id"
  ]
}
Dados da resposta
{
  "type": "object"
}
PATCH /scim/v2/Users/:id.json Atualizar um usuário (PATCH active, name) scim_users_update

Permissão: public · Somente HTTP (não é uma ferramenta MCP)

Exemplo
curl -X PATCH https://privatusanalytics.com/scim/v2/Users/:id.json \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "Operations": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      },
      "description": "Operações PatchOp do SCIM"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "Operations",
    "id"
  ]
}
Dados da resposta
{
  "type": "object"
}

SSO

POST /workspaces/:workspace_id/sso/activate.json Ativar uma configuração de SSO testada sso_activate

Permissão: workspace.manage

Exemplo
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/sso/activate.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "protocol": {
      "type": "string",
      "description": "saml ou oidc"
    },
    "status": {
      "type": "string",
      "description": "draft, testing, tested ou active"
    },
    "enforced": {
      "type": "boolean",
      "description": "O SSO é a única forma de entrar (exceto o proprietário)"
    },
    "domains": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Domínios de e-mail verificados"
    },
    "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 Desativar o SSO (volta para rascunho) sso_deactivate

Permissão: workspace.manage

Exemplo
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/sso/deactivate.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "protocol": {
      "type": "string",
      "description": "saml ou oidc"
    },
    "status": {
      "type": "string",
      "description": "draft, testing, tested ou active"
    },
    "enforced": {
      "type": "boolean",
      "description": "O SSO é a única forma de entrar (exceto o proprietário)"
    },
    "domains": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Domínios de e-mail verificados"
    },
    "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 Gerar um novo token SCIM (exibido uma única vez) sso_scim_token

Permissão: workspace.manage · Somente HTTP (não é uma ferramenta MCP)

Exemplo
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/sso/scim_token.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "object"
}
GET /workspaces/:workspace_id/sso.json Obter as configurações de SSO sso_get

Permissão: workspace.manage

Exemplo
curl https://privatusanalytics.com/workspaces/:workspace_id/sso.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "protocol": {
      "type": "string",
      "description": "saml ou oidc"
    },
    "status": {
      "type": "string",
      "description": "draft, testing, tested ou active"
    },
    "enforced": {
      "type": "boolean",
      "description": "O SSO é a única forma de entrar (exceto o proprietário)"
    },
    "domains": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Domínios de e-mail verificados"
    },
    "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 Criar ou atualizar as configurações de SSO sso_update

Permissão: workspace.manage

Exemplo
curl -X PATCH https://privatusanalytics.com/workspaces/:workspace_id/sso.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "protocol": {
      "type": "string",
      "description": "saml ou oidc",
      "enum": [
        "saml",
        "oidc"
      ]
    },
    "idp_sso_url": {
      "type": "string",
      "description": "SAML: URL de login único do IdP"
    },
    "idp_entity_id": {
      "type": "string",
      "description": "SAML: id da entidade do IdP (emissor)"
    },
    "idp_cert": {
      "type": "string",
      "description": "SAML: certificado X.509 de assinatura do IdP (PEM)"
    },
    "oidc_issuer": {
      "type": "string",
      "description": "OIDC: URL do emissor (discovery)"
    },
    "oidc_client_id": {
      "type": "string",
      "description": "OIDC: id do cliente"
    },
    "oidc_client_secret": {
      "type": "string",
      "description": "OIDC: segredo do cliente (somente gravação)"
    },
    "domains": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Domínios de e-mail verificados que usam este SSO"
    },
    "default_role": {
      "type": "string",
      "description": "Função dos membros criados por JIT ou SCIM",
      "enum": [
        "admin",
        "editor",
        "analyst",
        "viewer",
        "billing"
      ]
    },
    "jit_provisioning": {
      "type": "boolean",
      "description": "Criar membros no primeiro login por SSO"
    },
    "enforced": {
      "type": "boolean",
      "description": "Permitir apenas logins por SSO (precisa de uma configuração ativa)"
    },
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "protocol": {
      "type": "string",
      "description": "saml ou oidc"
    },
    "status": {
      "type": "string",
      "description": "draft, testing, tested ou active"
    },
    "enforced": {
      "type": "boolean",
      "description": "O SSO é a única forma de entrar (exceto o proprietário)"
    },
    "domains": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Domínios de e-mail verificados"
    },
    "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"
    }
  }
}

Segmentos

POST /sites/:site_id/segments.json Salvar filtros como um segmento segments_create

Permissão: content.write

Exemplo
curl -X POST https://privatusanalytics.com/sites/:site_id/segments.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nome do segmento, por exemplo \"Visitantes de celular vindos de anúncios\"",
      "examples": [
        "Mobile visitors from ads"
      ]
    },
    "description": {
      "type": "string",
      "description": "Nota opcional sobre a finalidade do segmento (no máximo 300 caracteres)",
      "examples": [
        "People who might buy the Pro plan"
      ]
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtros, e todos precisam corresponder. Cada item é uma condição [\"dimension\", \"operator\", \"value\"], ou {\"any\": [conditions]} quando basta que uma de várias corresponda. Dimensões: page, entry_page, exit_page, hostname, channel, referrer, referrer_url, ref, utm_source, utm_medium, utm_campaign, utm_content, utm_term, country (código ISO, por exemplo US), language, device (desktop, mobile, tablet, tv, other), browser, browser_version, os, os_version, screen, goal (id da meta), event (nome do evento personalizado) e prop:<key> (propriedade de evento personalizado). Operadores: is, is_not, contains, not_contains, starts_with, regex, not_regex, any_of e none_of (o valor é uma lista), gt e lt (um número), between (uma lista de dois números). Linhas do formulário de segmento também são aceitas: {\"dimension\", \"operator\", \"value\", \"property\" (para a dimensão prop), \"join\": \"and\" ou \"or\" (or combina a linha com a anterior)}. Exemplo: [[\"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": "Visível para todos com acesso ao site (false: somente você)",
      "default": true
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "filters",
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do segmento, por exemplo seg_7Q2K9XH3AB"
    },
    "site_id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "anyOf": [
        {
          "type": "string",
          "description": "Para que serve o segmento, ou null"
        },
        {
          "type": "null"
        }
      ]
    },
    "filters": {
      "type": "array",
      "description": "Filtros no formato de filtros das estatísticas: condições [\"dimension\", \"operator\", \"value\"] que precisam todas corresponder, e grupos {\"any\": [conditions]}"
    },
    "summary": {
      "type": "string",
      "description": "Os filtros em linguagem natural, por exemplo \"Visitantes dos Estados Unidos em celular que viram /pricing\""
    },
    "shared": {
      "type": "boolean",
      "description": "Visível para todos com acesso ao site"
    },
    "mine": {
      "type": "boolean",
      "description": "Criado por você"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:site_id/segments/:id.json Excluir um segmento segments_delete

Permissão: content.write

Exemplo
curl -X DELETE https://privatusanalytics.com/sites/:site_id/segments/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do segmento, por exemplo seg_7Q2K9XH3AB"
    },
    "site_id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "anyOf": [
        {
          "type": "string",
          "description": "Para que serve o segmento, ou null"
        },
        {
          "type": "null"
        }
      ]
    },
    "filters": {
      "type": "array",
      "description": "Filtros no formato de filtros das estatísticas: condições [\"dimension\", \"operator\", \"value\"] que precisam todas corresponder, e grupos {\"any\": [conditions]}"
    },
    "summary": {
      "type": "string",
      "description": "Os filtros em linguagem natural, por exemplo \"Visitantes dos Estados Unidos em celular que viram /pricing\""
    },
    "shared": {
      "type": "boolean",
      "description": "Visível para todos com acesso ao site"
    },
    "mine": {
      "type": "boolean",
      "description": "Criado por você"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/segments.json Listar segmentos que você pode usar em um site segments_list

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/sites/:site_id/segments.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Página (a partir de 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultados por página (máx. 100)"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Id do segmento, por exemplo seg_7Q2K9XH3AB"
      },
      "site_id": {
        "type": "string"
      },
      "name": {
        "type": "string"
      },
      "description": {
        "anyOf": [
          {
            "type": "string",
            "description": "Para que serve o segmento, ou null"
          },
          {
            "type": "null"
          }
        ]
      },
      "filters": {
        "type": "array",
        "description": "Filtros no formato de filtros das estatísticas: condições [\"dimension\", \"operator\", \"value\"] que precisam todas corresponder, e grupos {\"any\": [conditions]}"
      },
      "summary": {
        "type": "string",
        "description": "Os filtros em linguagem natural, por exemplo \"Visitantes dos Estados Unidos em celular que viram /pricing\""
      },
      "shared": {
        "type": "boolean",
        "description": "Visível para todos com acesso ao site"
      },
      "mine": {
        "type": "boolean",
        "description": "Criado por você"
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      },
      "updated_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
POST /sites/:site_id/segments/preview.json Descrever filtros em linguagem natural e contar os visitantes correspondentes nos últimos 30 dias segments_preview

Permissão: analytics.read

Exemplo
curl -X POST https://privatusanalytics.com/sites/:site_id/segments/preview.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtros, e todos precisam corresponder. Cada item é uma condição [\"dimension\", \"operator\", \"value\"], ou {\"any\": [conditions]} quando basta que uma de várias corresponda. Dimensões: page, entry_page, exit_page, hostname, channel, referrer, referrer_url, ref, utm_source, utm_medium, utm_campaign, utm_content, utm_term, country (código ISO, por exemplo US), language, device (desktop, mobile, tablet, tv, other), browser, browser_version, os, os_version, screen, goal (id da meta), event (nome do evento personalizado) e prop:<key> (propriedade de evento personalizado). Operadores: is, is_not, contains, not_contains, starts_with, regex, not_regex, any_of e none_of (o valor é uma lista), gt e lt (um número), between (uma lista de dois números). Linhas do formulário de segmento também são aceitas: {\"dimension\", \"operator\", \"value\", \"property\" (para a dimensão prop), \"join\": \"and\" ou \"or\" (or combina a linha com a anterior)}. Exemplo: [[\"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": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object"
}
GET /sites/:site_id/segments/:id.json Obter um segmento segments_get

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/sites/:site_id/segments/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do segmento, por exemplo seg_7Q2K9XH3AB"
    },
    "site_id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "anyOf": [
        {
          "type": "string",
          "description": "Para que serve o segmento, ou null"
        },
        {
          "type": "null"
        }
      ]
    },
    "filters": {
      "type": "array",
      "description": "Filtros no formato de filtros das estatísticas: condições [\"dimension\", \"operator\", \"value\"] que precisam todas corresponder, e grupos {\"any\": [conditions]}"
    },
    "summary": {
      "type": "string",
      "description": "Os filtros em linguagem natural, por exemplo \"Visitantes dos Estados Unidos em celular que viram /pricing\""
    },
    "shared": {
      "type": "boolean",
      "description": "Visível para todos com acesso ao site"
    },
    "mine": {
      "type": "boolean",
      "description": "Criado por você"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
PATCH /sites/:site_id/segments/:id.json Renomear um segmento ou alterar seus filtros ou compartilhamento segments_update

Permissão: content.write

Exemplo
curl -X PATCH https://privatusanalytics.com/sites/:site_id/segments/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nome do segmento"
    },
    "description": {
      "type": "string",
      "description": "Nota opcional sobre a finalidade do segmento (no máximo 300 caracteres, vazio para limpar)"
    },
    "filters": {
      "type": "array",
      "items": {},
      "description": "Filtros substitutos, no mesmo formato da criação. Filtros, e todos precisam corresponder. Cada item é uma condição [\"dimension\", \"operator\", \"value\"], ou {\"any\": [conditions]} quando basta que uma de várias corresponda. Dimensões: page, entry_page, exit_page, hostname, channel, referrer, referrer_url, ref, utm_source, utm_medium, utm_campaign, utm_content, utm_term, country (código ISO, por exemplo US), language, device (desktop, mobile, tablet, tv, other), browser, browser_version, os, os_version, screen, goal (id da meta), event (nome do evento personalizado) e prop:<key> (propriedade de evento personalizado). Operadores: is, is_not, contains, not_contains, starts_with, regex, not_regex, any_of e none_of (o valor é uma lista), gt e lt (um número), between (uma lista de dois números). Linhas do formulário de segmento também são aceitas: {\"dimension\", \"operator\", \"value\", \"property\" (para a dimensão prop), \"join\": \"and\" ou \"or\" (or combina a linha com a anterior)}. Exemplo: [[\"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": "Visível para todos no site"
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "site_id",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do segmento, por exemplo seg_7Q2K9XH3AB"
    },
    "site_id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "anyOf": [
        {
          "type": "string",
          "description": "Para que serve o segmento, ou null"
        },
        {
          "type": "null"
        }
      ]
    },
    "filters": {
      "type": "array",
      "description": "Filtros no formato de filtros das estatísticas: condições [\"dimension\", \"operator\", \"value\"] que precisam todas corresponder, e grupos {\"any\": [conditions]}"
    },
    "summary": {
      "type": "string",
      "description": "Os filtros em linguagem natural, por exemplo \"Visitantes dos Estados Unidos em celular que viram /pricing\""
    },
    "shared": {
      "type": "boolean",
      "description": "Visível para todos com acesso ao site"
    },
    "mine": {
      "type": "boolean",
      "description": "Criado por você"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Sincronização com data warehouse

POST /workspaces/:workspace_id/warehouses.json Adicionar um destino de data warehouse warehouse_destinations_create

Permissão: workspace.manage

Exemplo
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/warehouses.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nome de exibição, por exemplo Data lake"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Sites a enviar (pa_…). Vazio envia todos os sites"
    },
    "bucket": {
      "type": "string",
      "description": "s3: nome do bucket"
    },
    "region": {
      "type": "string",
      "description": "s3: região, por exemplo us-east-1 (auto para R2)"
    },
    "prefix": {
      "type": "string",
      "description": "s3/azure: prefixo do caminho, por exemplo privatus/events"
    },
    "endpoint": {
      "type": "string",
      "description": "s3: endpoint https para armazenamento compatível com S3 (interoperabilidade do GCS, R2, MinIO)"
    },
    "access_key_id": {
      "type": "string",
      "description": "s3: id da chave de acesso"
    },
    "secret_access_key": {
      "type": "string",
      "description": "s3: chave de acesso secreta (somente gravação)"
    },
    "service_account_json": {
      "type": "string",
      "description": "bigquery: chave JSON de conta de serviço com BigQuery Data Editor (somente gravação)"
    },
    "project_id": {
      "type": "string",
      "description": "bigquery: id do projeto (padrão: da chave)"
    },
    "dataset": {
      "type": "string",
      "description": "bigquery: id do dataset"
    },
    "table": {
      "type": "string",
      "description": "bigquery/snowflake: nome da tabela (colunas: schema v1)"
    },
    "account": {
      "type": "string",
      "description": "snowflake: identificador da conta, por exemplo xy12345.us-east-1 ou myorg-myaccount"
    },
    "user": {
      "type": "string",
      "description": "snowflake: usuário com autenticação por par de chaves"
    },
    "private_key": {
      "type": "string",
      "description": "snowflake: chave privada RSA em PEM (somente gravação)"
    },
    "database": {
      "type": "string",
      "description": "snowflake: banco de dados"
    },
    "schema": {
      "type": "string",
      "description": "snowflake: schema"
    },
    "warehouse": {
      "type": "string",
      "description": "snowflake: warehouse virtual"
    },
    "role": {
      "type": "string",
      "description": "snowflake: função (opcional)"
    },
    "sas_url": {
      "type": "string",
      "description": "azure: URL SAS do contêiner com permissão de criar/gravar (somente gravação)"
    },
    "kind": {
      "type": "string",
      "description": "s3 (também GCS/R2/MinIO), bigquery, snowflake ou azure",
      "enum": [
        "s3",
        "bigquery",
        "snowflake",
        "azure"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "kind",
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do destino, por exemplo whd_7Q2K9XH3AB"
    },
    "kind": {
      "type": "string",
      "description": "s3, bigquery, snowflake ou azure"
    },
    "name": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "Para onde os dados vão: s3://bucket/prefix, project.dataset.table, account/database.schema.table ou o contêiner Azure"
    },
    "configured": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Nomes das configurações preenchidas (os valores nunca são retornados)"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Sites enviados (pa_…). Vazio significa todos os sites"
    },
    "schedule": {
      "type": "string",
      "description": "daily: 02:00 UTC, envia o dia UTC anterior"
    },
    "schema_version": {
      "type": "string",
      "description": "Schema de linha enviado"
    },
    "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 Excluir um destino de data warehouse warehouse_destinations_delete

Permissão: workspace.manage

Exemplo
curl -X DELETE https://privatusanalytics.com/warehouses/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do destino, por exemplo whd_7Q2K9XH3AB"
    },
    "kind": {
      "type": "string",
      "description": "s3, bigquery, snowflake ou azure"
    },
    "name": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "Para onde os dados vão: s3://bucket/prefix, project.dataset.table, account/database.schema.table ou o contêiner Azure"
    },
    "configured": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Nomes das configurações preenchidas (os valores nunca são retornados)"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Sites enviados (pa_…). Vazio significa todos os sites"
    },
    "schedule": {
      "type": "string",
      "description": "daily: 02:00 UTC, envia o dia UTC anterior"
    },
    "schema_version": {
      "type": "string",
      "description": "Schema de linha enviado"
    },
    "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 Listar destinos de data warehouse warehouse_destinations_list

Permissão: workspace.manage

Exemplo
curl https://privatusanalytics.com/workspaces/:workspace_id/warehouses.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "description": "Somente destinos deste tipo",
      "enum": [
        "s3",
        "bigquery",
        "snowflake",
        "azure"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Página (a partir de 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultados por página (máx. 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Id do destino, por exemplo whd_7Q2K9XH3AB"
      },
      "kind": {
        "type": "string",
        "description": "s3, bigquery, snowflake ou azure"
      },
      "name": {
        "type": "string"
      },
      "target": {
        "type": "string",
        "description": "Para onde os dados vão: s3://bucket/prefix, project.dataset.table, account/database.schema.table ou o contêiner Azure"
      },
      "configured": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Nomes das configurações preenchidas (os valores nunca são retornados)"
      },
      "site_ids": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Sites enviados (pa_…). Vazio significa todos os sites"
      },
      "schedule": {
        "type": "string",
        "description": "daily: 02:00 UTC, envia o dia UTC anterior"
      },
      "schema_version": {
        "type": "string",
        "description": "Schema de linha enviado"
      },
      "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 Obter um destino de data warehouse (sem segredos) warehouse_destinations_get

Permissão: workspace.manage

Exemplo
curl https://privatusanalytics.com/warehouses/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do destino, por exemplo whd_7Q2K9XH3AB"
    },
    "kind": {
      "type": "string",
      "description": "s3, bigquery, snowflake ou azure"
    },
    "name": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "Para onde os dados vão: s3://bucket/prefix, project.dataset.table, account/database.schema.table ou o contêiner Azure"
    },
    "configured": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Nomes das configurações preenchidas (os valores nunca são retornados)"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Sites enviados (pa_…). Vazio significa todos os sites"
    },
    "schedule": {
      "type": "string",
      "description": "daily: 02:00 UTC, envia o dia UTC anterior"
    },
    "schema_version": {
      "type": "string",
      "description": "Schema de linha enviado"
    },
    "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 Enfileirar agora a sincronização de um dia warehouse_destinations_sync

Permissão: workspace.manage

Exemplo
curl -X POST https://privatusanalytics.com/warehouses/:id/sync.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "date": {
      "type": "string",
      "format": "date",
      "description": "Dia UTC a enviar, por exemplo 2026-09-28 (padrão: ontem)"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do destino, por exemplo whd_7Q2K9XH3AB"
    },
    "kind": {
      "type": "string",
      "description": "s3, bigquery, snowflake ou azure"
    },
    "name": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "Para onde os dados vão: s3://bucket/prefix, project.dataset.table, account/database.schema.table ou o contêiner Azure"
    },
    "configured": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Nomes das configurações preenchidas (os valores nunca são retornados)"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Sites enviados (pa_…). Vazio significa todos os sites"
    },
    "schedule": {
      "type": "string",
      "description": "daily: 02:00 UTC, envia o dia UTC anterior"
    },
    "schema_version": {
      "type": "string",
      "description": "Schema de linha enviado"
    },
    "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 Atualizar um destino de data warehouse (segredos em branco são mantidos) warehouse_destinations_update

Permissão: workspace.manage

Exemplo
curl -X PATCH https://privatusanalytics.com/warehouses/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nome de exibição, por exemplo Data lake"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Sites a enviar (pa_…). Vazio envia todos os sites"
    },
    "bucket": {
      "type": "string",
      "description": "s3: nome do bucket"
    },
    "region": {
      "type": "string",
      "description": "s3: região, por exemplo us-east-1 (auto para R2)"
    },
    "prefix": {
      "type": "string",
      "description": "s3/azure: prefixo do caminho, por exemplo privatus/events"
    },
    "endpoint": {
      "type": "string",
      "description": "s3: endpoint https para armazenamento compatível com S3 (interoperabilidade do GCS, R2, MinIO)"
    },
    "access_key_id": {
      "type": "string",
      "description": "s3: id da chave de acesso"
    },
    "secret_access_key": {
      "type": "string",
      "description": "s3: chave de acesso secreta (somente gravação)"
    },
    "service_account_json": {
      "type": "string",
      "description": "bigquery: chave JSON de conta de serviço com BigQuery Data Editor (somente gravação)"
    },
    "project_id": {
      "type": "string",
      "description": "bigquery: id do projeto (padrão: da chave)"
    },
    "dataset": {
      "type": "string",
      "description": "bigquery: id do dataset"
    },
    "table": {
      "type": "string",
      "description": "bigquery/snowflake: nome da tabela (colunas: schema v1)"
    },
    "account": {
      "type": "string",
      "description": "snowflake: identificador da conta, por exemplo xy12345.us-east-1 ou myorg-myaccount"
    },
    "user": {
      "type": "string",
      "description": "snowflake: usuário com autenticação por par de chaves"
    },
    "private_key": {
      "type": "string",
      "description": "snowflake: chave privada RSA em PEM (somente gravação)"
    },
    "database": {
      "type": "string",
      "description": "snowflake: banco de dados"
    },
    "schema": {
      "type": "string",
      "description": "snowflake: schema"
    },
    "warehouse": {
      "type": "string",
      "description": "snowflake: warehouse virtual"
    },
    "role": {
      "type": "string",
      "description": "snowflake: função (opcional)"
    },
    "sas_url": {
      "type": "string",
      "description": "azure: URL SAS do contêiner com permissão de criar/gravar (somente gravação)"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do destino, por exemplo whd_7Q2K9XH3AB"
    },
    "kind": {
      "type": "string",
      "description": "s3, bigquery, snowflake ou azure"
    },
    "name": {
      "type": "string"
    },
    "target": {
      "type": "string",
      "description": "Para onde os dados vão: s3://bucket/prefix, project.dataset.table, account/database.schema.table ou o contêiner Azure"
    },
    "configured": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Nomes das configurações preenchidas (os valores nunca são retornados)"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Sites enviados (pa_…). Vazio significa todos os sites"
    },
    "schedule": {
      "type": "string",
      "description": "daily: 02:00 UTC, envia o dia UTC anterior"
    },
    "schema_version": {
      "type": "string",
      "description": "Schema de linha enviado"
    },
    "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"
    }
  }
}

Site institucional

GET /changelog.json Listar entradas do changelog changelog_list

Novidades publicadas do produto, das mais recentes para as mais antigas. Também disponível como RSS em /changelog.rss.

Permissão: public

Exemplo
curl https://privatusanalytics.com/changelog.json
Entradas
{
  "type": "object",
  "properties": {
    "area": {
      "type": "string",
      "description": "Somente entradas desta área do produto",
      "enum": [
        "product",
        "dashboard",
        "tracker",
        "privacy",
        "api",
        "integrations",
        "billing",
        "docs"
      ]
    },
    "page": {
      "type": "integer",
      "description": "Página (a partir de 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultados por página (máx. 100)"
    }
  },
  "required": []
}
Dados da resposta
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Id da entrada, por exemplo chg_7Q2K9XH3AB"
      },
      "title": {
        "type": "string",
        "description": "Título"
      },
      "area": {
        "type": "string",
        "description": "Área do produto, por exemplo dashboard, tracker, api"
      },
      "body": {
        "type": "string",
        "description": "Corpo em Markdown"
      },
      "published_at": {
        "type": "string",
        "format": "date-time",
        "description": "Hora de publicação"
      },
      "url": {
        "type": "string",
        "description": "Link permanente"
      }
    }
  }
}
GET /changelog/:id.json Obter uma entrada do changelog changelog_get

Permissão: public

Exemplo
curl https://privatusanalytics.com/changelog/:id.json
Entradas
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id da entrada, por exemplo chg_7Q2K9XH3AB"
    },
    "title": {
      "type": "string",
      "description": "Título"
    },
    "area": {
      "type": "string",
      "description": "Área do produto, por exemplo dashboard, tracker, api"
    },
    "body": {
      "type": "string",
      "description": "Corpo em Markdown"
    },
    "published_at": {
      "type": "string",
      "format": "date-time",
      "description": "Hora de publicação"
    },
    "url": {
      "type": "string",
      "description": "Link permanente"
    }
  }
}
POST /contact.json Enviar uma mensagem para a equipe do Privatus Analytics contact_create

Os clientes de navegador enviam um token do Cloudflare Turnstile como `cf-turnstile-response`. As requisições com um token de API não precisam dele.

Permissão: public · Somente HTTP (não é uma ferramenta MCP)

Exemplo
curl -X POST https://privatusanalytics.com/contact.json \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Seu nome",
      "examples": [
        "Ada Lovelace"
      ]
    },
    "email": {
      "type": "string",
      "description": "Onde devemos responder",
      "examples": [
        "[email protected]"
      ]
    },
    "company": {
      "type": "string",
      "description": "Empresa ou organização (opcional)"
    },
    "topic": {
      "type": "string",
      "description": "Assunto da mensagem",
      "enum": [
        "general",
        "sales",
        "support",
        "privacy",
        "security",
        "partnerships",
        "press"
      ],
      "default": "general"
    },
    "message": {
      "type": "string",
      "description": "Sua mensagem (10 a 5.000 caracteres)"
    },
    "website": {
      "type": "string",
      "description": "Deixe em branco. Armadilha de spam para bots. Envios preenchidos são descartados"
    }
  },
  "required": [
    "name",
    "email",
    "message"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "received": {
      "type": "boolean",
      "description": "Sempre true quando o envio foi aceito"
    },
    "message": {
      "type": "string",
      "description": "O que acontece a seguir"
    }
  }
}
POST /newsletter/confirm.json Confirmar uma inscrição na newsletter (token assinado) newsletter_confirm

Permissão: public · Somente HTTP (não é uma ferramenta MCP)

Exemplo
curl -X POST https://privatusanalytics.com/newsletter/confirm.json \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Token assinado do e-mail de confirmação"
    }
  },
  "required": [
    "token"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "received": {
      "type": "boolean",
      "description": "Sempre true quando o envio foi aceito"
    },
    "message": {
      "type": "string",
      "description": "O que acontece a seguir"
    }
  }
}
POST /newsletter.json Inscrever um e-mail na newsletter newsletter_subscribe

Os clientes de navegador enviam um token do Cloudflare Turnstile como `cf-turnstile-response`. As requisições com um token de API não precisam dele.

Permissão: public · Somente HTTP (não é uma ferramenta MCP)

Exemplo
curl -X POST https://privatusanalytics.com/newsletter.json \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "description": "Endereço de e-mail a inscrever. Um link de confirmação é enviado para ele",
      "examples": [
        "[email protected]"
      ]
    },
    "website": {
      "type": "string",
      "description": "Deixe em branco. Armadilha de spam para bots. Envios preenchidos são descartados"
    }
  },
  "required": [
    "email"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "received": {
      "type": "boolean",
      "description": "Sempre true quando o envio foi aceito"
    },
    "message": {
      "type": "string",
      "description": "O que acontece a seguir"
    }
  }
}
POST /newsletter/unsubscribe.json Cancelar a inscrição com um token de link assinado newsletter_unsubscribe

Permissão: public · Somente HTTP (não é uma ferramenta MCP)

Exemplo
curl -X POST https://privatusanalytics.com/newsletter/unsubscribe.json \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Token assinado do link de cancelamento"
    },
    "list": {
      "type": "string",
      "description": "newsletter (padrão: a lista do link) ou marketing (todos os e-mails de marketing)",
      "enum": [
        "newsletter",
        "marketing"
      ]
    }
  },
  "required": [
    "token"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "received": {
      "type": "boolean",
      "description": "Sempre true quando o envio foi aceito"
    },
    "message": {
      "type": "string",
      "description": "O que acontece a seguir"
    }
  }
}
GET /pricing.json Obter planos, preços e limites dos planos pricing_get

Os mesmos dados da página de preços: a escada de eventos, cada limite dos planos e o que conta como evento. Passe events para obter a faixa correspondente.

Permissão: public

Exemplo
curl https://privatusanalytics.com/pricing.json
Entradas
{
  "type": "object",
  "properties": {
    "events": {
      "type": "integer",
      "description": "Visualizações de página mais eventos personalizados esperados ao mês. Retorna a faixa correspondente como `recommendation`",
      "examples": [
        750000
      ]
    },
    "interval": {
      "type": "string",
      "description": "Intervalo de cobrança dos preços exibidos: month, ou year (10x o preço mensal)",
      "enum": [
        "month",
        "year"
      ],
      "default": "month"
    }
  },
  "required": []
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "currency": {
      "type": "string",
      "description": "Moeda de todos os preços (USD)"
    },
    "tax_included": {
      "type": "boolean",
      "description": "Sempre true. Os preços incluem IVA ou imposto sobre vendas, então o preço exibido é o preço pago"
    },
    "interval": {
      "type": "string",
      "description": "month ou year. Os preços são para este intervalo"
    },
    "annual_multiplier": {
      "type": "integer",
      "description": "Preço anual = preço mensal x isto (dois meses grátis)"
    },
    "free_events": {
      "type": "integer",
      "description": "Eventos ao mês incluídos no plano Free"
    },
    "badge_bonus": {
      "type": "integer",
      "description": "Eventos gratuitos extras ao mês quando o selo opcional é exibido"
    },
    "tiers": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Escada de eventos: preços { events, pro, business } para o intervalo (pro é null onde só o Business é oferecido), além dos preços mensais"
    },
    "plans": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Planos com { id, name, from_price, limits }. Limites null significam ilimitado"
    },
    "counted": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "O que conta como evento faturável"
    },
    "not_counted": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "O que nunca conta para o uso"
    },
    "recommendation": {
      "anyOf": [
        {
          "type": "object",
          "description": "{ events, plan, tier_events, price } para a entrada `events`, ou null quando nenhum volume foi informado"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
GET /status.json Obter o status atual do sistema status_get

Saúde do banco de dados, do Redis e dos jobs em segundo plano, verificada no máximo a cada 15 segundos.

Permissão: public

Exemplo
curl https://privatusanalytics.com/status.json
Entradas
{
  "type": "object",
  "properties": {
    "fresh": {
      "type": "boolean",
      "description": "Ignorar o cache de 15 segundos e verificar novamente agora",
      "default": false
    }
  },
  "required": []
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Geral: operational, degraded ou outage"
    },
    "checked_at": {
      "type": "string",
      "format": "date-time",
      "description": "Quando as verificações rodaram (em cache por até 15 s)"
    },
    "components": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Por componente: { id, name, status, detail, latency_ms }, mais queue_latency_s e queue_depth para filas"
    }
  }
}
GET /tools/header-checker.json Verificar o Referrer-Policy e o CSP de uma página para análises tools_header_check

Permissão: public

Exemplo
curl https://privatusanalytics.com/tools/header-checker.json
Entradas
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Página pública a verificar (http ou https)",
      "examples": [
        "https://example.com"
      ]
    }
  },
  "required": [
    "url"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "URL final após redirecionamentos"
    },
    "status": {
      "type": "integer",
      "description": "Status HTTP da resposta final"
    },
    "findings": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Verificações: { check, value, level (ok, warn, info), note }"
    }
  }
}
GET /tools/privacy-policy-generator.json Redigir um parágrafo de política de privacidade para o Privatus Analytics tools_privacy_policy

Permissão: public

Exemplo
curl https://privatusanalytics.com/tools/privacy-policy-generator.json
Entradas
{
  "type": "object",
  "properties": {
    "site_name": {
      "type": "string",
      "description": "O nome do seu site ou empresa",
      "examples": [
        "Example Books"
      ]
    },
    "contact_email": {
      "type": "string",
      "description": "Contato de privacidade a mencionar (opcional)"
    },
    "honors_gpc": {
      "type": "boolean",
      "description": "Se Do Not Track e Global Privacy Control são respeitados (o padrão)",
      "default": true
    }
  },
  "required": [
    "site_name"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "site_name": {
      "type": "string",
      "description": "Entrada: nome do site ou da empresa"
    },
    "paragraphs": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "O texto da política, um parágrafo por item"
    },
    "text": {
      "type": "string",
      "description": "Os parágrafos unidos por linhas em branco"
    }
  }
}
GET /tools/qr-code.json Gerar um QR code em SVG tools_qr_code

Permissão: public

Exemplo
curl https://privatusanalytics.com/tools/qr-code.json
Entradas
{
  "type": "object",
  "properties": {
    "text": {
      "type": "string",
      "description": "URL ou texto a codificar (até 1.000 caracteres)",
      "examples": [
        "https://example.com/?utm_source=poster"
      ]
    },
    "level": {
      "type": "string",
      "description": "Correção de erros: l (7%), m (15%), q (25%), h (30%)",
      "enum": [
        "l",
        "m",
        "q",
        "h"
      ],
      "default": "m"
    }
  },
  "required": [
    "text"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "text": {
      "type": "string",
      "description": "O texto codificado"
    },
    "level": {
      "type": "string",
      "description": "Nível de correção de erros"
    },
    "size": {
      "type": "integer",
      "description": "Módulos por lado"
    },
    "svg": {
      "type": "string",
      "description": "Documento SVG independente"
    }
  }
}
GET /tools/tracker-scanner.json Listar cookies e rastreadores conhecidos em uma página tools_tracker_scan

Permissão: public

Exemplo
curl https://privatusanalytics.com/tools/tracker-scanner.json
Entradas
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Página pública a analisar (http ou https)",
      "examples": [
        "https://example.com"
      ]
    }
  },
  "required": [
    "url"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "URL final após redirecionamentos"
    },
    "status": {
      "type": "integer",
      "description": "Status HTTP da resposta final"
    },
    "truncated": {
      "type": "boolean",
      "description": "True quando a página tinha mais de 1 MB e só o primeiro 1 MB foi analisado"
    },
    "cookies": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Cookies definidos pela resposta HTTP: { name, domain, path, expires, secure, http_only, same_site }. Os valores nunca são retornados"
    },
    "trackers": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Ferramentas conhecidas referenciadas pela página: { name, category, match, evidence }"
    },
    "third_party_hosts": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Outros domínios dos quais a página carrega recursos"
    }
  }
}
GET /tools/utm-builder.json Montar uma URL de campanha com parâmetros UTM tools_utm_builder

Permissão: public

Exemplo
curl https://privatusanalytics.com/tools/utm-builder.json
Entradas
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "URL da página de destino",
      "examples": [
        "https://example.com/pricing"
      ]
    },
    "source": {
      "type": "string",
      "description": "utm_source: de onde vem o tráfego",
      "examples": [
        "newsletter"
      ]
    },
    "medium": {
      "type": "string",
      "description": "utm_medium: o canal, por exemplo email, cpc, social",
      "examples": [
        "email"
      ]
    },
    "campaign": {
      "type": "string",
      "description": "utm_campaign: o nome da campanha",
      "examples": [
        "fall_launch"
      ]
    },
    "term": {
      "type": "string",
      "description": "utm_term: palavra-chave de busca paga (opcional)"
    },
    "content": {
      "type": "string",
      "description": "utm_content: qual link ou criativo (opcional)"
    }
  },
  "required": [
    "url",
    "source",
    "medium",
    "campaign"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "A URL da página de destino com parâmetros UTM"
    },
    "params": {
      "type": "object",
      "description": "Os parâmetros UTM que foram adicionados"
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Problemas que vale corrigir (maiúsculas, espaços, dados pessoais)"
    }
  }
}
POST /waitlist.json Entrar em uma lista de espera (hospedagem na UE) waitlist_join

Os clientes de navegador enviam um token do Cloudflare Turnstile como `cf-turnstile-response`. As requisições com um token de API não precisam dele.

Permissão: public · Somente HTTP (não é uma ferramenta MCP)

Exemplo
curl -X POST https://privatusanalytics.com/waitlist.json \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "description": "E-mail a notificar",
      "examples": [
        "[email protected]"
      ]
    },
    "list": {
      "type": "string",
      "description": "Em qual lista de espera entrar",
      "enum": [
        "eu_hosting"
      ],
      "default": "eu_hosting"
    },
    "website": {
      "type": "string",
      "description": "Deixe em branco. Armadilha de spam para bots. Envios preenchidos são descartados"
    }
  },
  "required": [
    "email"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "received": {
      "type": "boolean",
      "description": "Sempre true quando o envio foi aceito"
    },
    "message": {
      "type": "string",
      "description": "O que acontece a seguir"
    }
  }
}

Sites

POST /sites/:site_id/data_reset.json Excluir todos os eventos e visitas em um intervalo de datas (roda em segundo plano, não pode ser desfeito) sites_reset_data

Permissão: sites.manage

Exemplo
curl -X POST https://privatusanalytics.com/sites/:site_id/data_reset.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "from": {
      "type": "string",
      "format": "date",
      "description": "Primeiro dia a excluir (fuso horário do site)"
    },
    "to": {
      "type": "string",
      "format": "date",
      "description": "Último dia a excluir, inclusive"
    },
    "confirm": {
      "type": "string",
      "description": "Digite o domínio para confirmar"
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "from",
    "to",
    "confirm",
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object"
}
GET /sites/:site_id/filter_stats.json Resumo do tráfego filtrado: bots, regras de tráfego ou remoções de PII por motivo e país (somente contagens) sites_filter_stats

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/sites/:site_id/filter_stats.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "description": "bot (bots filtrados), rule (regras de tráfego) ou redaction (removedor de PII)",
      "enum": [
        "bot",
        "rule",
        "redaction"
      ],
      "default": "bot"
    },
    "days": {
      "type": "integer",
      "description": "Dias a consultar para trás (1-395)",
      "default": 30
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object"
}
GET /sites/:site_id/access.json Listar membros e se eles podem ver este site sites_access_list

Permissão: members.manage

Exemplo
curl https://privatusanalytics.com/sites/:site_id/access.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "membership_id": {
      "type": "string",
      "format": "uuid",
      "description": "Id da associação"
    },
    "email": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "role": {
      "type": "string"
    },
    "access": {
      "type": "boolean",
      "description": "Pode ver este site"
    },
    "locked": {
      "type": "boolean",
      "description": "Proprietários e administradores sempre têm acesso"
    }
  }
}
PATCH /sites/:site_id/access.json Conceder ou remover o acesso de um membro a este site sites_access_update

Permissão: members.manage

Exemplo
curl -X PATCH https://privatusanalytics.com/sites/:site_id/access.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "membership_id": {
      "type": "string",
      "description": "Id da associação de sites_access_list"
    },
    "access": {
      "type": "boolean",
      "description": "true para conceder o acesso, false para removê-lo"
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "membership_id",
    "access",
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "membership_id": {
      "type": "string",
      "format": "uuid",
      "description": "Id da associação"
    },
    "email": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "role": {
      "type": "string"
    },
    "access": {
      "type": "boolean",
      "description": "Pode ver este site"
    },
    "locked": {
      "type": "boolean",
      "description": "Proprietários e administradores sempre têm acesso"
    }
  }
}
POST /sites/:site_id/favorite.json Marcar um site com estrela (fixado primeiro em Todos os sites) sites_favorite

Permissão: analytics.read

Exemplo
curl -X POST https://privatusanalytics.com/sites/:site_id/favorite.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do site usado no snippet de rastreamento"
    },
    "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": "Início da chave de ingestão do servidor"
        },
        {
          "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": "Snippet de rastreamento em HTML"
    },
    "favorite": {
      "type": "boolean",
      "description": "Marcado com estrela por você"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:site_id/favorite.json Remover a estrela de um site sites_unfavorite

Permissão: analytics.read

Exemplo
curl -X DELETE https://privatusanalytics.com/sites/:site_id/favorite.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do site usado no snippet de rastreamento"
    },
    "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": "Início da chave de ingestão do servidor"
        },
        {
          "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": "Snippet de rastreamento em HTML"
    },
    "favorite": {
      "type": "boolean",
      "description": "Marcado com estrela por você"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /sites/:site_id/setup.json Status da instalação e snippet de um site sites_setup_get

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/sites/:site_id/setup.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object"
}
POST /transfers/:token/accept.json Aceitar a transferência de um site para um dos seus espaços de trabalho site_transfers_accept

Permissão: public

Exemplo
curl -X POST https://privatusanalytics.com/transfers/:token/accept.json \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Espaço de trabalho para onde mover o site (ws_…)"
    },
    "token": {
      "type": "string",
      "description": "Token do recurso"
    }
  },
  "required": [
    "workspace_id",
    "token"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Site em transferência"
    },
    "site_domain": {
      "type": "string"
    },
    "from_workspace": {
      "type": "string",
      "description": "Nome do espaço de trabalho atual"
    },
    "to_workspace_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Espaço de trabalho de destino"
        },
        {
          "type": "null"
        }
      ]
    },
    "to_email": {
      "type": "string",
      "description": "E-mail do destinatário"
    },
    "status": {
      "type": "string",
      "description": "pending, accepted ou canceled"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /sites/:site_id/transfer.json Iniciar a transferência de um site para outro espaço de trabalho (envia e-mail ao destinatário) sites_transfer_start

Permissão: sites.manage

Exemplo
curl -X POST https://privatusanalytics.com/sites/:site_id/transfer.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "description": "E-mail da pessoa que receberá o site (ela escolhe um de seus espaços de trabalho)"
    },
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "email",
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Site em transferência"
    },
    "site_domain": {
      "type": "string"
    },
    "from_workspace": {
      "type": "string",
      "description": "Nome do espaço de trabalho atual"
    },
    "to_workspace_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Espaço de trabalho de destino"
        },
        {
          "type": "null"
        }
      ]
    },
    "to_email": {
      "type": "string",
      "description": "E-mail do destinatário"
    },
    "status": {
      "type": "string",
      "description": "pending, accepted ou canceled"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:site_id/transfer.json Cancelar uma transferência de site pendente sites_transfer_cancel

Permissão: sites.manage

Exemplo
curl -X DELETE https://privatusanalytics.com/sites/:site_id/transfer.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Id do site, por exemplo pa_7Q2K9XH3AB"
    }
  },
  "required": [
    "site_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Site em transferência"
    },
    "site_domain": {
      "type": "string"
    },
    "from_workspace": {
      "type": "string",
      "description": "Nome do espaço de trabalho atual"
    },
    "to_workspace_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Espaço de trabalho de destino"
        },
        {
          "type": "null"
        }
      ]
    },
    "to_email": {
      "type": "string",
      "description": "E-mail do destinatário"
    },
    "status": {
      "type": "string",
      "description": "pending, accepted ou canceled"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /transfers/:token.json Obter uma transferência pendente a partir do token enviado por e-mail site_transfers_get

Permissão: public

Exemplo
curl https://privatusanalytics.com/transfers/:token.json
Entradas
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "Token do recurso"
    }
  },
  "required": [
    "token"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "description": "Site em transferência"
    },
    "site_domain": {
      "type": "string"
    },
    "from_workspace": {
      "type": "string",
      "description": "Nome do espaço de trabalho atual"
    },
    "to_workspace_id": {
      "anyOf": [
        {
          "type": "string",
          "description": "Espaço de trabalho de destino"
        },
        {
          "type": "null"
        }
      ]
    },
    "to_email": {
      "type": "string",
      "description": "E-mail do destinatário"
    },
    "status": {
      "type": "string",
      "description": "pending, accepted ou canceled"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
POST /workspaces/:workspace_id/sites.json Adicionar um site sites_create

Permissão: sites.manage

Exemplo
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/sites.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "domain": {
      "type": "string",
      "description": "Domínio principal, por exemplo example.com",
      "examples": [
        "example.com"
      ]
    },
    "name": {
      "type": "string",
      "description": "Nome de exibição (o padrão é o domínio)"
    },
    "timezone": {
      "type": "string",
      "description": "Fuso horário dos relatórios"
    },
    "currency": {
      "type": "string",
      "description": "Moeda da receita (ISO 4217)"
    },
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "domain",
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do site usado no snippet de rastreamento"
    },
    "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": "Início da chave de ingestão do servidor"
        },
        {
          "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": "Snippet de rastreamento em HTML"
    },
    "favorite": {
      "type": "boolean",
      "description": "Marcado com estrela por você"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
DELETE /sites/:id.json Excluir um site (removido definitivamente após 7 dias) sites_delete

Permissão: sites.manage

Exemplo
curl -X DELETE https://privatusanalytics.com/sites/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "confirm": {
      "type": "string",
      "description": "Digite o domínio para confirmar"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "confirm",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do site usado no snippet de rastreamento"
    },
    "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": "Início da chave de ingestão do servidor"
        },
        {
          "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": "Snippet de rastreamento em HTML"
    },
    "favorite": {
      "type": "boolean",
      "description": "Marcado com estrela por você"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
GET /workspaces/:workspace_id/sites.json Listar sites de um espaço de trabalho sites_list

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/workspaces/:workspace_id/sites.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "description": "Filtrar por domínio ou nome"
    },
    "label": {
      "type": "string",
      "description": "Somente sites com este rótulo"
    },
    "sort": {
      "type": "string",
      "description": "position (sua ordem), name, ou visitors nos últimos 30 dias (mais visitados primeiro)",
      "enum": [
        "position",
        "name",
        "visitors"
      ],
      "default": "position"
    },
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Página (a partir de 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultados por página (máx. 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Id do site usado no snippet de rastreamento"
      },
      "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": "Início da chave de ingestão do servidor"
          },
          {
            "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": "Snippet de rastreamento em HTML"
      },
      "favorite": {
        "type": "boolean",
        "description": "Marcado com estrela por você"
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  }
}
GET /sites/:id.json Obter um site e todas as suas configurações sites_get

Permissão: analytics.read

Exemplo
curl https://privatusanalytics.com/sites/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do site usado no snippet de rastreamento"
    },
    "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": "Início da chave de ingestão do servidor"
        },
        {
          "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": "Snippet de rastreamento em HTML"
    },
    "favorite": {
      "type": "boolean",
      "description": "Marcado com estrela por você"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
PATCH /sites/:id.json Atualizar as configurações do site sites_update

Permissão: sites.manage

Exemplo
curl -X PATCH https://privatusanalytics.com/sites/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Nome de exibição"
    },
    "domain": {
      "type": "string",
      "description": "Domínio principal"
    },
    "extra_domains": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Hostnames adicionais"
    },
    "multi_domain_mode": {
      "type": "string",
      "description": "combined: um visitante entre domínios",
      "enum": [
        "combined",
        "separate"
      ]
    },
    "timezone": {
      "type": "string",
      "description": "Fuso horário dos relatórios"
    },
    "currency": {
      "type": "string",
      "description": "Moeda da receita (ISO 4217)"
    },
    "week_start": {
      "type": "integer",
      "description": "0 = domingo, 1 = segunda-feira"
    },
    "labels": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Rótulos para agrupar sites"
    },
    "honor_dnt": {
      "type": "boolean",
      "description": "Ignorar visitantes que enviam DNT"
    },
    "honor_gpc": {
      "type": "boolean",
      "description": "Ignorar visitantes que enviam GPC"
    },
    "pii_scrubber": {
      "type": "boolean",
      "description": "Ocultar e-mails, tokens, ids"
    },
    "redaction_rules": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "pattern": {
            "type": "string"
          }
        }
      },
      "description": "Regexes de ocultação personalizadas"
    },
    "allowed_params": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Parâmetros de consulta a manter nos caminhos"
    },
    "path_masks": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "pattern": {
            "type": "string"
          },
          "replacement": {
            "type": "string"
          }
        }
      },
      "description": "Regras de mascaramento de caminho, por exemplo /u/* -> /u/:id"
    },
    "retention_months": {
      "type": "integer",
      "description": "Excluir dados mais antigos que isto"
    },
    "bot_filtering": {
      "type": "boolean",
      "description": "Filtrar tráfego de bots"
    },
    "traffic_rule_modes": {
      "type": "object",
      "additionalProperties": true,
      "description": "block ou allow por lista de regras de tráfego"
    },
    "vitals_sample_rate": {
      "type": "integer",
      "description": "% de amostragem dos Web Vitals"
    },
    "conversion_denominator": {
      "type": "string",
      "description": "Taxa de conversão sobre visitas ou visitantes",
      "enum": [
        "visits",
        "visitors"
      ]
    },
    "public_dashboard": {
      "type": "boolean",
      "description": "Qualquer pessoa com o link pode ver as estatísticas"
    },
    "public_indexable": {
      "type": "boolean",
      "description": "Permitir que mecanismos de busca indexem a página pública"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do site usado no snippet de rastreamento"
    },
    "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": "Início da chave de ingestão do servidor"
        },
        {
          "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": "Snippet de rastreamento em HTML"
    },
    "favorite": {
      "type": "boolean",
      "description": "Marcado com estrela por você"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}

Tokens de API

POST /workspaces/:workspace_id/api_tokens.json Criar um token de API (o token é exibido uma única vez) api_tokens_create

Permissão: member

Exemplo
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/api_tokens.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Um nome para reconhecer o token",
      "examples": [
        "CI deploys"
      ]
    },
    "permissions": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "analytics.read",
          "analytics.export",
          "content.write",
          "sites.manage",
          "uptime.manage",
          "members.manage",
          "tokens.manage",
          "billing.manage",
          "workspace.manage"
        ]
      },
      "description": "Permissões (omita para todas as suas, uma lista vazia é recusada)"
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Restringir a estes ids de site (pa_…). Vazio = todos",
      "default": []
    },
    "expires_at": {
      "type": "string",
      "format": "date-time",
      "description": "Data de expiração (ISO 8601). Vazio = nunca"
    },
    "allowed_ips": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Aceitar requisições somente destes IPs/CIDRs",
      "default": []
    },
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "name",
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "name": {
      "type": "string"
    },
    "token": {
      "anyOf": [
        {
          "type": "string",
          "description": "O token em si: só retornado na criação"
        },
        {
          "type": "null"
        }
      ]
    },
    "token_prefix": {
      "type": "string",
      "description": "Primeiros caracteres, para reconhecer o token"
    },
    "owner": {
      "type": "string",
      "description": "E-mail do membro que é o dono"
    },
    "permissions": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Restrito a estes sites (vazio = todos)"
    },
    "allowed_ips": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "oauth_client": {
      "anyOf": [
        {
          "type": "string",
          "description": "Cliente MCP que o recebeu"
        },
        {
          "type": "null"
        }
      ]
    },
    "status": {
      "type": "string",
      "description": "active, expired ou 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 Revogar um token de API api_tokens_delete

Permissão: member

Exemplo
curl -X DELETE https://privatusanalytics.com/workspaces/:workspace_id/api_tokens/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "name": {
      "type": "string"
    },
    "token": {
      "anyOf": [
        {
          "type": "string",
          "description": "O token em si: só retornado na criação"
        },
        {
          "type": "null"
        }
      ]
    },
    "token_prefix": {
      "type": "string",
      "description": "Primeiros caracteres, para reconhecer o token"
    },
    "owner": {
      "type": "string",
      "description": "E-mail do membro que é o dono"
    },
    "permissions": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "site_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Restrito a estes sites (vazio = todos)"
    },
    "allowed_ips": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "oauth_client": {
      "anyOf": [
        {
          "type": "string",
          "description": "Cliente MCP que o recebeu"
        },
        {
          "type": "null"
        }
      ]
    },
    "status": {
      "type": "string",
      "description": "active, expired ou 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 Listar tokens de API api_tokens_list

Permissão: member

Exemplo
curl https://privatusanalytics.com/workspaces/:workspace_id/api_tokens.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "include_revoked": {
      "type": "boolean",
      "description": "Listar também tokens revogados e expirados",
      "default": false
    },
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Página (a partir de 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultados por página (máx. 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "format": "uuid"
      },
      "name": {
        "type": "string"
      },
      "token": {
        "anyOf": [
          {
            "type": "string",
            "description": "O token em si: só retornado na criação"
          },
          {
            "type": "null"
          }
        ]
      },
      "token_prefix": {
        "type": "string",
        "description": "Primeiros caracteres, para reconhecer o token"
      },
      "owner": {
        "type": "string",
        "description": "E-mail do membro que é o dono"
      },
      "permissions": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "site_ids": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Restrito a estes sites (vazio = todos)"
      },
      "allowed_ips": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "oauth_client": {
        "anyOf": [
          {
            "type": "string",
            "description": "Cliente MCP que o recebeu"
          },
          {
            "type": "null"
          }
        ]
      },
      "status": {
        "type": "string",
        "description": "active, expired ou 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"
      }
    }
  }
}

Webhooks

GET /workspaces/:workspace_id/webhooks/:webhook_id/deliveries.json Listar entregas de um webhook webhook_deliveries_list

Permissão: workspace.manage

Exemplo
curl https://privatusanalytics.com/workspaces/:workspace_id/webhooks/:webhook_id/deliveries.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Somente entregas bem-sucedidas ou com falha",
      "enum": [
        "succeeded",
        "failed"
      ]
    },
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    },
    "webhook_id": {
      "type": "string",
      "description": "Webhook do recurso"
    },
    "page": {
      "type": "integer",
      "description": "Página (a partir de 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultados por página (máx. 100)"
    }
  },
  "required": [
    "workspace_id",
    "webhook_id"
  ]
}
Dados da resposta
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Id da entrega, por exemplo whd_123"
      },
      "event": {
        "type": "string"
      },
      "status": {
        "type": "string",
        "description": "pending, succeeded ou failed"
      },
      "status_code": {
        "anyOf": [
          {
            "type": "integer",
            "description": "Status HTTP da última tentativa"
          },
          {
            "type": "null"
          }
        ]
      },
      "error": {
        "anyOf": [
          {
            "type": "string",
            "description": "Erro de conexão da última tentativa"
          },
          {
            "type": "null"
          }
        ]
      },
      "attempt": {
        "type": "integer"
      },
      "duration_ms": {
        "anyOf": [
          {
            "type": "integer"
          },
          {
            "type": "null"
          }
        ]
      },
      "payload": {
        "type": "object"
      },
      "response_body": {
        "anyOf": [
          {
            "type": "string",
            "description": "Primeiros 2.000 caracteres"
          },
          {
            "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 Enviar uma entrega novamente webhook_deliveries_redeliver

Permissão: workspace.manage

Exemplo
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 '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    },
    "webhook_id": {
      "type": "string",
      "description": "Webhook do recurso"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "workspace_id",
    "webhook_id",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id da entrega, por exemplo whd_123"
    },
    "event": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "description": "pending, succeeded ou failed"
    },
    "status_code": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Status HTTP da última tentativa"
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "anyOf": [
        {
          "type": "string",
          "description": "Erro de conexão da última tentativa"
        },
        {
          "type": "null"
        }
      ]
    },
    "attempt": {
      "type": "integer"
    },
    "duration_ms": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "payload": {
      "type": "object"
    },
    "response_body": {
      "anyOf": [
        {
          "type": "string",
          "description": "Primeiros 2.000 caracteres"
        },
        {
          "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 Adicionar um endpoint de webhook webhooks_create

Permissão: workspace.manage

Exemplo
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/webhooks.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Endpoint HTTPS que recebe o JSON enviado por 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": "Eventos a enviar"
    },
    "enabled": {
      "type": "boolean",
      "description": "Enviar entregas",
      "default": true
    },
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    }
  },
  "required": [
    "url",
    "events",
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do webhook, por exemplo wh_7Q2K9XH3AB"
    },
    "url": {
      "type": "string"
    },
    "events": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "enabled": {
      "type": "boolean"
    },
    "status": {
      "type": "string",
      "description": "active, failing ou disabled"
    },
    "secret": {
      "type": "string",
      "description": "Segredo de assinatura para 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 Excluir um webhook webhooks_delete

Permissão: workspace.manage

Exemplo
curl -X DELETE https://privatusanalytics.com/workspaces/:workspace_id/webhooks/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do webhook, por exemplo wh_7Q2K9XH3AB"
    },
    "url": {
      "type": "string"
    },
    "events": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "enabled": {
      "type": "boolean"
    },
    "status": {
      "type": "string",
      "description": "active, failing ou disabled"
    },
    "secret": {
      "type": "string",
      "description": "Segredo de assinatura para 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 Listar webhooks webhooks_list

Permissão: workspace.manage

Exemplo
curl https://privatusanalytics.com/workspaces/:workspace_id/webhooks.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    },
    "page": {
      "type": "integer",
      "description": "Página (a partir de 1)"
    },
    "per_page": {
      "type": "integer",
      "description": "Resultados por página (máx. 100)"
    }
  },
  "required": [
    "workspace_id"
  ]
}
Dados da resposta
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Id do webhook, por exemplo wh_7Q2K9XH3AB"
      },
      "url": {
        "type": "string"
      },
      "events": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "enabled": {
        "type": "boolean"
      },
      "status": {
        "type": "string",
        "description": "active, failing ou disabled"
      },
      "secret": {
        "type": "string",
        "description": "Segredo de assinatura para 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 Obter um webhook webhooks_get

Permissão: workspace.manage

Exemplo
curl https://privatusanalytics.com/workspaces/:workspace_id/webhooks/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN"
Entradas
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do webhook, por exemplo wh_7Q2K9XH3AB"
    },
    "url": {
      "type": "string"
    },
    "events": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "enabled": {
      "type": "boolean"
    },
    "status": {
      "type": "string",
      "description": "active, failing ou disabled"
    },
    "secret": {
      "type": "string",
      "description": "Segredo de assinatura para 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 Enviar uma entrega de teste webhooks_test

Permissão: workspace.manage

Exemplo
curl -X POST https://privatusanalytics.com/workspaces/:workspace_id/webhooks/:id/test.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id da entrega, por exemplo whd_123"
    },
    "event": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "description": "pending, succeeded ou failed"
    },
    "status_code": {
      "anyOf": [
        {
          "type": "integer",
          "description": "Status HTTP da última tentativa"
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "anyOf": [
        {
          "type": "string",
          "description": "Erro de conexão da última tentativa"
        },
        {
          "type": "null"
        }
      ]
    },
    "attempt": {
      "type": "integer"
    },
    "duration_ms": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "payload": {
      "type": "object"
    },
    "response_body": {
      "anyOf": [
        {
          "type": "string",
          "description": "Primeiros 2.000 caracteres"
        },
        {
          "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 Atualizar um webhook (eventos, URL, ativado, trocar segredo) webhooks_update

Permissão: workspace.manage

Exemplo
curl -X PATCH https://privatusanalytics.com/workspaces/:workspace_id/webhooks/:id.json \
  -H "Authorization: Bearer $PRIVATUS_TOKEN" \
  -H "Content-Type: application/json" -d '{…}'
Entradas
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Endpoint HTTPS"
    },
    "events": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "alert.triggered",
          "alert.resolved",
          "goal.completed_threshold",
          "uptime.down",
          "uptime.up",
          "export.ready",
          "import.completed",
          "import.failed",
          "site.created",
          "site.deleted",
          "member.added",
          "usage.threshold"
        ]
      },
      "description": "Eventos a enviar"
    },
    "enabled": {
      "type": "boolean",
      "description": "Enviar entregas"
    },
    "rotate_secret": {
      "type": "boolean",
      "description": "Substituir o segredo de assinatura",
      "default": false
    },
    "workspace_id": {
      "type": "string",
      "description": "Id do espaço de trabalho, por exemplo ws_7Q2K9XH3AB"
    },
    "id": {
      "type": "string",
      "description": "Id do recurso"
    }
  },
  "required": [
    "workspace_id",
    "id"
  ]
}
Dados da resposta
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Id do webhook, por exemplo wh_7Q2K9XH3AB"
    },
    "url": {
      "type": "string"
    },
    "events": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "enabled": {
      "type": "boolean"
    },
    "status": {
      "type": "string",
      "description": "active, failing ou disabled"
    },
    "secret": {
      "type": "string",
      "description": "Segredo de assinatura para 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"
    }
  }
}