---
title: Preview catalog entities
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > Software Catalog
---

# Preview catalog entities{% #preview-catalog-entities %}
Copy pageCopied
{% tab title="v2" %}

| Datadog site      | API endpoint                                                     |
| ----------------- | ---------------------------------------------------------------- |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/catalog/entity/preview |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/catalog/entity/preview |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/catalog/entity/preview      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/catalog/entity/preview      |
| us2.ddog-gov.com  | POST https://api.us2.ddog-gov.com/api/v2/catalog/entity/preview  |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/catalog/entity/preview     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/catalog/entity/preview |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/catalog/entity/preview |

### Overview



OAuth apps require the `apm_service_catalog_read` authorization [scope](https://docs.datadoghq.com/api/latest/scopes.md#software-catalog) to access this endpoint.



### Response

{% tab title="202" %}
Accepted
{% tab title="Model" %}
Response object containing an array of entity data items.

| Parent field    | Field                  | Type     | Description                                                                                  |
| --------------- | ---------------------- | -------- | -------------------------------------------------------------------------------------------- |
|                 | data [*required*] | [object] | Array of entity response data items.                                                         |
| data            | attributes             | object   | Entity response attributes containing core entity metadata fields.                           |
| attributes      | apiVersion             | string   | The API version of the entity schema.                                                        |
| attributes      | description            | string   | A short description of the entity.                                                           |
| attributes      | displayName            | string   | The user-friendly display name of the entity.                                                |
| attributes      | kind                   | string   | The kind of the entity (e.g. service, datastore, queue).                                     |
| attributes      | name                   | string   | The unique name of the entity within its kind and namespace.                                 |
| attributes      | namespace              | string   | The namespace the entity belongs to.                                                         |
| attributes      | owner                  | string   | The owner of the entity, usually a team.                                                     |
| attributes      | properties             | object   | Additional custom properties for the entity.                                                 |
| attributes      | tags                   | [string] | A set of custom tags assigned to the entity.                                                 |
| data            | id                     | string   | Entity unique identifier.                                                                    |
| data            | relationships          | object   | Entity relationships including incidents, oncalls, schemas, and related entities.            |
| relationships   | incidents              | object   | Incidents relationship containing a list of incident resources associated with this entity.  |
| incidents       | data                   | [object] | List of incident relationship data items.                                                    |
| data            | id [*required*]   | string   | Incident resource unique identifier.                                                         |
| data            | type [*required*] | enum     | Incident resource type. Allowed enum values: `incident`                                      |
| relationships   | oncalls                | object   | Oncalls relationship containing a list of oncall resources associated with this entity.      |
| oncalls         | data                   | [object] | List of oncall relationship data items.                                                      |
| data            | id [*required*]   | string   | Oncall resource unique identifier.                                                           |
| data            | type [*required*] | enum     | Oncall resource type. Allowed enum values: `oncall`                                          |
| relationships   | rawSchema              | object   | Raw schema relationship linking an entity to its raw schema resource.                        |
| rawSchema       | data [*required*] | object   | Raw schema relationship data containing the raw schema resource identifier and type.         |
| data            | id [*required*]   | string   | Raw schema unique identifier.                                                                |
| data            | type [*required*] | enum     | Raw schema resource type. Allowed enum values: `rawSchema`                                   |
| relationships   | relatedEntities        | object   | Related entities relationship containing a list of entity references related to this entity. |
| relatedEntities | data                   | [object] | List of related entity relationship data items.                                              |
| data            | id [*required*]   | string   | Related entity unique identifier.                                                            |
| data            | type [*required*] | enum     | Related entity resource type. Allowed enum values: `relatedEntity`                           |
| relationships   | schema                 | object   | Schema relationship linking an entity to its associated schema resource.                     |
| schema          | data [*required*] | object   | Schema relationship data containing the schema resource identifier and type.                 |
| data            | id [*required*]   | string   | Entity schema unique identifier.                                                             |
| data            | type [*required*] | enum     | Schema resource type. Allowed enum values: `schema`                                          |
| data            | type [*required*] | enum     | Entity resource type. Allowed enum values: `entity`                                          |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": [
    {
      "attributes": {
        "apiVersion": "string",
        "description": "string",
        "displayName": "string",
        "kind": "string",
        "name": "string",
        "namespace": "string",
        "owner": "string",
        "properties": {},
        "tags": []
      },
      "id": "string",
      "relationships": {
        "incidents": {
          "data": [
            {
              "id": "",
              "type": "incident"
            }
          ]
        },
        "oncalls": {
          "data": [
            {
              "id": "",
              "type": "oncall"
            }
          ]
        },
        "rawSchema": {
          "data": {
            "id": "",
            "type": "rawSchema"
          }
        },
        "relatedEntities": {
          "data": [
            {
              "id": "",
              "type": "relatedEntity"
            }
          ]
        },
        "schema": {
          "data": {
            "id": "",
            "type": "schema"
          }
        }
      },
      "type": "entity"
    }
  ]
}
```

{% /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

##### 
                  \# Curl command curl -X POST "https://api.datadoghq.com/api/v2/catalog/entity/preview" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" 
                
##### 

```python
"""
Preview catalog entities returns "Accepted" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.software_catalog_api import SoftwareCatalogApi

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = SoftwareCatalogApi(api_client)
    response = api_instance.preview_catalog_entities()

    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
# Preview catalog entities returns "Accepted" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::SoftwareCatalogAPI.new
p api_instance.preview_catalog_entities()
```

#### 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
// Preview catalog entities returns "Accepted" 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()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewSoftwareCatalogApi(apiClient)
	resp, r, err := api.PreviewCatalogEntities(ctx)

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `SoftwareCatalogApi.PreviewCatalogEntities`:\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
// Preview catalog entities returns "Accepted" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.SoftwareCatalogApi;
import com.datadog.api.client.v2.model.EntityResponseArray;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    SoftwareCatalogApi apiInstance = new SoftwareCatalogApi(defaultClient);

    try {
      EntityResponseArray result = apiInstance.previewCatalogEntities();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling SoftwareCatalogApi#previewCatalogEntities");
      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
// Preview catalog entities returns "Accepted" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_software_catalog::SoftwareCatalogAPI;

#[tokio::main]
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = SoftwareCatalogAPI::with_config(configuration);
    let resp = api.preview_catalog_entities().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
/**
 * Preview catalog entities returns "Accepted" response
 */

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

const configuration = client.createConfiguration();
const apiInstance = new v2.SoftwareCatalogApi(configuration);

apiInstance
  .previewCatalogEntities()
  .then((data: v2.EntityResponseArray) => {
    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 %}
