Metrics

Create a metric.

post/v2/metrics

Headers

Idempotency-Keystring

Non-empty idempotency key for deduplicating write requests on the same route.

Example:6f31c20e-725c-4be8-96f4-835042f67602

Optional. Duplicate keys within the same company namespace and route return 409.

Request body

namestring required

Human-readable name. Maximum 256 Unicode scalar values.

descriptionstring nullable

Optional description. Maximum 2048 Unicode scalar values.

measurement_unitsstring nullable

Optional unit of measure for the metric, such as m, ft, seconds, or tokens.

Example request

{
  "name": "Acme",
  "description": "Usage tracked for Acme.",
  "measurement_units": "m"
}

Response

Created.

idstring required

LedgerUp metric identifier.

namestring required

Human-readable name. Maximum 256 Unicode scalar values.

descriptionstring nullable required

Optional description. Maximum 2048 Unicode scalar values.

measurement_unitsstring nullable required

Optional unit of measure for the metric, such as m, ft, seconds, or tokens.

created_atinteger required

Unix timestamp in seconds.

updated_atinteger required

Unix timestamp in seconds.

archived_atinteger required

Unix timestamp in seconds.

Example response

{
  "id": "metric_0194f4e3a2b77c6aa91c4f6b4db2a980",
  "name": "Acme",
  "description": "Usage tracked for Acme.",
  "measurement_units": "m",
  "created_at": 1767225600,
  "updated_at": 1767225600,
  "archived_at": 1767225600
}

Changes