---
title: "Sets a metric for a Job"
method: POST
path: "/api/v1/jobs/{id}/metrics"
tags: ["Job"]
---

# Sets a metric for a Job

`POST /api/v1/jobs/{id}/metrics`

## Path parameters

- `id` integer, required

## Headers

- `X-Fields` string, mask

## Request body

- MetricsLoad
  - `name` string, required — The name of the metric.
  - `value` number, required — The value of the metric. Can be a float, NaN, Infinity, or -Infinity. NaN values are represented with the string "nan" and infinite values are represented with the strings "inf" and "-inf".
  - `step` integer — The step value for the metric, optional. Sequentially increasing step values are used to track how a metric changes over time. Indexed from 0. If not provided, defaults to 0.
  - `timestamp` string, date-time — A timestamp value to associate with the metric. If not provided, defaults to the server time when the metric is received.

## Response `200`

Success

- MetricsDump
  - `name` string, required — The name of the metric.
  - `value` number, required — The value of the metric. Can be a float, NaN, Infinity, or -Infinity. NaN values are represented with the string "nan" and infinite values are represented with the strings "inf" and "-inf".

---

[API](https://skmtc.net/usnistgov/apis/dioptra-rest-api.md) · [All operations](https://skmtc.net/usnistgov/apis/dioptra-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/usnistgov/dioptra-rest-api/versions/a73101579c5c/schema)
