---
title: "Ingest Web Vital REST API | HitKeep"
description: "Reference for the HitKeep REST API operation Ingest Web Vital, including request parameters, responses, and authentication notes."
canonical: "https://hitkeep.com/api/operations/ingestweb-vitals/post/"
---

# Ingest Web Vital REST API

POST

/ingest/web-vitals

FetchcURL

```
const url = 'http://127.0.0.1:25737/ingest/web-vitals';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"mid":"example","n":"LCP","nt":"example","p":"example","pid":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","sid":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","tsrc":"example","tv":"example","ua":"example","v":1}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```
curl --request POST \
  --url http://127.0.0.1:25737/ingest/web-vitals \
  --header 'Content-Type: application/json' \
  --data '{ "mid": "example", "n": "LCP", "nt": "example", "p": "example", "pid": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "sid": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "tsrc": "example", "tv": "example", "ua": "example", "v": 1 }'
```

-

Ingests one compact opt-in Web Vital sample from hk-vitals.js. The server resolves the site from Origin, derives the rating from standard thresholds, and strips browser-provided query strings or hashes from the path.

## Request Bodyrequired

application/json

object

**mid**

Optional web-vitals metric instance ID used for future dedupe and bfcache analysis.

string

**n**

required

Metric name.

string

Allowed values: LCP INP CLS FCP TTFB

**nt**

Navigation type.

string

**p**

required

Browser path. Query strings and hashes are stripped server-side.

string

**pid**

required

string format: uuid

**sid**

required

string format: uuid

**tsrc**

string

**tv**

string

**ua**

Optional browser user agent used transiently for traffic exclusions. The request header is the compatibility fallback.

string

**v**

required

Metric value. LCP, INP, FCP, and TTFB use milliseconds. CLS is unitless.

number

## Responses

### 202

Accepted

### 400

Invalid request

application/json

object

**message**

string

##### Examplegenerated

```
{
  "message": "example"
}
```

[Previous Preflight event ingest](https://hitkeep.com/api/operations/ingestevent/options/)[Next Preflight Web Vitals ingest](https://hitkeep.com/api/operations/ingestweb-vitals/options/)
