API workflow for updating a published conversation flow

We’re managing Retell agents via API as part of a CI/CD pipeline. Our current deploy flow is:

  1. PATCH /update-conversation-flow/{id} — update the flow

  2. PATCH /update-agent/{id} — update agent config

  3. POST /publish-agent-version/{id} — publish

This works fine on the first deploy. On subsequent deploys, step 1 fails with:

400 Cannot update published conversation flow

Question:
What is the correct API workflow to update a conversation flow that has already been published?

Once we deploy through API, in the UI looks like this:

We would need to replicate the process of clicking in the button `Create new version` in the API to be able to make a new deploy.

Hey @nicolas.costa

I’ve escalated this issue to our team for further investigation.

We’ll keep you updated as soon as we have more information.

Best regards

Hey @nicolas.costa you cannot update an already published version. You need to create a new version and then publish it.

You can create a new version using this API: https://docs.retellai.com/api-references/create-agent-version

Thank You