Agents on phone calls can take three actions:

EndConversation: allows the agent to end the call, e.g. if the user says “Goodbye!”

vocode_client.actions.create_action(
  request={
      "type": "action_end_conversation",
  }
)

DTMF: allows the agent to hit dial tones during a call, e.g. navigating a phone tree

vocode_client.actions.create_action(
  request={
      "type":"action_dtmf",
  }
)

TransferCall: allows the agent to transfer the call to another phone number

vocode_client.actions.create_action(
  request={
      "type":"action_transfer_call",
      "config":{
          "phone_number":"11234567890"
      }
  }
)

You can attach these as IDs to your phone number agent as follows:

from vocode import AgentUpdateParams

vocode_client.numbers.update_number(
  phone_number="11234567890",
  inbound_agent=AgentUpdateParams(
      actions=["<ACTION UUID>"]
  )
)

You can also add these as actions as raw payloads as follows:

from vocode import AgentUpdateParams, TransferCallActionUpdateParams

vocode_client.numbers.update_number(
  phone_number="11234567890",
  inbound_agent=AgentUpdateParams(
      actions=[TransferCallActionUpdateParams(
          type="action_transfer_call",
          config={
              "phone_number":"11234567890"
          }
      )]
  )
)