Hi everyone, I’m getting a 500 Internal Server Error when deploying an existing survey via the API, but only under a specific condition.
What I’m trying to do
I need to update some csv files related to a form and then re-deploy, without changing the form content itself.
To do that, I call the deployment endpoint using the survey asset id and the version_id of the last deployed version (important: the deployed one, not a draft), and set it active:
PATCH /api/v2/assets/{surveyId}/deployment/
Content-Type: application/json
{
"version_id": "{versionId}",
"active": true
}
What works
This API deploy call works fine as long as there is no saved draft of the form.
What fails
If I open the form in the UI, make any change, and save a draft (even if I don’t deploy it), then the exact same API call starts returning HTTP 500.
Steps to reproduce (consistent for me)
-
Have a deployed survey (Asset A) with deployed
version_id = X -
Call the PATCH deploy endpoint with
version_id = Xandactive: true→
works -
Edit the form in the UI and save a draft (creating a newer, non-deployed version)
-
Call the same PATCH deploy endpoint again with
version_id = Xandactive: true→
returns 500
Expected behavior
Either:
-
the API should redeploy the specified deployed version successfully, or
-
it should return a clear 4xx error explaining why it can’t deploy that version when a draft exists (e.g., “version is not latest”, “draft present”, etc.)
Questions
-
Is it expected that deployments via API fail with 500 when a new draft version exists?
-
Is there a recommended way to redeploy the last deployed version while keeping a draft around?
-
If this is a bug, is there a known workaround (discard draft, clone asset, etc.)?
Thanks in advance for any guidance!
