---
title: Get mapping
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > Rum Audience Management
---

# Get mapping{% #get-mapping %}
Copy pageCopied
{% tab title="v2" %}
**Note**: This endpoint may be subject to changes.
| Datadog site      | API endpoint                                                                |
| ----------------- | --------------------------------------------------------------------------- |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/product-analytics/{entity}/mapping |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/product-analytics/{entity}/mapping |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/product-analytics/{entity}/mapping      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/product-analytics/{entity}/mapping      |
| us2.ddog-gov.com  | GET https://api.us2.ddog-gov.com/api/v2/product-analytics/{entity}/mapping  |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/product-analytics/{entity}/mapping     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/product-analytics/{entity}/mapping |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/product-analytics/{entity}/mapping |

### Overview

Get entity mapping configuration including all available attributes and their properties

### Arguments

#### Path Parameters

| Name                     | Type   | Description                             |
| ------------------------ | ------ | --------------------------------------- |
| entity [*required*] | string | The entity for which to get the mapping |

### Response

{% tab title="200" %}
Successful response with entity mapping configuration
{% tab title="Model" %}
Response containing the entity attribute mapping configuration including all available attributes and their properties.

| Parent field | Field                  | Type     | Description                                                                                  |
| ------------ | ---------------------- | -------- | -------------------------------------------------------------------------------------------- |
|              | data                   | object   | The data object containing the resource type and attributes for the get mapping response.    |
| data         | attributes             | object   | Attributes of the get mapping response, containing the list of configured entity attributes. |
| attributes   | attributes             | [object] | The list of entity attributes and their mapping configurations.                              |
| attributes   | attribute              | string   | The attribute identifier as used in the entity data model.                                   |
| attributes   | description            | string   | Human-readable explanation of what the attribute represents.                                 |
| attributes   | display_name           | string   | The human-readable label for the attribute shown in the UI.                                  |
| attributes   | groups                 | [string] | List of group labels used to categorize the attribute.                                       |
| attributes   | is_custom              | boolean  | Whether this attribute is a custom user-defined attribute rather than a built-in one.        |
| attributes   | type                   | string   | The data type of the attribute (for example, string or number).                              |
| data         | id                     | string   | Unique identifier for the get mapping response resource.                                     |
| data         | type [*required*] | enum     | Get mappings response resource type. Allowed enum values: `get_mappings_response`            |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "attributes": [
        {
          "attribute": "user_id",
          "description": "Unique user identifier",
          "display_name": "User ID",
          "groups": [
            "Identity"
          ],
          "is_custom": false,
          "type": "string"
        },
        {
          "attribute": "user_email",
          "description": "User email address",
          "display_name": "Email Address",
          "groups": [
            "Identity",
            "Contact"
          ],
          "is_custom": false,
          "type": "string"
        },
        {
          "attribute": "first_country_code",
          "description": "The ISO code of the country for the user's first session",
          "display_name": "First Country Code",
          "groups": [
            "Geography"
          ],
          "is_custom": false,
          "type": "string"
        },
        {
          "attribute": "@customer_tier",
          "description": "Customer subscription tier",
          "display_name": "Customer Tier",
          "groups": [
            "Business"
          ],
          "is_custom": true,
          "type": "string"
        }
      ]
    },
    "id": "get_mappings_response",
    "type": "get_mappings_response"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

### Code Example

##### 
                  \# Path parameters export entity="users" \# Curl command curl -X GET "https://api.datadoghq.com/api/v2/product-analytics/${entity}/mapping" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" 
                
##### 

```python
"""
Get mapping returns "Successful response with entity mapping configuration" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.rum_audience_management_api import RumAudienceManagementApi

configuration = Configuration()
configuration.unstable_operations["get_mapping"] = True
with ApiClient(configuration) as api_client:
    api_instance = RumAudienceManagementApi(api_client)
    response = api_instance.get_mapping(
        entity="users",
    )

    print(response)
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=python) and then save the example to `example.py` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
##### 

```ruby
# Get mapping returns "Successful response with entity mapping configuration" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.get_mapping".to_sym] = true
end
api_instance = DatadogAPIClient::V2::RumAudienceManagementAPI.new
p api_instance.get_mapping("users")
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=ruby) and then save the example to `example.rb` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
##### 

```go
// Get mapping returns "Successful response with entity mapping configuration" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)

func main() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.GetMapping", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewRumAudienceManagementApi(apiClient)
	resp, r, err := api.GetMapping(ctx, "users")

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `RumAudienceManagementApi.GetMapping`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `RumAudienceManagementApi.GetMapping`:\n%s\n", responseContent)
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=go) and then save the example to `main.go` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
##### 

```java
// Get mapping returns "Successful response with entity mapping configuration" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.RumAudienceManagementApi;
import com.datadog.api.client.v2.model.GetMappingResponse;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    defaultClient.setUnstableOperationEnabled("v2.getMapping", true);
    RumAudienceManagementApi apiInstance = new RumAudienceManagementApi(defaultClient);

    try {
      GetMappingResponse result = apiInstance.getMapping("users");
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling RumAudienceManagementApi#getMapping");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```rust
// Get mapping returns "Successful response with entity mapping configuration"
// response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_rum_audience_management::RumAudienceManagementAPI;

#[tokio::main]
async fn main() {
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.GetMapping", true);
    let api = RumAudienceManagementAPI::with_config(configuration);
    let resp = api.get_mapping("users".to_string()).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Get mapping returns "Successful response with entity mapping configuration" response
 */

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.getMapping"] = true;
const apiInstance = new v2.RumAudienceManagementApi(configuration);

const params: v2.RumAudienceManagementApiGetMappingRequest = {
  entity: "users",
};

apiInstance
  .getMapping(params)
  .then((data: v2.GetMappingResponse) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}
