API

Update project

PATCHhttps://api.visitors.now/v1/project

Updates the project associated with the API key used for authentication.

Request

index.ts
const res = await fetch("https://api.visitors.now/v1/project", {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${VISITORS_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    name: "My Site",
    currency: "EUR",
    hostnames: ["mysite.com", "*.mysite.com"],
    blockedIps: ["203.0.113.10", "198.51.100.0/24"],
    blockedPathnames: ["/admin/*"],
    maskedPathnames: ["/users/:id"],
  }),
});

const project = await res.json();

Body parameters

name

string

Display name of the project.

public

boolean

Whether the project dashboard is publicly accessible.

currency

string

Currency used for revenue display.

hostnames

string[]

Hostnames allowed to send tracking events. Wildcards like *.example.com are supported.

blockedIps

string[]

IP addresses or IPv4 CIDR ranges blocked from sending tracking events.

blockedPathnames

string[]

Pathnames blocked from being tracked. Wildcards like /admin/* are supported.

maskedPathnames

string[]

Pathname patterns aggregated in analytics output.

Response

Returns the updated project object.

{
  "id": "fe14d7a2-0f3f-4dc4-9c0b-6f4a49f5c751",
  "name": "My Site",
  "domain": "visitors.now",
  "token": "b1a57b77-01f4-42e4-b7b4-1709b4d21d34",
  "public": false,
  "currency": "EUR",
  "hostnames": ["mysite.com", "*.mysite.com"],
  "blockedIps": ["203.0.113.10", "198.51.100.0/24"],
  "blockedPathnames": ["/admin/*"],
  "maskedPathnames": ["/users/:id"],
  "createdAt": "2025-11-28T14:30:56.834Z",
  "updatedAt": "2026-03-07T12:00:00.000Z"
}