API Reference

List Spectrum applications

GET /client/v4/zones/:zone_id/spectrum/apps/
GET /client/v4/zones/:zone_id/spectrum/apps/:app_id

Example curl:

curl -H 'X-Auth-Email: [email protected]' -H 'X-Auth-Key: 0000000000000000' 'https://api.cloudflare.com/client/v4/zones/123456789/spectrum/apps'

Example response:

{
  "result": {
    "id": "f68579455bd947efb65ffa1bcf33b52c",
    "protocol": "tcp/22",
    "dns": {
      "type": "CNAME",
      "name": "spectrum.example.com"
    },
    "origin_direct": [
      "tcp://192.0.2.1:22"
    ],
    "ip_firewall": true,
    "proxy_protocol": false,
    "tls": "off",
    "created_on": "2018-03-28T21:25:55.643771Z",
    "modified_on": "2018-03-28T21:25:55.643771Z"
  },
  "success": true,
  "errors": [],
  "messages": []
}

Create a new Spectrum application

POST /client/v4/zones/:zone_id/spectrum/apps

Required properties:

Name Type Description Example
protocol string The requested transport and port configured at Cloudflare’s edge. “tcp/22”
dns object The name and type of DNS record to be created to point to the Spectrum application. “dns”: {“type”: “CNAME”, “name”: “spectrum.example.com”}
origin_direct array A list of destination addresses to the origin. “origin_direct”: [“tcp://192.0.2.10:1024”]
origin_dns object Method and parameters used to discover the origin server address via DNS. Valid record types are A, AAAA, SRV and empty(both A and AAA). A request must contain either an “origin_dns” parameter or an “origin_direct” parameter. When both are specified the service returns an HTTP 400 Bad Request. “origin_dns”: {“type”: “A”, “name”: “mqtt.example.com”, ttl: 1200}
origin_port integer The destination port at the origin. 22

Optional properties:

Name Type Description Example
proxy_protocol boolean Enables Proxy Protocol v1 to the origin. true
ip_firewall boolean Enables IP Access Rules for this application. true
tls string Type of TLS termination for the application. Options are “off” (default, aka Passthrough), “flexible”, “full”, and “strict”. See Configuration Options for descriptions of each. “full”

Example curl:

curl -X POST -H 'X-Auth-Email: [email protected]' -H 'X-Auth-Key: 0000000000000000' 'https://api.cloudflare.com/client/v4/zones/123456789/spectrum/apps' --d {"protocol": "tcp/22", "origin_direct": ["tcp://192.0.2.10:1024"], "tls": "full", "proxy_protocol": false, "ip_firewall": false}

Example response:

{
  "result": {
    "id": "40d67c87c6cd4b889a4fd57805225e85",
    "protocol": "tcp/22",
    "dns": { "type": "CNAME", "name": "spectrum.example.com" },
    "origin_direct": [
      "tcp://192.0.2.10:1024"
    ],
    "proxy_protocol": true,
    "tls": "full",
    "created_on": "2017-08-30T18:27:29.868787Z",
    "modified_on": "2017-08-30T18:27:29.868787Z"
  },
  "success": true,
  "errors": [],
  "messages": []
}

Update a Spectrum application

PUT /client/v4/zones/:zone_id/spectrum/apps/:app_id

Required properties:

Name Type Description Example
protocol string The requested transport and port configured at Cloudflare’s edge. “tcp/22”
dns object The name and type of DNS record to be created to point to the Spectrum application. “dns”: {“type”: “CNAME”, “name”: “spectrum.example.com”}
origin_direct array A list of destination addresses to the origin. “origin_direct”: [“tcp://192.0.2.10:1024”]
origin_dns object Method and parameters used to discover the origin server address via DNS. Valid record types are A, AAAA, SRV and empty(both A and AAA). A request must contain either an “origin_dns” parameter or an “origin_direct” parameter. When both are specified the service returns an HTTP 400 Bad Request.
origin_port integer The destination port at the origin. 22

Optional Properties:

Name Type Description Example
proxy_protocol boolean Enables Proxy Protocol v1 to the origin. true
ip_firewall boolean Enables IP Access Rules for this application. true
tls string Type of TLS termination for the application. Options are “off” (default, aka Passthrough), “flexible”, “full”, and “strict”. See Configuration Options for descriptions of each. “full”

Example curl:

curl -X PUT -H 'X-Auth-Email: [email protected]' -H 'X-Auth-Key: 0000000000000000' 'https://api.cloudflare.com/client/v4/zones/123456789/spectrum/apps/40d67c87c6cd4b889a4fd57805225e85' --d { "protocol": "tcp/43", "dns": { "type": "CNAME", "name": "ssh.example.com" }, "origin_dns": { "type": "A", "name": "mqtt.example.com", "ttl": 120 }, "origin_port": 1234, "proxy_protocol": true }

Example response:

{
  "result": {
    "id": "40d67c87c6cd4b889a4fd57805225e85",
    "protocol": "tcp/43",
    "dns": { "type": "CNAME", "name": "ssh.example.com" },
    "origin_dns": {
      "type": "A",
      "name": "mqtt.example.com",
      "ttl": 120
    },
    "origin_port": 1234,
    "proxy_protocol": true,
    "tls": "off",
    "created_on": "2017-08-30T19:48:26.724612Z",
    "modified_on": "2017-08-30T19:48:26.836538Z"
  },
  "success": true,
  "errors": [],
  "messages": []
}

Delete a Spectrum application

DELETE /client/v4/zones/:zone_id/spectrum/apps/:app_id

Example curl:

curl -X DELETE -H 'X-Auth-Email: [email protected]' -H 'X-Auth-Key: 0000000000000000' 'https://api.cloudflare.com/client/v4/zones/123456789/spectrum/apps/1234'

Example response:

{
  "result": {
    "id": "40d67c87c6cd4b889a4fd57805225e85"
  },
  "success": true,
  "errors": [],
  "messages": []
}