?validate_only=true
as an optional query parameter to only run validation without persisting changes. After a PSK is generated, the PSK is immediately persisted to Cloudflare's edge and cannot be retrieved later. Note the PSK in a safe place.{}
curl --location --request POST 'https://api.cloudflare.com/client/v4/accounts//magic/ipsec_tunnels//psk_generate' \
--header 'Content-Type: application/json' \
--data-raw '{}'
{
"errors": [],
"messages": [],
"result": {
"ipsec_tunnel_id": "023e105f4ecef8ad9ca31a8372d0c353",
"psk": "O3bwKSjnaoCxDoUxjcq4Rk8ZKkezQUiy",
"psk_metadata": {
"last_generated_on": "2017-06-14T05:20:00Z"
}
},
"success": true
}