https://retellai.com/?utm_source=discord&utm_medium=seo logo
when i update and save an agent, one thats being u...
# ❓・ai-evy-support
j
@AI Evy when i update and save an agent, one thats being used in production, is it also necessary to publish, or will the changes already come into affect after pressing the save button for the prompt
a
Thanks for tagging me @justfeisgro. I'll look through relevant sources and get back to you shortly.
### Answer When updating an agent in production, you need to publish the changes for them to take effect [(1) ]() . According to the available information, once a version is published, the agent configuration for that version cannot be modified . However, there's an alternative approach: you can set your agent version to draft at the phone level so it will always use the last version [(2) ]() . This means if you want changes to automatically apply without manual publishing, you can configure your phone to use the draft version instead of a published version . The
is_published
property in the agent response indicates whether the agent version is published [(3) ]() [(4) ]() [(5) ]() [(6) ]() , but simply saving changes to a prompt doesn't automatically publish them - you need to explicitly publish for production use [(1) ]() .
​ To learn more, see the sources I considered: [[1] is_published" property of agents is not updating via "update agent " Api](https://discord.com/channels/1186424376300679209/1384428840247361587) [[2] Discord message from @askep3 on 2025-08-14](https://discord.com/channels/1186424376300679209/1186462578310910112/1405360061550821428) [[3] Update Agent](https://docs.retellai.com/api-references/update-agent) [[4] Get Agent](https://docs.retellai.com/api-references/get-agent) [[5] Create Agent](https://docs.retellai.com/api-references/create-agent) [[6] Create Agent](https://docs.retellai.com/api-references/create-agent) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
j
what do you mean by "set agent to draft at phone level"
@AI Evy what do you mean by "set agent to draft at phone level"
a
Thanks for the follow-up, @justfeisgro. I'll get back to you soon.
### Answer When you "set agent to draft at phone level," you're configuring your phone number to use the draft version of an agent instead of a published version [(1) ]() . In the Phone Numbers tab of the Retell AI dashboard, you can select
Draft
as the version for your phone number . When you select
Draft
, it will always fetch the latest version of the agent . This means any changes you make to your agent will automatically be used in production without needing to publish a new version. This is different from selecting a specific version number (like version 0, 1, 2, etc.) which would lock your phone number to that exact published version . With draft mode, your phone number will always use whatever the current state of your agent is, including any recent modifications you've made. The versioning system works because published versions cannot be changed , but the draft version can be continuously updated . This gives you the flexibility to have changes take effect immediately without going through the publishing process each time.
​ To learn more, see the sources I considered: [[1] Setup versioning for agents](https://docs.retellai.com/agent/version) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
j
@AI Evy OK SOUNDS GOOD, but how about the versioning in an http call to the agent, currently i have the call, call a specific version, will that still work now that I have set it to draft on phone number level?
a
Thanks for the follow-up, @justfeisgro. I'll get back to you soon.
### Answer When you make HTTP calls with specific version numbers, those will still work as expected [(1) ]() . The phone number level setting doesn't override API calls that explicitly specify a version [(2) ]() . You can use the version number as a parameter in API calls like
create_phone_call
. For example, when creating phone calls, you can use the
override_agent_version
parameter to specify which version to use for that particular call [(1) ]() :
Copy code
javascript
const phoneCallResponse = await client.call.createPhoneCall({
 from_number: '+14157774444',
 to_number: '+12137774445',
}) ;
The
override_agent_version
parameter allows you to override the agent version used for a specific call, which doesn't bind the agent version to the phone number - it's just for that one-time override . If you're using the Retell SDK and don't specify a version number, it will default to the latest version of the agent [(2) ]() . But when you explicitly specify a version in your API calls, that takes precedence. So setting your phone number to draft mode affects calls made directly to that phone number, while your HTTP API calls with explicit version parameters will continue to use the versions you specify in those calls.
​ To learn more, see the sources I considered: [[1] Create Phone Call](https://docs.retellai.com/api-references/create-phone-call) [[2] Setup versioning for agents](https://docs.retellai.com/agent/version) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
j
@AI Evy is it mandatory to mention agent version in api call? currently i have payload set as follows: { "from_number": "+15053873040", "to_number": "{{ $json.body.phone }}", "override_agent_id": "agent_44c97e98e8a3123125779187bf", "override_agent_version": 6, "metadata": {
a
Thanks for the follow-up, @justfeisgro. I'll get back to you soon.
### Answer No, it's not mandatory to mention agent version in API calls [(1) ]() . The
override_agent_version
parameter is optional and is used only when you want to override the agent version for that particular call . Looking at your payload, you're using both
override_agent_id
and
override_agent_version
. According to the documentation, these are both optional parameters that allow you to override the agent and agent version used for that specific call without binding them to the phone number . If you don't specify the
override_agent_version
parameter, the system will use the default version associated with your phone number or agent [(2) ]() . As mentioned in the versioning documentation, if you're using the Retell SDK and don't specify a version number, it will default to the latest version of the agent . So you have the flexibility to: - Include
override_agent_version
to use a specific version for that call [(1) ]() - Omit
override_agent_version
to use the default version [(2) ]() - Use just
override_agent_id
without specifying a version [(1) ]() Your current payload structure is valid, but you could remove the
override_agent_version
field if you want to use the default version instead of version 6 .
​ To learn more, see the sources I considered: [[1] Create Phone Call](https://docs.retellai.com/api-references/create-phone-call) [[2] Setup versioning for agents](https://docs.retellai.com/agent/version) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
j
@AI Evy how would a typical payload look like without an override function. of course making sure it calls the correct agent
a
Thanks for the follow-up, @justfeisgro. I'll get back to you soon.
### Answer A typical payload without override functions would look like this [(1) ]() :
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const phoneCallResponse = await client.call.createPhoneCall({
 from_number: '+14157774444',
 to_number: '+12137774445',
}) ;
console.log(phoneCallResponse.agent_id) ;
The minimal required parameters for creating a phone call are : - `from_number`: The number you own in E.164 format - `to_number`: The number you want to call, in E.164 format When you don't use override functions, the system will use the default agent that's bound to your phone number . This means you need to ensure your phone number is properly configured with the correct agent in the Retell AI dashboard before making the API call . Your payload would be:
Copy code
json
{
  "from_number": "+15053873040",
  "to_number": "{{ $json.body.phone }}"
}
The agent will be determined by whatever agent is configured for that
from_number
in your phone number settings .
​ To learn more, see the sources I considered: [[1] Create Phone Call](https://docs.retellai.com/api-references/create-phone-call) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
j
@AI Evy I see, so the system knows which agent to use by the from_number , thats great. I am not using the sdk, i am using a post http request, in json format, Ill post below, could you help me clean it up? I would like to be in the situation that whenever I press save on the agent, the http will call this latest version without having to publish and setting the agent version. I have already set to draft at phone level { "from_number": "+15053873040", "to_number": "{{ $json.body.phone }}", "override_agent_id": "agent_44c97e98e8a3123125779187bf", "override_agent_version": 6, "metadata": { "customer_name": "{{ $json.body.firstName }}", "customer_email": "{{ $json.body.email || 'unknown' }}", "company": "{{ $json.body.companyName || 'Unknown' }}", "campaign_id": "{{ $json.body.campaignId || 'unknown' }}", "source": "lemlist_webhook", "lead_is_paused": "{{ $json.body.isPaused }}" }, "retell_llm_dynamic_variables": { "customer_name": "{{ $json.body.firstName }}", "company_name": "{{ $json.body.companyName }}", "phone-number": "{{ $json.body.phone }}", "mobile_phone": "{{ $json.body.Mobile }}", "hubspotLeadId": "{{ $json.body.hubspotLeadId }}" }, "custom_sip_headers": { "X-Custom-Header": "Custom Value" } }
a
Thanks for the follow-up, @justfeisgro. I'll get back to you soon.
### Answer [(1) ]() , [(2) ]() , [(3) ]() , [(4) ]() , [(5) ]() , [(6) ]() , [(7) ]() , [(8) ]() , [(9) ]() , [(10) ]() , [(11) ]() ### Cleaned up payload for automatic draft version usage Since you've set your phone number to draft at the phone level, you can remove the override parameters to let the system use the draft version automatically [(5) ]() . Here's your cleaned up payload:
Copy code
json
{
  "from_number": "+15053873040",
  "to_number": "{{ $json.body.phone }}",
  "metadata": {
    "customer_name": "{{ $json.body.firstName }}",
    "customer_email": "{{ $json.body.email || 'unknown' }}",
    "company": "{{ $json.body.companyName || 'Unknown' }}",
    "campaign_id": "{{ $json.body.campaignId || 'unknown' }}",
    "source": "lemlist_webhook",
    "lead_is_paused": "{{ $json.body.isPaused }}"
  },
  "retell_llm_dynamic_variables": {
    "customer_name": "{{ $json.body.firstName }}",
    "company_name": "{{ $json.body.companyName }}",
    "phone-number": "{{ $json.body.phone }}",
    "mobile_phone": "{{ $json.body.Mobile }}",
    "hubspotLeadId": "{{ $json.body.hubspotLeadId }}"
  },
  "custom_sip_headers": {
    "X-Custom-Header": "Custom Value"
  }
}
[(3) ]() ### Key changes: 1. Removed
override_agent_id
- Since your phone number is already configured with the correct agent, this isn't needed 2. Removed
override_agent_version
- This was forcing version 6, but you want to use the draft version With the phone number set to draft mode, the system will automatically use whatever the current state of your agent is, including any recent modifications you've made [(5) ]() . This means when you press save on the agent, your HTTP calls will use the latest version without needing to publish [(11) ]() . The system will determine the agent to use based on your
from_number
configuration [(3) ]() , and since you've set it to draft at the phone level, it will always fetch the latest version of the agent [(5) ]() .
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.