# Tunnels ## List All Tunnels `client.zeroTrust.tunnels.list(TunnelListParamsparams, RequestOptionsoptions?): V4PagePaginationArray` **get** `/accounts/{account_id}/tunnels` Lists and filters all types of Tunnels in an account. ### Parameters - `params: TunnelListParams` - `account_id: string` Path param: Cloudflare account ID - `exclude_prefix?: string` Query param - `existed_at?: string` Query param: If provided, include only resources that were created (and not deleted) before this time. URL encoded. - `include_prefix?: string` Query param - `is_deleted?: boolean` Query param: If `true`, only include deleted tunnels. If `false`, exclude deleted tunnels. If empty, all tunnels will be included. - `name?: string` Query param: A user-friendly name for the tunnel. - `page?: number` Query param: Page number of paginated results. - `per_page?: number` Query param: Number of results to display. - `status?: "inactive" | "degraded" | "healthy" | "down"` Query param: The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - `"inactive"` - `"degraded"` - `"healthy"` - `"down"` - `tun_types?: Array<"cfd_tunnel" | "warp_connector" | "warp" | 4 more>` Query param: The types of tunnels to filter by, separated by commas. - `"cfd_tunnel"` - `"warp_connector"` - `"warp"` - `"magic"` - `"ip_sec"` - `"gre"` - `"cni"` - `uuid?: string` Query param: UUID of the tunnel. - `was_active_at?: string` Query param - `was_inactive_at?: string` Query param ### Returns - `TunnelListResponse = CloudflareTunnel | TunnelWARPConnectorTunnel` A Cloudflare Tunnel that connects your origin to Cloudflare's edge. - `CloudflareTunnel` A Cloudflare Tunnel that connects your origin to Cloudflare's edge. - `id?: string` UUID of the tunnel. - `account_tag?: string` Cloudflare account ID - `config_src?: "local" | "cloudflare"` Indicates if this is a locally or remotely configured tunnel. If `local`, manage the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the tunnel on the Zero Trust dashboard. - `"local"` - `"cloudflare"` - `connections?: Array` The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - `id?: string` UUID of the Cloudflare Tunnel connection. - `client_id?: string` UUID of the Cloudflare Tunnel connector. - `client_version?: string` The cloudflared version used to establish this connection. - `colo_name?: string` The Cloudflare data center used for this connection. - `is_pending_reconnect?: boolean` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `opened_at?: string` Timestamp of when the connection was established. - `origin_ip?: string` The public IP address of the host running cloudflared. - `uuid?: string` UUID of the Cloudflare Tunnel connection. - `conns_active_at?: string` Timestamp of when the tunnel established at least one connection to Cloudflare's edge. If `null`, the tunnel is inactive. - `conns_inactive_at?: string` Timestamp of when the tunnel became inactive (no connections to Cloudflare's edge). If `null`, the tunnel is active. - `created_at?: string` Timestamp of when the resource was created. - `deleted_at?: string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `metadata?: unknown` Metadata associated with the tunnel. - `name?: string` A user-friendly name for a tunnel. - `remote_config?: boolean` If `true`, the tunnel can be configured remotely from the Zero Trust dashboard. If `false`, the tunnel must be configured locally on the origin machine. - `status?: "inactive" | "degraded" | "healthy" | "down"` The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - `"inactive"` - `"degraded"` - `"healthy"` - `"down"` - `tun_type?: "cfd_tunnel" | "warp_connector" | "warp" | 4 more` The type of tunnel. - `"cfd_tunnel"` - `"warp_connector"` - `"warp"` - `"magic"` - `"ip_sec"` - `"gre"` - `"cni"` - `TunnelWARPConnectorTunnel` A Warp Connector Tunnel that connects your origin to Cloudflare's edge. - `id?: string` UUID of the tunnel. - `account_tag?: string` Cloudflare account ID - `connections?: Array` The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - `id?: string` UUID of the Cloudflare Tunnel connection. - `client_id?: string` UUID of the Cloudflare Tunnel connector. - `client_version?: string` The cloudflared version used to establish this connection. - `colo_name?: string` The Cloudflare data center used for this connection. - `is_pending_reconnect?: boolean` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `opened_at?: string` Timestamp of when the connection was established. - `origin_ip?: string` The public IP address of the host running cloudflared. - `uuid?: string` UUID of the Cloudflare Tunnel connection. - `conns_active_at?: string` Timestamp of when the tunnel established at least one connection to Cloudflare's edge. If `null`, the tunnel is inactive. - `conns_inactive_at?: string` Timestamp of when the tunnel became inactive (no connections to Cloudflare's edge). If `null`, the tunnel is active. - `created_at?: string` Timestamp of when the resource was created. - `deleted_at?: string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `metadata?: unknown` Metadata associated with the tunnel. - `name?: string` A user-friendly name for a tunnel. - `status?: "inactive" | "degraded" | "healthy" | "down"` The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - `"inactive"` - `"degraded"` - `"healthy"` - `"down"` - `tun_type?: "cfd_tunnel" | "warp_connector" | "warp" | 4 more` The type of tunnel. - `"cfd_tunnel"` - `"warp_connector"` - `"warp"` - `"magic"` - `"ip_sec"` - `"gre"` - `"cni"` ### Example ```node 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 tunnelListResponse of client.zeroTrust.tunnels.list({ account_id: '699d98642c564d2e855e9661899b7252', })) { console.log(tunnelListResponse); } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": [ { "id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "account_tag": "699d98642c564d2e855e9661899b7252", "config_src": "cloudflare", "connections": [ { "id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_version": "2022.7.1", "colo_name": "DFW", "is_pending_reconnect": false, "opened_at": "2021-01-25T18:22:34.317854Z", "origin_ip": "10.1.0.137", "uuid": "1bedc50d-42b3-473c-b108-ff3d10c0d925" } ], "conns_active_at": "2009-11-10T23:00:00Z", "conns_inactive_at": "2009-11-10T23:00:00Z", "created_at": "2021-01-25T18:22:34.317854Z", "deleted_at": "2009-11-10T23:00:00.000000Z", "metadata": {}, "name": "blog", "remote_config": true, "status": "healthy", "tun_type": "cfd_tunnel" } ], "success": true, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 } } ``` ## Domain Types ### Connection - `Connection` - `colo_name?: string` The Cloudflare data center used for this connection. - `is_pending_reconnect?: boolean` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `uuid?: string` UUID of the Cloudflare Tunnel connection. ### Tunnel List Response - `TunnelListResponse = CloudflareTunnel | TunnelWARPConnectorTunnel` A Cloudflare Tunnel that connects your origin to Cloudflare's edge. - `CloudflareTunnel` A Cloudflare Tunnel that connects your origin to Cloudflare's edge. - `id?: string` UUID of the tunnel. - `account_tag?: string` Cloudflare account ID - `config_src?: "local" | "cloudflare"` Indicates if this is a locally or remotely configured tunnel. If `local`, manage the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the tunnel on the Zero Trust dashboard. - `"local"` - `"cloudflare"` - `connections?: Array` The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - `id?: string` UUID of the Cloudflare Tunnel connection. - `client_id?: string` UUID of the Cloudflare Tunnel connector. - `client_version?: string` The cloudflared version used to establish this connection. - `colo_name?: string` The Cloudflare data center used for this connection. - `is_pending_reconnect?: boolean` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `opened_at?: string` Timestamp of when the connection was established. - `origin_ip?: string` The public IP address of the host running cloudflared. - `uuid?: string` UUID of the Cloudflare Tunnel connection. - `conns_active_at?: string` Timestamp of when the tunnel established at least one connection to Cloudflare's edge. If `null`, the tunnel is inactive. - `conns_inactive_at?: string` Timestamp of when the tunnel became inactive (no connections to Cloudflare's edge). If `null`, the tunnel is active. - `created_at?: string` Timestamp of when the resource was created. - `deleted_at?: string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `metadata?: unknown` Metadata associated with the tunnel. - `name?: string` A user-friendly name for a tunnel. - `remote_config?: boolean` If `true`, the tunnel can be configured remotely from the Zero Trust dashboard. If `false`, the tunnel must be configured locally on the origin machine. - `status?: "inactive" | "degraded" | "healthy" | "down"` The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - `"inactive"` - `"degraded"` - `"healthy"` - `"down"` - `tun_type?: "cfd_tunnel" | "warp_connector" | "warp" | 4 more` The type of tunnel. - `"cfd_tunnel"` - `"warp_connector"` - `"warp"` - `"magic"` - `"ip_sec"` - `"gre"` - `"cni"` - `TunnelWARPConnectorTunnel` A Warp Connector Tunnel that connects your origin to Cloudflare's edge. - `id?: string` UUID of the tunnel. - `account_tag?: string` Cloudflare account ID - `connections?: Array` The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - `id?: string` UUID of the Cloudflare Tunnel connection. - `client_id?: string` UUID of the Cloudflare Tunnel connector. - `client_version?: string` The cloudflared version used to establish this connection. - `colo_name?: string` The Cloudflare data center used for this connection. - `is_pending_reconnect?: boolean` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `opened_at?: string` Timestamp of when the connection was established. - `origin_ip?: string` The public IP address of the host running cloudflared. - `uuid?: string` UUID of the Cloudflare Tunnel connection. - `conns_active_at?: string` Timestamp of when the tunnel established at least one connection to Cloudflare's edge. If `null`, the tunnel is inactive. - `conns_inactive_at?: string` Timestamp of when the tunnel became inactive (no connections to Cloudflare's edge). If `null`, the tunnel is active. - `created_at?: string` Timestamp of when the resource was created. - `deleted_at?: string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `metadata?: unknown` Metadata associated with the tunnel. - `name?: string` A user-friendly name for a tunnel. - `status?: "inactive" | "degraded" | "healthy" | "down"` The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - `"inactive"` - `"degraded"` - `"healthy"` - `"down"` - `tun_type?: "cfd_tunnel" | "warp_connector" | "warp" | 4 more` The type of tunnel. - `"cfd_tunnel"` - `"warp_connector"` - `"warp"` - `"magic"` - `"ip_sec"` - `"gre"` - `"cni"` # Cloudflared ## List Cloudflare Tunnels `client.zeroTrust.tunnels.cloudflared.list(CloudflaredListParamsparams, RequestOptionsoptions?): V4PagePaginationArray` **get** `/accounts/{account_id}/cfd_tunnel` Lists and filters Cloudflare Tunnels in an account. ### Parameters - `params: CloudflaredListParams` - `account_id: string` Path param: Cloudflare account ID - `exclude_prefix?: string` Query param - `existed_at?: string` Query param: If provided, include only resources that were created (and not deleted) before this time. URL encoded. - `include_prefix?: string` Query param - `is_deleted?: boolean` Query param: If `true`, only include deleted tunnels. If `false`, exclude deleted tunnels. If empty, all tunnels will be included. - `name?: string` Query param: A user-friendly name for a tunnel. - `page?: number` Query param: Page number of paginated results. - `per_page?: number` Query param: Number of results to display. - `status?: "inactive" | "degraded" | "healthy" | "down"` Query param: The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - `"inactive"` - `"degraded"` - `"healthy"` - `"down"` - `uuid?: string` Query param: UUID of the tunnel. - `was_active_at?: string` Query param - `was_inactive_at?: string` Query param ### Returns - `CloudflareTunnel` A Cloudflare Tunnel that connects your origin to Cloudflare's edge. - `id?: string` UUID of the tunnel. - `account_tag?: string` Cloudflare account ID - `config_src?: "local" | "cloudflare"` Indicates if this is a locally or remotely configured tunnel. If `local`, manage the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the tunnel on the Zero Trust dashboard. - `"local"` - `"cloudflare"` - `connections?: Array` The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - `id?: string` UUID of the Cloudflare Tunnel connection. - `client_id?: string` UUID of the Cloudflare Tunnel connector. - `client_version?: string` The cloudflared version used to establish this connection. - `colo_name?: string` The Cloudflare data center used for this connection. - `is_pending_reconnect?: boolean` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `opened_at?: string` Timestamp of when the connection was established. - `origin_ip?: string` The public IP address of the host running cloudflared. - `uuid?: string` UUID of the Cloudflare Tunnel connection. - `conns_active_at?: string` Timestamp of when the tunnel established at least one connection to Cloudflare's edge. If `null`, the tunnel is inactive. - `conns_inactive_at?: string` Timestamp of when the tunnel became inactive (no connections to Cloudflare's edge). If `null`, the tunnel is active. - `created_at?: string` Timestamp of when the resource was created. - `deleted_at?: string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `metadata?: unknown` Metadata associated with the tunnel. - `name?: string` A user-friendly name for a tunnel. - `remote_config?: boolean` If `true`, the tunnel can be configured remotely from the Zero Trust dashboard. If `false`, the tunnel must be configured locally on the origin machine. - `status?: "inactive" | "degraded" | "healthy" | "down"` The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - `"inactive"` - `"degraded"` - `"healthy"` - `"down"` - `tun_type?: "cfd_tunnel" | "warp_connector" | "warp" | 4 more` The type of tunnel. - `"cfd_tunnel"` - `"warp_connector"` - `"warp"` - `"magic"` - `"ip_sec"` - `"gre"` - `"cni"` ### Example ```node 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 cloudflareTunnel of client.zeroTrust.tunnels.cloudflared.list({ account_id: '699d98642c564d2e855e9661899b7252', })) { console.log(cloudflareTunnel.id); } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": [ { "id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "account_tag": "699d98642c564d2e855e9661899b7252", "config_src": "cloudflare", "connections": [ { "id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_version": "2022.7.1", "colo_name": "DFW", "is_pending_reconnect": false, "opened_at": "2021-01-25T18:22:34.317854Z", "origin_ip": "10.1.0.137", "uuid": "1bedc50d-42b3-473c-b108-ff3d10c0d925" } ], "conns_active_at": "2009-11-10T23:00:00Z", "conns_inactive_at": "2009-11-10T23:00:00Z", "created_at": "2021-01-25T18:22:34.317854Z", "deleted_at": "2009-11-10T23:00:00.000000Z", "metadata": {}, "name": "blog", "remote_config": true, "status": "healthy", "tun_type": "cfd_tunnel" } ], "success": true, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 } } ``` ## Get a Cloudflare Tunnel `client.zeroTrust.tunnels.cloudflared.get(stringtunnelId, CloudflaredGetParamsparams, RequestOptionsoptions?): CloudflareTunnel` **get** `/accounts/{account_id}/cfd_tunnel/{tunnel_id}` Fetches a single Cloudflare Tunnel. ### Parameters - `tunnelId: string` UUID of the tunnel. - `params: CloudflaredGetParams` - `account_id: string` Cloudflare account ID ### Returns - `CloudflareTunnel` A Cloudflare Tunnel that connects your origin to Cloudflare's edge. - `id?: string` UUID of the tunnel. - `account_tag?: string` Cloudflare account ID - `config_src?: "local" | "cloudflare"` Indicates if this is a locally or remotely configured tunnel. If `local`, manage the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the tunnel on the Zero Trust dashboard. - `"local"` - `"cloudflare"` - `connections?: Array` The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - `id?: string` UUID of the Cloudflare Tunnel connection. - `client_id?: string` UUID of the Cloudflare Tunnel connector. - `client_version?: string` The cloudflared version used to establish this connection. - `colo_name?: string` The Cloudflare data center used for this connection. - `is_pending_reconnect?: boolean` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `opened_at?: string` Timestamp of when the connection was established. - `origin_ip?: string` The public IP address of the host running cloudflared. - `uuid?: string` UUID of the Cloudflare Tunnel connection. - `conns_active_at?: string` Timestamp of when the tunnel established at least one connection to Cloudflare's edge. If `null`, the tunnel is inactive. - `conns_inactive_at?: string` Timestamp of when the tunnel became inactive (no connections to Cloudflare's edge). If `null`, the tunnel is active. - `created_at?: string` Timestamp of when the resource was created. - `deleted_at?: string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `metadata?: unknown` Metadata associated with the tunnel. - `name?: string` A user-friendly name for a tunnel. - `remote_config?: boolean` If `true`, the tunnel can be configured remotely from the Zero Trust dashboard. If `false`, the tunnel must be configured locally on the origin machine. - `status?: "inactive" | "degraded" | "healthy" | "down"` The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - `"inactive"` - `"degraded"` - `"healthy"` - `"down"` - `tun_type?: "cfd_tunnel" | "warp_connector" | "warp" | 4 more` The type of tunnel. - `"cfd_tunnel"` - `"warp_connector"` - `"warp"` - `"magic"` - `"ip_sec"` - `"gre"` - `"cni"` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const cloudflareTunnel = await client.zeroTrust.tunnels.cloudflared.get( 'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415', { account_id: '699d98642c564d2e855e9661899b7252' }, ); console.log(cloudflareTunnel.id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "account_tag": "699d98642c564d2e855e9661899b7252", "config_src": "cloudflare", "connections": [ { "id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_version": "2022.7.1", "colo_name": "DFW", "is_pending_reconnect": false, "opened_at": "2021-01-25T18:22:34.317854Z", "origin_ip": "10.1.0.137", "uuid": "1bedc50d-42b3-473c-b108-ff3d10c0d925" } ], "conns_active_at": "2009-11-10T23:00:00Z", "conns_inactive_at": "2009-11-10T23:00:00Z", "created_at": "2021-01-25T18:22:34.317854Z", "deleted_at": "2009-11-10T23:00:00.000000Z", "metadata": {}, "name": "blog", "remote_config": true, "status": "healthy", "tun_type": "cfd_tunnel" }, "success": true } ``` ## Create a Cloudflare Tunnel `client.zeroTrust.tunnels.cloudflared.create(CloudflaredCreateParamsparams, RequestOptionsoptions?): CloudflareTunnel` **post** `/accounts/{account_id}/cfd_tunnel` Creates a new Cloudflare Tunnel in an account. ### Parameters - `params: CloudflaredCreateParams` - `account_id: string` Path param: Cloudflare account ID - `name: string` Body param: A user-friendly name for a tunnel. - `config_src?: "local" | "cloudflare"` Body param: Indicates if this is a locally or remotely configured tunnel. If `local`, manage the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the tunnel on the Zero Trust dashboard. - `"local"` - `"cloudflare"` - `tunnel_secret?: string` Body param: Sets the password required to run a locally-managed tunnel. Must be at least 32 bytes and encoded as a base64 string. ### Returns - `CloudflareTunnel` A Cloudflare Tunnel that connects your origin to Cloudflare's edge. - `id?: string` UUID of the tunnel. - `account_tag?: string` Cloudflare account ID - `config_src?: "local" | "cloudflare"` Indicates if this is a locally or remotely configured tunnel. If `local`, manage the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the tunnel on the Zero Trust dashboard. - `"local"` - `"cloudflare"` - `connections?: Array` The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - `id?: string` UUID of the Cloudflare Tunnel connection. - `client_id?: string` UUID of the Cloudflare Tunnel connector. - `client_version?: string` The cloudflared version used to establish this connection. - `colo_name?: string` The Cloudflare data center used for this connection. - `is_pending_reconnect?: boolean` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `opened_at?: string` Timestamp of when the connection was established. - `origin_ip?: string` The public IP address of the host running cloudflared. - `uuid?: string` UUID of the Cloudflare Tunnel connection. - `conns_active_at?: string` Timestamp of when the tunnel established at least one connection to Cloudflare's edge. If `null`, the tunnel is inactive. - `conns_inactive_at?: string` Timestamp of when the tunnel became inactive (no connections to Cloudflare's edge). If `null`, the tunnel is active. - `created_at?: string` Timestamp of when the resource was created. - `deleted_at?: string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `metadata?: unknown` Metadata associated with the tunnel. - `name?: string` A user-friendly name for a tunnel. - `remote_config?: boolean` If `true`, the tunnel can be configured remotely from the Zero Trust dashboard. If `false`, the tunnel must be configured locally on the origin machine. - `status?: "inactive" | "degraded" | "healthy" | "down"` The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - `"inactive"` - `"degraded"` - `"healthy"` - `"down"` - `tun_type?: "cfd_tunnel" | "warp_connector" | "warp" | 4 more` The type of tunnel. - `"cfd_tunnel"` - `"warp_connector"` - `"warp"` - `"magic"` - `"ip_sec"` - `"gre"` - `"cni"` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const cloudflareTunnel = await client.zeroTrust.tunnels.cloudflared.create({ account_id: '699d98642c564d2e855e9661899b7252', name: 'blog', }); console.log(cloudflareTunnel.id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "account_tag": "699d98642c564d2e855e9661899b7252", "config_src": "cloudflare", "connections": [ { "id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_version": "2022.7.1", "colo_name": "DFW", "is_pending_reconnect": false, "opened_at": "2021-01-25T18:22:34.317854Z", "origin_ip": "10.1.0.137", "uuid": "1bedc50d-42b3-473c-b108-ff3d10c0d925" } ], "conns_active_at": "2009-11-10T23:00:00Z", "conns_inactive_at": "2009-11-10T23:00:00Z", "created_at": "2021-01-25T18:22:34.317854Z", "deleted_at": "2009-11-10T23:00:00.000000Z", "metadata": {}, "name": "blog", "remote_config": true, "status": "healthy", "tun_type": "cfd_tunnel" }, "success": true } ``` ## Update a Cloudflare Tunnel `client.zeroTrust.tunnels.cloudflared.edit(stringtunnelId, CloudflaredEditParamsparams, RequestOptionsoptions?): CloudflareTunnel` **patch** `/accounts/{account_id}/cfd_tunnel/{tunnel_id}` Updates an existing Cloudflare Tunnel. ### Parameters - `tunnelId: string` UUID of the tunnel. - `params: CloudflaredEditParams` - `account_id: string` Path param: Cloudflare account ID - `name?: string` Body param: A user-friendly name for a tunnel. - `tunnel_secret?: string` Body param: Sets the password required to run a locally-managed tunnel. Must be at least 32 bytes and encoded as a base64 string. ### Returns - `CloudflareTunnel` A Cloudflare Tunnel that connects your origin to Cloudflare's edge. - `id?: string` UUID of the tunnel. - `account_tag?: string` Cloudflare account ID - `config_src?: "local" | "cloudflare"` Indicates if this is a locally or remotely configured tunnel. If `local`, manage the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the tunnel on the Zero Trust dashboard. - `"local"` - `"cloudflare"` - `connections?: Array` The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - `id?: string` UUID of the Cloudflare Tunnel connection. - `client_id?: string` UUID of the Cloudflare Tunnel connector. - `client_version?: string` The cloudflared version used to establish this connection. - `colo_name?: string` The Cloudflare data center used for this connection. - `is_pending_reconnect?: boolean` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `opened_at?: string` Timestamp of when the connection was established. - `origin_ip?: string` The public IP address of the host running cloudflared. - `uuid?: string` UUID of the Cloudflare Tunnel connection. - `conns_active_at?: string` Timestamp of when the tunnel established at least one connection to Cloudflare's edge. If `null`, the tunnel is inactive. - `conns_inactive_at?: string` Timestamp of when the tunnel became inactive (no connections to Cloudflare's edge). If `null`, the tunnel is active. - `created_at?: string` Timestamp of when the resource was created. - `deleted_at?: string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `metadata?: unknown` Metadata associated with the tunnel. - `name?: string` A user-friendly name for a tunnel. - `remote_config?: boolean` If `true`, the tunnel can be configured remotely from the Zero Trust dashboard. If `false`, the tunnel must be configured locally on the origin machine. - `status?: "inactive" | "degraded" | "healthy" | "down"` The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - `"inactive"` - `"degraded"` - `"healthy"` - `"down"` - `tun_type?: "cfd_tunnel" | "warp_connector" | "warp" | 4 more` The type of tunnel. - `"cfd_tunnel"` - `"warp_connector"` - `"warp"` - `"magic"` - `"ip_sec"` - `"gre"` - `"cni"` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const cloudflareTunnel = await client.zeroTrust.tunnels.cloudflared.edit( 'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415', { account_id: '699d98642c564d2e855e9661899b7252' }, ); console.log(cloudflareTunnel.id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "account_tag": "699d98642c564d2e855e9661899b7252", "config_src": "cloudflare", "connections": [ { "id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_version": "2022.7.1", "colo_name": "DFW", "is_pending_reconnect": false, "opened_at": "2021-01-25T18:22:34.317854Z", "origin_ip": "10.1.0.137", "uuid": "1bedc50d-42b3-473c-b108-ff3d10c0d925" } ], "conns_active_at": "2009-11-10T23:00:00Z", "conns_inactive_at": "2009-11-10T23:00:00Z", "created_at": "2021-01-25T18:22:34.317854Z", "deleted_at": "2009-11-10T23:00:00.000000Z", "metadata": {}, "name": "blog", "remote_config": true, "status": "healthy", "tun_type": "cfd_tunnel" }, "success": true } ``` ## Delete a Cloudflare Tunnel `client.zeroTrust.tunnels.cloudflared.delete(stringtunnelId, CloudflaredDeleteParamsparams, RequestOptionsoptions?): CloudflareTunnel` **delete** `/accounts/{account_id}/cfd_tunnel/{tunnel_id}` Deletes a Cloudflare Tunnel from an account. ### Parameters - `tunnelId: string` UUID of the tunnel. - `params: CloudflaredDeleteParams` - `account_id: string` Cloudflare account ID ### Returns - `CloudflareTunnel` A Cloudflare Tunnel that connects your origin to Cloudflare's edge. - `id?: string` UUID of the tunnel. - `account_tag?: string` Cloudflare account ID - `config_src?: "local" | "cloudflare"` Indicates if this is a locally or remotely configured tunnel. If `local`, manage the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the tunnel on the Zero Trust dashboard. - `"local"` - `"cloudflare"` - `connections?: Array` The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - `id?: string` UUID of the Cloudflare Tunnel connection. - `client_id?: string` UUID of the Cloudflare Tunnel connector. - `client_version?: string` The cloudflared version used to establish this connection. - `colo_name?: string` The Cloudflare data center used for this connection. - `is_pending_reconnect?: boolean` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `opened_at?: string` Timestamp of when the connection was established. - `origin_ip?: string` The public IP address of the host running cloudflared. - `uuid?: string` UUID of the Cloudflare Tunnel connection. - `conns_active_at?: string` Timestamp of when the tunnel established at least one connection to Cloudflare's edge. If `null`, the tunnel is inactive. - `conns_inactive_at?: string` Timestamp of when the tunnel became inactive (no connections to Cloudflare's edge). If `null`, the tunnel is active. - `created_at?: string` Timestamp of when the resource was created. - `deleted_at?: string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `metadata?: unknown` Metadata associated with the tunnel. - `name?: string` A user-friendly name for a tunnel. - `remote_config?: boolean` If `true`, the tunnel can be configured remotely from the Zero Trust dashboard. If `false`, the tunnel must be configured locally on the origin machine. - `status?: "inactive" | "degraded" | "healthy" | "down"` The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - `"inactive"` - `"degraded"` - `"healthy"` - `"down"` - `tun_type?: "cfd_tunnel" | "warp_connector" | "warp" | 4 more` The type of tunnel. - `"cfd_tunnel"` - `"warp_connector"` - `"warp"` - `"magic"` - `"ip_sec"` - `"gre"` - `"cni"` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const cloudflareTunnel = await client.zeroTrust.tunnels.cloudflared.delete( 'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415', { account_id: '699d98642c564d2e855e9661899b7252' }, ); console.log(cloudflareTunnel.id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "account_tag": "699d98642c564d2e855e9661899b7252", "config_src": "cloudflare", "connections": [ { "id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_version": "2022.7.1", "colo_name": "DFW", "is_pending_reconnect": false, "opened_at": "2021-01-25T18:22:34.317854Z", "origin_ip": "10.1.0.137", "uuid": "1bedc50d-42b3-473c-b108-ff3d10c0d925" } ], "conns_active_at": "2009-11-10T23:00:00Z", "conns_inactive_at": "2009-11-10T23:00:00Z", "created_at": "2021-01-25T18:22:34.317854Z", "deleted_at": "2009-11-10T23:00:00.000000Z", "metadata": {}, "name": "blog", "remote_config": true, "status": "healthy", "tun_type": "cfd_tunnel" }, "success": true } ``` # Configurations ## Get configuration `client.zeroTrust.tunnels.cloudflared.configurations.get(stringtunnelId, ConfigurationGetParamsparams, RequestOptionsoptions?): ConfigurationGetResponse` **get** `/accounts/{account_id}/cfd_tunnel/{tunnel_id}/configurations` Gets the configuration for a remotely-managed tunnel ### Parameters - `tunnelId: string` UUID of the tunnel. - `params: ConfigurationGetParams` - `account_id: string` Identifier. ### Returns - `ConfigurationGetResponse` Cloudflare Tunnel configuration - `account_id?: string` Identifier. - `config?: Config` The tunnel configuration and ingress rules. - `ingress?: Array` List of public hostname definitions. At least one ingress rule needs to be defined for the tunnel. - `hostname: string` Public hostname for this service. - `service: string` Protocol and address of destination server. Supported protocols: http://, https://, unix://, tcp://, ssh://, rdp://, unix+tls://, smb://. Alternatively can return a HTTP status code http_status:[code] e.g. 'http_status:404'. - `originRequest?: OriginRequest` Configuration parameters for the public hostname specific connection settings between cloudflared and origin server. - `access?: Access` For all L7 requests to this hostname, cloudflared will validate each request's Cf-Access-Jwt-Assertion request header. - `audTag: Array` Access applications that are allowed to reach this hostname for this Tunnel. Audience tags can be identified in the dashboard or via the List Access policies API. - `teamName: string` - `required?: boolean` Deny traffic that has not fulfilled Access authorization. - `caPool?: string` Path to the certificate authority (CA) for the certificate of your origin. This option should be used only if your certificate is not signed by Cloudflare. - `connectTimeout?: number` Timeout for establishing a new TCP connection to your origin server. This excludes the time taken to establish TLS, which is controlled by tlsTimeout. - `disableChunkedEncoding?: boolean` Disables chunked transfer encoding. Useful if you are running a WSGI server. - `http2Origin?: boolean` Attempt to connect to origin using HTTP2. Origin must be configured as https. - `httpHostHeader?: string` Sets the HTTP Host header on requests sent to the local service. - `keepAliveConnections?: number` Maximum number of idle keepalive connections between Tunnel and your origin. This does not restrict the total number of concurrent connections. - `keepAliveTimeout?: number` Timeout after which an idle keepalive connection can be discarded. - `matchSNItoHost?: boolean` Auto configure the Hostname on the origin server certificate. - `noHappyEyeballs?: boolean` Disable the “happy eyeballs” algorithm for IPv4/IPv6 fallback if your local network has misconfigured one of the protocols. - `noTLSVerify?: boolean` Disables TLS verification of the certificate presented by your origin. Will allow any certificate from the origin to be accepted. - `originServerName?: string` Hostname that cloudflared should expect from your origin server certificate. - `proxyType?: string` cloudflared starts a proxy server to translate HTTP traffic into TCP when proxying, for example, SSH or RDP. This configures what type of proxy will be started. Valid options are: "" for the regular proxy and "socks" for a SOCKS5 proxy. - `tcpKeepAlive?: number` The timeout after which a TCP keepalive packet is sent on a connection between Tunnel and the origin server. - `tlsTimeout?: number` Timeout for completing a TLS handshake to your origin server, if you have chosen to connect Tunnel to an HTTPS server. - `path?: string` Requests with this path route to this public hostname. - `originRequest?: OriginRequest` Configuration parameters for the public hostname specific connection settings between cloudflared and origin server. - `access?: Access` For all L7 requests to this hostname, cloudflared will validate each request's Cf-Access-Jwt-Assertion request header. - `audTag: Array` Access applications that are allowed to reach this hostname for this Tunnel. Audience tags can be identified in the dashboard or via the List Access policies API. - `teamName: string` - `required?: boolean` Deny traffic that has not fulfilled Access authorization. - `caPool?: string` Path to the certificate authority (CA) for the certificate of your origin. This option should be used only if your certificate is not signed by Cloudflare. - `connectTimeout?: number` Timeout for establishing a new TCP connection to your origin server. This excludes the time taken to establish TLS, which is controlled by tlsTimeout. - `disableChunkedEncoding?: boolean` Disables chunked transfer encoding. Useful if you are running a WSGI server. - `http2Origin?: boolean` Attempt to connect to origin using HTTP2. Origin must be configured as https. - `httpHostHeader?: string` Sets the HTTP Host header on requests sent to the local service. - `keepAliveConnections?: number` Maximum number of idle keepalive connections between Tunnel and your origin. This does not restrict the total number of concurrent connections. - `keepAliveTimeout?: number` Timeout after which an idle keepalive connection can be discarded. - `matchSNItoHost?: boolean` Auto configure the Hostname on the origin server certificate. - `noHappyEyeballs?: boolean` Disable the “happy eyeballs” algorithm for IPv4/IPv6 fallback if your local network has misconfigured one of the protocols. - `noTLSVerify?: boolean` Disables TLS verification of the certificate presented by your origin. Will allow any certificate from the origin to be accepted. - `originServerName?: string` Hostname that cloudflared should expect from your origin server certificate. - `proxyType?: string` cloudflared starts a proxy server to translate HTTP traffic into TCP when proxying, for example, SSH or RDP. This configures what type of proxy will be started. Valid options are: "" for the regular proxy and "socks" for a SOCKS5 proxy. - `tcpKeepAlive?: number` The timeout after which a TCP keepalive packet is sent on a connection between Tunnel and the origin server. - `tlsTimeout?: number` Timeout for completing a TLS handshake to your origin server, if you have chosen to connect Tunnel to an HTTPS server. - `created_at?: string` - `source?: "local" | "cloudflare"` Indicates if this is a locally or remotely configured tunnel. If `local`, manage the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the tunnel's configuration on the Zero Trust dashboard. - `"local"` - `"cloudflare"` - `tunnel_id?: string` UUID of the tunnel. - `version?: number` The version of the Tunnel Configuration. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const configuration = await client.zeroTrust.tunnels.cloudflared.configurations.get( 'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(configuration.account_id); ``` #### Response ```json { "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": { "account_id": "023e105f4ecef8ad9ca31a8372d0c353", "config": { "ingress": [ { "hostname": "tunnel.example.com", "service": "https://localhost:8001", "originRequest": { "access": { "audTag": [ "string" ], "teamName": "zero-trust-organization-name", "required": false }, "caPool": "caPool", "connectTimeout": 10, "disableChunkedEncoding": true, "http2Origin": true, "httpHostHeader": "httpHostHeader", "keepAliveConnections": 100, "keepAliveTimeout": 90, "matchSNItoHost": false, "noHappyEyeballs": false, "noTLSVerify": false, "originServerName": "originServerName", "proxyType": "proxyType", "tcpKeepAlive": 30, "tlsTimeout": 10 }, "path": "subpath" } ], "originRequest": { "access": { "audTag": [ "string" ], "teamName": "zero-trust-organization-name", "required": false }, "caPool": "caPool", "connectTimeout": 10, "disableChunkedEncoding": true, "http2Origin": true, "httpHostHeader": "httpHostHeader", "keepAliveConnections": 100, "keepAliveTimeout": 90, "matchSNItoHost": false, "noHappyEyeballs": false, "noTLSVerify": false, "originServerName": "originServerName", "proxyType": "proxyType", "tcpKeepAlive": 30, "tlsTimeout": 10 }, "warp-routing": { "enabled": true } }, "created_at": "2014-01-01T05:20:00.12345Z", "source": "cloudflare", "tunnel_id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "version": 0 } } ``` ## Put configuration `client.zeroTrust.tunnels.cloudflared.configurations.update(stringtunnelId, ConfigurationUpdateParamsparams, RequestOptionsoptions?): ConfigurationUpdateResponse` **put** `/accounts/{account_id}/cfd_tunnel/{tunnel_id}/configurations` Adds or updates the configuration for a remotely-managed tunnel. ### Parameters - `tunnelId: string` UUID of the tunnel. - `params: ConfigurationUpdateParams` - `account_id: string` Path param: Identifier. - `config?: Config` Body param: The tunnel configuration and ingress rules. - `ingress?: Array` List of public hostname definitions. At least one ingress rule needs to be defined for the tunnel. - `hostname: string` Public hostname for this service. - `service: string` Protocol and address of destination server. Supported protocols: http://, https://, unix://, tcp://, ssh://, rdp://, unix+tls://, smb://. Alternatively can return a HTTP status code http_status:[code] e.g. 'http_status:404'. - `originRequest?: OriginRequest` Configuration parameters for the public hostname specific connection settings between cloudflared and origin server. - `access?: Access` For all L7 requests to this hostname, cloudflared will validate each request's Cf-Access-Jwt-Assertion request header. - `audTag: Array` Access applications that are allowed to reach this hostname for this Tunnel. Audience tags can be identified in the dashboard or via the List Access policies API. - `teamName: string` - `required?: boolean` Deny traffic that has not fulfilled Access authorization. - `caPool?: string` Path to the certificate authority (CA) for the certificate of your origin. This option should be used only if your certificate is not signed by Cloudflare. - `connectTimeout?: number` Timeout for establishing a new TCP connection to your origin server. This excludes the time taken to establish TLS, which is controlled by tlsTimeout. - `disableChunkedEncoding?: boolean` Disables chunked transfer encoding. Useful if you are running a WSGI server. - `http2Origin?: boolean` Attempt to connect to origin using HTTP2. Origin must be configured as https. - `httpHostHeader?: string` Sets the HTTP Host header on requests sent to the local service. - `keepAliveConnections?: number` Maximum number of idle keepalive connections between Tunnel and your origin. This does not restrict the total number of concurrent connections. - `keepAliveTimeout?: number` Timeout after which an idle keepalive connection can be discarded. - `matchSNItoHost?: boolean` Auto configure the Hostname on the origin server certificate. - `noHappyEyeballs?: boolean` Disable the “happy eyeballs” algorithm for IPv4/IPv6 fallback if your local network has misconfigured one of the protocols. - `noTLSVerify?: boolean` Disables TLS verification of the certificate presented by your origin. Will allow any certificate from the origin to be accepted. - `originServerName?: string` Hostname that cloudflared should expect from your origin server certificate. - `proxyType?: string` cloudflared starts a proxy server to translate HTTP traffic into TCP when proxying, for example, SSH or RDP. This configures what type of proxy will be started. Valid options are: "" for the regular proxy and "socks" for a SOCKS5 proxy. - `tcpKeepAlive?: number` The timeout after which a TCP keepalive packet is sent on a connection between Tunnel and the origin server. - `tlsTimeout?: number` Timeout for completing a TLS handshake to your origin server, if you have chosen to connect Tunnel to an HTTPS server. - `path?: string` Requests with this path route to this public hostname. - `originRequest?: OriginRequest` Configuration parameters for the public hostname specific connection settings between cloudflared and origin server. - `access?: Access` For all L7 requests to this hostname, cloudflared will validate each request's Cf-Access-Jwt-Assertion request header. - `audTag: Array` Access applications that are allowed to reach this hostname for this Tunnel. Audience tags can be identified in the dashboard or via the List Access policies API. - `teamName: string` - `required?: boolean` Deny traffic that has not fulfilled Access authorization. - `caPool?: string` Path to the certificate authority (CA) for the certificate of your origin. This option should be used only if your certificate is not signed by Cloudflare. - `connectTimeout?: number` Timeout for establishing a new TCP connection to your origin server. This excludes the time taken to establish TLS, which is controlled by tlsTimeout. - `disableChunkedEncoding?: boolean` Disables chunked transfer encoding. Useful if you are running a WSGI server. - `http2Origin?: boolean` Attempt to connect to origin using HTTP2. Origin must be configured as https. - `httpHostHeader?: string` Sets the HTTP Host header on requests sent to the local service. - `keepAliveConnections?: number` Maximum number of idle keepalive connections between Tunnel and your origin. This does not restrict the total number of concurrent connections. - `keepAliveTimeout?: number` Timeout after which an idle keepalive connection can be discarded. - `matchSNItoHost?: boolean` Auto configure the Hostname on the origin server certificate. - `noHappyEyeballs?: boolean` Disable the “happy eyeballs” algorithm for IPv4/IPv6 fallback if your local network has misconfigured one of the protocols. - `noTLSVerify?: boolean` Disables TLS verification of the certificate presented by your origin. Will allow any certificate from the origin to be accepted. - `originServerName?: string` Hostname that cloudflared should expect from your origin server certificate. - `proxyType?: string` cloudflared starts a proxy server to translate HTTP traffic into TCP when proxying, for example, SSH or RDP. This configures what type of proxy will be started. Valid options are: "" for the regular proxy and "socks" for a SOCKS5 proxy. - `tcpKeepAlive?: number` The timeout after which a TCP keepalive packet is sent on a connection between Tunnel and the origin server. - `tlsTimeout?: number` Timeout for completing a TLS handshake to your origin server, if you have chosen to connect Tunnel to an HTTPS server. ### Returns - `ConfigurationUpdateResponse` Cloudflare Tunnel configuration - `account_id?: string` Identifier. - `config?: Config` The tunnel configuration and ingress rules. - `ingress?: Array` List of public hostname definitions. At least one ingress rule needs to be defined for the tunnel. - `hostname: string` Public hostname for this service. - `service: string` Protocol and address of destination server. Supported protocols: http://, https://, unix://, tcp://, ssh://, rdp://, unix+tls://, smb://. Alternatively can return a HTTP status code http_status:[code] e.g. 'http_status:404'. - `originRequest?: OriginRequest` Configuration parameters for the public hostname specific connection settings between cloudflared and origin server. - `access?: Access` For all L7 requests to this hostname, cloudflared will validate each request's Cf-Access-Jwt-Assertion request header. - `audTag: Array` Access applications that are allowed to reach this hostname for this Tunnel. Audience tags can be identified in the dashboard or via the List Access policies API. - `teamName: string` - `required?: boolean` Deny traffic that has not fulfilled Access authorization. - `caPool?: string` Path to the certificate authority (CA) for the certificate of your origin. This option should be used only if your certificate is not signed by Cloudflare. - `connectTimeout?: number` Timeout for establishing a new TCP connection to your origin server. This excludes the time taken to establish TLS, which is controlled by tlsTimeout. - `disableChunkedEncoding?: boolean` Disables chunked transfer encoding. Useful if you are running a WSGI server. - `http2Origin?: boolean` Attempt to connect to origin using HTTP2. Origin must be configured as https. - `httpHostHeader?: string` Sets the HTTP Host header on requests sent to the local service. - `keepAliveConnections?: number` Maximum number of idle keepalive connections between Tunnel and your origin. This does not restrict the total number of concurrent connections. - `keepAliveTimeout?: number` Timeout after which an idle keepalive connection can be discarded. - `matchSNItoHost?: boolean` Auto configure the Hostname on the origin server certificate. - `noHappyEyeballs?: boolean` Disable the “happy eyeballs” algorithm for IPv4/IPv6 fallback if your local network has misconfigured one of the protocols. - `noTLSVerify?: boolean` Disables TLS verification of the certificate presented by your origin. Will allow any certificate from the origin to be accepted. - `originServerName?: string` Hostname that cloudflared should expect from your origin server certificate. - `proxyType?: string` cloudflared starts a proxy server to translate HTTP traffic into TCP when proxying, for example, SSH or RDP. This configures what type of proxy will be started. Valid options are: "" for the regular proxy and "socks" for a SOCKS5 proxy. - `tcpKeepAlive?: number` The timeout after which a TCP keepalive packet is sent on a connection between Tunnel and the origin server. - `tlsTimeout?: number` Timeout for completing a TLS handshake to your origin server, if you have chosen to connect Tunnel to an HTTPS server. - `path?: string` Requests with this path route to this public hostname. - `originRequest?: OriginRequest` Configuration parameters for the public hostname specific connection settings between cloudflared and origin server. - `access?: Access` For all L7 requests to this hostname, cloudflared will validate each request's Cf-Access-Jwt-Assertion request header. - `audTag: Array` Access applications that are allowed to reach this hostname for this Tunnel. Audience tags can be identified in the dashboard or via the List Access policies API. - `teamName: string` - `required?: boolean` Deny traffic that has not fulfilled Access authorization. - `caPool?: string` Path to the certificate authority (CA) for the certificate of your origin. This option should be used only if your certificate is not signed by Cloudflare. - `connectTimeout?: number` Timeout for establishing a new TCP connection to your origin server. This excludes the time taken to establish TLS, which is controlled by tlsTimeout. - `disableChunkedEncoding?: boolean` Disables chunked transfer encoding. Useful if you are running a WSGI server. - `http2Origin?: boolean` Attempt to connect to origin using HTTP2. Origin must be configured as https. - `httpHostHeader?: string` Sets the HTTP Host header on requests sent to the local service. - `keepAliveConnections?: number` Maximum number of idle keepalive connections between Tunnel and your origin. This does not restrict the total number of concurrent connections. - `keepAliveTimeout?: number` Timeout after which an idle keepalive connection can be discarded. - `matchSNItoHost?: boolean` Auto configure the Hostname on the origin server certificate. - `noHappyEyeballs?: boolean` Disable the “happy eyeballs” algorithm for IPv4/IPv6 fallback if your local network has misconfigured one of the protocols. - `noTLSVerify?: boolean` Disables TLS verification of the certificate presented by your origin. Will allow any certificate from the origin to be accepted. - `originServerName?: string` Hostname that cloudflared should expect from your origin server certificate. - `proxyType?: string` cloudflared starts a proxy server to translate HTTP traffic into TCP when proxying, for example, SSH or RDP. This configures what type of proxy will be started. Valid options are: "" for the regular proxy and "socks" for a SOCKS5 proxy. - `tcpKeepAlive?: number` The timeout after which a TCP keepalive packet is sent on a connection between Tunnel and the origin server. - `tlsTimeout?: number` Timeout for completing a TLS handshake to your origin server, if you have chosen to connect Tunnel to an HTTPS server. - `created_at?: string` - `source?: "local" | "cloudflare"` Indicates if this is a locally or remotely configured tunnel. If `local`, manage the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the tunnel's configuration on the Zero Trust dashboard. - `"local"` - `"cloudflare"` - `tunnel_id?: string` UUID of the tunnel. - `version?: number` The version of the Tunnel Configuration. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const configuration = await client.zeroTrust.tunnels.cloudflared.configurations.update( 'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(configuration.account_id); ``` #### Response ```json { "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": { "account_id": "023e105f4ecef8ad9ca31a8372d0c353", "config": { "ingress": [ { "hostname": "tunnel.example.com", "service": "https://localhost:8001", "originRequest": { "access": { "audTag": [ "string" ], "teamName": "zero-trust-organization-name", "required": false }, "caPool": "caPool", "connectTimeout": 10, "disableChunkedEncoding": true, "http2Origin": true, "httpHostHeader": "httpHostHeader", "keepAliveConnections": 100, "keepAliveTimeout": 90, "matchSNItoHost": false, "noHappyEyeballs": false, "noTLSVerify": false, "originServerName": "originServerName", "proxyType": "proxyType", "tcpKeepAlive": 30, "tlsTimeout": 10 }, "path": "subpath" } ], "originRequest": { "access": { "audTag": [ "string" ], "teamName": "zero-trust-organization-name", "required": false }, "caPool": "caPool", "connectTimeout": 10, "disableChunkedEncoding": true, "http2Origin": true, "httpHostHeader": "httpHostHeader", "keepAliveConnections": 100, "keepAliveTimeout": 90, "matchSNItoHost": false, "noHappyEyeballs": false, "noTLSVerify": false, "originServerName": "originServerName", "proxyType": "proxyType", "tcpKeepAlive": 30, "tlsTimeout": 10 }, "warp-routing": { "enabled": true } }, "created_at": "2014-01-01T05:20:00.12345Z", "source": "cloudflare", "tunnel_id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "version": 0 } } ``` ## Domain Types ### Configuration Get Response - `ConfigurationGetResponse` Cloudflare Tunnel configuration - `account_id?: string` Identifier. - `config?: Config` The tunnel configuration and ingress rules. - `ingress?: Array` List of public hostname definitions. At least one ingress rule needs to be defined for the tunnel. - `hostname: string` Public hostname for this service. - `service: string` Protocol and address of destination server. Supported protocols: http://, https://, unix://, tcp://, ssh://, rdp://, unix+tls://, smb://. Alternatively can return a HTTP status code http_status:[code] e.g. 'http_status:404'. - `originRequest?: OriginRequest` Configuration parameters for the public hostname specific connection settings between cloudflared and origin server. - `access?: Access` For all L7 requests to this hostname, cloudflared will validate each request's Cf-Access-Jwt-Assertion request header. - `audTag: Array` Access applications that are allowed to reach this hostname for this Tunnel. Audience tags can be identified in the dashboard or via the List Access policies API. - `teamName: string` - `required?: boolean` Deny traffic that has not fulfilled Access authorization. - `caPool?: string` Path to the certificate authority (CA) for the certificate of your origin. This option should be used only if your certificate is not signed by Cloudflare. - `connectTimeout?: number` Timeout for establishing a new TCP connection to your origin server. This excludes the time taken to establish TLS, which is controlled by tlsTimeout. - `disableChunkedEncoding?: boolean` Disables chunked transfer encoding. Useful if you are running a WSGI server. - `http2Origin?: boolean` Attempt to connect to origin using HTTP2. Origin must be configured as https. - `httpHostHeader?: string` Sets the HTTP Host header on requests sent to the local service. - `keepAliveConnections?: number` Maximum number of idle keepalive connections between Tunnel and your origin. This does not restrict the total number of concurrent connections. - `keepAliveTimeout?: number` Timeout after which an idle keepalive connection can be discarded. - `matchSNItoHost?: boolean` Auto configure the Hostname on the origin server certificate. - `noHappyEyeballs?: boolean` Disable the “happy eyeballs” algorithm for IPv4/IPv6 fallback if your local network has misconfigured one of the protocols. - `noTLSVerify?: boolean` Disables TLS verification of the certificate presented by your origin. Will allow any certificate from the origin to be accepted. - `originServerName?: string` Hostname that cloudflared should expect from your origin server certificate. - `proxyType?: string` cloudflared starts a proxy server to translate HTTP traffic into TCP when proxying, for example, SSH or RDP. This configures what type of proxy will be started. Valid options are: "" for the regular proxy and "socks" for a SOCKS5 proxy. - `tcpKeepAlive?: number` The timeout after which a TCP keepalive packet is sent on a connection between Tunnel and the origin server. - `tlsTimeout?: number` Timeout for completing a TLS handshake to your origin server, if you have chosen to connect Tunnel to an HTTPS server. - `path?: string` Requests with this path route to this public hostname. - `originRequest?: OriginRequest` Configuration parameters for the public hostname specific connection settings between cloudflared and origin server. - `access?: Access` For all L7 requests to this hostname, cloudflared will validate each request's Cf-Access-Jwt-Assertion request header. - `audTag: Array` Access applications that are allowed to reach this hostname for this Tunnel. Audience tags can be identified in the dashboard or via the List Access policies API. - `teamName: string` - `required?: boolean` Deny traffic that has not fulfilled Access authorization. - `caPool?: string` Path to the certificate authority (CA) for the certificate of your origin. This option should be used only if your certificate is not signed by Cloudflare. - `connectTimeout?: number` Timeout for establishing a new TCP connection to your origin server. This excludes the time taken to establish TLS, which is controlled by tlsTimeout. - `disableChunkedEncoding?: boolean` Disables chunked transfer encoding. Useful if you are running a WSGI server. - `http2Origin?: boolean` Attempt to connect to origin using HTTP2. Origin must be configured as https. - `httpHostHeader?: string` Sets the HTTP Host header on requests sent to the local service. - `keepAliveConnections?: number` Maximum number of idle keepalive connections between Tunnel and your origin. This does not restrict the total number of concurrent connections. - `keepAliveTimeout?: number` Timeout after which an idle keepalive connection can be discarded. - `matchSNItoHost?: boolean` Auto configure the Hostname on the origin server certificate. - `noHappyEyeballs?: boolean` Disable the “happy eyeballs” algorithm for IPv4/IPv6 fallback if your local network has misconfigured one of the protocols. - `noTLSVerify?: boolean` Disables TLS verification of the certificate presented by your origin. Will allow any certificate from the origin to be accepted. - `originServerName?: string` Hostname that cloudflared should expect from your origin server certificate. - `proxyType?: string` cloudflared starts a proxy server to translate HTTP traffic into TCP when proxying, for example, SSH or RDP. This configures what type of proxy will be started. Valid options are: "" for the regular proxy and "socks" for a SOCKS5 proxy. - `tcpKeepAlive?: number` The timeout after which a TCP keepalive packet is sent on a connection between Tunnel and the origin server. - `tlsTimeout?: number` Timeout for completing a TLS handshake to your origin server, if you have chosen to connect Tunnel to an HTTPS server. - `created_at?: string` - `source?: "local" | "cloudflare"` Indicates if this is a locally or remotely configured tunnel. If `local`, manage the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the tunnel's configuration on the Zero Trust dashboard. - `"local"` - `"cloudflare"` - `tunnel_id?: string` UUID of the tunnel. - `version?: number` The version of the Tunnel Configuration. ### Configuration Update Response - `ConfigurationUpdateResponse` Cloudflare Tunnel configuration - `account_id?: string` Identifier. - `config?: Config` The tunnel configuration and ingress rules. - `ingress?: Array` List of public hostname definitions. At least one ingress rule needs to be defined for the tunnel. - `hostname: string` Public hostname for this service. - `service: string` Protocol and address of destination server. Supported protocols: http://, https://, unix://, tcp://, ssh://, rdp://, unix+tls://, smb://. Alternatively can return a HTTP status code http_status:[code] e.g. 'http_status:404'. - `originRequest?: OriginRequest` Configuration parameters for the public hostname specific connection settings between cloudflared and origin server. - `access?: Access` For all L7 requests to this hostname, cloudflared will validate each request's Cf-Access-Jwt-Assertion request header. - `audTag: Array` Access applications that are allowed to reach this hostname for this Tunnel. Audience tags can be identified in the dashboard or via the List Access policies API. - `teamName: string` - `required?: boolean` Deny traffic that has not fulfilled Access authorization. - `caPool?: string` Path to the certificate authority (CA) for the certificate of your origin. This option should be used only if your certificate is not signed by Cloudflare. - `connectTimeout?: number` Timeout for establishing a new TCP connection to your origin server. This excludes the time taken to establish TLS, which is controlled by tlsTimeout. - `disableChunkedEncoding?: boolean` Disables chunked transfer encoding. Useful if you are running a WSGI server. - `http2Origin?: boolean` Attempt to connect to origin using HTTP2. Origin must be configured as https. - `httpHostHeader?: string` Sets the HTTP Host header on requests sent to the local service. - `keepAliveConnections?: number` Maximum number of idle keepalive connections between Tunnel and your origin. This does not restrict the total number of concurrent connections. - `keepAliveTimeout?: number` Timeout after which an idle keepalive connection can be discarded. - `matchSNItoHost?: boolean` Auto configure the Hostname on the origin server certificate. - `noHappyEyeballs?: boolean` Disable the “happy eyeballs” algorithm for IPv4/IPv6 fallback if your local network has misconfigured one of the protocols. - `noTLSVerify?: boolean` Disables TLS verification of the certificate presented by your origin. Will allow any certificate from the origin to be accepted. - `originServerName?: string` Hostname that cloudflared should expect from your origin server certificate. - `proxyType?: string` cloudflared starts a proxy server to translate HTTP traffic into TCP when proxying, for example, SSH or RDP. This configures what type of proxy will be started. Valid options are: "" for the regular proxy and "socks" for a SOCKS5 proxy. - `tcpKeepAlive?: number` The timeout after which a TCP keepalive packet is sent on a connection between Tunnel and the origin server. - `tlsTimeout?: number` Timeout for completing a TLS handshake to your origin server, if you have chosen to connect Tunnel to an HTTPS server. - `path?: string` Requests with this path route to this public hostname. - `originRequest?: OriginRequest` Configuration parameters for the public hostname specific connection settings between cloudflared and origin server. - `access?: Access` For all L7 requests to this hostname, cloudflared will validate each request's Cf-Access-Jwt-Assertion request header. - `audTag: Array` Access applications that are allowed to reach this hostname for this Tunnel. Audience tags can be identified in the dashboard or via the List Access policies API. - `teamName: string` - `required?: boolean` Deny traffic that has not fulfilled Access authorization. - `caPool?: string` Path to the certificate authority (CA) for the certificate of your origin. This option should be used only if your certificate is not signed by Cloudflare. - `connectTimeout?: number` Timeout for establishing a new TCP connection to your origin server. This excludes the time taken to establish TLS, which is controlled by tlsTimeout. - `disableChunkedEncoding?: boolean` Disables chunked transfer encoding. Useful if you are running a WSGI server. - `http2Origin?: boolean` Attempt to connect to origin using HTTP2. Origin must be configured as https. - `httpHostHeader?: string` Sets the HTTP Host header on requests sent to the local service. - `keepAliveConnections?: number` Maximum number of idle keepalive connections between Tunnel and your origin. This does not restrict the total number of concurrent connections. - `keepAliveTimeout?: number` Timeout after which an idle keepalive connection can be discarded. - `matchSNItoHost?: boolean` Auto configure the Hostname on the origin server certificate. - `noHappyEyeballs?: boolean` Disable the “happy eyeballs” algorithm for IPv4/IPv6 fallback if your local network has misconfigured one of the protocols. - `noTLSVerify?: boolean` Disables TLS verification of the certificate presented by your origin. Will allow any certificate from the origin to be accepted. - `originServerName?: string` Hostname that cloudflared should expect from your origin server certificate. - `proxyType?: string` cloudflared starts a proxy server to translate HTTP traffic into TCP when proxying, for example, SSH or RDP. This configures what type of proxy will be started. Valid options are: "" for the regular proxy and "socks" for a SOCKS5 proxy. - `tcpKeepAlive?: number` The timeout after which a TCP keepalive packet is sent on a connection between Tunnel and the origin server. - `tlsTimeout?: number` Timeout for completing a TLS handshake to your origin server, if you have chosen to connect Tunnel to an HTTPS server. - `created_at?: string` - `source?: "local" | "cloudflare"` Indicates if this is a locally or remotely configured tunnel. If `local`, manage the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the tunnel's configuration on the Zero Trust dashboard. - `"local"` - `"cloudflare"` - `tunnel_id?: string` UUID of the tunnel. - `version?: number` The version of the Tunnel Configuration. # Connections ## List Cloudflare Tunnel connections `client.zeroTrust.tunnels.cloudflared.connections.get(stringtunnelId, ConnectionGetParamsparams, RequestOptionsoptions?): SinglePage` **get** `/accounts/{account_id}/cfd_tunnel/{tunnel_id}/connections` Fetches connection details for a Cloudflare Tunnel. ### Parameters - `tunnelId: string` UUID of the tunnel. - `params: ConnectionGetParams` - `account_id: string` Cloudflare account ID ### Returns - `Client` A client (typically cloudflared) that maintains connections to a Cloudflare data center. - `id?: string` UUID of the Cloudflare Tunnel connection. - `arch?: string` The cloudflared OS architecture used to establish this connection. - `config_version?: number` The version of the remote tunnel configuration. Used internally to sync cloudflared with the Zero Trust dashboard. - `conns?: Array` The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - `id?: string` UUID of the Cloudflare Tunnel connection. - `client_id?: string` UUID of the Cloudflare Tunnel connector. - `client_version?: string` The cloudflared version used to establish this connection. - `colo_name?: string` The Cloudflare data center used for this connection. - `is_pending_reconnect?: boolean` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `opened_at?: string` Timestamp of when the connection was established. - `origin_ip?: string` The public IP address of the host running cloudflared. - `uuid?: string` UUID of the Cloudflare Tunnel connection. - `features?: Array` Features enabled for the Cloudflare Tunnel. - `run_at?: string` Timestamp of when the tunnel connection was started. - `version?: string` The cloudflared version used to establish this connection. ### Example ```node 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 client of client.zeroTrust.tunnels.cloudflared.connections.get( 'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415', { account_id: '699d98642c564d2e855e9661899b7252' }, )) { console.log(client.id); } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": [ { "id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "arch": "linux_amd64", "config_version": 0, "conns": [ { "id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_version": "2022.7.1", "colo_name": "DFW", "is_pending_reconnect": false, "opened_at": "2021-01-25T18:22:34.317854Z", "origin_ip": "10.1.0.137", "uuid": "1bedc50d-42b3-473c-b108-ff3d10c0d925" } ], "features": [ "ha-origin" ], "run_at": "2009-11-10T23:00:00Z", "version": "2022.7.1" } ], "success": true, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 } } ``` ## Clean up Cloudflare Tunnel connections `client.zeroTrust.tunnels.cloudflared.connections.delete(stringtunnelId, ConnectionDeleteParamsparams, RequestOptionsoptions?): ConnectionDeleteResponse | null` **delete** `/accounts/{account_id}/cfd_tunnel/{tunnel_id}/connections` Removes a connection (aka Cloudflare Tunnel Connector) from a Cloudflare Tunnel independently of its current state. If no connector id (client_id) is provided all connectors will be removed. We recommend running this command after rotating tokens. ### Parameters - `tunnelId: string` UUID of the tunnel. - `params: ConnectionDeleteParams` - `account_id: string` Path param: Cloudflare account ID - `client_id?: string` Query param: UUID of the Cloudflare Tunnel connector. ### Returns - `ConnectionDeleteResponse = unknown` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const connection = await client.zeroTrust.tunnels.cloudflared.connections.delete( 'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415', { account_id: '699d98642c564d2e855e9661899b7252' }, ); console.log(connection); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": {}, "success": true } ``` ## Domain Types ### Client - `Client` A client (typically cloudflared) that maintains connections to a Cloudflare data center. - `id?: string` UUID of the Cloudflare Tunnel connection. - `arch?: string` The cloudflared OS architecture used to establish this connection. - `config_version?: number` The version of the remote tunnel configuration. Used internally to sync cloudflared with the Zero Trust dashboard. - `conns?: Array` The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - `id?: string` UUID of the Cloudflare Tunnel connection. - `client_id?: string` UUID of the Cloudflare Tunnel connector. - `client_version?: string` The cloudflared version used to establish this connection. - `colo_name?: string` The Cloudflare data center used for this connection. - `is_pending_reconnect?: boolean` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `opened_at?: string` Timestamp of when the connection was established. - `origin_ip?: string` The public IP address of the host running cloudflared. - `uuid?: string` UUID of the Cloudflare Tunnel connection. - `features?: Array` Features enabled for the Cloudflare Tunnel. - `run_at?: string` Timestamp of when the tunnel connection was started. - `version?: string` The cloudflared version used to establish this connection. ### Connection Delete Response - `ConnectionDeleteResponse = unknown` # Token ## Get a Cloudflare Tunnel token `client.zeroTrust.tunnels.cloudflared.token.get(stringtunnelId, TokenGetParamsparams, RequestOptionsoptions?): TokenGetResponse` **get** `/accounts/{account_id}/cfd_tunnel/{tunnel_id}/token` Gets the token used to associate cloudflared with a specific tunnel. ### Parameters - `tunnelId: string` UUID of the tunnel. - `params: TokenGetParams` - `account_id: string` Cloudflare account ID ### Returns - `TokenGetResponse = string` The Tunnel Token is used as a mechanism to authenticate the operation of a tunnel. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const token = await client.zeroTrust.tunnels.cloudflared.token.get( 'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415', { account_id: '699d98642c564d2e855e9661899b7252' }, ); console.log(token); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": "eyJhIjoiNWFiNGU5Z...", "success": true } ``` ## Domain Types ### Token Get Response - `TokenGetResponse = string` The Tunnel Token is used as a mechanism to authenticate the operation of a tunnel. # Connectors ## Get Cloudflare Tunnel connector `client.zeroTrust.tunnels.cloudflared.connectors.get(stringtunnelId, stringconnectorId, ConnectorGetParamsparams, RequestOptionsoptions?): Client` **get** `/accounts/{account_id}/cfd_tunnel/{tunnel_id}/connectors/{connector_id}` Fetches connector and connection details for a Cloudflare Tunnel. ### Parameters - `tunnelId: string` UUID of the tunnel. - `connectorId: string` UUID of the Cloudflare Tunnel connector. - `params: ConnectorGetParams` - `account_id: string` Cloudflare account ID ### Returns - `Client` A client (typically cloudflared) that maintains connections to a Cloudflare data center. - `id?: string` UUID of the Cloudflare Tunnel connection. - `arch?: string` The cloudflared OS architecture used to establish this connection. - `config_version?: number` The version of the remote tunnel configuration. Used internally to sync cloudflared with the Zero Trust dashboard. - `conns?: Array` The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - `id?: string` UUID of the Cloudflare Tunnel connection. - `client_id?: string` UUID of the Cloudflare Tunnel connector. - `client_version?: string` The cloudflared version used to establish this connection. - `colo_name?: string` The Cloudflare data center used for this connection. - `is_pending_reconnect?: boolean` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `opened_at?: string` Timestamp of when the connection was established. - `origin_ip?: string` The public IP address of the host running cloudflared. - `uuid?: string` UUID of the Cloudflare Tunnel connection. - `features?: Array` Features enabled for the Cloudflare Tunnel. - `run_at?: string` Timestamp of when the tunnel connection was started. - `version?: string` The cloudflared version used to establish this connection. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const client = await client.zeroTrust.tunnels.cloudflared.connectors.get( 'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415', '1bedc50d-42b3-473c-b108-ff3d10c0d925', { account_id: '699d98642c564d2e855e9661899b7252' }, ); console.log(client.id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "arch": "linux_amd64", "config_version": 0, "conns": [ { "id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_version": "2022.7.1", "colo_name": "DFW", "is_pending_reconnect": false, "opened_at": "2021-01-25T18:22:34.317854Z", "origin_ip": "10.1.0.137", "uuid": "1bedc50d-42b3-473c-b108-ff3d10c0d925" } ], "features": [ "ha-origin" ], "run_at": "2009-11-10T23:00:00Z", "version": "2022.7.1" }, "success": true } ``` # Management ## Get a Cloudflare Tunnel management token `client.zeroTrust.tunnels.cloudflared.management.create(stringtunnelId, ManagementCreateParamsparams, RequestOptionsoptions?): ManagementCreateResponse` **post** `/accounts/{account_id}/cfd_tunnel/{tunnel_id}/management` Gets a management token used to access the management resources (i.e. Streaming Logs) of a tunnel. ### Parameters - `tunnelId: string` UUID of the tunnel. - `params: ManagementCreateParams` - `account_id: string` Path param: Cloudflare account ID - `resources: Array<"logs">` Body param - `"logs"` ### Returns - `ManagementCreateResponse = string` The Tunnel Token is used as a mechanism to authenticate the operation of a tunnel. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const management = await client.zeroTrust.tunnels.cloudflared.management.create( 'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415', { account_id: '699d98642c564d2e855e9661899b7252', resources: ['logs'] }, ); console.log(management); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": "eyJhIjoiNWFiNGU5Z...", "success": true } ``` ## Domain Types ### Management Create Response - `ManagementCreateResponse = string` The Tunnel Token is used as a mechanism to authenticate the operation of a tunnel. # WARP Connector ## List Warp Connector Tunnels `client.zeroTrust.tunnels.warpConnector.list(WARPConnectorListParamsparams, RequestOptionsoptions?): V4PagePaginationArray` **get** `/accounts/{account_id}/warp_connector` Lists and filters Warp Connector Tunnels in an account. ### Parameters - `params: WARPConnectorListParams` - `account_id: string` Path param: Cloudflare account ID - `exclude_prefix?: string` Query param - `existed_at?: string` Query param: If provided, include only resources that were created (and not deleted) before this time. URL encoded. - `include_prefix?: string` Query param - `is_deleted?: boolean` Query param: If `true`, only include deleted tunnels. If `false`, exclude deleted tunnels. If empty, all tunnels will be included. - `name?: string` Query param: A user-friendly name for the tunnel. - `page?: number` Query param: Page number of paginated results. - `per_page?: number` Query param: Number of results to display. - `status?: "inactive" | "degraded" | "healthy" | "down"` Query param: The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - `"inactive"` - `"degraded"` - `"healthy"` - `"down"` - `uuid?: string` Query param: UUID of the tunnel. - `was_active_at?: string` Query param - `was_inactive_at?: string` Query param ### Returns - `WARPConnectorListResponse` A Warp Connector Tunnel that connects your origin to Cloudflare's edge. - `id?: string` UUID of the tunnel. - `account_tag?: string` Cloudflare account ID - `connections?: Array` The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - `id?: string` UUID of the Cloudflare Tunnel connection. - `client_id?: string` UUID of the Cloudflare Tunnel connector. - `client_version?: string` The cloudflared version used to establish this connection. - `colo_name?: string` The Cloudflare data center used for this connection. - `is_pending_reconnect?: boolean` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `opened_at?: string` Timestamp of when the connection was established. - `origin_ip?: string` The public IP address of the host running cloudflared. - `uuid?: string` UUID of the Cloudflare Tunnel connection. - `conns_active_at?: string` Timestamp of when the tunnel established at least one connection to Cloudflare's edge. If `null`, the tunnel is inactive. - `conns_inactive_at?: string` Timestamp of when the tunnel became inactive (no connections to Cloudflare's edge). If `null`, the tunnel is active. - `created_at?: string` Timestamp of when the resource was created. - `deleted_at?: string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `metadata?: unknown` Metadata associated with the tunnel. - `name?: string` A user-friendly name for a tunnel. - `status?: "inactive" | "degraded" | "healthy" | "down"` The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - `"inactive"` - `"degraded"` - `"healthy"` - `"down"` - `tun_type?: "cfd_tunnel" | "warp_connector" | "warp" | 4 more` The type of tunnel. - `"cfd_tunnel"` - `"warp_connector"` - `"warp"` - `"magic"` - `"ip_sec"` - `"gre"` - `"cni"` ### Example ```node 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 warpConnectorListResponse of client.zeroTrust.tunnels.warpConnector.list({ account_id: '699d98642c564d2e855e9661899b7252', })) { console.log(warpConnectorListResponse.id); } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": [ { "id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "account_tag": "699d98642c564d2e855e9661899b7252", "connections": [ { "id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_version": "2022.7.1", "colo_name": "DFW", "is_pending_reconnect": false, "opened_at": "2021-01-25T18:22:34.317854Z", "origin_ip": "10.1.0.137", "uuid": "1bedc50d-42b3-473c-b108-ff3d10c0d925" } ], "conns_active_at": "2009-11-10T23:00:00Z", "conns_inactive_at": "2009-11-10T23:00:00Z", "created_at": "2021-01-25T18:22:34.317854Z", "deleted_at": "2009-11-10T23:00:00.000000Z", "metadata": {}, "name": "blog", "status": "healthy", "tun_type": "cfd_tunnel" } ], "success": true, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 } } ``` ## Get a Warp Connector Tunnel `client.zeroTrust.tunnels.warpConnector.get(stringtunnelId, WARPConnectorGetParamsparams, RequestOptionsoptions?): WARPConnectorGetResponse` **get** `/accounts/{account_id}/warp_connector/{tunnel_id}` Fetches a single Warp Connector Tunnel. ### Parameters - `tunnelId: string` UUID of the tunnel. - `params: WARPConnectorGetParams` - `account_id: string` Cloudflare account ID ### Returns - `WARPConnectorGetResponse` A Warp Connector Tunnel that connects your origin to Cloudflare's edge. - `id?: string` UUID of the tunnel. - `account_tag?: string` Cloudflare account ID - `connections?: Array` The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - `id?: string` UUID of the Cloudflare Tunnel connection. - `client_id?: string` UUID of the Cloudflare Tunnel connector. - `client_version?: string` The cloudflared version used to establish this connection. - `colo_name?: string` The Cloudflare data center used for this connection. - `is_pending_reconnect?: boolean` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `opened_at?: string` Timestamp of when the connection was established. - `origin_ip?: string` The public IP address of the host running cloudflared. - `uuid?: string` UUID of the Cloudflare Tunnel connection. - `conns_active_at?: string` Timestamp of when the tunnel established at least one connection to Cloudflare's edge. If `null`, the tunnel is inactive. - `conns_inactive_at?: string` Timestamp of when the tunnel became inactive (no connections to Cloudflare's edge). If `null`, the tunnel is active. - `created_at?: string` Timestamp of when the resource was created. - `deleted_at?: string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `metadata?: unknown` Metadata associated with the tunnel. - `name?: string` A user-friendly name for a tunnel. - `status?: "inactive" | "degraded" | "healthy" | "down"` The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - `"inactive"` - `"degraded"` - `"healthy"` - `"down"` - `tun_type?: "cfd_tunnel" | "warp_connector" | "warp" | 4 more` The type of tunnel. - `"cfd_tunnel"` - `"warp_connector"` - `"warp"` - `"magic"` - `"ip_sec"` - `"gre"` - `"cni"` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const warpConnector = await client.zeroTrust.tunnels.warpConnector.get( 'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415', { account_id: '699d98642c564d2e855e9661899b7252' }, ); console.log(warpConnector.id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "account_tag": "699d98642c564d2e855e9661899b7252", "connections": [ { "id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_version": "2022.7.1", "colo_name": "DFW", "is_pending_reconnect": false, "opened_at": "2021-01-25T18:22:34.317854Z", "origin_ip": "10.1.0.137", "uuid": "1bedc50d-42b3-473c-b108-ff3d10c0d925" } ], "conns_active_at": "2009-11-10T23:00:00Z", "conns_inactive_at": "2009-11-10T23:00:00Z", "created_at": "2021-01-25T18:22:34.317854Z", "deleted_at": "2009-11-10T23:00:00.000000Z", "metadata": {}, "name": "blog", "status": "healthy", "tun_type": "cfd_tunnel" }, "success": true } ``` ## Create a Warp Connector Tunnel `client.zeroTrust.tunnels.warpConnector.create(WARPConnectorCreateParamsparams, RequestOptionsoptions?): WARPConnectorCreateResponse` **post** `/accounts/{account_id}/warp_connector` Creates a new Warp Connector Tunnel in an account. ### Parameters - `params: WARPConnectorCreateParams` - `account_id: string` Path param: Cloudflare account ID - `name: string` Body param: A user-friendly name for a tunnel. - `ha?: boolean` Body param: Indicates that the tunnel will be created to be highly available. If omitted, defaults to false. ### Returns - `WARPConnectorCreateResponse` A Warp Connector Tunnel that connects your origin to Cloudflare's edge. - `id?: string` UUID of the tunnel. - `account_tag?: string` Cloudflare account ID - `connections?: Array` The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - `id?: string` UUID of the Cloudflare Tunnel connection. - `client_id?: string` UUID of the Cloudflare Tunnel connector. - `client_version?: string` The cloudflared version used to establish this connection. - `colo_name?: string` The Cloudflare data center used for this connection. - `is_pending_reconnect?: boolean` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `opened_at?: string` Timestamp of when the connection was established. - `origin_ip?: string` The public IP address of the host running cloudflared. - `uuid?: string` UUID of the Cloudflare Tunnel connection. - `conns_active_at?: string` Timestamp of when the tunnel established at least one connection to Cloudflare's edge. If `null`, the tunnel is inactive. - `conns_inactive_at?: string` Timestamp of when the tunnel became inactive (no connections to Cloudflare's edge). If `null`, the tunnel is active. - `created_at?: string` Timestamp of when the resource was created. - `deleted_at?: string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `metadata?: unknown` Metadata associated with the tunnel. - `name?: string` A user-friendly name for a tunnel. - `status?: "inactive" | "degraded" | "healthy" | "down"` The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - `"inactive"` - `"degraded"` - `"healthy"` - `"down"` - `tun_type?: "cfd_tunnel" | "warp_connector" | "warp" | 4 more` The type of tunnel. - `"cfd_tunnel"` - `"warp_connector"` - `"warp"` - `"magic"` - `"ip_sec"` - `"gre"` - `"cni"` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const warpConnector = await client.zeroTrust.tunnels.warpConnector.create({ account_id: '699d98642c564d2e855e9661899b7252', name: 'blog', }); console.log(warpConnector.id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "account_tag": "699d98642c564d2e855e9661899b7252", "connections": [ { "id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_version": "2022.7.1", "colo_name": "DFW", "is_pending_reconnect": false, "opened_at": "2021-01-25T18:22:34.317854Z", "origin_ip": "10.1.0.137", "uuid": "1bedc50d-42b3-473c-b108-ff3d10c0d925" } ], "conns_active_at": "2009-11-10T23:00:00Z", "conns_inactive_at": "2009-11-10T23:00:00Z", "created_at": "2021-01-25T18:22:34.317854Z", "deleted_at": "2009-11-10T23:00:00.000000Z", "metadata": {}, "name": "blog", "status": "healthy", "tun_type": "cfd_tunnel" }, "success": true } ``` ## Update a Warp Connector Tunnel `client.zeroTrust.tunnels.warpConnector.edit(stringtunnelId, WARPConnectorEditParamsparams, RequestOptionsoptions?): WARPConnectorEditResponse` **patch** `/accounts/{account_id}/warp_connector/{tunnel_id}` Updates an existing Warp Connector Tunnel. ### Parameters - `tunnelId: string` UUID of the tunnel. - `params: WARPConnectorEditParams` - `account_id: string` Path param: Cloudflare account ID - `name?: string` Body param: A user-friendly name for a tunnel. - `tunnel_secret?: string` Body param: Sets the password required to run a locally-managed tunnel. Must be at least 32 bytes and encoded as a base64 string. ### Returns - `WARPConnectorEditResponse` A Warp Connector Tunnel that connects your origin to Cloudflare's edge. - `id?: string` UUID of the tunnel. - `account_tag?: string` Cloudflare account ID - `connections?: Array` The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - `id?: string` UUID of the Cloudflare Tunnel connection. - `client_id?: string` UUID of the Cloudflare Tunnel connector. - `client_version?: string` The cloudflared version used to establish this connection. - `colo_name?: string` The Cloudflare data center used for this connection. - `is_pending_reconnect?: boolean` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `opened_at?: string` Timestamp of when the connection was established. - `origin_ip?: string` The public IP address of the host running cloudflared. - `uuid?: string` UUID of the Cloudflare Tunnel connection. - `conns_active_at?: string` Timestamp of when the tunnel established at least one connection to Cloudflare's edge. If `null`, the tunnel is inactive. - `conns_inactive_at?: string` Timestamp of when the tunnel became inactive (no connections to Cloudflare's edge). If `null`, the tunnel is active. - `created_at?: string` Timestamp of when the resource was created. - `deleted_at?: string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `metadata?: unknown` Metadata associated with the tunnel. - `name?: string` A user-friendly name for a tunnel. - `status?: "inactive" | "degraded" | "healthy" | "down"` The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - `"inactive"` - `"degraded"` - `"healthy"` - `"down"` - `tun_type?: "cfd_tunnel" | "warp_connector" | "warp" | 4 more` The type of tunnel. - `"cfd_tunnel"` - `"warp_connector"` - `"warp"` - `"magic"` - `"ip_sec"` - `"gre"` - `"cni"` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const response = await client.zeroTrust.tunnels.warpConnector.edit( 'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415', { account_id: '699d98642c564d2e855e9661899b7252' }, ); console.log(response.id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "account_tag": "699d98642c564d2e855e9661899b7252", "connections": [ { "id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_version": "2022.7.1", "colo_name": "DFW", "is_pending_reconnect": false, "opened_at": "2021-01-25T18:22:34.317854Z", "origin_ip": "10.1.0.137", "uuid": "1bedc50d-42b3-473c-b108-ff3d10c0d925" } ], "conns_active_at": "2009-11-10T23:00:00Z", "conns_inactive_at": "2009-11-10T23:00:00Z", "created_at": "2021-01-25T18:22:34.317854Z", "deleted_at": "2009-11-10T23:00:00.000000Z", "metadata": {}, "name": "blog", "status": "healthy", "tun_type": "cfd_tunnel" }, "success": true } ``` ## Delete a Warp Connector Tunnel `client.zeroTrust.tunnels.warpConnector.delete(stringtunnelId, WARPConnectorDeleteParamsparams, RequestOptionsoptions?): WARPConnectorDeleteResponse` **delete** `/accounts/{account_id}/warp_connector/{tunnel_id}` Deletes a Warp Connector Tunnel from an account. ### Parameters - `tunnelId: string` UUID of the tunnel. - `params: WARPConnectorDeleteParams` - `account_id: string` Cloudflare account ID ### Returns - `WARPConnectorDeleteResponse` A Warp Connector Tunnel that connects your origin to Cloudflare's edge. - `id?: string` UUID of the tunnel. - `account_tag?: string` Cloudflare account ID - `connections?: Array` The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - `id?: string` UUID of the Cloudflare Tunnel connection. - `client_id?: string` UUID of the Cloudflare Tunnel connector. - `client_version?: string` The cloudflared version used to establish this connection. - `colo_name?: string` The Cloudflare data center used for this connection. - `is_pending_reconnect?: boolean` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `opened_at?: string` Timestamp of when the connection was established. - `origin_ip?: string` The public IP address of the host running cloudflared. - `uuid?: string` UUID of the Cloudflare Tunnel connection. - `conns_active_at?: string` Timestamp of when the tunnel established at least one connection to Cloudflare's edge. If `null`, the tunnel is inactive. - `conns_inactive_at?: string` Timestamp of when the tunnel became inactive (no connections to Cloudflare's edge). If `null`, the tunnel is active. - `created_at?: string` Timestamp of when the resource was created. - `deleted_at?: string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `metadata?: unknown` Metadata associated with the tunnel. - `name?: string` A user-friendly name for a tunnel. - `status?: "inactive" | "degraded" | "healthy" | "down"` The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - `"inactive"` - `"degraded"` - `"healthy"` - `"down"` - `tun_type?: "cfd_tunnel" | "warp_connector" | "warp" | 4 more` The type of tunnel. - `"cfd_tunnel"` - `"warp_connector"` - `"warp"` - `"magic"` - `"ip_sec"` - `"gre"` - `"cni"` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const warpConnector = await client.zeroTrust.tunnels.warpConnector.delete( 'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415', { account_id: '699d98642c564d2e855e9661899b7252' }, ); console.log(warpConnector.id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "account_tag": "699d98642c564d2e855e9661899b7252", "connections": [ { "id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_version": "2022.7.1", "colo_name": "DFW", "is_pending_reconnect": false, "opened_at": "2021-01-25T18:22:34.317854Z", "origin_ip": "10.1.0.137", "uuid": "1bedc50d-42b3-473c-b108-ff3d10c0d925" } ], "conns_active_at": "2009-11-10T23:00:00Z", "conns_inactive_at": "2009-11-10T23:00:00Z", "created_at": "2021-01-25T18:22:34.317854Z", "deleted_at": "2009-11-10T23:00:00.000000Z", "metadata": {}, "name": "blog", "status": "healthy", "tun_type": "cfd_tunnel" }, "success": true } ``` ## Domain Types ### WARP Connector List Response - `WARPConnectorListResponse` A Warp Connector Tunnel that connects your origin to Cloudflare's edge. - `id?: string` UUID of the tunnel. - `account_tag?: string` Cloudflare account ID - `connections?: Array` The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - `id?: string` UUID of the Cloudflare Tunnel connection. - `client_id?: string` UUID of the Cloudflare Tunnel connector. - `client_version?: string` The cloudflared version used to establish this connection. - `colo_name?: string` The Cloudflare data center used for this connection. - `is_pending_reconnect?: boolean` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `opened_at?: string` Timestamp of when the connection was established. - `origin_ip?: string` The public IP address of the host running cloudflared. - `uuid?: string` UUID of the Cloudflare Tunnel connection. - `conns_active_at?: string` Timestamp of when the tunnel established at least one connection to Cloudflare's edge. If `null`, the tunnel is inactive. - `conns_inactive_at?: string` Timestamp of when the tunnel became inactive (no connections to Cloudflare's edge). If `null`, the tunnel is active. - `created_at?: string` Timestamp of when the resource was created. - `deleted_at?: string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `metadata?: unknown` Metadata associated with the tunnel. - `name?: string` A user-friendly name for a tunnel. - `status?: "inactive" | "degraded" | "healthy" | "down"` The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - `"inactive"` - `"degraded"` - `"healthy"` - `"down"` - `tun_type?: "cfd_tunnel" | "warp_connector" | "warp" | 4 more` The type of tunnel. - `"cfd_tunnel"` - `"warp_connector"` - `"warp"` - `"magic"` - `"ip_sec"` - `"gre"` - `"cni"` ### WARP Connector Get Response - `WARPConnectorGetResponse` A Warp Connector Tunnel that connects your origin to Cloudflare's edge. - `id?: string` UUID of the tunnel. - `account_tag?: string` Cloudflare account ID - `connections?: Array` The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - `id?: string` UUID of the Cloudflare Tunnel connection. - `client_id?: string` UUID of the Cloudflare Tunnel connector. - `client_version?: string` The cloudflared version used to establish this connection. - `colo_name?: string` The Cloudflare data center used for this connection. - `is_pending_reconnect?: boolean` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `opened_at?: string` Timestamp of when the connection was established. - `origin_ip?: string` The public IP address of the host running cloudflared. - `uuid?: string` UUID of the Cloudflare Tunnel connection. - `conns_active_at?: string` Timestamp of when the tunnel established at least one connection to Cloudflare's edge. If `null`, the tunnel is inactive. - `conns_inactive_at?: string` Timestamp of when the tunnel became inactive (no connections to Cloudflare's edge). If `null`, the tunnel is active. - `created_at?: string` Timestamp of when the resource was created. - `deleted_at?: string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `metadata?: unknown` Metadata associated with the tunnel. - `name?: string` A user-friendly name for a tunnel. - `status?: "inactive" | "degraded" | "healthy" | "down"` The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - `"inactive"` - `"degraded"` - `"healthy"` - `"down"` - `tun_type?: "cfd_tunnel" | "warp_connector" | "warp" | 4 more` The type of tunnel. - `"cfd_tunnel"` - `"warp_connector"` - `"warp"` - `"magic"` - `"ip_sec"` - `"gre"` - `"cni"` ### WARP Connector Create Response - `WARPConnectorCreateResponse` A Warp Connector Tunnel that connects your origin to Cloudflare's edge. - `id?: string` UUID of the tunnel. - `account_tag?: string` Cloudflare account ID - `connections?: Array` The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - `id?: string` UUID of the Cloudflare Tunnel connection. - `client_id?: string` UUID of the Cloudflare Tunnel connector. - `client_version?: string` The cloudflared version used to establish this connection. - `colo_name?: string` The Cloudflare data center used for this connection. - `is_pending_reconnect?: boolean` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `opened_at?: string` Timestamp of when the connection was established. - `origin_ip?: string` The public IP address of the host running cloudflared. - `uuid?: string` UUID of the Cloudflare Tunnel connection. - `conns_active_at?: string` Timestamp of when the tunnel established at least one connection to Cloudflare's edge. If `null`, the tunnel is inactive. - `conns_inactive_at?: string` Timestamp of when the tunnel became inactive (no connections to Cloudflare's edge). If `null`, the tunnel is active. - `created_at?: string` Timestamp of when the resource was created. - `deleted_at?: string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `metadata?: unknown` Metadata associated with the tunnel. - `name?: string` A user-friendly name for a tunnel. - `status?: "inactive" | "degraded" | "healthy" | "down"` The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - `"inactive"` - `"degraded"` - `"healthy"` - `"down"` - `tun_type?: "cfd_tunnel" | "warp_connector" | "warp" | 4 more` The type of tunnel. - `"cfd_tunnel"` - `"warp_connector"` - `"warp"` - `"magic"` - `"ip_sec"` - `"gre"` - `"cni"` ### WARP Connector Edit Response - `WARPConnectorEditResponse` A Warp Connector Tunnel that connects your origin to Cloudflare's edge. - `id?: string` UUID of the tunnel. - `account_tag?: string` Cloudflare account ID - `connections?: Array` The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - `id?: string` UUID of the Cloudflare Tunnel connection. - `client_id?: string` UUID of the Cloudflare Tunnel connector. - `client_version?: string` The cloudflared version used to establish this connection. - `colo_name?: string` The Cloudflare data center used for this connection. - `is_pending_reconnect?: boolean` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `opened_at?: string` Timestamp of when the connection was established. - `origin_ip?: string` The public IP address of the host running cloudflared. - `uuid?: string` UUID of the Cloudflare Tunnel connection. - `conns_active_at?: string` Timestamp of when the tunnel established at least one connection to Cloudflare's edge. If `null`, the tunnel is inactive. - `conns_inactive_at?: string` Timestamp of when the tunnel became inactive (no connections to Cloudflare's edge). If `null`, the tunnel is active. - `created_at?: string` Timestamp of when the resource was created. - `deleted_at?: string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `metadata?: unknown` Metadata associated with the tunnel. - `name?: string` A user-friendly name for a tunnel. - `status?: "inactive" | "degraded" | "healthy" | "down"` The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - `"inactive"` - `"degraded"` - `"healthy"` - `"down"` - `tun_type?: "cfd_tunnel" | "warp_connector" | "warp" | 4 more` The type of tunnel. - `"cfd_tunnel"` - `"warp_connector"` - `"warp"` - `"magic"` - `"ip_sec"` - `"gre"` - `"cni"` ### WARP Connector Delete Response - `WARPConnectorDeleteResponse` A Warp Connector Tunnel that connects your origin to Cloudflare's edge. - `id?: string` UUID of the tunnel. - `account_tag?: string` Cloudflare account ID - `connections?: Array` The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - `id?: string` UUID of the Cloudflare Tunnel connection. - `client_id?: string` UUID of the Cloudflare Tunnel connector. - `client_version?: string` The cloudflared version used to establish this connection. - `colo_name?: string` The Cloudflare data center used for this connection. - `is_pending_reconnect?: boolean` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `opened_at?: string` Timestamp of when the connection was established. - `origin_ip?: string` The public IP address of the host running cloudflared. - `uuid?: string` UUID of the Cloudflare Tunnel connection. - `conns_active_at?: string` Timestamp of when the tunnel established at least one connection to Cloudflare's edge. If `null`, the tunnel is inactive. - `conns_inactive_at?: string` Timestamp of when the tunnel became inactive (no connections to Cloudflare's edge). If `null`, the tunnel is active. - `created_at?: string` Timestamp of when the resource was created. - `deleted_at?: string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `metadata?: unknown` Metadata associated with the tunnel. - `name?: string` A user-friendly name for a tunnel. - `status?: "inactive" | "degraded" | "healthy" | "down"` The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - `"inactive"` - `"degraded"` - `"healthy"` - `"down"` - `tun_type?: "cfd_tunnel" | "warp_connector" | "warp" | 4 more` The type of tunnel. - `"cfd_tunnel"` - `"warp_connector"` - `"warp"` - `"magic"` - `"ip_sec"` - `"gre"` - `"cni"` # Token ## Get a Warp Connector Tunnel token `client.zeroTrust.tunnels.warpConnector.token.get(stringtunnelId, TokenGetParamsparams, RequestOptionsoptions?): TokenGetResponse` **get** `/accounts/{account_id}/warp_connector/{tunnel_id}/token` Gets the token used to associate warp device with a specific Warp Connector tunnel. ### Parameters - `tunnelId: string` UUID of the tunnel. - `params: TokenGetParams` - `account_id: string` Cloudflare account ID ### Returns - `TokenGetResponse = string` The Tunnel Token is used as a mechanism to authenticate the operation of a tunnel. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const token = await client.zeroTrust.tunnels.warpConnector.token.get( 'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415', { account_id: '699d98642c564d2e855e9661899b7252' }, ); console.log(token); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": "eyJhIjoiNWFiNGU5Z...", "success": true } ``` ## Domain Types ### Token Get Response - `TokenGetResponse = string` The Tunnel Token is used as a mechanism to authenticate the operation of a tunnel. # Connections ## List WARP Connector Tunnel connections `client.zeroTrust.tunnels.warpConnector.connections.get(stringtunnelId, ConnectionGetParamsparams, RequestOptionsoptions?): SinglePage` **get** `/accounts/{account_id}/warp_connector/{tunnel_id}/connections` Fetches connection details for a WARP Connector Tunnel. ### Parameters - `tunnelId: string` UUID of the tunnel. - `params: ConnectionGetParams` - `account_id: string` Cloudflare account ID ### Returns - `ConnectionGetResponse` A WARP Connector client that maintains a connection to a Cloudflare data center. - `id?: string` UUID of the Cloudflare Tunnel connector. - `arch?: string` The cloudflared OS architecture used to establish this connection. - `conns?: Array` The WARP Connector Tunnel connections between your origin and Cloudflare's edge. - `id?: string` UUID of the Cloudflare Tunnel connection. - `client_id?: string` UUID of the Cloudflare Tunnel connector. - `client_version?: string` The cloudflared version used to establish this connection. - `colo_name?: string` The Cloudflare data center used for this connection. - `opened_at?: string` Timestamp of when the connection was established. - `origin_ip?: string` The public IP address of the host running WARP Connector. - `features?: Array` Features enabled for the Cloudflare Tunnel. - `ha_status?: "offline" | "passive" | "active"` The HA status of a WARP Connector client. - `"offline"` - `"passive"` - `"active"` - `run_at?: string` Timestamp of when the tunnel connection was started. - `version?: string` The cloudflared version used to establish this connection. ### Example ```node 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 connectionGetResponse of client.zeroTrust.tunnels.warpConnector.connections.get( 'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415', { account_id: '699d98642c564d2e855e9661899b7252' }, )) { console.log(connectionGetResponse.id); } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": [ { "id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "arch": "linux_amd64", "conns": [ { "id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_version": "2022.7.1", "colo_name": "DFW", "opened_at": "2021-01-25T18:22:34.317854Z", "origin_ip": "10.1.0.137" } ], "features": [ "ha-origin" ], "ha_status": "offline", "run_at": "2009-11-10T23:00:00Z", "version": "2022.7.1" } ], "success": true, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 } } ``` ## Domain Types ### Connection Get Response - `ConnectionGetResponse` A WARP Connector client that maintains a connection to a Cloudflare data center. - `id?: string` UUID of the Cloudflare Tunnel connector. - `arch?: string` The cloudflared OS architecture used to establish this connection. - `conns?: Array` The WARP Connector Tunnel connections between your origin and Cloudflare's edge. - `id?: string` UUID of the Cloudflare Tunnel connection. - `client_id?: string` UUID of the Cloudflare Tunnel connector. - `client_version?: string` The cloudflared version used to establish this connection. - `colo_name?: string` The Cloudflare data center used for this connection. - `opened_at?: string` Timestamp of when the connection was established. - `origin_ip?: string` The public IP address of the host running WARP Connector. - `features?: Array` Features enabled for the Cloudflare Tunnel. - `ha_status?: "offline" | "passive" | "active"` The HA status of a WARP Connector client. - `"offline"` - `"passive"` - `"active"` - `run_at?: string` Timestamp of when the tunnel connection was started. - `version?: string` The cloudflared version used to establish this connection. # Connectors ## Get WARP Connector Tunnel connector `client.zeroTrust.tunnels.warpConnector.connectors.get(stringtunnelId, stringconnectorId, ConnectorGetParamsparams, RequestOptionsoptions?): ConnectorGetResponse` **get** `/accounts/{account_id}/warp_connector/{tunnel_id}/connectors/{connector_id}` Fetches connector and connection details for a WARP Connector Tunnel. ### Parameters - `tunnelId: string` UUID of the tunnel. - `connectorId: string` UUID of the Cloudflare Tunnel connector. - `params: ConnectorGetParams` - `account_id: string` Cloudflare account ID ### Returns - `ConnectorGetResponse` A WARP Connector client that maintains a connection to a Cloudflare data center. - `id?: string` UUID of the Cloudflare Tunnel connector. - `arch?: string` The cloudflared OS architecture used to establish this connection. - `conns?: Array` The WARP Connector Tunnel connections between your origin and Cloudflare's edge. - `id?: string` UUID of the Cloudflare Tunnel connection. - `client_id?: string` UUID of the Cloudflare Tunnel connector. - `client_version?: string` The cloudflared version used to establish this connection. - `colo_name?: string` The Cloudflare data center used for this connection. - `opened_at?: string` Timestamp of when the connection was established. - `origin_ip?: string` The public IP address of the host running WARP Connector. - `features?: Array` Features enabled for the Cloudflare Tunnel. - `ha_status?: "offline" | "passive" | "active"` The HA status of a WARP Connector client. - `"offline"` - `"passive"` - `"active"` - `run_at?: string` Timestamp of when the tunnel connection was started. - `version?: string` The cloudflared version used to establish this connection. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const connector = await client.zeroTrust.tunnels.warpConnector.connectors.get( 'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415', '1bedc50d-42b3-473c-b108-ff3d10c0d925', { account_id: '699d98642c564d2e855e9661899b7252' }, ); console.log(connector.id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "arch": "linux_amd64", "conns": [ { "id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_version": "2022.7.1", "colo_name": "DFW", "opened_at": "2021-01-25T18:22:34.317854Z", "origin_ip": "10.1.0.137" } ], "features": [ "ha-origin" ], "ha_status": "offline", "run_at": "2009-11-10T23:00:00Z", "version": "2022.7.1" }, "success": true } ``` ## Domain Types ### Connector Get Response - `ConnectorGetResponse` A WARP Connector client that maintains a connection to a Cloudflare data center. - `id?: string` UUID of the Cloudflare Tunnel connector. - `arch?: string` The cloudflared OS architecture used to establish this connection. - `conns?: Array` The WARP Connector Tunnel connections between your origin and Cloudflare's edge. - `id?: string` UUID of the Cloudflare Tunnel connection. - `client_id?: string` UUID of the Cloudflare Tunnel connector. - `client_version?: string` The cloudflared version used to establish this connection. - `colo_name?: string` The Cloudflare data center used for this connection. - `opened_at?: string` Timestamp of when the connection was established. - `origin_ip?: string` The public IP address of the host running WARP Connector. - `features?: Array` Features enabled for the Cloudflare Tunnel. - `ha_status?: "offline" | "passive" | "active"` The HA status of a WARP Connector client. - `"offline"` - `"passive"` - `"active"` - `run_at?: string` Timestamp of when the tunnel connection was started. - `version?: string` The cloudflared version used to establish this connection. # Failover ## Trigger a manual failover for a WARP Connector Tunnel `client.zeroTrust.tunnels.warpConnector.failover.update(stringtunnelId, FailoverUpdateParamsparams, RequestOptionsoptions?): FailoverUpdateResponse | null` **put** `/accounts/{account_id}/warp_connector/{tunnel_id}/failover` Triggers a manual failover for a specific WARP Connector Tunnel, setting the specified client as the active connector. The tunnel must be configured for high availability (HA) and the client must be linked to the tunnel. ### Parameters - `tunnelId: string` UUID of the tunnel. - `params: FailoverUpdateParams` - `account_id: string` Path param: Cloudflare account ID - `client_id: string` Body param: UUID of the Cloudflare Tunnel connector. ### Returns - `FailoverUpdateResponse = unknown` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const failover = await client.zeroTrust.tunnels.warpConnector.failover.update( 'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415', { account_id: '699d98642c564d2e855e9661899b7252', client_id: '1bedc50d-42b3-473c-b108-ff3d10c0d925', }, ); console.log(failover); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": {}, "success": true } ``` ## Domain Types ### Failover Update Response - `FailoverUpdateResponse = unknown`