---
title: Get a custom destination
description: Get a specific custom destination in your organization.
breadcrumbs: Docs > API > Get a custom destination
---

> For the complete documentation index, see [llms.txt](https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/llms.txt).

# Get a custom destination

## v2 (latest)

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

### Overview

Get a specific custom destination in your organization.

This endpoint requires any of the following permissions:

- `logs_read_config`
- `logs_read_data`

### Arguments

#### Path Parameters

| Field                              | Type   | Description                       |
| ---------------------------------- | ------ | --------------------------------- |
| custom_destination_id [*required*] | string | The ID of the custom destination. |

### Response

{% tabs %}
{% tab label="200" %}
OK

{% tabs %}
{% tab label="Model" %}
The custom destination.

| Parent field              | Field                                 | Type     | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ------------------------- | ------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                           | data                                  | object   | The definition of a custom destination.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| data                      | attributes                            | object   | The attributes associated with the custom destination.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| attributes                | enabled                               | boolean  | Whether logs matching this custom destination should be forwarded or not. Default: `true`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| attributes                | forward_tags                          | boolean  | Whether tags from the forwarded logs should be forwarded or not. Default: `true`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| 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`. Default: `ALLOW_LIST`.                                                                                                                                                                                                                                                                      |
| attributes                | forwarder_destination                 | <oneOf>  | A custom destination's location to forward logs.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| forwarder_destination     | <type=http>                           | object   | The HTTP destination.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| <type=http>               | auth [*required*]                     | <oneOf>  | Authentication method of the HTTP requests.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| auth                      | <type=basic>                          | object   | Basic access authentication.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| <type=basic>              | type [*required*]                     | enum     | Type of the basic access authentication. Allowed enum values: `basic`. Default: `basic`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| auth                      | <type=custom_header>                  | object   | Custom header access authentication.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| <type=custom_header>      | header_name [*required*]              | string   | The header name of the authentication.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| <type=custom_header>      | type [*required*]                     | enum     | Type of the custom header access authentication. Allowed enum values: `custom_header`. Default: `custom_header`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| <type=http>               | endpoint [*required*]                 | string   | The destination for which logs will be forwarded to. Must have HTTPS scheme and forwarding back to Datadog is not allowed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| <type=http>               | type [*required*]                     | enum     | Type of the HTTP destination. Allowed enum values: `http`. Default: `http`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| forwarder_destination     | <type=splunk_hec>                     | object   | The Splunk HTTP Event Collector (HEC) destination.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| <type=splunk_hec>         | endpoint [*required*]                 | string   | The destination for which logs will be forwarded to. Must have HTTPS scheme and forwarding back to Datadog is not allowed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| <type=splunk_hec>         | 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.                                                                                                                                             |
| <type=splunk_hec>         | type [*required*]                     | enum     | Type of the Splunk HTTP Event Collector (HEC) destination. Allowed enum values: `splunk_hec`. Default: `splunk_hec`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| forwarder_destination     | <type=elasticsearch>                  | object   | The Elasticsearch destination.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| <type=elasticsearch>      | auth [*required*]                     | object   | Basic access authentication.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| additionalProperties      | <any-key>                             | any      | Basic access authentication.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| <type=elasticsearch>      | endpoint [*required*]                 | string   | The destination for which logs will be forwarded to. Must have HTTPS scheme and forwarding back to Datadog is not allowed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| <type=elasticsearch>      | 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)).                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| <type=elasticsearch>      | 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: - Hourly: `yyyy-MM-dd-HH` (as an example, it would render: `2022-10-19-09`) - Daily: `yyyy-MM-dd` (as an example, it would render: `2022-10-19`) - Weekly: `yyyy-'W'ww` (as an example, it would render: `2022-W42`) - Monthly: `yyyy-MM` (as an example, it would render: `2022-10`) If this field is missing or is blank, it means that the index name will always be the same (that is, no rotation). |
| <type=elasticsearch>      | type [*required*]                     | enum     | Type of the Elasticsearch destination. Allowed enum values: `elasticsearch`. Default: `elasticsearch`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| forwarder_destination     | <type=microsoft_sentinel>             | object   | The Microsoft Sentinel destination.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| <type=microsoft_sentinel> | client_id [*required*]                | string   | Client ID from the Datadog Azure integration.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| <type=microsoft_sentinel> | data_collection_endpoint [*required*] | string   | Azure data collection endpoint.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| <type=microsoft_sentinel> | data_collection_rule_id [*required*]  | string   | Azure data collection rule ID.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| <type=microsoft_sentinel> | tenant_id [*required*]                | string   | Tenant ID from the Datadog Azure integration.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| <type=microsoft_sentinel> | type [*required*]                     | enum     | Type of the Microsoft Sentinel destination. Allowed enum values: `microsoft_sentinel`. Default: `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. Default: `""`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| data                      | id                                    | string   | The custom destination ID. Read-only.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| data                      | type                                  | enum     | The type of the resource. The value should always be `custom_destination`. Allowed enum values: `custom_destination`. Default: `custom_destination`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
{% /tab %}

