---
title: "Get Metric ID for Mapped Metric"
description: "How to call Get Metric ID for Mapped Metric (GET /api/mapped-metrics/{id}/relationships/metric) in the Klaviyo REST API: authentication, parameters, request and response bodies, and an example request."
url: "https://developers.klaviyo.com/en/reference/get_metric_id_for_mapped_metric"
revision: "2026-10-15"
operationId: "get_metric_id_for_mapped_metric"
aliases: ["get_mapped_metric_relationships_metric"]
method: "GET"
endpoint: "https://a.klaviyo.com/api/mapped-metrics/{id}/relationships/metric"
authentication: "privateKey"
scopes: ["metrics:read"]
rateLimits: {"burst":"3/s","steady":"60/m"}
revisionHeader: {"name":"revision","required":true}
deprecated: false
openApi: "https://raw.githubusercontent.com/klaviyo/openapi/2026-10-15/openapi/stable/apis/get_metric_id_for_mapped_metric.json"
related: ["https://developers.klaviyo.com/en/reference/metrics/llms.txt","https://developers.klaviyo.com/en/reference/get_mapped_metrics.md","https://developers.klaviyo.com/en/reference/get_mapped_metric.md","https://developers.klaviyo.com/en/reference/update_mapped_metric.md","https://developers.klaviyo.com/en/reference/get_metric_for_mapped_metric.md","https://developers.klaviyo.com/en/reference/get_custom_metric_for_mapped_metric.md","https://developers.klaviyo.com/en/reference/get_custom_metric_id_for_mapped_metric.md"]
---

# Get Metric ID for Mapped Metric

> This is the Markdown version of https://developers.klaviyo.com/en/reference/get_metric_id_for_mapped_metric

```http
GET https://a.klaviyo.com/api/mapped-metrics/{id}/relationships/metric
```

Get the ID of the metric for the given mapped metric.

- Revision header: `revision: 2026-10-15` (required)
- Scopes: `metrics:read`
- Rate limits: Burst: `3/s`, Steady: `60/m`
- OpenAPI: [Download this endpoint's OpenAPI document](https://raw.githubusercontent.com/klaviyo/openapi/2026-10-15/openapi/stable/apis/get_metric_id_for_mapped_metric.json)

## Example request

### curl

```bash
curl --request GET \
     --url 'https://a.klaviyo.com/api/mapped-metrics/revenue/relationships/metric' \
     --header 'Authorization: Klaviyo-API-Key your-private-api-key' \
     --header 'accept: application/vnd.api+json' \
     --header 'revision: 2026-10-15'
```

### CLI

```bash
klaviyo metrics get-metric-id-for-mapped-metric revenue
```

Sign in first with `klaviyo auth login`. [Install the Klaviyo CLI](https://developers.klaviyo.com/en/docs/klaviyo_cli.md)

### Python

```python
from klaviyo_api import KlaviyoAPI

klaviyo = KlaviyoAPI("your-private-api-key")

response = klaviyo.Metrics.get_metric_id_for_mapped_metric("revenue")
```

Install it with `pip install klaviyo-api`. [The Python SDK on GitHub](https://github.com/klaviyo/klaviyo-api-python)

### Node.js

```javascript
import { ApiKeySession, MetricsApi } from 'klaviyo-api'

const session = new ApiKeySession('your-private-api-key')
const metricsApi = new MetricsApi(session)

const response = await metricsApi.getMetricIdForMappedMetric('revenue')
```

Install it with `npm install klaviyo-api`. [The Node.js SDK on GitHub](https://github.com/klaviyo/klaviyo-api-node)

### Ruby

```ruby
require 'klaviyo-api-sdk'

KlaviyoAPI.configure do |config|
  config.api_key['Klaviyo-API-Key'] = 'Klaviyo-API-Key your-private-api-key'
end

response = KlaviyoAPI::Metrics.get_metric_id_for_mapped_metric('revenue')
```

Install it with `gem install klaviyo-api-sdk`. [The Ruby SDK on GitHub](https://github.com/klaviyo/klaviyo-api-ruby)

### PHP

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

use KlaviyoAPI\KlaviyoAPI;

$klaviyo = new KlaviyoAPI('your-private-api-key');

$response = $klaviyo->Metrics->getMetricIdForMappedMetric('revenue');
```

Install it with `composer require klaviyo/api`. [The PHP SDK on GitHub](https://github.com/klaviyo/klaviyo-api-php)

## Path parameters

- `id` (string, required): The type of mapping. Allowed values: `added_to_cart`, `cancelled_sales`, `ordered_product`, `refunded_sales`, `revenue`, `started_checkout`, `viewed_product` Example: `revenue`

## Headers

- `revision` (string, required): API endpoint revision (format: YYYY-MM-DD[.suffix]) Default: `2026-10-15`

## Responses

### 200: Success

Content type: `application/vnd.api+json`

- `data` (object, required, nullable)
  - `type` (string, required): Allowed values: `metric`
  - `id` (string, required): The Metric ID
- `links` (object)
  - `self` (string<uri>, required)
- `meta` (object): Response-level metadata
  - `agent_hints` (object): Optional hints emitted by the API for agent callers
    - `next_steps` (string[]): Suggested follow-up actions for agents to take after this response

#### Example response body

```json
{
  "data": {
    "type": "metric",
    "id": "string"
  },
  "links": {
    "self": "https://www.example.com"
  },
  "meta": {
    "agent_hints": {
      "next_steps": [
        "string"
      ]
    }
  }
}
```

### 4XX: Client Error

Content type: `application/vnd.api+json`

- `errors` (object[], required)
  - `id` (string, required)
  - `code` (string, required)
  - `title` (string, required)
  - `detail` (string, required)
  - `source` (object)
    - `pointer` (string)
    - `parameter` (string)

#### Example response body

```json
{
  "errors": [
    {
      "id": "string",
      "code": "string",
      "title": "string",
      "detail": "string",
      "source": {
        "pointer": "string",
        "parameter": "string"
      }
    }
  ]
}
```

### 5XX: Server Error

Content type: `application/vnd.api+json`

- `errors` (object[], required)
  - `id` (string, required)
  - `code` (string, required)
  - `title` (string, required)
  - `detail` (string, required)
  - `source` (object)
    - `pointer` (string)
    - `parameter` (string)

#### Example response body

```json
{
  "errors": [
    {
      "id": "string",
      "code": "string",
      "title": "string",
      "detail": "string",
      "source": {
        "pointer": "string",
        "parameter": "string"
      }
    }
  ]
}
```
