Skip to content
Start here

List Spectrum application protocols

client.spectrum.protocols.list(ProtocolListParams { zone_id } params, RequestOptionsoptions?): SinglePage<ProtocolListResponse { description, name, ports, transport } >
GET/zones/{zone_id}/spectrum/protocols

Retrieves a list of Spectrum application protocols available for a zone.

Security
API Token

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

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
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
Accepted Permissions (at least one required)
Zone Settings WriteZone Settings Read
ParametersExpand Collapse
params: ProtocolListParams { zone_id }
zone_id: string

Zone identifier.

maxLength32
ReturnsExpand Collapse
ProtocolListResponse { description, name, ports, transport }
description: string

The full name of the application protocol.

name: string

The short name of the application protocol.

ports: Array<number>

The available listening ports for the given protocol.

transport: string

The transport layer protocol used by the application protocol

List Spectrum application protocols

import Cloudflare from 'cloudflare';

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

// Automatically fetches more pages as needed.
for await (const protocolListResponse of client.spectrum.protocols.list({
  zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
})) {
  console.log(protocolListResponse.description);
}
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": [
    {
      "description": "Minecraft Game Server",
      "name": "Minecraft",
      "ports": [
        25565
      ],
      "transport": "tcp"
    }
  ],
  "result_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 2000,
    "total_pages": 100
  }
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": [
    {
      "description": "Minecraft Game Server",
      "name": "Minecraft",
      "ports": [
        25565
      ],
      "transport": "tcp"
    }
  ],
  "result_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 2000,
    "total_pages": 100
  }
}