sinch.domains.voice.api.v2.batches_apis module
- class sinch.domains.voice.api.v2.batches_apis.Batches(sinch)[source]
Bases:
BaseVoice- start(commands: ~sinch.domains.voice.models.v2.svaml.types.amd_command_dict.AmdCommandDict | ~sinch.domains.voice.models.v2.svaml.types.dial_command_dict.DialCommandDict | ~sinch.domains.voice.models.v2.svaml.types.messages_command_dict.MessagesCommandDict | ~sinch.domains.voice.models.v2.svaml.types.stop_messages_command_dict.StopMessagesCommandDict | ~sinch.domains.voice.models.v2.svaml.types.custom_event_command_dict.CustomEventCommandDict | ~sinch.domains.voice.models.v2.svaml.types.hangup_command_dict.HangupCommandDict | ~sinch.domains.voice.models.v2.svaml.types.answer_command_dict.AnswerCommandDict | ~sinch.domains.voice.models.v2.svaml.types.pause_command_dict.PauseCommandDict | ~sinch.domains.voice.models.v2.svaml.types.start_recording_command_dict.StartRecordingCommandDict | ~sinch.domains.voice.models.v2.svaml.types.stop_recording_command_dict.StopRecordingCommandDict | ~sinch.domains.voice.models.v2.svaml.types.bridge_call_command_dict.BridgeCallCommandDict | ~sinch.domains.voice.models.v2.svaml.types.menu_command_dict.MenuCommandDict | ~sinch.domains.voice.models.v2.svaml.types.goto_menu_command_dict.GotoMenuCommandDict | ~collections.abc.Sequence[~sinch.domains.voice.models.v2.svaml.types.amd_command_dict.AmdCommandDict | ~sinch.domains.voice.models.v2.svaml.types.dial_command_dict.DialCommandDict | ~sinch.domains.voice.models.v2.svaml.types.messages_command_dict.MessagesCommandDict | ~sinch.domains.voice.models.v2.svaml.types.stop_messages_command_dict.StopMessagesCommandDict | ~sinch.domains.voice.models.v2.svaml.types.custom_event_command_dict.CustomEventCommandDict | ~sinch.domains.voice.models.v2.svaml.types.hangup_command_dict.HangupCommandDict | ~sinch.domains.voice.models.v2.svaml.types.answer_command_dict.AnswerCommandDict | ~sinch.domains.voice.models.v2.svaml.types.pause_command_dict.PauseCommandDict | ~sinch.domains.voice.models.v2.svaml.types.start_recording_command_dict.StartRecordingCommandDict | ~sinch.domains.voice.models.v2.svaml.types.stop_recording_command_dict.StopRecordingCommandDict | ~sinch.domains.voice.models.v2.svaml.types.bridge_call_command_dict.BridgeCallCommandDict | ~sinch.domains.voice.models.v2.svaml.types.menu_command_dict.MenuCommandDict | ~sinch.domains.voice.models.v2.svaml.types.goto_menu_command_dict.GotoMenuCommandDict], parameters: ~typing.List[~typing.Dict[str, str]], service_id: str | None = None, batch_options: ~sinch.domains.voice.models.v2.batches.types.batch_options_dict.BatchOptionsDict | None | ~sinch.core.sentinel.Unset = <sinch.core.sentinel.Unset object>, idempotency_key: str | None | ~sinch.core.sentinel.Unset = <sinch.core.sentinel.Unset object>, **kwargs) StartBatchResponse[source]
Create a batch of outbound call sessions, associated to the project’s default service or to the service specified in the serviceId query parameter.
The request contains a single set of SVAML commands describing the call flow, together with one parameters entry per call session to queue. Placeholders in the commands (prefixed with @) are substituted with the values of the matching parameters entry, so each session can be personalized without changing the command structure.
Queued sessions are initiated asynchronously, paced according to batch_options.
- Parameters:
commands (Union[SvamlCommandDict, Sequence[SvamlCommandDict]]) – (required) SVAML commands describing the call flow.
parameters (List[Dict[str, str]]) – (required) Parameter sets for dynamic placeholders in the commands. Each entry queues one call session.
service_id (Optional[str]) – (optional) The ID of the service to use for the batch. If omitted, the project’s default service is used.
batch_options (UnsetOr[Optional[BatchOptionsDict]]) – (optional) Options controlling how the batch is processed (maximum calls per second, time-to-live).
**kwargs –
Additional parameters for the request.
idempotency_key (str | None | Unset)
- Returns:
The created batch. Identifiers of the individual call sessions are retrieved with
get_details().- Return type:
For detailed documentation, visit https://developers.sinch.com/docs/voice-2.0.
- get(
- batch_id: str,
- **kwargs,
Retrieve a summary of a batch, including statistics on completed, failed, in-progress, and queued calls. This provides an overview of the batch execution state and individual call session states.
- Parameters:
batch_id (str) – (required) The ID of the batch.
**kwargs –
Additional parameters for the request.
- Returns:
The batch summary.
- Return type:
For detailed documentation, visit https://developers.sinch.com/docs/voice-2.0.
- get_details(
- batch_id: str,
- **kwargs,
Retrieve per-session details for a batch, including the current state of each call session in the batch.
Use this endpoint when individual session-level visibility is needed (for example, to inspect which sessions are QUEUED, IN_PROGRESS or COMPLETED). EXPIRED sessions are never returned because they were never initiated.
- Parameters:
batch_id (str) – (required) The ID of the batch.
**kwargs –
Additional parameters for the request.
- Returns:
The per-session batch details.
- Return type:
For detailed documentation, visit https://developers.sinch.com/docs/voice-2.0.
- stop(
- batch_id: str,
- **kwargs,
Stop processing a batch of call sessions. This will prevent any queued calls in the batch from being initiated. Calls that are already in progress will not be affected and will continue until completion.
- Parameters:
batch_id (str) – (required) The ID of the batch.
**kwargs –
Additional parameters for the request.
- Returns:
The state of the batch processing cancellation request.
- Return type:
For detailed documentation, visit https://developers.sinch.com/docs/voice-2.0.