Metrics
POST
/api/v1/metrics/parse-bulk

Parse a multi-label rubric into a list of independent metric drafts.

Each "Label #N" block becomes its own un-persisted draft metric the user can edit (name, type, capture_rationale, ...) before POSTing to /metrics individually. Defaults are chosen so the most common case ("did happen?") is one click away: metric_type="boolean" with capture_rationale=True.

The endpoint does NOT write to the database.

Authorization

AuthorizationBearer <token>

JWT access token. Use: Authorization: Bearer .

In: header

Header Parameters

X-Workspace-Id?string|null
Authorization?string|null
X-API-Key?string|null
X-EFFICIENTAI-API-KEY?string|null

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Request body for bulk-importing multiple metrics from a prompt.

Optional hierarchy fields let the bulk import produce a parent category metric with the parsed labels as children instead of N independent top-level metrics.

Response Body

application/json

application/json

curl -X POST "https://example.com/api/v1/metrics/parse-bulk" \  -H "Content-Type: application/json" \  -d '{    "prompt": "string"  }'
{  "metrics": [    {      "name": "string",      "description": "string",      "metric_type": "rating",      "custom_data_type": "boolean",      "custom_config": {},      "supported_surfaces": [        "string"      ],      "enabled_surfaces": [        "string"      ],      "capture_rationale": true,      "suggested_tags": [        "string"      ],      "source_label": {        "label_name": "string",        "definition": "",        "examples": ""      }    }  ],  "parent": {    "name": "string",    "description": "string",    "selection_mode": "single_choice",    "supported_surfaces": [      "string"    ],    "enabled_surfaces": [      "string"    ]  }}

Community & contact

  1. Found a bug or have a feature request? Open a GitHub issue.
  2. Join our Discord for faster replies!