---
title: Get all custom destinations
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > Logs Custom Destinations
---

# Get all custom destinations{% #get-all-custom-destinations %}
Copy pageCopied
{% tab title="v2" %}

| Datadog site      | API endpoint                                                             |
| ----------------- | ------------------------------------------------------------------------ |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/logs/config/custom-destinations |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/logs/config/custom-destinations |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/logs/config/custom-destinations      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/logs/config/custom-destinations      |
| us2.ddog-gov.com  | GET https://api.us2.ddog-gov.com/api/v2/logs/config/custom-destinations  |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/logs/config/custom-destinations     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/logs/config/custom-destinations |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/logs/config/custom-destinations |

### Overview

Get the list of configured custom destinations in your organization with their definitions. This endpoint requires any of the following permissions:
`logs_read_config``logs_read_data` 


### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
The available custom destinations.

| Parent field          | Field                                      | Type          | Description                                                                                                                                                                                                                      |
| --------------------- | ------------------------------------------ | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                       | data                                       | [object]      | A list of custom destinations.                                                                                                                                                                                                   |
| data                  | attributes                                 | object        | The attributes associated with the custom destination.                                                                                                                                                                           |
| attributes            | enabled                                    | boolean       | Whether logs matching this custom destination should be forwarded or not.                                                                                                                                                        |
| attributes            | forward_tags                               | boolean       | Whether tags from the forwarded logs should be forwarded or not.                                                                                                                                                                 |
| attributes            | forward_tags_restriction_list              | [string]      | List of [keys of tags](https://docs.datadoghq.com/getting_started/tagging.md#define-tags) to be filtered.                                                                                                                        | An empty list represents no restriction is in place and either all or no tags will be forwarded depending on `forward_tags_restriction_list_type` parameter.                                                                                                                                                                                                                                                            |
| attributes            | forward_tags_restriction_list_type         | enum          | How `forward_tags_restriction_list` parameter should be interpreted. If `ALLOW_LIST`, then only tags whose keys on the forwarded logs match the ones on the restriction list are forwarded.                                      | `BLOCK_LIST` works the opposite way. It does not forward the tags matching the ones on the list. Allowed enum values: `ALLOW_LIST,BLOCK_LIST`                                                                                                                                                                                                                                                                           |
| attributes            | forwarder_destination                      |  <oneOf> | A custom destination's location to forward logs.                                                                                                                                                                                 |
| forwarder_destination | Option 1                                   | object        | The HTTP destination.                                                                                                                                                                                                            |
| Option 1              | auth [*required*]                     |  <oneOf> | Authentication method of the HTTP requests.                                                                                                                                                                                      |
| auth                  | Option 1                                   | object        | Basic access authentication.                                                                                                                                                                                                     |
| Option 1              | type [*required*]                     | enum          | Type of the basic access authentication. Allowed enum values: `basic`                                                                                                                                                            |
| auth                  | Option 2                                   | object        | Custom header access authentication.                                                                                                                                                                                             |
| Option 2              | header_name [*required*]              | string        | The header name of the authentication.                                                                                                                                                                                           |
| Option 2              | type [*required*]                     | enum          | Type of the custom header access authentication. Allowed enum values: `custom_header`                                                                                                                                            |
| Option 1              | endpoint [*required*]                 | string        | The destination for which logs will be forwarded to. Must have HTTPS scheme and forwarding back to Datadog is not allowed.                                                                                                       |
| Option 1              | type [*required*]                     | enum          | Type of the HTTP destination. Allowed enum values: `http`                                                                                                                                                                        |
| forwarder_destination | Option 2                                   | object        | The Splunk HTTP Event Collector (HEC) destination.                                                                                                                                                                               |
| Option 2              | endpoint [*required*]                 | string        | The destination for which logs will be forwarded to. Must have HTTPS scheme and forwarding back to Datadog is not allowed.                                                                                                       |
| Option 2              | sourcetype                                 | string        | The Splunk sourcetype for the events sent to this Splunk destination.                                                                                                                                                            | If the field is absent from the request and no sourcetype has been previously set on this destination, the default sourcetype `_json` is used. On update, if the field is absent from the request but a sourcetype was previously set, the previous value is kept. If set to `null`, the sourcetype field is omitted from the forwarded event entirely. Otherwise, the provided string value is used as the sourcetype. |
| Option 2              | type [*required*]                     | enum          | Type of the Splunk HTTP Event Collector (HEC) destination. Allowed enum values: `splunk_hec`                                                                                                                                     |
| forwarder_destination | Option 3                                   | object        | The Elasticsearch destination.                                                                                                                                                                                                   |
| Option 3              | auth [*required*]                     | object        | Basic access authentication.                                                                                                                                                                                                     |
| additionalProperties  | <any-key>                                  |               | Basic access authentication.                                                                                                                                                                                                     |
| Option 3              | endpoint [*required*]                 | string        | The destination for which logs will be forwarded to. Must have HTTPS scheme and forwarding back to Datadog is not allowed.                                                                                                       |
| Option 3              | index_name [*required*]               | string        | Name of the Elasticsearch index (must follow [Elasticsearch's criteria](https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-create-index.html#indices-create-api-path-params)).                                 |
| Option 3              | index_rotation                             | string        | Date pattern with US locale and UTC timezone to be appended to the index name after adding `-` (that is, `${index_name}-${indexPattern}`). You can customize the index rotation naming pattern by choosing one of these options: | If this field is missing or is blank, it means that the index name will always be the same (that is, no rotation).                                                                                                                                                                                                                                                                                                      |
| Option 3              | type [*required*]                     | enum          | Type of the Elasticsearch destination. Allowed enum values: `elasticsearch`                                                                                                                                                      |
| forwarder_destination | Option 4                                   | object        | The Microsoft Sentinel destination.                                                                                                                                                                                              |
| Option 4              | client_id [*required*]                | string        | Client ID from the Datadog Azure integration.                                                                                                                                                                                    |
| Option 4              | data_collection_endpoint [*required*] | string        | Azure data collection endpoint.                                                                                                                                                                                                  |
| Option 4              | data_collection_rule_id [*required*]  | string        | Azure data collection rule ID.                                                                                                                                                                                                   |
| Option 4              | stream_name [*required*]              | string        | Azure stream name.                                                                                                                                                                                                               |
| Option 4              | tenant_id [*required*]                | string        | Tenant ID from the Datadog Azure integration.                                                                                                                                                                                    |
| Option 4              | type [*required*]                     | enum          | Type of the Microsoft Sentinel destination. Allowed enum values: `microsoft_sentinel`                                                                                                                                            |
| attributes            | name                                       | string        | The custom destination name.                                                                                                                                                                                                     |
| attributes            | query                                      | string        | The custom destination query filter. Logs matching this query are forwarded to the destination.                                                                                                                                  |
| data                  | id                                         | string        | The custom destination ID.                                                                                                                                                                                                       |
| data                  | type                                       | enum          | The type of the resource. The value should always be `custom_destination`. Allowed enum values: `custom_destination`                                                                                                             |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": [
    {
      "attributes": {
        "enabled": true,
        "forward_tags": true,
        "forward_tags_restriction_list": [
          "datacenter",
          "host"
        ],
        "forward_tags_restriction_list_type": "ALLOW_LIST",
        "forwarder_destination": {
          "auth": {
            "type": "basic"
          },
          "endpoint": "https://example.com",
          "type": "http"
        },
        "name": "Nginx logs",
        "query": "source:nginx"
      },
      "id": "be5d7a69-d0c8-4d4d-8ee8-bba292d98139",
      "type": "custom_destination"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="403" %}
Forbidden
{% 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 %}

{% 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 GET "https://api.datadoghq.com/api/v2/logs/config/custom-destinations" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" 
                
##### 

```python
"""
Get all custom destinations returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.logs_custom_destinations_api import LogsCustomDestinationsApi

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = LogsCustomDestinationsApi(api_client)
    response = api_instance.list_logs_custom_destinations()

    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="<API-KEY>" DD_APP_KEY="<APP-KEY>" python3 "example.py"
##### 

```ruby
# Get all custom destinations returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::LogsCustomDestinationsAPI.new
p api_instance.list_logs_custom_destinations()
```

#### 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="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
##### 

```go
// Get all custom destinations returns "OK" 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.NewLogsCustomDestinationsApi(apiClient)
	resp, r, err := api.ListLogsCustomDestinations(ctx)

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `LogsCustomDestinationsApi.ListLogsCustomDestinations`:\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="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"
##### 

```java
// Get all custom destinations returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.LogsCustomDestinationsApi;
import com.datadog.api.client.v2.model.CustomDestinationsResponse;

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

    try {
      CustomDestinationsResponse result = apiInstance.listLogsCustomDestinations();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println(
          "Exception when calling LogsCustomDestinationsApi#listLogsCustomDestinations");
      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="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"
##### 

```rust
// Get all custom destinations returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_logs_custom_destinations::LogsCustomDestinationsAPI;

#[tokio::main]
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = LogsCustomDestinationsAPI::with_config(configuration);
    let resp = api.list_logs_custom_destinations().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="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo run
##### 

```typescript
/**
 * Get all custom destinations returns "OK" response
 */

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

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

apiInstance
  .listLogsCustomDestinations()
  .then((data: v2.CustomDestinationsResponse) => {
    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="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"
{% /tab %}
