> This page is for Gateway.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.merge.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.merge.dev/_mcp/server.

# Get Export Destination

GET https://api-gateway.merge.dev/v1/export-destinations/{destination_id}

Return an export destination, with its recent delivery status.

Reference: https://docs.merge.dev/merge-gateway/management-api/export-destinations/get-export-destination

## Authentication

- `Authorization` header (bearer token, required) — A management key (`mgmt_...`), sent as `Authorization: Bearer <key>`. Reading /v1/routing-policies also accepts the organization's gateway API keys; writing there needs a management key.

## Request

### Path parameters

- `destination_id` (string, required) — The destination's `id`.

## Response

### 200

The export destination

- `consecutive_failures` (integer, required) — Failed deliveries in a row.
- `created_at` (datetime, required) — When the destination was created.
- `credential_hint` (string, required, nullable) — The last 4 characters of the stored secret, to tell secrets apart. null when the secret is under 12 characters (4 would give away too much of it).
- `credential_username` (string, required, nullable) — grafana only: the Grafana Cloud instance ID. Not a secret, so it is returned.
- `delivery_suspended_until` (datetime, required, nullable) — Set while delivery is paused after repeated failures.
- `enabled` (boolean, required) — Whether the gateway exports to the destination.
- `id` (string, required) — The destination's id.
- `kind` ("otlp", required) — Can't be changed after creation.
- `last_error_at` (datetime, required, nullable) — When a delivery last failed.
- `last_error_message` (string, required, nullable) — Why the last failed delivery failed.
- `last_success_at` (datetime, required, nullable) — When a delivery last succeeded.
- `metrics_enabled` (boolean, required) — Also export metrics. Datadog and Grafana Cloud bill these separately.
- `ml_app` (string, required, nullable) — Datadog only: the ml_app tag on exported spans.
- `name` (string, required) — A name for the destination, unique in the organization.
- `organization_id` (string, required) — The organization the destination belongs to.
- `otlp_endpoint` (string, required, nullable) — generic only: the https URL of your OTLP collector.
- `otlp_preset` (enum, required) — Where spans go. Besides the presets create accepts, `datadog-apm`: those destinations are created in the dashboard only. Can't be changed after creation.
  - Allowed values: `datadog`, `datadog-apm`, `grafana`, `generic`
- `privacy_mode` (boolean, required) — When true, prompts and completions are left out of exported spans.
- `sample_rate` (double, required) — Fraction of requests exported, from 0.0001 to 1.
- `site` (string, required, nullable) — datadog: a Datadog site, like datadoghq.com. grafana: a Grafana Cloud zone, like prod-us-east-0. generic: not allowed; use otlp_endpoint.
- `updated_at` (datetime, required) — When the destination last changed.

## Errors

### 401 Unauthorized Error

The key is missing or invalid.

- `detail` (ErrorResponseDetail, required) — A message, or an object with a `code` to branch on and a `message`.

### 403 Forbidden Error

The key lacks the scope this route needs, or the change is not allowed.

- `detail` (ErrorResponseDetail, required) — A message, or an object with a `code` to branch on and a `message`.

### 404 Not Found Error

The resource does not exist in the key's organization.

- `detail` (ErrorResponseDetail, required) — A message, or an object with a `code` to branch on and a `message`.

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### ErrorResponseDetail

A message, or an object with a `code` to branch on and a `message`.

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)
- `ctx` (ValidationErrorCtx, optional)
- `input` (any, optional)

### ErrorDetail

A structured error. Some carry extra fields, like `count`.

- `code` (string, required) — A stable code to branch on, like `payment_method_required`.
- `message` (string, required) — A human-readable explanation.

### ValidationErrorLocItems

### ValidationErrorCtx

## Examples

**Response**

```json
{
  "consecutive_failures": 0,
  "created_at": "2026-06-02T17:04:00Z",
  "credential_hint": "9f2c",
  "credential_username": null,
  "delivery_suspended_until": null,
  "enabled": true,
  "id": "1a7e3c5b-8d2f-4b6a-9c0e-3f5d7b9a1c24",
  "kind": "otlp",
  "last_error_at": null,
  "last_error_message": null,
  "last_success_at": "2026-10-15T08:12:44Z",
  "metrics_enabled": false,
  "ml_app": "support-bot",
  "name": "datadog-prod",
  "organization_id": "3f2b8c1e-6a4d-4e7f-9b21-5c8d0e7a4f13",
  "otlp_endpoint": null,
  "otlp_preset": "datadog",
  "privacy_mode": true,
  "sample_rate": 1,
  "site": "datadoghq.com",
  "updated_at": "2026-09-14T09:30:00Z"
}
```

**SDK Code**

```python
import requests

url = "https://api-gateway.merge.dev/v1/export-destinations/destination_id"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api-gateway.merge.dev/v1/export-destinations/destination_id';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api-gateway.merge.dev/v1/export-destinations/destination_id"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api-gateway.merge.dev/v1/export-destinations/destination_id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api-gateway.merge.dev/v1/export-destinations/destination_id")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api-gateway.merge.dev/v1/export-destinations/destination_id', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api-gateway.merge.dev/v1/export-destinations/destination_id");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api-gateway.merge.dev/v1/export-destinations/destination_id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```