# Networks # Routes ## List tunnel routes **get** `/accounts/{account_id}/teamnet/routes` Lists and filters private network routes in an account. ### Path Parameters - `account_id: string` Cloudflare account ID ### Query Parameters - `comment: optional string` Optional remark describing the route. - `existed_at: optional string` If provided, include only resources that were created (and not deleted) before this time. URL encoded. - `is_deleted: optional boolean` If `true`, only include deleted routes. If `false`, exclude deleted routes. If empty, all routes will be included. - `network_subset: optional string` If set, only list routes that are contained within this IP range. - `network_superset: optional string` If set, only list routes that contain this IP range. - `page: optional number` Page number of paginated results. - `per_page: optional number` Number of results to display. - `route_id: optional string` UUID of the route. - `tun_types: optional array of "cfd_tunnel" or "warp_connector" or "warp" or 4 more` The types of tunnels to filter by, separated by commas. - `"cfd_tunnel"` - `"warp_connector"` - `"warp"` - `"magic"` - `"ip_sec"` - `"gre"` - `"cni"` - `tunnel_id: optional string` UUID of the tunnel. - `virtual_network_id: optional string` UUID of the virtual network. ### Returns - `errors: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `result: array of Teamnet` - `id: optional string` UUID of the route. - `comment: optional string` Optional remark describing the route. - `created_at: optional string` Timestamp of when the resource was created. - `deleted_at: optional string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `network: optional string` The private IPv4 or IPv6 range connected by the route, in CIDR notation. - `tun_type: optional "cfd_tunnel" or "warp_connector" or "warp" or 4 more` The type of tunnel. - `"cfd_tunnel"` - `"warp_connector"` - `"warp"` - `"magic"` - `"ip_sec"` - `"gre"` - `"cni"` - `tunnel_id: optional string` UUID of the tunnel. - `tunnel_name: optional string` A user-friendly name for a tunnel. - `virtual_network_id: optional string` UUID of the virtual network. - `virtual_network_name: optional string` A user-friendly name for the virtual network. - `success: true` Whether the API call was successful - `true` - `result_info: optional object { count, page, per_page, total_count }` - `count: optional number` Total number of results for the requested service - `page: optional number` Current page within paginated list of results - `per_page: optional number` Number of results per page of results - `total_count: optional number` Total results available without any search parameters ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/teamnet/routes \ -H "Authorization: Bearer $CLOUDFLARE_API_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": [ { "id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "comment": "Example comment for this route.", "created_at": "2021-01-25T18:22:34.317854Z", "deleted_at": "2009-11-10T23:00:00.000000Z", "network": "172.16.0.0/16", "tun_type": "cfd_tunnel", "tunnel_id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "tunnel_name": "blog", "virtual_network_id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "virtual_network_name": "us-east-1-vpc" } ], "success": true, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 } } ``` ## Get tunnel route **get** `/accounts/{account_id}/teamnet/routes/{route_id}` Get a private network route in an account. ### Path Parameters - `account_id: string` Cloudflare account ID - `route_id: string` UUID of the route. ### Returns - `errors: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `result: Route` - `id: optional string` UUID of the route. - `comment: optional string` Optional remark describing the route. - `created_at: optional string` Timestamp of when the resource was created. - `deleted_at: optional string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `network: optional string` The private IPv4 or IPv6 range connected by the route, in CIDR notation. - `tunnel_id: optional string` UUID of the tunnel. - `virtual_network_id: optional string` UUID of the virtual network. - `success: true` Whether the API call was successful - `true` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/teamnet/routes/$ROUTE_ID \ -H "Authorization: Bearer $CLOUDFLARE_API_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": { "id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "comment": "Example comment for this route.", "created_at": "2021-01-25T18:22:34.317854Z", "deleted_at": "2009-11-10T23:00:00.000000Z", "network": "172.16.0.0/16", "tunnel_id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "virtual_network_id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415" }, "success": true } ``` ## Create a tunnel route **post** `/accounts/{account_id}/teamnet/routes` Routes a private network through a Cloudflare Tunnel. ### Path Parameters - `account_id: string` Cloudflare account ID ### Body Parameters - `network: string` The private IPv4 or IPv6 range connected by the route, in CIDR notation. - `tunnel_id: string` UUID of the tunnel. - `comment: optional string` Optional remark describing the route. - `virtual_network_id: optional string` UUID of the virtual network. ### Returns - `errors: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `result: Route` - `id: optional string` UUID of the route. - `comment: optional string` Optional remark describing the route. - `created_at: optional string` Timestamp of when the resource was created. - `deleted_at: optional string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `network: optional string` The private IPv4 or IPv6 range connected by the route, in CIDR notation. - `tunnel_id: optional string` UUID of the tunnel. - `virtual_network_id: optional string` UUID of the virtual network. - `success: true` Whether the API call was successful - `true` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/teamnet/routes \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ -d '{ "network": "172.16.0.0/16", "tunnel_id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "comment": "Example comment for this route.", "virtual_network_id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415" }' ``` #### 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", "comment": "Example comment for this route.", "created_at": "2021-01-25T18:22:34.317854Z", "deleted_at": "2009-11-10T23:00:00.000000Z", "network": "172.16.0.0/16", "tunnel_id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "virtual_network_id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415" }, "success": true } ``` ## Update a tunnel route **patch** `/accounts/{account_id}/teamnet/routes/{route_id}` Updates an existing private network route in an account. The fields that are meant to be updated should be provided in the body of the request. ### Path Parameters - `account_id: string` Cloudflare account ID - `route_id: string` UUID of the route. ### Body Parameters - `comment: optional string` Optional remark describing the route. - `network: optional string` The private IPv4 or IPv6 range connected by the route, in CIDR notation. - `tunnel_id: optional string` UUID of the tunnel. - `virtual_network_id: optional string` UUID of the virtual network. ### Returns - `errors: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `result: Route` - `id: optional string` UUID of the route. - `comment: optional string` Optional remark describing the route. - `created_at: optional string` Timestamp of when the resource was created. - `deleted_at: optional string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `network: optional string` The private IPv4 or IPv6 range connected by the route, in CIDR notation. - `tunnel_id: optional string` UUID of the tunnel. - `virtual_network_id: optional string` UUID of the virtual network. - `success: true` Whether the API call was successful - `true` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/teamnet/routes/$ROUTE_ID \ -X PATCH \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ -d '{ "comment": "Example comment for this route.", "network": "172.16.0.0/16", "tunnel_id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "virtual_network_id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415" }' ``` #### 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", "comment": "Example comment for this route.", "created_at": "2021-01-25T18:22:34.317854Z", "deleted_at": "2009-11-10T23:00:00.000000Z", "network": "172.16.0.0/16", "tunnel_id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "virtual_network_id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415" }, "success": true } ``` ## Delete a tunnel route **delete** `/accounts/{account_id}/teamnet/routes/{route_id}` Deletes a private network route from an account. ### Path Parameters - `account_id: string` Cloudflare account ID - `route_id: string` UUID of the route. ### Returns - `errors: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `result: Route` - `id: optional string` UUID of the route. - `comment: optional string` Optional remark describing the route. - `created_at: optional string` Timestamp of when the resource was created. - `deleted_at: optional string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `network: optional string` The private IPv4 or IPv6 range connected by the route, in CIDR notation. - `tunnel_id: optional string` UUID of the tunnel. - `virtual_network_id: optional string` UUID of the virtual network. - `success: true` Whether the API call was successful - `true` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/teamnet/routes/$ROUTE_ID \ -X DELETE \ -H "Authorization: Bearer $CLOUDFLARE_API_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": { "id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "comment": "Example comment for this route.", "created_at": "2021-01-25T18:22:34.317854Z", "deleted_at": "2009-11-10T23:00:00.000000Z", "network": "172.16.0.0/16", "tunnel_id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "virtual_network_id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415" }, "success": true } ``` ## Domain Types ### Network Route - `NetworkRoute = object { id, comment, created_at, 4 more }` - `id: optional string` UUID of the route. - `comment: optional string` Optional remark describing the route. - `created_at: optional string` Timestamp of when the resource was created. - `deleted_at: optional string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `network: optional string` The private IPv4 or IPv6 range connected by the route, in CIDR notation. - `tunnel_id: optional string` UUID of the tunnel. - `virtual_network_id: optional string` UUID of the virtual network. ### Route - `Route = object { id, comment, created_at, 4 more }` - `id: optional string` UUID of the route. - `comment: optional string` Optional remark describing the route. - `created_at: optional string` Timestamp of when the resource was created. - `deleted_at: optional string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `network: optional string` The private IPv4 or IPv6 range connected by the route, in CIDR notation. - `tunnel_id: optional string` UUID of the tunnel. - `virtual_network_id: optional string` UUID of the virtual network. ### Teamnet - `Teamnet = object { id, comment, created_at, 7 more }` - `id: optional string` UUID of the route. - `comment: optional string` Optional remark describing the route. - `created_at: optional string` Timestamp of when the resource was created. - `deleted_at: optional string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `network: optional string` The private IPv4 or IPv6 range connected by the route, in CIDR notation. - `tun_type: optional "cfd_tunnel" or "warp_connector" or "warp" or 4 more` The type of tunnel. - `"cfd_tunnel"` - `"warp_connector"` - `"warp"` - `"magic"` - `"ip_sec"` - `"gre"` - `"cni"` - `tunnel_id: optional string` UUID of the tunnel. - `tunnel_name: optional string` A user-friendly name for a tunnel. - `virtual_network_id: optional string` UUID of the virtual network. - `virtual_network_name: optional string` A user-friendly name for the virtual network. # IPs ## Get tunnel route by IP **get** `/accounts/{account_id}/teamnet/routes/ip/{ip}` Fetches routes that contain the given IP address. ### Path Parameters - `account_id: string` Cloudflare account ID - `ip: string` ### Query Parameters - `default_virtual_network_fallback: optional boolean` When the virtual_network_id parameter is not provided the request filter will default search routes that are in the default virtual network for the account. If this parameter is set to false, the search will include routes that do not have a virtual network. - `virtual_network_id: optional string` UUID of the virtual network. ### Returns - `errors: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `result: Teamnet` - `id: optional string` UUID of the route. - `comment: optional string` Optional remark describing the route. - `created_at: optional string` Timestamp of when the resource was created. - `deleted_at: optional string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `network: optional string` The private IPv4 or IPv6 range connected by the route, in CIDR notation. - `tun_type: optional "cfd_tunnel" or "warp_connector" or "warp" or 4 more` The type of tunnel. - `"cfd_tunnel"` - `"warp_connector"` - `"warp"` - `"magic"` - `"ip_sec"` - `"gre"` - `"cni"` - `tunnel_id: optional string` UUID of the tunnel. - `tunnel_name: optional string` A user-friendly name for a tunnel. - `virtual_network_id: optional string` UUID of the virtual network. - `virtual_network_name: optional string` A user-friendly name for the virtual network. - `success: true` Whether the API call was successful - `true` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/teamnet/routes/ip/$IP \ -H "Authorization: Bearer $CLOUDFLARE_API_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": { "id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "comment": "Example comment for this route.", "created_at": "2021-01-25T18:22:34.317854Z", "deleted_at": "2009-11-10T23:00:00.000000Z", "network": "172.16.0.0/16", "tun_type": "cfd_tunnel", "tunnel_id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "tunnel_name": "blog", "virtual_network_id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "virtual_network_name": "us-east-1-vpc" }, "success": true } ``` # Networks ## Create a tunnel route (CIDR Endpoint) **post** `/accounts/{account_id}/teamnet/routes/network/{ip_network_encoded}` Routes a private network through a Cloudflare Tunnel. The CIDR in `ip_network_encoded` must be written in URL-encoded format. ### Path Parameters - `account_id: string` Cloudflare account ID - `ip_network_encoded: string` IP/CIDR range in URL-encoded format ### Body Parameters - `tunnel_id: string` UUID of the tunnel. - `comment: optional string` Optional remark describing the route. - `virtual_network_id: optional string` UUID of the virtual network. ### Returns - `errors: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `result: Route` - `id: optional string` UUID of the route. - `comment: optional string` Optional remark describing the route. - `created_at: optional string` Timestamp of when the resource was created. - `deleted_at: optional string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `network: optional string` The private IPv4 or IPv6 range connected by the route, in CIDR notation. - `tunnel_id: optional string` UUID of the tunnel. - `virtual_network_id: optional string` UUID of the virtual network. - `success: true` Whether the API call was successful - `true` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/teamnet/routes/network/$IP_NETWORK_ENCODED \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ -d '{ "tunnel_id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "comment": "Example comment for this route.", "virtual_network_id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415" }' ``` #### 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", "comment": "Example comment for this route.", "created_at": "2021-01-25T18:22:34.317854Z", "deleted_at": "2009-11-10T23:00:00.000000Z", "network": "172.16.0.0/16", "tunnel_id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "virtual_network_id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415" }, "success": true } ``` ## Update a tunnel route (CIDR Endpoint) **patch** `/accounts/{account_id}/teamnet/routes/network/{ip_network_encoded}` Updates an existing private network route in an account. The CIDR in `ip_network_encoded` must be written in URL-encoded format. ### Path Parameters - `account_id: string` Cloudflare account ID - `ip_network_encoded: string` IP/CIDR range in URL-encoded format ### Returns - `errors: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `result: Route` - `id: optional string` UUID of the route. - `comment: optional string` Optional remark describing the route. - `created_at: optional string` Timestamp of when the resource was created. - `deleted_at: optional string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `network: optional string` The private IPv4 or IPv6 range connected by the route, in CIDR notation. - `tunnel_id: optional string` UUID of the tunnel. - `virtual_network_id: optional string` UUID of the virtual network. - `success: true` Whether the API call was successful - `true` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/teamnet/routes/network/$IP_NETWORK_ENCODED \ -X PATCH \ -H "Authorization: Bearer $CLOUDFLARE_API_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": { "id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "comment": "Example comment for this route.", "created_at": "2021-01-25T18:22:34.317854Z", "deleted_at": "2009-11-10T23:00:00.000000Z", "network": "172.16.0.0/16", "tunnel_id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "virtual_network_id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415" }, "success": true } ``` ## Delete a tunnel route (CIDR Endpoint) **delete** `/accounts/{account_id}/teamnet/routes/network/{ip_network_encoded}` Deletes a private network route from an account. The CIDR in `ip_network_encoded` must be written in URL-encoded format. If no virtual_network_id is provided it will delete the route from the default vnet. If no tun_type is provided it will fetch the type from the tunnel_id or if that is missing it will assume Cloudflare Tunnel as default. If tunnel_id is provided it will delete the route from that tunnel, otherwise it will delete the route based on the vnet and tun_type. ### Path Parameters - `account_id: string` Cloudflare account ID - `ip_network_encoded: string` IP/CIDR range in URL-encoded format ### Query Parameters - `tun_type: optional "cfd_tunnel" or "warp_connector" or "warp" or 4 more` The type of tunnel. - `"cfd_tunnel"` - `"warp_connector"` - `"warp"` - `"magic"` - `"ip_sec"` - `"gre"` - `"cni"` - `tunnel_id: optional string` UUID of the tunnel. - `virtual_network_id: optional string` UUID of the virtual network. ### Returns - `errors: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `result: Route` - `id: optional string` UUID of the route. - `comment: optional string` Optional remark describing the route. - `created_at: optional string` Timestamp of when the resource was created. - `deleted_at: optional string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `network: optional string` The private IPv4 or IPv6 range connected by the route, in CIDR notation. - `tunnel_id: optional string` UUID of the tunnel. - `virtual_network_id: optional string` UUID of the virtual network. - `success: true` Whether the API call was successful - `true` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/teamnet/routes/network/$IP_NETWORK_ENCODED \ -X DELETE \ -H "Authorization: Bearer $CLOUDFLARE_API_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": { "id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "comment": "Example comment for this route.", "created_at": "2021-01-25T18:22:34.317854Z", "deleted_at": "2009-11-10T23:00:00.000000Z", "network": "172.16.0.0/16", "tunnel_id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "virtual_network_id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415" }, "success": true } ``` # Virtual Networks ## List virtual networks **get** `/accounts/{account_id}/teamnet/virtual_networks` Lists and filters virtual networks in an account. ### Path Parameters - `account_id: string` Cloudflare account ID ### Query Parameters - `id: optional string` UUID of the virtual network. - `is_default: optional boolean` If `true`, only include the default virtual network. If `false`, exclude the default virtual network. If empty, all virtual networks will be included. - `is_default_network: optional boolean` If `true`, only include the default virtual network. If `false`, exclude the default virtual network. If empty, all virtual networks will be included. - `is_deleted: optional boolean` If `true`, only include deleted virtual networks. If `false`, exclude deleted virtual networks. If empty, all virtual networks will be included. - `name: optional string` A user-friendly name for the virtual network. ### Returns - `errors: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `result: array of VirtualNetwork` - `id: string` UUID of the virtual network. - `comment: string` Optional remark describing the virtual network. - `created_at: string` Timestamp of when the resource was created. - `is_default_network: boolean` If `true`, this virtual network is the default for the account. - `name: string` A user-friendly name for the virtual network. - `deleted_at: optional string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `success: true` Whether the API call was successful - `true` - `result_info: optional object { count, page, per_page, total_count }` - `count: optional number` Total number of results for the requested service - `page: optional number` Current page within paginated list of results - `per_page: optional number` Number of results per page of results - `total_count: optional number` Total results available without any search parameters ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/teamnet/virtual_networks \ -H "Authorization: Bearer $CLOUDFLARE_API_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": [ { "id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "comment": "Staging VPC for data science", "created_at": "2021-01-25T18:22:34.317854Z", "is_default_network": true, "name": "us-east-1-vpc", "deleted_at": "2009-11-10T23:00:00.000000Z" } ], "success": true, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 } } ``` ## Get a virtual network **get** `/accounts/{account_id}/teamnet/virtual_networks/{virtual_network_id}` Get a virtual network. ### Path Parameters - `account_id: string` Cloudflare account ID - `virtual_network_id: string` UUID of the virtual network. ### Returns - `errors: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `result: VirtualNetwork` - `id: string` UUID of the virtual network. - `comment: string` Optional remark describing the virtual network. - `created_at: string` Timestamp of when the resource was created. - `is_default_network: boolean` If `true`, this virtual network is the default for the account. - `name: string` A user-friendly name for the virtual network. - `deleted_at: optional string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `success: true` Whether the API call was successful - `true` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/teamnet/virtual_networks/$VIRTUAL_NETWORK_ID \ -H "Authorization: Bearer $CLOUDFLARE_API_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": { "id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "comment": "Staging VPC for data science", "created_at": "2021-01-25T18:22:34.317854Z", "is_default_network": true, "name": "us-east-1-vpc", "deleted_at": "2009-11-10T23:00:00.000000Z" }, "success": true } ``` ## Create a virtual network **post** `/accounts/{account_id}/teamnet/virtual_networks` Adds a new virtual network to an account. ### Path Parameters - `account_id: string` Cloudflare account ID ### Body Parameters - `name: string` A user-friendly name for the virtual network. - `comment: optional string` Optional remark describing the virtual network. - `is_default: optional boolean` If `true`, this virtual network is the default for the account. - `is_default_network: optional boolean` If `true`, this virtual network is the default for the account. ### Returns - `errors: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `result: VirtualNetwork` - `id: string` UUID of the virtual network. - `comment: string` Optional remark describing the virtual network. - `created_at: string` Timestamp of when the resource was created. - `is_default_network: boolean` If `true`, this virtual network is the default for the account. - `name: string` A user-friendly name for the virtual network. - `deleted_at: optional string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `success: true` Whether the API call was successful - `true` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/teamnet/virtual_networks \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ -d '{ "name": "us-east-1-vpc", "comment": "Staging VPC for data science", "is_default": true }' ``` #### 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", "comment": "Staging VPC for data science", "created_at": "2021-01-25T18:22:34.317854Z", "is_default_network": true, "name": "us-east-1-vpc", "deleted_at": "2009-11-10T23:00:00.000000Z" }, "success": true } ``` ## Update a virtual network **patch** `/accounts/{account_id}/teamnet/virtual_networks/{virtual_network_id}` Updates an existing virtual network. ### Path Parameters - `account_id: string` Cloudflare account ID - `virtual_network_id: string` UUID of the virtual network. ### Body Parameters - `comment: optional string` Optional remark describing the virtual network. - `is_default_network: optional boolean` If `true`, this virtual network is the default for the account. - `name: optional string` A user-friendly name for the virtual network. ### Returns - `errors: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `result: VirtualNetwork` - `id: string` UUID of the virtual network. - `comment: string` Optional remark describing the virtual network. - `created_at: string` Timestamp of when the resource was created. - `is_default_network: boolean` If `true`, this virtual network is the default for the account. - `name: string` A user-friendly name for the virtual network. - `deleted_at: optional string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `success: true` Whether the API call was successful - `true` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/teamnet/virtual_networks/$VIRTUAL_NETWORK_ID \ -X PATCH \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ -d '{ "comment": "Staging VPC for data science", "name": "us-east-1-vpc" }' ``` #### 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", "comment": "Staging VPC for data science", "created_at": "2021-01-25T18:22:34.317854Z", "is_default_network": true, "name": "us-east-1-vpc", "deleted_at": "2009-11-10T23:00:00.000000Z" }, "success": true } ``` ## Delete a virtual network **delete** `/accounts/{account_id}/teamnet/virtual_networks/{virtual_network_id}` Deletes an existing virtual network. ### Path Parameters - `account_id: string` Cloudflare account ID - `virtual_network_id: string` UUID of the virtual network. ### Returns - `errors: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `result: VirtualNetwork` - `id: string` UUID of the virtual network. - `comment: string` Optional remark describing the virtual network. - `created_at: string` Timestamp of when the resource was created. - `is_default_network: boolean` If `true`, this virtual network is the default for the account. - `name: string` A user-friendly name for the virtual network. - `deleted_at: optional string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `success: true` Whether the API call was successful - `true` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/teamnet/virtual_networks/$VIRTUAL_NETWORK_ID \ -X DELETE \ -H "Authorization: Bearer $CLOUDFLARE_API_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": { "id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "comment": "Staging VPC for data science", "created_at": "2021-01-25T18:22:34.317854Z", "is_default_network": true, "name": "us-east-1-vpc", "deleted_at": "2009-11-10T23:00:00.000000Z" }, "success": true } ``` ## Domain Types ### Virtual Network - `VirtualNetwork = object { id, comment, created_at, 3 more }` - `id: string` UUID of the virtual network. - `comment: string` Optional remark describing the virtual network. - `created_at: string` Timestamp of when the resource was created. - `is_default_network: boolean` If `true`, this virtual network is the default for the account. - `name: string` A user-friendly name for the virtual network. - `deleted_at: optional string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. # Subnets ## List Subnets **get** `/accounts/{account_id}/zerotrust/subnets` Lists and filters subnets in an account. ### Path Parameters - `account_id: string` Cloudflare account ID ### Query Parameters - `address_family: optional "v4" or "v6"` If set, only include subnets in the given address family - `v4` or `v6` - `"v4"` - `"v6"` - `comment: optional string` If set, only list subnets with the given comment. - `existed_at: optional string` If provided, include only resources that were created (and not deleted) before this time. URL encoded. - `is_default_network: optional boolean` If `true`, only include default subnets. If `false`, exclude default subnets subnets. If not set, all subnets will be included. - `is_deleted: optional boolean` If `true`, only include deleted subnets. If `false`, exclude deleted subnets. If not set, all subnets will be included. - `name: optional string` If set, only list subnets with the given name - `network: optional string` If set, only list the subnet whose network exactly matches the given CIDR. - `page: optional number` Page number of paginated results. - `per_page: optional number` Number of results to display. - `sort_order: optional "asc" or "desc"` Sort order of the results. `asc` means oldest to newest, `desc` means newest to oldest. If not set, they will not be in any particular order. - `"asc"` - `"desc"` - `subnet_types: optional "cloudflare_source" or "warp"` If set, the types of subnets to include, separated by comma. - `"cloudflare_source"` - `"warp"` ### Returns - `errors: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `result: array of Subnet` - `id: optional string` The UUID of the subnet. - `comment: optional string` An optional description of the subnet. - `created_at: optional string` Timestamp of when the resource was created. - `deleted_at: optional string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `is_default_network: optional boolean` If `true`, this is the default subnet for the account. There can only be one default subnet per account. - `name: optional string` A user-friendly name for the subnet. - `network: optional string` The private IPv4 or IPv6 range defining the subnet, in CIDR notation. - `subnet_type: optional "cloudflare_source" or "warp"` The type of subnet. - `"cloudflare_source"` - `"warp"` - `success: true` Whether the API call was successful - `true` - `result_info: optional object { count, page, per_page, total_count }` - `count: optional number` Total number of results for the requested service - `page: optional number` Current page within paginated list of results - `per_page: optional number` Number of results per page of results - `total_count: optional number` Total results available without any search parameters ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/zerotrust/subnets \ -H "Authorization: Bearer $CLOUDFLARE_API_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": [ { "id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "comment": "example comment", "created_at": "2021-01-25T18:22:34.317854Z", "deleted_at": "2009-11-10T23:00:00.000000Z", "is_default_network": true, "name": "IPv4 Cloudflare Source IPs", "network": "100.64.0.0/12", "subnet_type": "cloudflare_source" } ], "success": true, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 } } ``` # WARP ## Create WARP IP subnet **post** `/accounts/{account_id}/zerotrust/subnets/warp` Create a WARP IP assignment subnet. Currently, only IPv4 subnets can be created. **Network constraints:** - The network must be within one of the following private IP ranges: - `10.0.0.0/8` (RFC 1918) - `172.16.0.0/12` (RFC 1918) - `192.168.0.0/16` (RFC 1918) - `100.64.0.0/10` (RFC 6598 - CGNAT) - The subnet must have a prefix length of `/24` or larger (e.g., `/16`, `/20`, `/24` are valid; `/25`, `/28` are not) ### Path Parameters - `account_id: string` Cloudflare account ID ### Body Parameters - `name: string` A user-friendly name for the subnet. - `network: string` The private IPv4 or IPv6 range defining the subnet, in CIDR notation. - `comment: optional string` An optional description of the subnet. - `is_default_network: optional boolean` If `true`, this is the default subnet for the account. There can only be one default subnet per account. ### Returns - `errors: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `result: Subnet` - `id: optional string` The UUID of the subnet. - `comment: optional string` An optional description of the subnet. - `created_at: optional string` Timestamp of when the resource was created. - `deleted_at: optional string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `is_default_network: optional boolean` If `true`, this is the default subnet for the account. There can only be one default subnet per account. - `name: optional string` A user-friendly name for the subnet. - `network: optional string` The private IPv4 or IPv6 range defining the subnet, in CIDR notation. - `subnet_type: optional "cloudflare_source" or "warp"` The type of subnet. - `"cloudflare_source"` - `"warp"` - `success: true` Whether the API call was successful - `true` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/zerotrust/subnets/warp \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ -d '{ "name": "IPv4 Cloudflare Source IPs", "network": "100.64.0.0/12", "comment": "example comment" }' ``` #### 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", "comment": "example comment", "created_at": "2021-01-25T18:22:34.317854Z", "deleted_at": "2009-11-10T23:00:00.000000Z", "is_default_network": true, "name": "IPv4 Cloudflare Source IPs", "network": "100.64.0.0/12", "subnet_type": "cloudflare_source" }, "success": true } ``` ## Get WARP IP subnet **get** `/accounts/{account_id}/zerotrust/subnets/warp/{subnet_id}` Get a WARP IP assignment subnet. ### Path Parameters - `account_id: string` Cloudflare account ID - `subnet_id: string` The UUID of the subnet. ### Returns - `errors: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `result: Subnet` - `id: optional string` The UUID of the subnet. - `comment: optional string` An optional description of the subnet. - `created_at: optional string` Timestamp of when the resource was created. - `deleted_at: optional string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `is_default_network: optional boolean` If `true`, this is the default subnet for the account. There can only be one default subnet per account. - `name: optional string` A user-friendly name for the subnet. - `network: optional string` The private IPv4 or IPv6 range defining the subnet, in CIDR notation. - `subnet_type: optional "cloudflare_source" or "warp"` The type of subnet. - `"cloudflare_source"` - `"warp"` - `success: true` Whether the API call was successful - `true` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/zerotrust/subnets/warp/$SUBNET_ID \ -H "Authorization: Bearer $CLOUDFLARE_API_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": { "id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "comment": "example comment", "created_at": "2021-01-25T18:22:34.317854Z", "deleted_at": "2009-11-10T23:00:00.000000Z", "is_default_network": true, "name": "IPv4 Cloudflare Source IPs", "network": "100.64.0.0/12", "subnet_type": "cloudflare_source" }, "success": true } ``` ## Update WARP IP subnet **patch** `/accounts/{account_id}/zerotrust/subnets/warp/{subnet_id}` Updates a WARP IP assignment subnet. **Update constraints:** - The `network` field cannot be modified for WARP subnets. Only `name`, `comment`, and `is_default_network` can be updated. - IPv6 subnets cannot be updated ### Path Parameters - `account_id: string` Cloudflare account ID - `subnet_id: string` The UUID of the subnet. ### Body Parameters - `comment: optional string` An optional description of the subnet. - `is_default_network: optional boolean` If `true`, this is the default subnet for the account. There can only be one default subnet per account. - `name: optional string` A user-friendly name for the subnet. - `network: optional string` The private IPv4 or IPv6 range defining the subnet, in CIDR notation. ### Returns - `errors: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `result: Subnet` - `id: optional string` The UUID of the subnet. - `comment: optional string` An optional description of the subnet. - `created_at: optional string` Timestamp of when the resource was created. - `deleted_at: optional string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `is_default_network: optional boolean` If `true`, this is the default subnet for the account. There can only be one default subnet per account. - `name: optional string` A user-friendly name for the subnet. - `network: optional string` The private IPv4 or IPv6 range defining the subnet, in CIDR notation. - `subnet_type: optional "cloudflare_source" or "warp"` The type of subnet. - `"cloudflare_source"` - `"warp"` - `success: true` Whether the API call was successful - `true` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/zerotrust/subnets/warp/$SUBNET_ID \ -X PATCH \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ -d '{ "comment": "example comment", "name": "IPv4 Cloudflare Source IPs", "network": "100.64.0.0/12" }' ``` #### 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", "comment": "example comment", "created_at": "2021-01-25T18:22:34.317854Z", "deleted_at": "2009-11-10T23:00:00.000000Z", "is_default_network": true, "name": "IPv4 Cloudflare Source IPs", "network": "100.64.0.0/12", "subnet_type": "cloudflare_source" }, "success": true } ``` ## Delete WARP IP subnet **delete** `/accounts/{account_id}/zerotrust/subnets/warp/{subnet_id}` Delete a WARP IP assignment subnet. This operation is idempotent - deleting an already-deleted or non-existent subnet will return success with a null result. ### Path Parameters - `account_id: string` Cloudflare account ID - `subnet_id: string` The UUID of the subnet. ### Returns - `errors: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `result: object { id, comment, created_at, 5 more }` - `id: optional string` The UUID of the subnet. - `comment: optional string` An optional description of the subnet. - `created_at: optional string` Timestamp of when the resource was created. - `deleted_at: optional string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `is_default_network: optional boolean` If `true`, this is the default subnet for the account. There can only be one default subnet per account. - `name: optional string` A user-friendly name for the subnet. - `network: optional string` The private IPv4 or IPv6 range defining the subnet, in CIDR notation. - `subnet_type: optional "cloudflare_source" or "warp"` The type of subnet. - `"cloudflare_source"` - `"warp"` - `success: true` Whether the API call was successful - `true` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/zerotrust/subnets/warp/$SUBNET_ID \ -X DELETE \ -H "Authorization: Bearer $CLOUDFLARE_API_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": { "id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "comment": "example comment", "created_at": "2021-01-25T18:22:34.317854Z", "deleted_at": "2009-11-10T23:00:00.000000Z", "is_default_network": true, "name": "IPv4 Cloudflare Source IPs", "network": "100.64.0.0/12", "subnet_type": "cloudflare_source" }, "success": true } ``` ## Domain Types ### Subnet - `Subnet = object { id, comment, created_at, 5 more }` - `id: optional string` The UUID of the subnet. - `comment: optional string` An optional description of the subnet. - `created_at: optional string` Timestamp of when the resource was created. - `deleted_at: optional string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `is_default_network: optional boolean` If `true`, this is the default subnet for the account. There can only be one default subnet per account. - `name: optional string` A user-friendly name for the subnet. - `network: optional string` The private IPv4 or IPv6 range defining the subnet, in CIDR notation. - `subnet_type: optional "cloudflare_source" or "warp"` The type of subnet. - `"cloudflare_source"` - `"warp"` ### WARP Delete Response - `WARPDeleteResponse = object { id, comment, created_at, 5 more }` - `id: optional string` The UUID of the subnet. - `comment: optional string` An optional description of the subnet. - `created_at: optional string` Timestamp of when the resource was created. - `deleted_at: optional string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `is_default_network: optional boolean` If `true`, this is the default subnet for the account. There can only be one default subnet per account. - `name: optional string` A user-friendly name for the subnet. - `network: optional string` The private IPv4 or IPv6 range defining the subnet, in CIDR notation. - `subnet_type: optional "cloudflare_source" or "warp"` The type of subnet. - `"cloudflare_source"` - `"warp"` # Cloudflare Source ## Update Cloudflare Source Subnet **patch** `/accounts/{account_id}/zerotrust/subnets/cloudflare_source/{address_family}` Updates the Cloudflare Source subnet of the given address family ### Path Parameters - `account_id: string` Cloudflare account ID - `address_family: "v4" or "v6"` IP address family, either `v4` (IPv4) or `v6` (IPv6) - `"v4"` - `"v6"` ### Body Parameters - `comment: optional string` An optional description of the subnet. - `name: optional string` A user-friendly name for the subnet. - `network: optional string` The private IPv4 or IPv6 range defining the subnet, in CIDR notation. ### Returns - `errors: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `result: Subnet` - `id: optional string` The UUID of the subnet. - `comment: optional string` An optional description of the subnet. - `created_at: optional string` Timestamp of when the resource was created. - `deleted_at: optional string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `is_default_network: optional boolean` If `true`, this is the default subnet for the account. There can only be one default subnet per account. - `name: optional string` A user-friendly name for the subnet. - `network: optional string` The private IPv4 or IPv6 range defining the subnet, in CIDR notation. - `subnet_type: optional "cloudflare_source" or "warp"` The type of subnet. - `"cloudflare_source"` - `"warp"` - `success: true` Whether the API call was successful - `true` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/zerotrust/subnets/cloudflare_source/$ADDRESS_FAMILY \ -X PATCH \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ -d '{ "comment": "example comment", "name": "IPv4 Cloudflare Source IPs", "network": "100.64.0.0/12" }' ``` #### 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", "comment": "example comment", "created_at": "2021-01-25T18:22:34.317854Z", "deleted_at": "2009-11-10T23:00:00.000000Z", "is_default_network": true, "name": "IPv4 Cloudflare Source IPs", "network": "100.64.0.0/12", "subnet_type": "cloudflare_source" }, "success": true } ``` # Hostname Routes ## List hostname routes **get** `/accounts/{account_id}/zerotrust/routes/hostname` Lists and filters hostname routes in an account. ### Path Parameters - `account_id: string` Cloudflare account ID ### Query Parameters - `id: optional string` The hostname route ID. - `comment: optional string` If set, only list hostname routes with the given comment. - `existed_at: optional string` If provided, include only resources that were created (and not deleted) before this time. URL encoded. - `hostname: optional string` If set, only list hostname routes that contain a substring of the given value, the filter is case-insensitive. - `is_deleted: optional boolean` If `true`, only return deleted hostname routes. If `false`, exclude deleted hostname routes. - `page: optional number` Page number of paginated results. - `per_page: optional number` Number of results to display. - `tunnel_id: optional string` If set, only list hostname routes that point to a specific tunnel. ### Returns - `errors: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `result: array of HostnameRoute` - `id: optional string` The hostname route ID. - `comment: optional string` An optional description of the hostname route. - `created_at: optional string` Timestamp of when the resource was created. - `deleted_at: optional string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `hostname: optional string` The hostname of the route. - `tunnel_id: optional string` UUID of the tunnel. - `tunnel_name: optional string` A user-friendly name for a tunnel. - `success: true` Whether the API call was successful - `true` - `result_info: optional object { count, page, per_page, total_count }` - `count: optional number` Total number of results for the requested service - `page: optional number` Current page within paginated list of results - `per_page: optional number` Number of results per page of results - `total_count: optional number` Total results available without any search parameters ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/zerotrust/routes/hostname \ -H "Authorization: Bearer $CLOUDFLARE_API_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": [ { "id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "comment": "example comment", "created_at": "2021-01-25T18:22:34.317854Z", "deleted_at": "2009-11-10T23:00:00.000000Z", "hostname": "office-1.local", "tunnel_id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "tunnel_name": "api-tunnel" } ], "success": true, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 } } ``` ## Get hostname route **get** `/accounts/{account_id}/zerotrust/routes/hostname/{hostname_route_id}` Get a hostname route. ### Path Parameters - `account_id: string` Cloudflare account ID - `hostname_route_id: string` The hostname route ID. ### Returns - `errors: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `result: HostnameRoute` - `id: optional string` The hostname route ID. - `comment: optional string` An optional description of the hostname route. - `created_at: optional string` Timestamp of when the resource was created. - `deleted_at: optional string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `hostname: optional string` The hostname of the route. - `tunnel_id: optional string` UUID of the tunnel. - `tunnel_name: optional string` A user-friendly name for a tunnel. - `success: true` Whether the API call was successful - `true` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/zerotrust/routes/hostname/$HOSTNAME_ROUTE_ID \ -H "Authorization: Bearer $CLOUDFLARE_API_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": { "id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "comment": "example comment", "created_at": "2021-01-25T18:22:34.317854Z", "deleted_at": "2009-11-10T23:00:00.000000Z", "hostname": "office-1.local", "tunnel_id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "tunnel_name": "api-tunnel" }, "success": true } ``` ## Create hostname route **post** `/accounts/{account_id}/zerotrust/routes/hostname` Create a hostname route. ### Path Parameters - `account_id: string` Cloudflare account ID ### Body Parameters - `comment: optional string` An optional description of the hostname route. - `hostname: optional string` The hostname of the route. - `tunnel_id: optional string` UUID of the tunnel. ### Returns - `errors: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `result: HostnameRoute` - `id: optional string` The hostname route ID. - `comment: optional string` An optional description of the hostname route. - `created_at: optional string` Timestamp of when the resource was created. - `deleted_at: optional string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `hostname: optional string` The hostname of the route. - `tunnel_id: optional string` UUID of the tunnel. - `tunnel_name: optional string` A user-friendly name for a tunnel. - `success: true` Whether the API call was successful - `true` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/zerotrust/routes/hostname \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ -d '{ "comment": "example comment", "hostname": "office-1.local", "tunnel_id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415" }' ``` #### 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", "comment": "example comment", "created_at": "2021-01-25T18:22:34.317854Z", "deleted_at": "2009-11-10T23:00:00.000000Z", "hostname": "office-1.local", "tunnel_id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "tunnel_name": "api-tunnel" }, "success": true } ``` ## Update hostname route **patch** `/accounts/{account_id}/zerotrust/routes/hostname/{hostname_route_id}` Updates a hostname route. ### Path Parameters - `account_id: string` Cloudflare account ID - `hostname_route_id: string` The hostname route ID. ### Body Parameters - `comment: optional string` An optional description of the hostname route. - `hostname: optional string` The hostname of the route. - `tunnel_id: optional string` UUID of the tunnel. ### Returns - `errors: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `result: HostnameRoute` - `id: optional string` The hostname route ID. - `comment: optional string` An optional description of the hostname route. - `created_at: optional string` Timestamp of when the resource was created. - `deleted_at: optional string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `hostname: optional string` The hostname of the route. - `tunnel_id: optional string` UUID of the tunnel. - `tunnel_name: optional string` A user-friendly name for a tunnel. - `success: true` Whether the API call was successful - `true` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/zerotrust/routes/hostname/$HOSTNAME_ROUTE_ID \ -X PATCH \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ -d '{ "comment": "example comment", "hostname": "office-1.local", "tunnel_id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415" }' ``` #### 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", "comment": "example comment", "created_at": "2021-01-25T18:22:34.317854Z", "deleted_at": "2009-11-10T23:00:00.000000Z", "hostname": "office-1.local", "tunnel_id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "tunnel_name": "api-tunnel" }, "success": true } ``` ## Delete hostname route **delete** `/accounts/{account_id}/zerotrust/routes/hostname/{hostname_route_id}` Delete a hostname route. ### Path Parameters - `account_id: string` Cloudflare account ID - `hostname_route_id: string` The hostname route ID. ### Returns - `errors: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `messages: array of ResponseInfo` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `result: HostnameRoute` - `id: optional string` The hostname route ID. - `comment: optional string` An optional description of the hostname route. - `created_at: optional string` Timestamp of when the resource was created. - `deleted_at: optional string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `hostname: optional string` The hostname of the route. - `tunnel_id: optional string` UUID of the tunnel. - `tunnel_name: optional string` A user-friendly name for a tunnel. - `success: true` Whether the API call was successful - `true` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/zerotrust/routes/hostname/$HOSTNAME_ROUTE_ID \ -X DELETE \ -H "Authorization: Bearer $CLOUDFLARE_API_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": { "id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "comment": "example comment", "created_at": "2021-01-25T18:22:34.317854Z", "deleted_at": "2009-11-10T23:00:00.000000Z", "hostname": "office-1.local", "tunnel_id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "tunnel_name": "api-tunnel" }, "success": true } ``` ## Domain Types ### Hostname Route - `HostnameRoute = object { id, comment, created_at, 4 more }` - `id: optional string` The hostname route ID. - `comment: optional string` An optional description of the hostname route. - `created_at: optional string` Timestamp of when the resource was created. - `deleted_at: optional string` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `hostname: optional string` The hostname of the route. - `tunnel_id: optional string` UUID of the tunnel. - `tunnel_name: optional string` A user-friendly name for a tunnel.