# Update observability destination

> Source: https://truto.one/docs/api-reference/admin/observability-destinations/update/

`PATCH /observability-destination/{id}`

Resource: **Observability destinations**

## Path parameters

- **`id`** _(string, required)_

## Request body

- **`type`** _(string)_
  Allowed: `datadog`, `splunk_hec`, `sentinel`
- **`name`** _(string)_
- **`is_active`** _(boolean)_
- **`config`** _(object)_
- **`secrets`** _(object)_
  Secret bag stored as a single encrypted JSON blob. Replaces the stored secrets when provided. Never returned by the API.

## Response body

- **`id`** _(string)_
  The ID of the observability destination.
- **`environment_id`** _(string)_
  The environment whose logs are forwarded.
- **`type`** _(string)_
  Destination type.
  Allowed: `datadog`, `splunk_hec`, `sentinel`
- **`name`** _(string)_
  Human-readable destination name.
- **`is_active`** _(boolean)_
  Whether forwarding is enabled.
- **`config`** _(object)_
  Non-secret destination configuration (site, tags, log_types filter).
- **`created_at`** _(string)_
- **`updated_at`** _(string)_

## Code examples

### curl

```bash
curl -X PATCH 'https://api.truto.one/observability-destination/{id}' \
  -H 'Authorization: Bearer <your_api_token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "type": "datadog",
  "name": "your_name",
  "is_active": true,
  "config": {},
  "secrets": {}
}'
```

### JavaScript

```javascript
const body = {
  "type": "datadog",
  "name": "your_name",
  "is_active": true,
  "config": {},
  "secrets": {}
};

const response = await fetch('https://api.truto.one/observability-destination/{id}', {
  method: 'PATCH',
  headers: {
    'Authorization': 'Bearer <your_api_token>',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify(body),
});

const data = await response.json();
console.log(data);
```

### Python

```python
import requests

url = "https://api.truto.one/observability-destination/{id}"
headers = {
    "Authorization": "Bearer <your_api_token>",
    "Content-Type": "application/json",
}
params = {
}
payload = {
    "type": "datadog",
    "name": "your_name",
    "is_active": True,
    "config": {},
    "secrets": {}
}

response = requests.patch(url, headers=headers, params=params, json=payload)
print(response.json())
```
