Can you provide an example of how to add/update/delete VCL snippets via API?
Hi @kailan,
Thank you for looking into it.
Yes, it helps to an extend, but using POST /service/service_id/version/version_id/snippet means that I would need to create each snippet and each additional feature (for example, request settings, gzip config etc.) separately.
I am looking for an ability to pretty much clone an existing service with a all features into a new service. Ideally, I would like to be able to call POST /service or PUT /service/service_id will all features in the request body. Do you think this feature is currently supported?
There is currently no way to populate this kind of configuration when creating a service via the API.
We do have an API endpoint in beta that allows copying all or some properties of a service to a new or existing service (/service/:service_id/version/:number/copy
) but this currently requires a feature flag to be enabled on your account.
I’m working with our teams internally to see if we can make this endpoint available for general use, and I will update you once I hear back.