{% tab label="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 %}
{% /tabs %}
{% /tab %}

{% tab label="400" %}
Bad Request

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="403" %}
Forbidden

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="404" %}
Not Found

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="429" %}
Too many requests

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}
{% /tabs %}

### Code Example

{% tabs %}
{% tab label="Curl" %}
```bash
# Path parameters
export custom_destination_id="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.com" # Or us3.datadoghq.com, us5.datadoghq.com, datadoghq.eu, ap1.datadoghq.com, ap2.datadoghq.com, uk1.datadoghq.com, ddog-gov.com, us2.ddog-gov.com
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/logs/config/custom-destinations/${custom_destination_id}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
```
{% /tab %}

{% tab label="Go" %}
```go
// Get a custom destination 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() {
	// there is a valid "custom_destination" in the system
	CustomDestinationDataID := os.Getenv("CUSTOM_DESTINATION_DATA_ID")

	ctx := datadog.NewDefaultContext(context.Background())
	ctx = context.WithValue(ctx, datadog.ContextAccessToken, os.Getenv("DD_BEARER_TOKEN"))
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewLogsCustomDestinationsApi(apiClient)
	resp, r, err := api.GetLogsCustomDestination(ctx, CustomDestinationDataID)

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

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

#### Instructions

First [install the library and its dependencies](https://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=go) and then save the example to `main.go` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"
```
{% /tab %}

{% tab label="Java" %}
```java
// Get a custom destination 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.CustomDestinationResponse;

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

    // there is a valid "custom_destination" in the system
    String CUSTOM_DESTINATION_DATA_ID = System.getenv("CUSTOM_DESTINATION_DATA_ID");

    try {
      CustomDestinationResponse result =
          apiInstance.getLogsCustomDestination(CUSTOM_DESTINATION_DATA_ID);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println(
          "Exception when calling LogsCustomDestinationsApi#getLogsCustomDestination");
      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://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=java) and then save the example to `Example.java` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"
```
{% /tab %}

{% tab label="Python" %}
```python
"""
Get a custom destination returns "OK" response
"""

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

# there is a valid "custom_destination" in the system
CUSTOM_DESTINATION_DATA_ID = environ["CUSTOM_DESTINATION_DATA_ID"]

configuration = Configuration()
configuration.access_token = environ["DD_BEARER_TOKEN"]
with ApiClient(configuration) as api_client:
    api_instance = LogsCustomDestinationsApi(api_client)
    response = api_instance.get_logs_custom_destination(
        custom_destination_id=CUSTOM_DESTINATION_DATA_ID,
    )

    print(response)
```

#### Instructions

First [install the library and its dependencies](https://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=python) and then save the example to `example.py` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"
```
{% /tab %}

{% tab label="Ruby" %}
```ruby
# Get a custom destination returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.access_token = ENV["DD_BEARER_TOKEN"]
end
api_instance = DatadogAPIClient::V2::LogsCustomDestinationsAPI.new

# there is a valid "custom_destination" in the system
CUSTOM_DESTINATION_DATA_ID = ENV["CUSTOM_DESTINATION_DATA_ID"]
p api_instance.get_logs_custom_destination(CUSTOM_DESTINATION_DATA_ID)
```

#### Instructions

First [install the library and its dependencies](https://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=ruby) and then save the example to `example.rb` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"
```
{% /tab %}

{% tab label="Rust" %}
```rust
// Get a custom destination returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_logs_custom_destinations::LogsCustomDestinationsAPI;

#[tokio::main]
async fn main() {
    // there is a valid "custom_destination" in the system
    let custom_destination_data_id = std::env::var("CUSTOM_DESTINATION_DATA_ID").unwrap();
    let configuration = datadog::Configuration::new();
    let api = LogsCustomDestinationsAPI::with_config(configuration);
    let resp = api
        .get_logs_custom_destination(custom_destination_data_id.clone())
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
```

#### Instructions

First [install the library and its dependencies](https://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=rust) and then save the example to `src/main.rs` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo run
```
{% /tab %}

{% tab label="TypeScript" %}
```typescript
/**
 * Get a custom destination returns "OK" response
 */

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

const configuration = client.createConfiguration({
  authMethods: {
    AuthZ: {
      accessToken: process.env.DD_BEARER_TOKEN as string,
    },
  },
});
const apiInstance = new v2.LogsCustomDestinationsApi(configuration);

// there is a valid "custom_destination" in the system
const CUSTOM_DESTINATION_DATA_ID = process.env
  .CUSTOM_DESTINATION_DATA_ID as string;

const params: v2.LogsCustomDestinationsApiGetLogsCustomDestinationRequest = {
  customDestinationId: CUSTOM_DESTINATION_DATA_ID,
};

apiInstance
  .getLogsCustomDestination(params)
  .then((data: v2.CustomDestinationResponse) => {
    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://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=typescript) and then save the example to `example.ts` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"
```
{% /tab %}
{% /tabs %}
