{"command":{"effect":"write","timeoutSeconds":30,"inputSchema":{"type":"object","description":"Updates a specific GRE tunnel. Use `?validate_only=true` as an optional query parameter to only run validation without persisting changes.","properties":{"path":{"type":"object","properties":{"gre_tunnel_id":{"$ref":"#/definitions/magic_identifier"},"account_id":{"$ref":"#/definitions/magic_identifier"}},"required":["gre_tunnel_id","account_id"],"additionalProperties":false},"headers":{"type":"object","properties":{"x-magic-new-hc-target":{"type":"boolean","description":"If true, the health check target in the request and response bodies will be presented using the new object format. Defaults to false."}},"required":[],"additionalProperties":false},"body":{"$ref":"#/definitions/magic_gre_tunnel_update_request"}},"required":["path","body"],"additionalProperties":false,"definitions":{"magic_identifier":{"description":"Identifier","type":"string","maxLength":32,"examples":["023e105f4ecef8ad9ca31a8372d0c353"]},"magic_gre_tunnel_update_request":{"allOf":[{"$ref":"#/definitions/magic_gre_tunnel_add_single_request"}]},"magic_gre_tunnel_add_single_request":{"type":"object","properties":{"automatic_return_routing":{"$ref":"#/definitions/magic_automatic_return_routing"},"cloudflare_gre_endpoint":{"$ref":"#/definitions/magic_cloudflare_gre_endpoint"},"customer_gre_endpoint":{"$ref":"#/definitions/magic_customer_gre_endpoint"},"description":{"$ref":"#/definitions/magic_schemas-description"},"health_check":{"$ref":"#/definitions/magic_tunnel_health_check"},"interface_address":{"$ref":"#/definitions/magic_interface_address"},"interface_address6":{"$ref":"#/definitions/magic_interface_address6"},"mtu":{"$ref":"#/definitions/magic_mtu"},"name":{"$ref":"#/definitions/magic_gre_tunnel_name"},"ttl":{"$ref":"#/definitions/magic_ttl"}},"required":["name","customer_gre_endpoint","cloudflare_gre_endpoint","interface_address"]},"magic_automatic_return_routing":{"description":"True if automatic stateful return routing should be enabled for a tunnel, false otherwise. Requires the `coupler_integration` account flag to be enabled; requests setting this to `true` without that flag will be rejected.","type":"boolean","default":false,"examples":[true]},"magic_cloudflare_gre_endpoint":{"description":"The IP address assigned to the Cloudflare side of the GRE tunnel.","type":"string","examples":["203.0.113.1"]},"magic_customer_gre_endpoint":{"description":"The IP address assigned to the customer side of the GRE tunnel.","type":"string","examples":["203.0.113.1"]},"magic_schemas-description":{"description":"An optional description of the GRE tunnel.","type":"string","examples":["Tunnel for ISP X"]},"magic_tunnel_health_check":{"allOf":[{"$ref":"#/definitions/magic_health_check_base"},{"properties":{"direction":{"description":"The direction of the flow of the healthcheck. Either unidirectional, where the probe comes to you via the tunnel and the result comes back to Cloudflare via the open Internet, or bidirectional where both the probe and result come and go via the tunnel.","type":"string","default":"unidirectional","enum":["unidirectional","bidirectional"],"examples":["bidirectional"]}},"type":"object"}]},"magic_interface_address":{"description":"A 31-bit prefix (/31 in CIDR notation) supporting two hosts, one for each side of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255.","type":"string","examples":["192.0.2.0/31"]},"magic_interface_address6":{"description":"A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the address being the first IP of the subnet and not same as the address of virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127","type":"string","examples":["2606:54c1:7:0:a9fe:12d2:1:200/127"]},"magic_mtu":{"description":"Maximum Transmission Unit (MTU) in bytes for the GRE tunnel. The minimum value is 576.","type":"integer","default":1476},"magic_gre_tunnel_name":{"description":"The name of the tunnel. The name cannot contain spaces or special characters, must be 15 characters or less, and cannot share a name with another GRE tunnel.","type":"string","examples":["GRE_1"]},"magic_ttl":{"description":"Time To Live (TTL) in number of hops of the GRE tunnel.","type":"integer","default":64},"magic_health_check_base":{"type":"object","properties":{"enabled":{"description":"Determines whether to run healthchecks for a tunnel.","type":"boolean","default":true,"examples":[true]},"rate":{"description":"How frequent the health check is run. The default value is `mid`.","type":"string","default":"mid","enum":["low","mid","high"],"examples":["low"]},"target":{"description":"The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target. Must be in object form if the x-magic-new-hc-target header is set to true and string form if x-magic-new-hc-target is absent or set to false.","oneOf":[{"$ref":"#/definitions/magic_health_check_target"},{"type":"string"}]},"type":{"description":"The type of healthcheck to run, reply or request. The default value is `reply`.","type":"string","default":"reply","enum":["reply","request"],"examples":["request"]}}},"magic_health_check_target":{"description":"The destination address in a request type health check. After the healthcheck is decapsulated at the customer end of the tunnel, the ICMP echo will be forwarded to this address. This field defaults to `customer_gre_endpoint address`. This field is ignored for bidirectional healthchecks as the interface_address (not assigned to the Cloudflare side of the tunnel) is used as the target.","type":"object","properties":{"saved":{"description":"The saved health check target. Setting the value to the empty string indicates that the calculated default value will be used.","type":"string","examples":["203.0.113.1"]}}}}},"name":"Update GRE Tunnel","id":"cloudflare.magic-gre-tunnels-update-gre-tunnel","example":{"path":{"gre_tunnel_id":"023e105f4ecef8ad9ca31a8372d0c353","account_id":"023e105f4ecef8ad9ca31a8372d0c353"},"body":{"name":"GRE_1","customer_gre_endpoint":"203.0.113.1","cloudflare_gre_endpoint":"203.0.113.1","interface_address":"192.0.2.0/31"}},"maxRequests":1,"summary":false}}