API

Add masked pathname

POSThttps://api.visitors.now/v1/project/masked-pathnames

Adds a pathname pattern to aggregate in analytics output.

Request

index.ts
const res = await fetch("https://api.visitors.now/v1/project/masked-pathnames", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${VISITORS_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    pathname: "/users/:id",
  }),
});

const data = await res.json();

Body parameters

pathname

stringrequired

Pathname pattern to mask. Must start with /.

Response

{
  "maskedPathnames": ["/users/:id"]
}