> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.coperniq.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.coperniq.io/_mcp/server.

# List Measurements

GET https://api.coperniq.io/v1/measurements

Lists the measurements (and sub-measurements) available to your company. Use these IDs when
setting `measurementIds` on a catalog item. A "sub-measurement" is a measurement with
`type: SUB_CALCULATION`.


Reference: https://docs.coperniq.io/api-reference/measurements/list-measurements

## Authentication

- `x-api-key` header (required) — API Key authentication via header

## Request

### Query parameters

- `type` (enum, optional) — Filter by measurement type
  - Allowed values: `MEASUREMENT`, `SUB_CALCULATION`
- `include_archived` (boolean, optional, default: false) — Whether to include archived (inactive) records in the response. By default only active records are returned.
- `page` (integer, optional, default: 1) — Page number (1-based)
- `page_size` (integer, optional, default: 20) — Number of items per page (max 100)

## Response

### 200

List of measurements

- `list of Measurement`

## Errors

### 400 Bad Request Error

Invalid request

- `message` (string, optional)
- `code` (enum, optional)
  - Allowed values: `GRAPHQL_ERROR`
- `field` (string, optional) — Field that caused the validation error (if applicable)

### 401 Unauthorized Error

Authentication failed

- `message` (string, optional)
- `code` (enum, optional)
  - Allowed values: `GRAPHQL_ERROR`

### 502 Bad Gateway Error

Bad Gateway — downstream GraphQL service returned errors

- `message` (string, required) — Summary of the downstream service failure
- `code` (enum, required)
  - Allowed values: `GRAPHQL_ERROR`

## Types

### Measurement

A named measurement or sub-calculation that a catalog item can link to (via `measurementIds`) to drive its quantity. A "sub-measurement" is simply a Measurement with `type: SUB_CALCULATION` — not a separate structure.

- `id` (integer, required) — Measurement identifier
- `name` (string, required) — Measurement name
- `type` (enum, required) — A plain MEASUREMENT is a raw input value; a SUB_CALCULATION ("sub-measurement") derives its value from a formula over other measurements.
  - Allowed values: `MEASUREMENT`, `SUB_CALCULATION`
- `unit` (CatalogUnit, optional, nullable) — The unit this measurement is expressed in, if any.
- `minimumValue` (double, optional, nullable) — Minimum allowed value. Only meaningful for type MEASUREMENT.
- `formula` (MeasurementFormula, optional) — The formula driving a SUB\_CALCULATION measurement's quantity. Read-only — there is no API to create or edit a measurement's formula; it can only be authored in the app. Shape: `operands` names each referenced measurement (`{name, measurementId}`); `ast` is a binary-operation tree (`ADD`/`SUB`/`MUL`/`DIV`) whose leaves are either `{operandRef}` (referencing an entry in `operands` by name) or `{constant}` (a literal number); `sourceText` is the original formula text as authored.
- `isArchived` (boolean, optional) — Whether this measurement has been archived.

### CatalogUnit

A unit of measure from the company's unit registry (e.g. Each, Square Feet, Linear Feet). Referenced by catalog items and measurements via `unitId`.

- `id` (integer, required) — Catalog unit identifier
- `code` (string, required) — Stable short code for the unit (e.g. "SF", "EA")
- `label` (string, required) — Human-readable label for the unit (e.g. "Square Feet")
- `dimension` (enum, optional, nullable) — The physical dimension this unit measures, if any. Null for packaging-style units (e.g. bundle, roll) that can't be used on a measurement.
  - Allowed values: `LENGTH`, `AREA`, `COUNT`
- `isCustom` (boolean, optional) — Whether this unit was defined by the company, as opposed to one of the seeded defaults.
- `isArchived` (boolean, optional) — Whether this unit has been archived.

### MeasurementFormula

The formula driving a SUB\_CALCULATION measurement's quantity. Read-only — there is no API to create or edit a measurement's formula; it can only be authored in the app. Shape: `operands` names each referenced measurement (`{name, measurementId}`); `ast` is a binary-operation tree (`ADD`/`SUB`/`MUL`/`DIV`) whose leaves are either `{operandRef}` (referencing an entry in `operands` by name) or `{constant}` (a literal number); `sourceText` is the original formula text as authored.

- `operands` (list of MeasurementFormulaOperandsItems, optional)
- `ast` (MeasurementFormulaAst, optional) — Binary-operation AST node or leaf. See the formula description above.
- `sourceText` (string, optional) — The formula as originally authored (e.g. "( m1 + m2 ) / 100")

### MeasurementFormulaOperandsItems

- `name` (string, optional)
- `measurementId` (integer, optional)

### MeasurementFormulaAst

Binary-operation AST node or leaf. See the formula description above.

## Examples

**Response**

```json
[
  {
    "id": 1,
    "name": "string",
    "type": "MEASUREMENT",
    "unit": {
      "id": 1,
      "code": "string",
      "label": "string",
      "dimension": "LENGTH",
      "isCustom": true,
      "isArchived": true
    },
    "minimumValue": 1.1,
    "formula": {
      "operands": [
        {
          "name": "string",
          "measurementId": 1
        }
      ],
      "ast": {},
      "sourceText": "string"
    },
    "isArchived": true
  }
]
```

**SDK Code**

```python
import requests

url = "https://api.coperniq.io/v1/measurements"

headers = {"x-api-key": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.coperniq.io/v1/measurements';
const options = {method: 'GET', headers: {'x-api-key': '<apiKey>'}};

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

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.coperniq.io/v1/measurements"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-api-key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.coperniq.io/v1/measurements")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.coperniq.io/v1/measurements")
  .header("x-api-key", "<apiKey>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.coperniq.io/v1/measurements', [
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.coperniq.io/v1/measurements");
var request = new RestRequest(Method.GET);
request.AddHeader("x-api-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["x-api-key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.coperniq.io/v1/measurements")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```