Skip to content

Web vitals

1 operation in the WP Waterfall API.

Report the web vitals of a marketing page

post/public/vitalsPermalink to Report the web vitals of a marketing page

  • Dashboard session only, no API key

No sign-in, no cookie. Send a page path and up to five metrics (LCP, INP, CLS, FCP, TTFB) measured in the visitor's browser. A visitor who denied analytics, or whose browser sends Global Privacy Control, sends nothing. WP Waterfall keeps a count, a sum, and how many were good, needs improvement, or poor, for each page, metric, and day. It stores no address, no query string, and nothing that names the visitor, and it deletes rows after 90 days. Limited to 120 requests an hour per address. After 300 different pages in one day, new pages count as /other.

Parameters

NameInTypeDescription
Idempotency-Key requiredheaderstringSend a fresh unique value on every POST: a POST without it answers 422. The answer is stored for 24 hours, so a retry with the same key and body returns the first answer, and the same key with a different body returns 422.

Request body application/json, required, WebVitalsRequest

Fields

NameTypeDescription
route requiredstring
metrics requiredarray of object
metrics[].name requiredstringOne of: LCP, INP, CLS, FCP, TTFB.
metrics[].value requirednumberRange: 0 to 600000.

Responses

StatusBodyDescription
202WebVitalsResponseReceived
400ProblemThe request could not be read: bad JSON, a bad header, or a malformed value.
409ProblemThe current state does not allow this: the same change is already running, or another change got there first.
422ProblemA field is missing or not valid
429ProblemToo many reports from this address

202 response fields

NameTypeDescription
received requiredboolean