---
title: "Post Custom Metrics"
method: POST
path: "/api/v1/report/metric"
tags: ["Report Metric"]
---

# Post Custom Metrics

`POST /api/v1/report/metric`

## Request

- Base URL: `https://public-api.linearb.io`
- URL: `https://public-api.linearb.io/api/v1/report/metric`
- Auth: API key in header `x-api-key`
- TypeScript: <https://skmtc.dev/linearb/apis/linearb-api/docs/api/v1/report/metric/post.ts> (a function with typed inputs; its response is checked against the schema)

Post report event
This API allows you to report events in order to be able to query later in LinearB platform

## Request body

- PostCustomMetricModel
  - `metric_name` string, required: The metric you are reporting
  - `timestamp` union, required: Timestamp at which the event happened
    - string
    - integer
  - `value` number: Float value representing metric
  - `source` string: Source of the event
  - `entity` object: Entity defining the branch/pr url being reported
  - `tags` object: Any tags that can help identify the event later on

## Response `200`

Successful Response

- PostCustomMetricResponseModel
  - `message` string, required
  - `event_uuid` string

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `405`: Method Not Allowed
- `409`: Conflict
- `422`: Validation Error
- `500`: Internal server error
- `504`: Gateway Timeout

---

[API](https://skmtc.dev/linearb/apis/linearb-api.md) - [All operations](https://skmtc.dev/linearb/apis/linearb-api/llms.txt) - [OpenAPI document](https://skmtc.dev/linearb/apis/linearb-api/revisions/3aea06710db6?raw)
