Update multiple IPsec tunnels
PUT/accounts/{account_id}/magic/ipsec_tunnels
Update multiple IPsec tunnels associated with an account. Use ?validate_only=true as an optional query parameter to only run validation without persisting changes.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
Example:
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Example:
Accepted Permissions (at least one required)
Update multiple IPsec tunnels
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/magic/ipsec_tunnels \
-X PUT \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
-d '{}'{
"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": {
"modified": true,
"modified_ipsec_tunnels": [
{
"id": "c4a7362d577a6c3019a474fd6f485821",
"cloudflare_endpoint": "203.0.113.1",
"interface_address": "192.0.2.0/31",
"name": "IPsec_1",
"allow_null_cipher": true,
"automatic_return_routing": true,
"bgp": {
"customer_asn": 0,
"extra_prefixes": [
"string"
],
"md5_key": "md5_key"
},
"bgp_status": {
"state": "BGP_DOWN",
"tcp_established": true,
"updated_at": "2019-12-27T18:11:19.117Z",
"bgp_state": "bgp_state",
"cf_speaker_ip": "192.168.1.1",
"cf_speaker_port": 1,
"customer_speaker_ip": "192.168.1.1",
"customer_speaker_port": 1
},
"created_on": "2017-06-14T00:00:00Z",
"custom_remote_identities": {
"fqdn_id": "fqdn_id"
},
"customer_endpoint": "203.0.113.1",
"description": "Tunnel for ISP X",
"health_check": {
"direction": "bidirectional",
"enabled": true,
"rate": "low",
"target": {
"effective": "203.0.113.1",
"saved": "203.0.113.1"
},
"type": "request"
},
"interface_address6": "2606:54c1:7:0:a9fe:12d2:1:200/127",
"modified_on": "2017-06-14T05:20:00Z",
"psk_metadata": {
"last_generated_on": "2017-06-14T05:20:00Z"
},
"replay_protection": false
}
]
},
"success": true
}Returns Examples
{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"result": {
"modified": true,
"modified_ipsec_tunnels": [
{
"id": "c4a7362d577a6c3019a474fd6f485821",
"cloudflare_endpoint": "203.0.113.1",
"interface_address": "192.0.2.0/31",
"name": "IPsec_1",
"allow_null_cipher": true,
"automatic_return_routing": true,
"bgp": {
"customer_asn": 0,
"extra_prefixes": [
"string"
],
"md5_key": "md5_key"
},
"bgp_status": {
"state": "BGP_DOWN",
"tcp_established": true,
"updated_at": "2019-12-27T18:11:19.117Z",
"bgp_state": "bgp_state",
"cf_speaker_ip": "192.168.1.1",
"cf_speaker_port": 1,
"customer_speaker_ip": "192.168.1.1",
"customer_speaker_port": 1
},
"created_on": "2017-06-14T00:00:00Z",
"custom_remote_identities": {
"fqdn_id": "fqdn_id"
},
"customer_endpoint": "203.0.113.1",
"description": "Tunnel for ISP X",
"health_check": {
"direction": "bidirectional",
"enabled": true,
"rate": "low",
"target": {
"effective": "203.0.113.1",
"saved": "203.0.113.1"
},
"type": "request"
},
"interface_address6": "2606:54c1:7:0:a9fe:12d2:1:200/127",
"modified_on": "2017-06-14T05:20:00Z",
"psk_metadata": {
"last_generated_on": "2017-06-14T05:20:00Z"
},
"replay_protection": false
}
]
},
"success": true
}