---
title: "Bulk create test metrics"
method: POST
path: "/ai/tests/test_framework/v1/metrics/bulk_create"
tags: ["AI Tests"]
---

# Bulk create test metrics

`POST /ai/tests/test_framework/v1/metrics/bulk_create`

## Request

- Base URL: `https://api.telnyx.com/v2`
- URL: `https://api.telnyx.com/v2/ai/tests/test_framework/v1/metrics/bulk_create`
- Auth: HTTP bearer

Creates several metrics in one request. Accepts an array of metric objects and returns the created metrics.

## Request body

- CreateAiTestMetricRequest[]
  - `name` string, required
  - `description` string
  - `type` string: How the metric is evaluated: custom_code or llm_judge.
  - `eval_type` string: What the metric scores: numeric, continuous_qualitative, or binary_workflow_adherence.
  - `prompt` string: Judge prompt used by llm_judge metrics.
  - `enum_values` string[]
  - `agents` integer[]
  - `assistant_id` string
  - `add_to_new_agents` boolean, nullable
  - `simulation_enabled` boolean
  - `observability_enabled` boolean
  - `sampling_enabled` boolean
  - `audio_enabled` boolean
  - `display_order` integer

## Response `200`

Test metrics created.

- AiTestMetric[]
  - `id` integer, required
  - `slug` string, nullable: Stable identifier of a built-in metric.
  - `project` integer, nullable
  - `agent` integer, nullable
  - `agents` integer[]: Test agent IDs the metric is attached to.
  - `agent_names` string[]
  - `name` string, required
  - `description` string
  - `function_name` string, nullable: Built-in evaluation function used by custom_code metrics.
  - `type` string, required: How the metric is evaluated: custom_code or llm_judge.
  - `eval_type` string, required: What the metric scores: numeric, continuous_qualitative, or binary_workflow_adherence.
  - `enum_values` string[]: Allowed values for qualitative enum metrics.
  - `audio_enabled` boolean
  - `observability_enabled` boolean
  - `simulation_enabled` boolean
  - `sampling_enabled` boolean
  - `sample_rate` number, nullable
  - `prompt` string: Judge prompt used by llm_judge metrics.
  - `display_order` integer
  - `evaluation_trigger` string
  - `trigger_type` string
  - `evaluation_trigger_prompt` string
  - `evaluation_trigger_custom_code` string
  - `priority_assignment_prompt` string
  - `configuration` object, nullable
  - `overall_score` union
    - number
    - string
  - `total_score` union
    - number
    - string
  - `kb_file_ids` integer[]
  - `knowledge_base_files` string[]
  - `metric_cost` number
  - `alert_type` string
  - `significant_change_alert_status` string
  - `significant_change_alert_direction` string
  - `window_size` integer: Sliding window size the alert status is computed over.
  - `std_multiplier` number: Standard-deviation multiplier for significant-change alerts.
  - `ewma_alpha` number: Smoothing factor for the alert trend.
  - `add_to_new_agents` boolean, nullable: Whether the metric is attached to newly created test agents by default.
  - `alert_filters` object, nullable
  - `uses_llm_judge` boolean
  - `user_defined` boolean

## Other responses

- `400`: Bad Request. The AI Tests service rejected the request.
- `401`: Unauthorized. Missing or invalid API key.
- `404`: Not Found. The requested resource does not exist or is not enabled for your account.
- `422`: Unprocessable Entity. A validation error occurred.
- `429`: Too Many Requests. The AI Tests service rate-limited the request.
- `503`: Service Unavailable. The AI Tests service is unavailable.

## Changes

> 152 revisions in range; 1 not diffed.

- **2026-10-22** `09b2e45a88da`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/team-telnyx/apis/telnyx-api-2/changes/ai/tests/test_framework/v1/metrics/bulk_create/post.md)

---

[API](https://skmtc.dev/team-telnyx/apis/telnyx-api-2.md) - [All operations](https://skmtc.dev/team-telnyx/apis/telnyx-api-2/llms.txt) - [OpenAPI document](https://skmtc.dev/team-telnyx/apis/telnyx-api-2/revisions/f82938f53ff4?raw)
