> ## Documentation Index
> Fetch the complete documentation index at: https://integration.delogue.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Read measurement charts

> Retrieve a style's measurement chart, its graded lines with per-size values, and the measurement files that ship alongside it.

<Info>
  **When to use this.** A measurement chart holds the graded measurements for a style — one
  line per point of measure, one value per size, computed cumulatively from the grading size.
  These endpoints are **read-only**: use them to pull a style's chart, its lines and per-size
  values, and the measurement files attached to the style. Charts are created and edited in
  Delogue Classic and the Delogue 2.0 UI; the API surfaces them for reporting and integration.
</Info>

## The workflow

A chart hangs off a style. It carries a size range, a grading size, a unit, and a set of
measurement lines; each line carries the entered value and a server-computed value for every
size. Measurement files (tech-pack PDFs, grading sheets) live beside the chart on the style.
You can reach a chart either directly by its id or through the style it belongs to.

<Steps>
  <Step title="Find a chart">
    `GET /api/measurement-charts` with `styleId` or `sizeRangeId` filters (plus sort and paging)
    to locate charts. The list returns chart headers only — no lines — so it stays fast.
  </Step>

  <Step title="Read the chart">
    `GET /api/measurement-charts/{chartId}` returns the full chart: header, size range, grading
    size, `properties` flags, and every line with its per-size `value` and `computedValue`.
  </Step>

  <Step title="Read the lines on their own">
    `GET /api/measurement-charts/{chartId}/lines` returns just the lines, ordered by `position`,
    when you already hold the chart header and only need the graded values.
  </Step>

  <Step title="Or go through the style">
    `GET /api/styles/{styleId}/measurement-chart` returns the same chart addressed by its style,
    and `GET /api/styles/{styleId}/measurement-chart/files` returns the style's measurement
    files. For a linked (copy) style, the files come from the master style.
  </Step>
</Steps>

```mermaid theme={"dark"}
sequenceDiagram
  participant D as Designer
  participant API as Delogue API
  D->>API: GET /api/measurement-charts?styleId=10427
  API-->>D: chart headers (no lines)
  D->>API: GET /api/measurement-charts/{chartId}
  API-->>D: chart + graded lines + per-size values
  D->>API: GET /api/styles/{styleId}/measurement-chart/files
  API-->>D: measurement files
```

## Walkthrough

Read the measurement chart for a style, then the files that ship with it. The chart response
carries the graded lines inline; each measurement shows both the `value` entered for the size
and the `computedValue` calculated server-side from the grading size.

<CodeGroup>
  ```bash cURL theme={"dark"}
  curl "https://service.my.delogue.com/api/measurement-charts" \
    -H "Accept: application/json" \
    -H "X-Auth-Token: Bearer YOUR_API_KEY"
  ```

  ```js JavaScript theme={"dark"}
  const res = await fetch("https://service.my.delogue.com/api/measurement-charts", {
    method: "GET",
    headers: {
      "Accept": "application/json",
      "X-Auth-Token": "Bearer YOUR_API_KEY",
    },
  });
  const { data } = await res.json();
  ```
</CodeGroup>

```json theme={"dark"}
{
  "status": "success",
  "code": "measurement_charts_retrieved",
  "data": [
    {
      "id": 4821,
      "styleId": 10427,
      "sizeRange": {
        "id": 55,
        "name": "Ladies XS-XL",
        "customId": "LDS"
      },
      "gradingSize": {
        "id": 312,
        "name": "M"
      },
      "unit": "cm",
      "properties": [
        "useFraction"
      ]
    },
    {
      "id": 4822,
      "styleId": 10510,
      "sizeRange": {
        "id": 56,
        "name": "Mens S-XXL",
        "customId": null
      },
      "gradingSize": {
        "id": 320,
        "name": "L"
      },
      "unit": "cm",
      "properties": []
    }
  ],
  "pagination": {
    "hasMore": true,
    "cursor": "eyJTaWduYXR1cmUiOiJhYmMxMjMifQ=="
  }
}
```

The `computedValue` on each measurement is derived — you do not send it. It accumulates from
the grading size outward, and resolves through each size's related size when the size range uses
advanced grading. Only **active** files are returned by the files endpoint.

## Field reference

The fields that matter most when reading a chart, its lines, and its files:

| Field         | What it means at Delogue                                                                                                                          |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| `gradingSize` | The base (grading) size that the chart's other sizes are graded from.                                                                             |
| `id`          | Unique identifier of the measurement chart.                                                                                                       |
| `properties`  | Chart boolean flags as a string array. Possible values: isLocked, hideInActiveSizes, isLink, hideTags, useFraction. A flag's absence means false. |
| `sizeRange`   | The size range the chart is built on.                                                                                                             |
| `styleId`     | Id of the style this chart is listed under (the representative style using the chart), or null when none applies.                                 |
| `unit`        | Free-text unit label for the chart's measurements, for example cm or inch.                                                                        |

## Roles & permissions

Reading measurement charts requires **style read** access — the same `styles` permission that
gates the style itself, on a **designer (brand)** account, typically `CompanyAdmin` or
`CompanyUser`. Every chart endpoint applies this check, so a same-org user without style read
permission is refused even though the data is in their organisation. A chart or style that
belongs to another organisation returns `403`; an id that exists nowhere returns `404`.

## When things go wrong

Errors use the standard envelope (`status: "error"`, a `code`, and `error.details[]`). A
cross-organisation `chartId` or `styleId` returns `403`; a genuinely missing id returns `404`.
See [Errors & responses](/concepts/errors) for the full list of codes and how to resolve them.

## What to call next

<CardGroup cols={2}>
  <Card title="Styles" href="/guides/styles">
    Charts hang off styles — create and manage the styles they belong to.
  </Card>

  <Card title="Size ranges" href="/guides/size-ranges">
    A chart is built on a size range and grades from its grading size.
  </Card>

  <Card title="Measurement files" href="/api-reference/measurementcharts/get-measurement-files-for-a-style">
    Fetch the files on a style: `GET /api/styles/{styleId}/measurement-chart/files`.
  </Card>

  <Card title="Authentication" href="/authentication">
    How to get and send your `X-Auth-Token` API key.
  </Card>
</CardGroup>
