# Update a destination

> Update a destination's endpoint, headers, signals, projects or name, keeping the fields left out.

> Nevia is in early access for selected teams. The CLI installs with `curl -fsSL https://get.nevia.cloud | sh`, and the MCP server is at https://api.nevia.cloud/mcp. A person signs in once in the browser.
> Setup, sign-in and requesting access: [SKILL.md](https://nevia.cloud/SKILL.md). When Nevia fits and when it doesn't: [why.md](https://nevia.cloud/why.md).

> For the complete documentation index, see [llms.txt](https://nevia.cloud/llms.txt). This page's HTML version: https://nevia.cloud/docs/reference/api/observability/updateDestination

`PATCH https://api.nevia.cloud/v1/destinations/{dst}`

## Authorization

- `bearerAuth`: HTTP bearer in the Authorization header

Send the token in the `Authorization: Bearer <token>` header. See [Authenticate](https://nevia.cloud/docs/reference/api.md#authenticate).

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `dst` | path | string | yes | Destination id: 27 lowercase letters and digits. Match `^[A-Za-z0-9_-]{1,64}$`. |

## Request body

Content type: `application/json`, required

Schema: `DestinationUpdateRequest`

What to change. Absent fields stay, except headers, which a destination that has them takes again with every update.

| Field | Type | Required | Description |
|---|---|---|---|
| `name` | string | no | A label for people, not unique. Length `1 <= length <= 100`. |
| `endpoint` | string (uri) | no | Required unless the `preset` has regions. Give this or `region`, not both. Length `length <= 2048`. |
| `instance_id` | string | no | With a `preset` that takes it (`grafana_cloud`), the account's instance ID. It goes in the credential header with `api_key`, so it is write-only too. Length `1 <= length <= 128`. |
| `api_key` | string | no | With a `preset`, its key or token, given with every other credential field it takes. These and `headers` together replace every header. Length `1 <= length`. |
| `headers` | DestinationHeaders & object | no | HTTP headers sent with every request, such as the vendor's API key. Write-only: no response returns a value. At most 16, each value at most 4096 bytes and all of them at most 8192 bytes as JSON. Names ignore case. |
| `signals` | array<DestinationSignal> | no | Items `1 <= items`. |
| `projects` | array<ProjectId> | no | Items `items <= 100`. |

## Behavior

Header values are never read back, so an update to a destination that has headers gives them again, in `headers` or its preset's credential fields (`api_key`, and `instance_id` for Grafana Cloud). Header values are never read back. Saving sends one test record per signal: a log record with the body `Nevia test record` and a gauge `nevia.destination.test` of 1, on a resource with `service.name` `nevia`. `test` says how the destination answered each, as a code and its HTTP status, and `delivery` starts from it. The destination is saved whatever it answered, so fix it with `PATCH` and read the new `test`.

## Example request

### cURL

```bash
curl -X PATCH "https://api.nevia.cloud/v1/destinations/01d30cbpnr2g96ry9h5kkkhd6db" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "api_key": "<api key>",
    "signals": [
      "logs"
    ]
  }'
```

### JavaScript

```js
const body = JSON.stringify({
  "api_key": "<api key>",
  "signals": [
    "logs"
  ]
})

fetch("https://api.nevia.cloud/v1/destinations/01d30cbpnr2g96ry9h5kkkhd6db", {
  method: "PATCH",
  headers: {
    "Content-Type": "application/json",
    "Authorization": `Bearer ${process.env.TOKEN}`
  },
  body
})
```

### Python

```python
import os
import requests

url = "https://api.nevia.cloud/v1/destinations/01d30cbpnr2g96ry9h5kkkhd6db"
body = """{
  "api_key": "<api key>",
  "signals": [
    "logs"
  ]
}"""
response = requests.request("PATCH", url, data = body, headers = {
  "Content-Type": "application/json", 
  "Authorization": f"Bearer {os.environ['TOKEN']}"
})

print(response.text)
```

## Responses

### 200

The destination and its answer to the test records.

Content type: `application/json`

Schema: `DestinationWriteResponse`

The destination and its answer to the test records just sent

| Field | Type | Required | Description |
|---|---|---|---|
| `destination` | Destination | yes | An OTLP/HTTP endpoint the workspace exports its telemetry to, without its header values. |
| `test` | DestinationTest | yes | The destination's answer to one test record per signal it receives. |

Example:

```json
{
  "destination": {
    "id": "01d30cbpnr2g96ry9h5kkkhd6db",
    "workspace": "01d4cnjjq40hnnh0nwmkg35nv2h",
    "name": "Honeycomb production",
    "endpoint": "https://api.honeycomb.io",
    "preset": "honeycomb",
    "header_names": [
      "x-honeycomb-team"
    ],
    "signals": [
      "logs"
    ],
    "projects": [
      "01ck8y1dm5qqnf88mytnh4m0h4g"
    ],
    "delivery": {
      "status": "delivering",
      "last_error": {
        "code": "delivered",
        "http_status": 503,
        "failed_at": "2026-09-10T12:34:56Z"
      },
      "last_delivered_at": "2026-09-10T12:34:56Z",
      "dropped": 0
    },
    "created_by": "01d4cnjmn4fbb1r5btxb5mypv62",
    "updated_by": "01d4cnjmn4fbb1r5btxb5mypv62",
    "created_at": "2026-09-10T12:34:56Z",
    "updated_at": "2026-09-10T12:34:56Z",
    "deleted_at": "2026-09-10T12:34:56Z"
  },
  "test": {
    "logs": {
      "code": "delivered",
      "http_status": 200
    },
    "metrics": {
      "code": "delivered",
      "http_status": 200
    }
  }
}
```

### 400

`validation_failed`: malformed body, unknown field, or invalid id or name. Fix `details.field` and retry. `validation_failed`: the destination has headers and the update does not give them again.

Content type: `application/json`

Schema: `ErrorEnvelope`

Body of every error response

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | Error | yes |  |

Example `validation_failed: malformed body, unknown field, or invalid id or name. Fix \`details.field\` and retry`:

```json
{
  "error": {
    "code": "validation_failed",
    "message": "Unknown field `colour` in the request body. Remove it; request bodies are strict.",
    "details": {
      "field": "colour",
      "in": "body"
    }
  }
}
```

Example `validation_failed: the destination has headers and the update does not give them again`:

```json
{
  "error": {
    "code": "validation_failed",
    "message": "Invalid `headers` in the request body: header values are never read back, so an update to a destination with headers gives them again; send `headers` (or the preset's credential fields).",
    "details": {
      "field": "headers",
      "in": "body"
    }
  }
}
```

### 401

`unauthorized`: the credential is missing, malformed, expired, or revoked. Send a valid bearer token.

Content type: `application/json`

Schema: `ErrorEnvelope`

Body of every error response

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | Error | yes |  |

Example `unauthorized`:

```json
{
  "error": {
    "code": "unauthorized",
    "message": "Missing credential. Send `Authorization: Bearer <token>` with an access token.",
    "details": {}
  }
}
```

### 403

`forbidden`: the token is read-only or scoped elsewhere, or the role cannot do this. Use a token or role that allows it.

Content type: `application/json`

Schema: `ErrorEnvelope`

Body of every error response

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | Error | yes |  |

Example `forbidden`:

```json
{
  "error": {
    "code": "forbidden",
    "message": "You can view computer 01d4cnjk3xg90y576w8y6t4gdwm but your role does not allow computer#edit. Ask a workspace admin to change your role (PATCH /v1/workspaces/{ws}/access/{principal}).",
    "details": {
      "computer": "01d4cnjk3xg90y576w8y6t4gdwm",
      "permission": "computer#edit"
    }
  }
}
```

### 404

`not_found`: the destination does not exist, or you cannot see it. Both return the same response.

Content type: `application/json`

Schema: `ErrorEnvelope`

Body of every error response

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | Error | yes |  |

Example `not_found`:

```json
{
  "error": {
    "code": "not_found",
    "message": "Destination 01d30cbpnr2g96ry9h5kkkhd6db was not found. List the destinations you can access with GET /v1/destinations?workspace=<ws>.",
    "details": {
      "destination": "01d30cbpnr2g96ry9h5kkkhd6db"
    }
  }
}
```

### 409

`invalid_state`: another update changed the destination's endpoint or headers while this one ran. Nothing was changed.

Content type: `application/json`

Schema: `ErrorEnvelope`

Body of every error response

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | Error | yes |  |

Example `invalid_state`:

```json
{
  "error": {
    "code": "invalid_state",
    "message": "Destination 01d30cbpnr2g96ry9h5kkkhd6db's endpoint or headers changed while this request ran. Read it again and send the update with its current endpoint in mind.",
    "details": {
      "destination": "01d30cbpnr2g96ry9h5kkkhd6db",
      "workspace": "01d4cnjjq40hnnh0nwmkg35nv2h"
    }
  }
}
```

### 422

`not_supported`: the platform has no secret store for destination headers. Reads still work.

Content type: `application/json`

Schema: `ErrorEnvelope`

Body of every error response

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | Error | yes |  |

Example `not_supported`:

```json
{
  "error": {
    "code": "not_supported",
    "message": "Destinations are not available on this platform: it has no secret store for their headers.",
    "details": {}
  }
}
```

### 429

`rate_limited`: slow down. Retry after `Retry-After`.

Content type: `application/json`

Schema: `ErrorEnvelope`

Body of every error response

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | Error | yes |  |

Example `rate_limited`:

```json
{
  "error": {
    "code": "rate_limited",
    "message": "Too many requests. Retry after 2 seconds.",
    "details": {
      "retry_after_seconds": 2
    }
  }
}
```

### 500

`request_failed`, or the failed action's own code, such as `creation_failed`, `authorization_failed` or `command_execution_failed`. The diagnostic stays in server logs.

Content type: `application/json`

Schema: `ErrorEnvelope`

Body of every error response

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | Error | yes |  |

Example `request_failed`:

```json
{
  "error": {
    "code": "request_failed",
    "message": "request failed",
    "details": {}
  }
}
```

### 503

The action is temporarily unavailable, named by its code (`creation_failed`, `wake_failed`, ...). Wait at least `Retry-After` seconds (60 by default). `details.retryable` says whether repeating the request is safe. Keep the original `Idempotency-Key`. Signing in again does not help.

Content type: `application/json`

Schema: `ErrorEnvelope`

Body of every error response

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | Error | yes |  |

Example `creation_failed`:

```json
{
  "error": {
    "code": "creation_failed",
    "message": "The computer could not be created. Try again later.",
    "details": {
      "retryable": true
    }
  }
}
```
