Skip to content
Start here

Delete Destination

client.workers.observability.destinations.delete(stringslug, DestinationDeleteParams { account_id } params, RequestOptionsoptions?): DestinationDeleteResponse { configuration, enabled, name, 2 more }
DELETE/accounts/{account_id}/workers/observability/destinations/{slug}

Delete a Workers Observability Telemetry Destination.

Security
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
User Service Key

Used when interacting with the Origin CA certificates API. View/change your key.

Example:X-Auth-User-Service-Key: v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719
Accepted Permissions (at least one required)
Workers Observability Write
ParametersExpand Collapse
slug: string
params: DestinationDeleteParams { account_id }
account_id: string

Your Cloudflare account ID.

ReturnsExpand Collapse
DestinationDeleteResponse { configuration, enabled, name, 2 more }
configuration: Configuration { destination_conf, logpushDataset, logpushJob, 2 more }
destination_conf: string
logpushDataset: "opentelemetry-traces" | "opentelemetry-logs"
One of the following:
"opentelemetry-traces"
"opentelemetry-logs"
logpushJob: number
type: "logpush"
url: string
enabled: boolean
name: string
scripts: Array<string>
slug: string

Delete Destination

import Cloudflare from 'cloudflare';

const client = new Cloudflare({
  apiEmail: process.env['CLOUDFLARE_EMAIL'], // This is the default and can be omitted
  apiKey: process.env['CLOUDFLARE_API_KEY'], // This is the default and can be omitted
});

const destination = await client.workers.observability.destinations.delete('slug', {
  account_id: 'account_id',
});

console.log(destination.configuration);
{
  "errors": [
    {
      "message": "message"
    }
  ],
  "messages": [
    {
      "message": "Successful request"
    }
  ],
  "success": true,
  "result": {
    "configuration": {
      "destination_conf": "destination_conf",
      "logpushDataset": "opentelemetry-traces",
      "logpushJob": 0,
      "type": "logpush",
      "url": "url"
    },
    "enabled": true,
    "name": "name",
    "scripts": [
      "string"
    ],
    "slug": "slug"
  }
}
Returns Examples
{
  "errors": [
    {
      "message": "message"
    }
  ],
  "messages": [
    {
      "message": "Successful request"
    }
  ],
  "success": true,
  "result": {
    "configuration": {
      "destination_conf": "destination_conf",
      "logpushDataset": "opentelemetry-traces",
      "logpushJob": 0,
      "type": "logpush",
      "url": "url"
    },
    "enabled": true,
    "name": "name",
    "scripts": [
      "string"
    ],
    "slug": "slug"
  }
}