API

Add blocked pathname

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

Blocks a pathname from being tracked.

Request

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

const data = await res.json();

Body parameters

pathname

stringrequired

Pathname to block. Must start with /.

Response

{
  "blockedPathnames": ["/admin/*"]
}