---
updatedAt: 2026-04-21T03:40:36.000Z
agentTools:
  projectIndex: https://docs.ternary.app/llms.txt
---

# Create measure preferences

Create measure display preferences for a specific data source. Measure preferences control the order and visibility of measures in reports and dashboards.

Each preference specifies a `category`, a `priority` (lower numbers appear first), and a list of measure schema field names in `values`.

Priorities must be unique consecutive integers starting at 1. Current limitation: create requests accept fewer than ten categories with this consecutive sequence. PATCH does not require a consecutive priority sequence.

Category priority orders groups. Values must exactly match Analytics schema field names, including their namespace. Within each group the UI sorts options alphabetically by display label, not by the order of values in this array.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Core API",
    "description": "Ternary Resource Management API",
    "version": "1.0.0",
    "contact": {},
    "license": {
      "name": "MIT",
      "identifier": "MIT"
    }
  },
  "tags": [
    {
      "name": "Measure Preferences",
      "description": "Manage measure display preferences for data sources."
    }
  ],
  "servers": [
    {
      "url": "https://core-api.ternary.app/api",
      "description": "Core API"
    },
    {
      "url": "https://core-api.eu.ternary.app/api",
      "description": "Core API (EU)"
    }
  ],
  "externalDocs": {
    "description": "Raw JSON",
    "url": "https://core-api.ternary.app/api/docs.json"
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },
    "schemas": {
      "DataSource": {
        "type": "string",
        "enum": [
          "ALERT_EVENTS",
          "AWS_COMMITMENT_ALLOCATION",
          "AWS_COMMITMENT_CHART",
          "AWS_COMMITMENT_TABLE",
          "AWS_COMPUTE_INSTANCES",
          "AWS_COMPUTE_UTILIZATION",
          "AWS_COMPUTE_VISIBILITY",
          "AWS_DATABASE_ELASTICACHE",
          "AWS_DATABASE_INSTANCES",
          "AWS_DATABASE_MEMORY_DB",
          "AWS_DATABASE_VISIBILITY",
          "AWS_EBS_VISIBILITY",
          "AWS_EBS_VOLUMES",
          "AWS_KUBERNETES_INSTANCES",
          "AWS_KUBERNETES_NODE_COST",
          "AWS_KUBERNETES_NODE_USAGE",
          "AWS_OPEN_SEARCH_VISIBILITY",
          "AWS_REDSHIFT_VISIBILITY",
          "AWS_STORAGE_VISIBILITY",
          "AZURE_COMMITMENT_CHART",
          "AZURE_COMMITMENT_TABLE",
          "AZURE_COMPUTE_VISIBILITY",
          "AZURE_KUBERNETES_NODE_USAGE",
          "AZURE_SQL_VISIBILITY",
          "AZURE_STORAGE_VISIBILITY",
          "BIGQUERY_CAPACITY_COMMITTED",
          "BIGQUERY_COST",
          "BIGQUERY_RESERVATION_USAGE",
          "BIGQUERY_STORAGE",
          "BIGQUERY_TIMELINE",
          "BIGQUERY_USAGE",
          "CARBON_FOOTPRINT",
          "CLOUD_RUN_SERVICES",
          "CLOUD_RUN",
          "CLOUD_SPANNER_USAGE",
          "CLOUD_SPANNER",
          "CLOUD_SQL_COST",
          "CLOUD_SQL_INSTANCE_USAGE_DAILY",
          "CLOUD_SQL_INSTANCE_USAGE",
          "COMMITTED_USE",
          "DATABRICKS_BILLING_USAGE",
          "DATABRICKS_NODE_TIMELINE",
          "EXTERNAL_METRICS",
          "FOCUS_BILLING",
          "GCP_BIGQUERY_COMMITMENT_INVENTORY",
          "GCP_COMBINED_CUD_UTILIZATION",
          "GCP_COMPUTE_CUD_INVENTORY",
          "GCP_COMPUTE_CUD_SPEND_INVENTORY",
          "GCP_COMPUTE_CUD_UTILIZATION",
          "GCP_COMPUTE_INSTANCES",
          "GCP_COMPUTE_VISIBILITY",
          "GCP_CUD_COVERABLE_COST",
          "GCP_CUSTOM_PRICING",
          "KUBERNETES_CLUSTER_USAGE",
          "KUBERNETES_CONTAINER_USAGE",
          "KUBERNETES_NODE_USAGE",
          "MSP_ROLLUP",
          "PREDICTION_BOUNDS",
          "SNOWFLAKE_DATABASE_USAGE_METER_HELPER",
          "SNOWFLAKE_DATABASE_USAGE",
          "SNOWFLAKE_WAREHOUSE_USAGE",
          "STORAGE_COST",
          "STORAGE_USAGE"
        ],
        "description": "A billing or usage dataset that a report, rule, or alert reads from."
      },
      "FailureResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "HTTP status code",
            "example": "400 - Bad Request"
          },
          "message": {
            "type": "string",
            "description": "Error message",
            "example": "ERROR_INVALID_PARAMS"
          },
          "reason": {
            "type": "string",
            "description": "Error reason code"
          }
        },
        "required": [
          "code",
          "message"
        ]
      },
      "CreateMeasurePreferencesResponseBody": {
        "type": "object",
        "properties": {
          "preferenceIDs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "preferenceIDs"
        ]
      },
      "CreateMeasurePreferencesRequestBody": {
        "type": "object",
        "properties": {
          "tenantID": {
            "type": "string",
            "format": "uuid",
            "description": "A unique identifier for an organization",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
            "example": "92f36764-5af2-4ff5-a494-d841f32040be"
          },
          "dataSource": {
            "allOf": [
              {
                "$ref": "#/components/schemas/DataSource"
              },
              {
                "description": "Data source"
              }
            ]
          },
          "preferences": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "category": {
                  "type": "string",
                  "description": "Measure category"
                },
                "priority": {
                  "type": "number",
                  "description": "Order in which it appears in the UI"
                },
                "values": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "Measure values"
                }
              },
              "required": [
                "category",
                "priority",
                "values"
              ]
            },
            "description": "Measure preferences"
          }
        },
        "required": [
          "tenantID",
          "dataSource",
          "preferences"
        ]
      }
    }
  },
  "paths": {
    "/measure-preferences": {
      "post": {
        "summary": "Create measure preferences",
        "tags": [
          "Measure Preferences"
        ],
        "operationId": "createMeasurePreference",
        "description": "Create measure display preferences for a specific data source. Measure preferences control the order and visibility of measures in reports and dashboards.\n\nEach preference specifies a `category`, a `priority` (lower numbers appear first), and a list of measure schema field names in `values`.\n\nPriorities must be unique consecutive integers starting at 1. Current limitation: create requests accept fewer than ten categories with this consecutive sequence. PATCH does not require a consecutive priority sequence.\n\nCategory priority orders groups. Values must exactly match Analytics schema field names, including their namespace. Within each group the UI sorts options alphabetically by display label, not by the order of values in this array.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateMeasurePreferencesRequestBody"
              },
              "examples": {
                "createMeasurePreference": {
                  "value": {
                    "tenantID": "92f36764-5af2-4ff5-a494-d841f32040be",
                    "dataSource": "FOCUS_BILLING",
                    "preferences": [
                      {
                        "category": "PREFERRED",
                        "priority": 1,
                        "values": [
                          "TERNARY_MULTI_CLOUD_FIELD/AbsoluteCredits"
                        ]
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateMeasurePreferencesResponseBody"
                },
                "examples": {
                  "createMeasurePreference": {
                    "value": {
                      "preferenceIDs": [
                        "664c39dc-9472-4da8-bbcb-77b0cba48373"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResponse"
                },
                "examples": {
                  "400Response": {
                    "value": {
                      "code": "400 - Bad Request",
                      "message": "ERROR_INVALID_PARAMS"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResponse"
                },
                "examples": {
                  "401Response": {
                    "value": {
                      "code": "401 - Unauthorized",
                      "message": "ERROR_UNAUTHORIZED"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResponse"
                },
                "examples": {
                  "403Response": {
                    "value": {
                      "code": "403 - Forbidden",
                      "message": "ERROR_PERMISSION_DENIED"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "x-tagGroups": [
    {
      "name": "Core API",
      "tags": [
        "Alert Rule",
        "Alert Rule Events",
        "API Keys",
        "AWS Rate Recommendations",
        "Azure Rate Recommendations",
        "Billing Rules",
        "Budget",
        "Cases",
        "Cost Alerts",
        "Custom Label",
        "Custom Measures",
        "Data Integration",
        "Data Integration: Alibaba",
        "Data Integration: AWS",
        "Data Integration: Azure",
        "Data Integration: Custom Data",
        "Data Integration: Databricks",
        "Data Integration: GCP",
        "Data Integration: Oracle",
        "Data Integration: Snowflake",
        "Dimension Preferences",
        "GCP Rate Recommendations",
        "Integrations",
        "Label Map",
        "MCP Availability",
        "MCP Client Usage",
        "Measure Preferences",
        "MSP Billing Information",
        "MSP Child",
        "MSP Shared Payer Integrations",
        "MSP Tenant Settings",
        "Permissions",
        "Ramp Plans",
        "Report",
        "Resource Subscriptions",
        "Role",
        "Savings Opportunity Filter",
        "Scoped View",
        "Support Tickets",
        "Tenant",
        "Tenant SSO Config",
        "Usage Recommendations",
        "User",
        "User Group Config"
      ]
    }
  ]
}
```