client.calls.list(...)
-
-
-
from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) client.calls.list()
-
-
-
assistant_id:
typing.Optional[str]— This will return calls with the specified assistantId.
-
limit:
typing.Optional[float]— This is the maximum number of items to return. Defaults to 100.
-
created_at_gt:
typing.Optional[dt.datetime]— This will return items where the createdAt is greater than the specified value.
-
created_at_lt:
typing.Optional[dt.datetime]— This will return items where the createdAt is less than the specified value.
-
created_at_ge:
typing.Optional[dt.datetime]— This will return items where the createdAt is greater than or equal to the specified value.
-
created_at_le:
typing.Optional[dt.datetime]— This will return items where the createdAt is less than or equal to the specified value.
-
updated_at_gt:
typing.Optional[dt.datetime]— This will return items where the updatedAt is greater than the specified value.
-
updated_at_lt:
typing.Optional[dt.datetime]— This will return items where the updatedAt is less than the specified value.
-
updated_at_ge:
typing.Optional[dt.datetime]— This will return items where the updatedAt is greater than or equal to the specified value.
-
updated_at_le:
typing.Optional[dt.datetime]— This will return items where the updatedAt is less than or equal to the specified value.
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.calls.create(...)
-
-
-
from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) client.calls.create()
-
-
-
name:
typing.Optional[str]— This is the name of the call. This is just for your own reference.
-
assistant_id:
typing.Optional[str]— This is the assistant that will be used for the call. To use a transient assistant, useassistantinstead.
-
assistant:
typing.Optional[CreateAssistantDto]— This is the assistant that will be used for the call. To use an existing assistant, useassistantIdinstead.
-
assistant_overrides:
typing.Optional[AssistantOverrides]— These are the overrides for theassistantorassistantId's settings and template variables.
-
squad_id:
typing.Optional[str]— This is the squad that will be used for the call. To use a transient squad, usesquadinstead.
-
squad:
typing.Optional[CreateSquadDto]— This is a squad that will be used for the call. To use an existing squad, usesquadIdinstead.
-
phone_number_id:
typing.Optional[str]This is the phone number that will be used for the call. To use a transient number, use
phoneNumberinstead.Only relevant for
outboundPhoneCallandinboundPhoneCalltype.
-
phone_number:
typing.Optional[ImportTwilioPhoneNumberDto]This is the phone number that will be used for the call. To use an existing number, use
phoneNumberIdinstead.Only relevant for
outboundPhoneCallandinboundPhoneCalltype.
-
customer_id:
typing.Optional[str]This is the customer that will be called. To call a transient customer , use
customerinstead.Only relevant for
outboundPhoneCallandinboundPhoneCalltype.
-
customer:
typing.Optional[CreateCustomerDto]This is the customer that will be called. To call an existing customer, use
customerIdinstead.Only relevant for
outboundPhoneCallandinboundPhoneCalltype.
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.calls.get(...)
-
-
-
from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) client.calls.get( id="id", )
-
-
-
id:
str
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.calls.delete(...)
-
-
-
from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) client.calls.delete( id="id", )
-
-
-
id:
str
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.calls.update(...)
-
-
-
from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) client.calls.update( id="id", )
-
-
-
id:
str
-
name:
typing.Optional[str]— This is the name of the call. This is just for your own reference.
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.assistants.list(...)
-
-
-
from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) client.assistants.list()
-
-
-
limit:
typing.Optional[float]— This is the maximum number of items to return. Defaults to 100.
-
created_at_gt:
typing.Optional[dt.datetime]— This will return items where the createdAt is greater than the specified value.
-
created_at_lt:
typing.Optional[dt.datetime]— This will return items where the createdAt is less than the specified value.
-
created_at_ge:
typing.Optional[dt.datetime]— This will return items where the createdAt is greater than or equal to the specified value.
-
created_at_le:
typing.Optional[dt.datetime]— This will return items where the createdAt is less than or equal to the specified value.
-
updated_at_gt:
typing.Optional[dt.datetime]— This will return items where the updatedAt is greater than the specified value.
-
updated_at_lt:
typing.Optional[dt.datetime]— This will return items where the updatedAt is less than the specified value.
-
updated_at_ge:
typing.Optional[dt.datetime]— This will return items where the updatedAt is greater than or equal to the specified value.
-
updated_at_le:
typing.Optional[dt.datetime]— This will return items where the updatedAt is less than or equal to the specified value.
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.assistants.create(...)
-
-
-
from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) client.assistants.create()
-
-
-
transcriber:
typing.Optional[CreateAssistantDtoTranscriber]— These are the options for the assistant's transcriber.
-
model:
typing.Optional[CreateAssistantDtoModel]— These are the options for the assistant's LLM.
-
voice:
typing.Optional[CreateAssistantDtoVoice]— These are the options for the assistant's voice.
-
first_message_mode:
typing.Optional[CreateAssistantDtoFirstMessageMode]This is the mode for the first message. Default is 'assistant-speaks-first'.
Use:
- 'assistant-speaks-first' to have the assistant speak first.
- 'assistant-waits-for-user' to have the assistant wait for the user to speak first.
- 'assistant-speaks-first-with-model-generated-message' to have the assistant speak first with a message generated by the model based on the conversation state. (
assistant.model.messagesat call start,call.messagesat squad transfer points).
@default 'assistant-speaks-first'
-
hipaa_enabled:
typing.Optional[bool]— When this is enabled, no logs, recordings, or transcriptions will be stored. At the end of the call, you will still receive an end-of-call-report message to store on your server. Defaults to false.
-
client_messages:
typing.Optional[typing.Sequence[CreateAssistantDtoClientMessagesItem]]— These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transcript,tool-calls,user-interrupted,voice-input. You can check the shape of the messages in ClientMessage schema.
-
server_messages:
typing.Optional[typing.Sequence[CreateAssistantDtoServerMessagesItem]]— These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema.
-
silence_timeout_seconds:
typing.Optional[float]How many seconds of silence to wait before ending the call. Defaults to 30.
@default 30
-
max_duration_seconds:
typing.Optional[float]This is the maximum number of seconds that the call will last. When the call reaches this duration, it will be ended.
@default 600 (10 minutes)
-
background_sound:
typing.Optional[CreateAssistantDtoBackgroundSound]— This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'.
-
backchanneling_enabled:
typing.Optional[bool]This determines whether the model says 'mhmm', 'ahem' etc. while user is speaking.
Default
falsewhile in beta.@default false
-
background_denoising_enabled:
typing.Optional[bool]This enables filtering of noise and background speech while the user is talking.
Default
falsewhile in beta.@default false
-
model_output_in_messages_enabled:
typing.Optional[bool]This determines whether the model's output is used in conversation history rather than the transcription of assistant's speech.
Default
falsewhile in beta.@default false
-
transport_configurations:
typing.Optional[typing.Sequence[TransportConfigurationTwilio]]— These are the configurations to be passed to the transport providers of assistant's calls, like Twilio. You can store multiple configurations for different transport providers. For a call, only the configuration matching the call transport provider is used.
-
name:
typing.Optional[str]This is the name of the assistant.
This is required when you want to transfer between assistants in a call.
-
first_message:
typing.Optional[str]This is the first message that the assistant will say. This can also be a URL to a containerized audio file (mp3, wav, etc.).
If unspecified, assistant will wait for user to speak and use the model to respond once they speak.
-
voicemail_detection:
typing.Optional[TwilioVoicemailDetection]These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool]. This uses Twilio's built-in detection while the VoicemailTool relies on the model to detect if a voicemail was reached. You can use neither of them, one of them, or both of them. By default, Twilio built-in detection is enabled while VoicemailTool is not.
-
voicemail_message:
typing.Optional[str]This is the message that the assistant will say if the call is forwarded to voicemail.
If unspecified, it will hang up.
-
end_call_message:
typing.Optional[str]This is the message that the assistant will say if it ends the call.
If unspecified, it will hang up without saying anything.
-
end_call_phrases:
typing.Optional[typing.Sequence[str]]— This list contains phrases that, if spoken by the assistant, will trigger the call to be hung up. Case insensitive.
-
metadata:
typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]— This is for metadata you want to store on the assistant.
-
server_url:
typing.Optional[str]This is the URL Vapi will communicate with via HTTP GET and POST Requests. This is used for retrieving context, function calling, and end-of-call reports.
All requests will be sent with the call object among other things relevant to that message. You can find more details in the Server URL documentation.
This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: tool.server.url > assistant.serverUrl > phoneNumber.serverUrl > org.serverUrl
-
server_url_secret:
typing.Optional[str]This is the secret you can set that Vapi will send with every request to your server. Will be sent as a header called x-vapi-secret.
Same precedence logic as serverUrl.
-
analysis_plan:
typing.Optional[AnalysisPlan]— This is the plan for analysis of assistant's calls. Stored incall.analysis.
-
artifact_plan:
typing.Optional[ArtifactPlan]This is the plan for artifacts generated during assistant's calls. Stored in
call.artifact.Note:
recordingEnabledis currently at the root level. It will be moved toartifactPlanin the future, but will remain backwards compatible.
-
message_plan:
typing.Optional[MessagePlan]This is the plan for static predefined messages that can be spoken by the assistant during the call, like
idleMessages.Note:
firstMessage,voicemailMessage, andendCallMessageare currently at the root level. They will be moved tomessagePlanin the future, but will remain backwards compatible.
-
start_speaking_plan:
typing.Optional[StartSpeakingPlan]This is the plan for when the assistant should start talking.
You should configure this if you're running into these issues:
- The assistant is too slow to start talking after the customer is done speaking.
- The assistant is too fast to start talking after the customer is done speaking.
- The assistant is so fast that it's actually interrupting the customer.
-
stop_speaking_plan:
typing.Optional[StopSpeakingPlan]This is the plan for when assistant should stop talking on customer interruption.
You should configure this if you're running into these issues:
- The assistant is too slow to recognize customer's interruption.
- The assistant is too fast to recognize customer's interruption.
- The assistant is getting interrupted by phrases that are just acknowledgments.
- The assistant is getting interrupted by background noises.
- The assistant is not properly stopping -- it starts talking right after getting interrupted.
-
monitor_plan:
typing.Optional[MonitorPlan]This is the plan for real-time monitoring of the assistant's calls.
Usage:
- To enable live listening of the assistant's calls, set
monitorPlan.listenEnabledtotrue. - To enable live control of the assistant's calls, set
monitorPlan.controlEnabledtotrue.
Note,
serverMessages,clientMessages,serverUrlandserverUrlSecretare currently at the root level but will be moved tomonitorPlanin the future. Will remain backwards compatible - To enable live listening of the assistant's calls, set
-
credential_ids:
typing.Optional[typing.Sequence[str]]— These are the credentials that will be used for the assistant calls. By default, all the credentials are available for use in the call but you can provide a subset using this.
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.assistants.get(...)
-
-
-
from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) client.assistants.get( id="id", )
-
-
-
id:
str
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.assistants.delete(...)
-
-
-
from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) client.assistants.delete( id="id", )
-
-
-
id:
str
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.assistants.update(...)
-
-
-
from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) client.assistants.update( id="id", )
-
-
-
id:
str
-
transcriber:
typing.Optional[UpdateAssistantDtoTranscriber]— These are the options for the assistant's transcriber.
-
model:
typing.Optional[UpdateAssistantDtoModel]— These are the options for the assistant's LLM.
-
voice:
typing.Optional[UpdateAssistantDtoVoice]— These are the options for the assistant's voice.
-
first_message_mode:
typing.Optional[UpdateAssistantDtoFirstMessageMode]This is the mode for the first message. Default is 'assistant-speaks-first'.
Use:
- 'assistant-speaks-first' to have the assistant speak first.
- 'assistant-waits-for-user' to have the assistant wait for the user to speak first.
- 'assistant-speaks-first-with-model-generated-message' to have the assistant speak first with a message generated by the model based on the conversation state. (
assistant.model.messagesat call start,call.messagesat squad transfer points).
@default 'assistant-speaks-first'
-
hipaa_enabled:
typing.Optional[bool]— When this is enabled, no logs, recordings, or transcriptions will be stored. At the end of the call, you will still receive an end-of-call-report message to store on your server. Defaults to false.
-
client_messages:
typing.Optional[typing.Sequence[UpdateAssistantDtoClientMessagesItem]]— These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transcript,tool-calls,user-interrupted,voice-input. You can check the shape of the messages in ClientMessage schema.
-
server_messages:
typing.Optional[typing.Sequence[UpdateAssistantDtoServerMessagesItem]]— These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema.
-
silence_timeout_seconds:
typing.Optional[float]How many seconds of silence to wait before ending the call. Defaults to 30.
@default 30
-
max_duration_seconds:
typing.Optional[float]This is the maximum number of seconds that the call will last. When the call reaches this duration, it will be ended.
@default 600 (10 minutes)
-
background_sound:
typing.Optional[UpdateAssistantDtoBackgroundSound]— This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'.
-
backchanneling_enabled:
typing.Optional[bool]This determines whether the model says 'mhmm', 'ahem' etc. while user is speaking.
Default
falsewhile in beta.@default false
-
background_denoising_enabled:
typing.Optional[bool]This enables filtering of noise and background speech while the user is talking.
Default
falsewhile in beta.@default false
-
model_output_in_messages_enabled:
typing.Optional[bool]This determines whether the model's output is used in conversation history rather than the transcription of assistant's speech.
Default
falsewhile in beta.@default false
-
transport_configurations:
typing.Optional[typing.Sequence[TransportConfigurationTwilio]]— These are the configurations to be passed to the transport providers of assistant's calls, like Twilio. You can store multiple configurations for different transport providers. For a call, only the configuration matching the call transport provider is used.
-
name:
typing.Optional[str]This is the name of the assistant.
This is required when you want to transfer between assistants in a call.
-
first_message:
typing.Optional[str]This is the first message that the assistant will say. This can also be a URL to a containerized audio file (mp3, wav, etc.).
If unspecified, assistant will wait for user to speak and use the model to respond once they speak.
-
voicemail_detection:
typing.Optional[TwilioVoicemailDetection]These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool]. This uses Twilio's built-in detection while the VoicemailTool relies on the model to detect if a voicemail was reached. You can use neither of them, one of them, or both of them. By default, Twilio built-in detection is enabled while VoicemailTool is not.
-
voicemail_message:
typing.Optional[str]This is the message that the assistant will say if the call is forwarded to voicemail.
If unspecified, it will hang up.
-
end_call_message:
typing.Optional[str]This is the message that the assistant will say if it ends the call.
If unspecified, it will hang up without saying anything.
-
end_call_phrases:
typing.Optional[typing.Sequence[str]]— This list contains phrases that, if spoken by the assistant, will trigger the call to be hung up. Case insensitive.
-
metadata:
typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]— This is for metadata you want to store on the assistant.
-
server_url:
typing.Optional[str]This is the URL Vapi will communicate with via HTTP GET and POST Requests. This is used for retrieving context, function calling, and end-of-call reports.
All requests will be sent with the call object among other things relevant to that message. You can find more details in the Server URL documentation.
This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: tool.server.url > assistant.serverUrl > phoneNumber.serverUrl > org.serverUrl
-
server_url_secret:
typing.Optional[str]This is the secret you can set that Vapi will send with every request to your server. Will be sent as a header called x-vapi-secret.
Same precedence logic as serverUrl.
-
analysis_plan:
typing.Optional[AnalysisPlan]— This is the plan for analysis of assistant's calls. Stored incall.analysis.
-
artifact_plan:
typing.Optional[ArtifactPlan]This is the plan for artifacts generated during assistant's calls. Stored in
call.artifact.Note:
recordingEnabledis currently at the root level. It will be moved toartifactPlanin the future, but will remain backwards compatible.
-
message_plan:
typing.Optional[MessagePlan]This is the plan for static predefined messages that can be spoken by the assistant during the call, like
idleMessages.Note:
firstMessage,voicemailMessage, andendCallMessageare currently at the root level. They will be moved tomessagePlanin the future, but will remain backwards compatible.
-
start_speaking_plan:
typing.Optional[StartSpeakingPlan]This is the plan for when the assistant should start talking.
You should configure this if you're running into these issues:
- The assistant is too slow to start talking after the customer is done speaking.
- The assistant is too fast to start talking after the customer is done speaking.
- The assistant is so fast that it's actually interrupting the customer.
-
stop_speaking_plan:
typing.Optional[StopSpeakingPlan]This is the plan for when assistant should stop talking on customer interruption.
You should configure this if you're running into these issues:
- The assistant is too slow to recognize customer's interruption.
- The assistant is too fast to recognize customer's interruption.
- The assistant is getting interrupted by phrases that are just acknowledgments.
- The assistant is getting interrupted by background noises.
- The assistant is not properly stopping -- it starts talking right after getting interrupted.
-
monitor_plan:
typing.Optional[MonitorPlan]This is the plan for real-time monitoring of the assistant's calls.
Usage:
- To enable live listening of the assistant's calls, set
monitorPlan.listenEnabledtotrue. - To enable live control of the assistant's calls, set
monitorPlan.controlEnabledtotrue.
Note,
serverMessages,clientMessages,serverUrlandserverUrlSecretare currently at the root level but will be moved tomonitorPlanin the future. Will remain backwards compatible - To enable live listening of the assistant's calls, set
-
credential_ids:
typing.Optional[typing.Sequence[str]]— These are the credentials that will be used for the assistant calls. By default, all the credentials are available for use in the call but you can provide a subset using this.
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.phone_numbers.list(...)
-
-
-
from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) client.phone_numbers.list()
-
-
-
limit:
typing.Optional[float]— This is the maximum number of items to return. Defaults to 100.
-
created_at_gt:
typing.Optional[dt.datetime]— This will return items where the createdAt is greater than the specified value.
-
created_at_lt:
typing.Optional[dt.datetime]— This will return items where the createdAt is less than the specified value.
-
created_at_ge:
typing.Optional[dt.datetime]— This will return items where the createdAt is greater than or equal to the specified value.
-
created_at_le:
typing.Optional[dt.datetime]— This will return items where the createdAt is less than or equal to the specified value.
-
updated_at_gt:
typing.Optional[dt.datetime]— This will return items where the updatedAt is greater than the specified value.
-
updated_at_lt:
typing.Optional[dt.datetime]— This will return items where the updatedAt is less than the specified value.
-
updated_at_ge:
typing.Optional[dt.datetime]— This will return items where the updatedAt is greater than or equal to the specified value.
-
updated_at_le:
typing.Optional[dt.datetime]— This will return items where the updatedAt is less than or equal to the specified value.
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.phone_numbers.create(...)
-
-
-
from vapi import CreateByoPhoneNumberDto, Vapi client = Vapi( token="YOUR_TOKEN", ) client.phone_numbers.create( request=CreateByoPhoneNumberDto( credential_id="credentialId", ), )
-
-
-
request:
PhoneNumbersCreateRequest
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.phone_numbers.get(...)
-
-
-
from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) client.phone_numbers.get( id="id", )
-
-
-
id:
str
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.phone_numbers.delete(...)
-
-
-
from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) client.phone_numbers.delete( id="id", )
-
-
-
id:
str
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.phone_numbers.update(...)
-
-
-
from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) client.phone_numbers.update( id="id", )
-
-
-
id:
str
-
fallback_destination:
typing.Optional[UpdatePhoneNumberDtoFallbackDestination]This is the fallback destination an inbound call will be transferred to if:
assistantIdis not setsquadIdis not set- and,
assistant-requestmessage to theserverUrlfails
If this is not set and above conditions are met, the inbound call is hung up with an error message.
-
name:
typing.Optional[str]— This is the name of the phone number. This is just for your own reference.
-
assistant_id:
typing.Optional[str]This is the assistant that will be used for incoming calls to this phone number.
If neither
assistantIdnorsquadIdis set,assistant-requestwill be sent to your Server URL. CheckServerMessageandServerMessageResponsefor the shape of the message and response that is expected.
-
squad_id:
typing.Optional[str]This is the squad that will be used for incoming calls to this phone number.
If neither
assistantIdnorsquadIdis set,assistant-requestwill be sent to your Server URL. CheckServerMessageandServerMessageResponsefor the shape of the message and response that is expected.
-
server_url:
typing.Optional[str]This is the server URL where messages will be sent for calls on this number. This includes the
assistant-requestmessage.You can see the shape of the messages sent in
ServerMessage.This overrides the
org.serverUrl. Order of precedence: tool.server.url > assistant.serverUrl > phoneNumber.serverUrl > org.serverUrl.
-
server_url_secret:
typing.Optional[str]This is the secret Vapi will send with every message to your server. It's sent as a header called x-vapi-secret.
Same precedence logic as serverUrl.
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.squads.list(...)
-
-
-
from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) client.squads.list()
-
-
-
limit:
typing.Optional[float]— This is the maximum number of items to return. Defaults to 100.
-
created_at_gt:
typing.Optional[dt.datetime]— This will return items where the createdAt is greater than the specified value.
-
created_at_lt:
typing.Optional[dt.datetime]— This will return items where the createdAt is less than the specified value.
-
created_at_ge:
typing.Optional[dt.datetime]— This will return items where the createdAt is greater than or equal to the specified value.
-
created_at_le:
typing.Optional[dt.datetime]— This will return items where the createdAt is less than or equal to the specified value.
-
updated_at_gt:
typing.Optional[dt.datetime]— This will return items where the updatedAt is greater than the specified value.
-
updated_at_lt:
typing.Optional[dt.datetime]— This will return items where the updatedAt is less than the specified value.
-
updated_at_ge:
typing.Optional[dt.datetime]— This will return items where the updatedAt is greater than or equal to the specified value.
-
updated_at_le:
typing.Optional[dt.datetime]— This will return items where the updatedAt is less than or equal to the specified value.
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.squads.create(...)
-
-
-
from vapi import SquadMemberDto, Vapi client = Vapi( token="YOUR_TOKEN", ) client.squads.create( members=[SquadMemberDto()], )
-
-
-
members:
typing.Sequence[SquadMemberDto]This is the list of assistants that make up the squad.
The call will start with the first assistant in the list.
-
name:
typing.Optional[str]— This is the name of the squad.
-
members_overrides:
typing.Optional[AssistantOverrides]This can be used to override all the assistants' settings and provide values for their template variables.
Both
membersOverridesandmembers[n].assistantOverridescan be used together. First,members[n].assistantOverridesis applied. Then,membersOverridesis applied as a global override.
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.squads.get(...)
-
-
-
from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) client.squads.get( id="id", )
-
-
-
id:
str
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.squads.delete(...)
-
-
-
from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) client.squads.delete( id="id", )
-
-
-
id:
str
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.squads.update(...)
-
-
-
from vapi import SquadMemberDto, Vapi client = Vapi( token="YOUR_TOKEN", ) client.squads.update( id="id", members=[SquadMemberDto()], )
-
-
-
id:
str
-
members:
typing.Sequence[SquadMemberDto]This is the list of assistants that make up the squad.
The call will start with the first assistant in the list.
-
name:
typing.Optional[str]— This is the name of the squad.
-
members_overrides:
typing.Optional[AssistantOverrides]This can be used to override all the assistants' settings and provide values for their template variables.
Both
membersOverridesandmembers[n].assistantOverridescan be used together. First,members[n].assistantOverridesis applied. Then,membersOverridesis applied as a global override.
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.blocks.list(...)
-
-
-
from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) client.blocks.list()
-
-
-
limit:
typing.Optional[float]— This is the maximum number of items to return. Defaults to 100.
-
created_at_gt:
typing.Optional[dt.datetime]— This will return items where the createdAt is greater than the specified value.
-
created_at_lt:
typing.Optional[dt.datetime]— This will return items where the createdAt is less than the specified value.
-
created_at_ge:
typing.Optional[dt.datetime]— This will return items where the createdAt is greater than or equal to the specified value.
-
created_at_le:
typing.Optional[dt.datetime]— This will return items where the createdAt is less than or equal to the specified value.
-
updated_at_gt:
typing.Optional[dt.datetime]— This will return items where the updatedAt is greater than the specified value.
-
updated_at_lt:
typing.Optional[dt.datetime]— This will return items where the updatedAt is less than the specified value.
-
updated_at_ge:
typing.Optional[dt.datetime]— This will return items where the updatedAt is greater than or equal to the specified value.
-
updated_at_le:
typing.Optional[dt.datetime]— This will return items where the updatedAt is less than or equal to the specified value.
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.blocks.create(...)
-
-
-
from vapi import CreateConversationBlockDto, Vapi client = Vapi( token="YOUR_TOKEN", ) client.blocks.create( request=CreateConversationBlockDto( instruction="instruction", ), )
-
-
-
request:
BlocksCreateRequest
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.blocks.get(...)
-
-
-
from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) client.blocks.get( id="id", )
-
-
-
id:
str
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.blocks.delete(...)
-
-
-
from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) client.blocks.delete( id="id", )
-
-
-
id:
str
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.blocks.update(...)
-
-
-
from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) client.blocks.update( id="id", )
-
-
-
id:
str
-
messages:
typing.Optional[typing.Sequence[UpdateBlockDtoMessagesItem]]— These are the pre-configured messages that will be spoken to the user while the block is running.
-
input_schema:
typing.Optional[JsonSchema]This is the input schema for the block. This is the input the block needs to run. It's given to the block as
steps[0].inputThese are accessible as variables:
- ({{input.propertyName}}) in context of the block execution (step)
- ({{stepName.input.propertyName}}) in context of the workflow
-
output_schema:
typing.Optional[JsonSchema]This is the output schema for the block. This is the output the block will return to the workflow (
{{stepName.output}}).These are accessible as variables:
- ({{output.propertyName}}) in context of the block execution (step)
- ({{stepName.output.propertyName}}) in context of the workflow (read caveat #1)
- ({{blockName.output.propertyName}}) in context of the workflow (read caveat #2)
Caveats:
- a workflow can execute a step multiple times. example, if a loop is used in the graph. {{stepName.output.propertyName}} will reference the latest usage of the step.
- a workflow can execute a block multiple times. example, if a step is called multiple times or if a block is used in multiple steps. {{blockName.output.propertyName}} will reference the latest usage of the block. this liquid variable is just provided for convenience when creating blocks outside of a workflow with steps.
-
tool:
typing.Optional[UpdateBlockDtoTool]— This is the tool that the block will call. To use an existing tool, usetoolId.
-
steps:
typing.Optional[typing.Sequence[UpdateBlockDtoStepsItem]]— These are the steps in the workflow.
-
name:
typing.Optional[str]— This is the name of the block. This is just for your reference.
-
instruction:
typing.Optional[str]This is the instruction to the model.
You can reference any variable in the context of the current block execution (step):
- "{{input.your-property-name}}" for the current step's input
- "{{your-step-name.output.your-property-name}}" for another step's output (in the same workflow; read caveat #1)
- "{{your-step-name.input.your-property-name}}" for another step's input (in the same workflow; read caveat #1)
- "{{your-block-name.output.your-property-name}}" for another block's output (in the same workflow; read caveat #2)
- "{{your-block-name.input.your-property-name}}" for another block's input (in the same workflow; read caveat #2)
- "{{workflow.input.your-property-name}}" for the current workflow's input
- "{{global.your-property-name}}" for the global context
This can be as simple or as complex as you want it to be.
- "say hello and ask the user about their day!"
- "collect the user's first and last name"
- "user is {{input.firstName}} {{input.lastName}}. their age is {{input.age}}. ask them about their salary and if they might be interested in buying a house. we offer {{input.offer}}"
Caveats:
- a workflow can execute a step multiple times. example, if a loop is used in the graph. {{stepName.output/input.propertyName}} will reference the latest usage of the step.
- a workflow can execute a block multiple times. example, if a step is called multiple times or if a block is used in multiple steps. {{blockName.output/input.propertyName}} will reference the latest usage of the block. this liquid variable is just provided for convenience when creating blocks outside of a workflow with steps.
-
tool_id:
typing.Optional[str]— This is the id of the tool that the block will call. To use a transient tool, usetool.
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.tools.list(...)
-
-
-
from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) client.tools.list()
-
-
-
limit:
typing.Optional[float]— This is the maximum number of items to return. Defaults to 100.
-
created_at_gt:
typing.Optional[dt.datetime]— This will return items where the createdAt is greater than the specified value.
-
created_at_lt:
typing.Optional[dt.datetime]— This will return items where the createdAt is less than the specified value.
-
created_at_ge:
typing.Optional[dt.datetime]— This will return items where the createdAt is greater than or equal to the specified value.
-
created_at_le:
typing.Optional[dt.datetime]— This will return items where the createdAt is less than or equal to the specified value.
-
updated_at_gt:
typing.Optional[dt.datetime]— This will return items where the updatedAt is greater than the specified value.
-
updated_at_lt:
typing.Optional[dt.datetime]— This will return items where the updatedAt is less than the specified value.
-
updated_at_ge:
typing.Optional[dt.datetime]— This will return items where the updatedAt is greater than or equal to the specified value.
-
updated_at_le:
typing.Optional[dt.datetime]— This will return items where the updatedAt is less than or equal to the specified value.
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.tools.create(...)
-
-
-
from vapi import CreateDtmfToolDto, Vapi client = Vapi( token="YOUR_TOKEN", ) client.tools.create( request=CreateDtmfToolDto(), )
-
-
-
request:
ToolsCreateRequest
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.tools.get(...)
-
-
-
from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) client.tools.get( id="id", )
-
-
-
id:
str
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.tools.delete(...)
-
-
-
from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) client.tools.delete( id="id", )
-
-
-
id:
str
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.tools.update(...)
-
-
-
from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) client.tools.update( id="id", )
-
-
-
id:
str
-
async_:
typing.Optional[bool]This determines if the tool is async.
If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server.
If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server.
Defaults to synchronous (
false).
-
messages:
typing.Optional[typing.Sequence[UpdateToolDtoMessagesItem]]These are the messages that will be spoken to the user as the tool is running.
For some tools, this is auto-filled based on special fields like
tool.destinations. For others like the function tool, these can be custom configured.
-
function:
typing.Optional[OpenAiFunction]This is the function definition of the tool.
For
endCall,transferCall, anddtmftools, this is auto-filled based on tool-specific fields liketool.destinations. But, even in those cases, you can provide a custom function definition for advanced use cases.An example of an advanced use case is if you want to customize the message that's spoken for
endCalltool. You can specify a function where it returns an argument "reason". Then, inmessagesarray, you can have many "request-complete" messages. One of these messages will be triggered if themessages[].conditionsmatches the "reason" argument.
-
server:
typing.Optional[Server]This is the server that will be hit when this tool is requested by the model.
All requests will be sent with the call object among other things. You can find more details in the Server URL documentation.
This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: highest tool.server.url, then assistant.serverUrl, then phoneNumber.serverUrl, then org.serverUrl.
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.files.list()
-
-
-
from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) client.files.list()
-
-
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.files.create(...)
-
-
-
from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) client.files.create()
-
-
-
file: `from future import annotations
core.File` — See core.File for more documentation
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.files.get(...)
-
-
-
from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) client.files.get( id="id", )
-
-
-
id:
str
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.files.delete(...)
-
-
-
from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) client.files.delete( id="id", )
-
-
-
id:
str
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.files.update(...)
-
-
-
from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) client.files.update( id="id", )
-
-
-
id:
str
-
name:
typing.Optional[str]— This is the name of the file. This is just for your own reference.
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.analytics.get(...)
-
-
-
from vapi import AnalyticsOperation, AnalyticsQuery, Vapi client = Vapi( token="YOUR_TOKEN", ) client.analytics.get( queries=[ AnalyticsQuery( name="name", operations=[ AnalyticsOperation( operation="sum", column="id", ) ], ) ], )
-
-
-
queries:
typing.Sequence[AnalyticsQuery]— This is the list of metric queries you want to perform.
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-
client.logs.get(...)
-
-
-
from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) response = client.logs.get() for item in response: yield item # alternatively, you can paginate page-by-page for page in response.iter_pages(): yield page
-
-
-
org_id:
typing.Optional[str]— This is the unique identifier for the org that this log belongs to.
-
type:
typing.Optional[LogsGetRequestType]— This is the type of the log.
-
assistant_id:
typing.Optional[str]— This is the ID of the assistant.
-
phone_number_id:
typing.Optional[str]— This is the ID of the phone number.
-
customer_id:
typing.Optional[str]— This is the ID of the customer.
-
squad_id:
typing.Optional[str]— This is the ID of the squad.
-
call_id:
typing.Optional[str]— This is the ID of the call.
-
page:
typing.Optional[int]— This is the page number to return. Defaults to 1.
-
sort_order:
typing.Optional[LogsGetRequestSortOrder]— This is the sort order for pagination. Defaults to 'ASC'.
-
limit:
typing.Optional[float]— This is the maximum number of items to return. Defaults to 100.
-
created_at_gt:
typing.Optional[dt.datetime]— This will return items where the createdAt is greater than the specified value.
-
created_at_lt:
typing.Optional[dt.datetime]— This will return items where the createdAt is less than the specified value.
-
created_at_ge:
typing.Optional[dt.datetime]— This will return items where the createdAt is greater than or equal to the specified value.
-
created_at_le:
typing.Optional[dt.datetime]— This will return items where the createdAt is less than or equal to the specified value.
-
updated_at_gt:
typing.Optional[dt.datetime]— This will return items where the updatedAt is greater than the specified value.
-
updated_at_lt:
typing.Optional[dt.datetime]— This will return items where the updatedAt is less than the specified value.
-
updated_at_ge:
typing.Optional[dt.datetime]— This will return items where the updatedAt is greater than or equal to the specified value.
-
updated_at_le:
typing.Optional[dt.datetime]— This will return items where the updatedAt is less than or equal to the specified value.
-
request_options:
typing.Optional[RequestOptions]— Request-specific configuration.
-
-