Put a service's websites behind a CDN, or take them out of it. Behind Cloudflare, only Cloudflare's address ranges reach its websites, and the visitor is the address Cloudflare forwards (taken only from connections that come from those ranges): firewall rules, rate limits and analytics see that visitor. Over plain HTTP only Cloudflare's connections are checked, so set Cloudflare's SSL mode to Full (strict). Let's Encrypt's challenges always get through.
API key access: full.
apiKeyAuthorizationBearer <pyo_…>An API key from the dashboard's API keys page: Authorization: Bearer pyo_…. Keys can expire, and an expired one gets a 401.
application/jsonPut a service's websites behind a CDN, or take them out of it. Behind Cloudflare, only Cloudflare's address ranges reach its websites, and the visitor is the address Cloudflare forwards (taken only from connections that come from those ranges): firewall rules, rate limits and analytics see that visitor. Over plain HTTP only Cloudflare's connections are checked, so set Cloudflare's SSL mode to Full (strict). Let's Encrypt's challenges always get through.
API key access: full.
op*"setServiceBehindCdn""setServiceBehindCdn"serviceId*stringcdn?|"cloudflare", or null for none.
Done. Always ok: true, and some operations add more, such as a new API key or a join command. A warning comes with a change that went through but won't fully take effect yet, such as more replicas than the servers have room for.
application/jsoncurl -X POST 'https://your-pyo.example.com/api/v1/ops' \
-H 'Content-Type: application/json' \
-d '{
"op": "setServiceBehindCdn",
"serviceId": "svc_8kq2x7ad"
}'{}