sinch.domains.conversation.api.v1 package
- class sinch.domains.conversation.api.v1.Apps(sinch)[source]
Bases:
BaseConversation- create(
- channel_credentials: ConversationChannelCredentialsDict,
- display_name: str,
- conversation_metadata_report_view: Literal['NONE', 'FULL'] | Annotated[str, Strict(strict=True)] | None | Unset = UNSET,
- retention_policy: RetentionPolicyDict | None | Unset = UNSET,
- dispatch_retention_policy: DispatchRetentionPolicyDict | None | Unset = UNSET,
- processing_mode: Literal['CONVERSATION', 'DISPATCH'] | Annotated[str, Strict(strict=True)] | None | Unset = UNSET,
- smart_conversation: SmartConversationDict | None | Unset = UNSET,
- event_destination_settings: EventDestinationSettingsDict | None | Unset = UNSET,
- message_retry_settings: MessageRetrySettingsDict | None | Unset = UNSET,
- delivery_report_based_fallback: DeliveryReportBasedFallbackDict | None | Unset = UNSET,
- *,
- raw_response: Literal[False] = False,
- **kwargs,
- create(
- channel_credentials: ConversationChannelCredentialsDict,
- display_name: str,
- conversation_metadata_report_view: Literal['NONE', 'FULL'] | Annotated[str, Strict(strict=True)] | None | Unset = UNSET,
- retention_policy: RetentionPolicyDict | None | Unset = UNSET,
- dispatch_retention_policy: DispatchRetentionPolicyDict | None | Unset = UNSET,
- processing_mode: Literal['CONVERSATION', 'DISPATCH'] | Annotated[str, Strict(strict=True)] | None | Unset = UNSET,
- smart_conversation: SmartConversationDict | None | Unset = UNSET,
- event_destination_settings: EventDestinationSettingsDict | None | Unset = UNSET,
- message_retry_settings: MessageRetrySettingsDict | None | Unset = UNSET,
- delivery_report_based_fallback: DeliveryReportBasedFallbackDict | None | Unset = UNSET,
- *,
- raw_response: Literal[True],
- **kwargs,
Creates a new Conversation API app for one or more channels. The app ID is generated at creation and returned in the response.
- Parameters:
channel_credentials (ConversationChannelCredentialsDict) – Channel credentials, keyed by channel. The order of the entries defines the app channel priority.
display_name (str) – The display name for the app.
conversation_metadata_report_view (UnsetOr[Optional[ConversationMetadataReportViewType]]) – Whether conversation metadata is included in reports.
retention_policy (UnsetOr[Optional[RetentionPolicyDict]]) – The retention policy for messages and conversations.
dispatch_retention_policy (UnsetOr[Optional[DispatchRetentionPolicyDict]]) – The retention policy for messages in dispatch mode.
processing_mode (UnsetOr[Optional[ProcessingModeType]]) – The processing mode for the app.
smart_conversation (UnsetOr[Optional[SmartConversationDict]]) – Smart Conversation settings for the app.
event_destination_settings (UnsetOr[Optional[EventDestinationSettingsDict]]) – Settings for the destination of Sinch events.
message_retry_settings (UnsetOr[Optional[MessageRetrySettingsDict]]) – Settings controlling message retry behavior.
delivery_report_based_fallback (UnsetOr[Optional[DeliveryReportBasedFallbackDict]]) – Delivery-report-based channel fallback settings.
raw_response (bool) – When
False(default) the response exposeschannel_credentialsas a channel-keyed model. Set toTrueto get the rawAppResponsewithchannel_credentialsas the server array.**kwargs –
Additional parameters for the request.
- Returns:
The created app.
- Return type:
Union[AppResponse, AppCustomResponse]
- update(
- app_id: str,
- channel_credentials: ConversationChannelCredentialsDict | None | Unset = UNSET,
- display_name: str | None | Unset = UNSET,
- conversation_metadata_report_view: Literal['NONE', 'FULL'] | Annotated[str, Strict(strict=True)] | None | Unset = UNSET,
- retention_policy: RetentionPolicyDict | None | Unset = UNSET,
- dispatch_retention_policy: DispatchRetentionPolicyDict | None | Unset = UNSET,
- processing_mode: Literal['CONVERSATION', 'DISPATCH'] | Annotated[str, Strict(strict=True)] | None | Unset = UNSET,
- smart_conversation: SmartConversationDict | None | Unset = UNSET,
- event_destination_settings: EventDestinationSettingsDict | None | Unset = UNSET,
- message_retry_settings: MessageRetrySettingsDict | None | Unset = UNSET,
- delivery_report_based_fallback: DeliveryReportBasedFallbackDict | None | Unset = UNSET,
- *,
- raw_response: Literal[False] = False,
- **kwargs,
- update(
- app_id: str,
- channel_credentials: ConversationChannelCredentialsDict | None | Unset = UNSET,
- display_name: str | None | Unset = UNSET,
- conversation_metadata_report_view: Literal['NONE', 'FULL'] | Annotated[str, Strict(strict=True)] | None | Unset = UNSET,
- retention_policy: RetentionPolicyDict | None | Unset = UNSET,
- dispatch_retention_policy: DispatchRetentionPolicyDict | None | Unset = UNSET,
- processing_mode: Literal['CONVERSATION', 'DISPATCH'] | Annotated[str, Strict(strict=True)] | None | Unset = UNSET,
- smart_conversation: SmartConversationDict | None | Unset = UNSET,
- event_destination_settings: EventDestinationSettingsDict | None | Unset = UNSET,
- message_retry_settings: MessageRetrySettingsDict | None | Unset = UNSET,
- delivery_report_based_fallback: DeliveryReportBasedFallbackDict | None | Unset = UNSET,
- *,
- raw_response: Literal[True],
- **kwargs,
Updates a particular app as specified by the App ID. Note that this is a
PATCHoperation, so any specified field values will replace existing values. If you’d like to add configurations to an existing app, make sure to include the existing values AND the new values in the call (for example, get the app, merge your changes into itschannel_credentialsmap, and send the updated map here).Omitted parameters are left untouched on the server; passing
Noneexplicitly clears the field.- Parameters:
app_id (str) – The ID of the app to update.
channel_credentials (UnsetOr[Optional[ConversationChannelCredentialsDict]]) – Channel credentials, keyed by channel. The order of the entries defines the app channel priority.
display_name (UnsetOr[Optional[str]]) – The display name for the app.
conversation_metadata_report_view (UnsetOr[Optional[ConversationMetadataReportViewType]]) – Whether conversation metadata is included in reports.
retention_policy (UnsetOr[Optional[RetentionPolicyDict]]) – The retention policy for messages and conversations.
dispatch_retention_policy (UnsetOr[Optional[DispatchRetentionPolicyDict]]) – The retention policy for messages in dispatch mode.
processing_mode (UnsetOr[Optional[ProcessingModeType]]) – The processing mode for the app.
smart_conversation (UnsetOr[Optional[SmartConversationDict]]) – Smart Conversation settings for the app.
event_destination_settings (UnsetOr[Optional[EventDestinationSettingsDict]]) – Settings for the destination of Sinch events.
message_retry_settings (UnsetOr[Optional[MessageRetrySettingsDict]]) – Settings controlling message retry behavior.
delivery_report_based_fallback (UnsetOr[Optional[DeliveryReportBasedFallbackDict]]) – Delivery-report-based channel fallback settings.
raw_response (bool) – When
False(default) the response exposeschannel_credentialsas a channel-keyed model. Set toTrueto get the rawAppResponsewithchannel_credentialsas the server array.**kwargs –
Additional parameters for the request.
- Returns:
The updated app.
- Return type:
Union[AppResponse, AppCustomResponse]
- delete(app_id: str, **kwargs) None[source]
Deletes the app specified by the App ID. Note that this operation will not delete contacts (which are stored at the project level) nor any channel-specific resources (for example, WhatsApp Sender Identities will not be deleted).
- Parameters:
app_id (str) – The ID of the app to delete.
- Returns:
None
- Return type:
None
For detailed documentation, visit https://developers.sinch.com/docs/conversation/.
- get(
- app_id: str,
- *,
- raw_response: Literal[False] = False,
- **kwargs,
- get(
- app_id: str,
- *,
- raw_response: Literal[True],
- **kwargs,
Returns a particular app as specified by the App ID.
- Parameters:
app_id (str) – The ID of the app to retrieve.
raw_response (bool) – When
False(default) the response exposeschannel_credentialsas a channel-keyed model. Set toTrueto get the rawAppResponsewithchannel_credentialsas the server array.
- Returns:
The app details.
- Return type:
Union[AppResponse, AppCustomResponse]
For detailed documentation, visit https://developers.sinch.com/docs/conversation/.
- list(
- *,
- raw_response: Literal[False] = False,
- **kwargs,
- list(
- *,
- raw_response: Literal[True],
- **kwargs,
List all apps for the current project.
- Parameters:
raw_response (bool) – When
False(default) each app exposeschannel_credentialsas a channel-keyed model. Set toTrueto iterate rawAppResponseobjects withchannel_credentialsas the server array.- Returns:
A paginator for iterating through the apps.
- Return type:
Union[Paginator[ListAppsResponse, AppResponse], Paginator[ListAppsCustomResponse, AppCustomResponse]]
For detailed documentation, visit https://developers.sinch.com/docs/conversation/.
- class sinch.domains.conversation.api.v1.Contacts(sinch)[source]
Bases:
BaseConversation- list(
- page_size: int | None = None,
- page_token: str | None = None,
- external_id: str | None = None,
- channel: Literal['WHATSAPP', 'RCS', 'SMS', 'MESSENGER', 'VIBERBM', 'MMS', 'INSTAGRAM', 'TELEGRAM', 'KAKAOTALK', 'KAKAOTALKCHAT', 'LINE', 'WECHAT', 'APPLEBC'] | Annotated[str, Strict(strict=True)] | None = None,
- identity: str | None = None,
- **kwargs,
List all contacts in the project. Note that, if a WhatsApp contact is returned, the
display_namefield of that contact may be populated with the WhatsApp display name (if the name is already stored on the server and thedisplay_namefield has not been overwritten by the user).- Parameters:
page_size (Optional[int]) – (optional) The maximum number of contacts to fetch. The server default is 10 and the maximum is 20.
page_token (Optional[str]) – (optional) Next page token previously returned if any.
external_id (Optional[str]) – (optional) Contact identifier in an external system. If used,
channelandidentitycan’t be used.channel (Optional[ConversationChannelType]) – (optional) Specifies a channel. If set,
identitymust be set andexternal_idcan’t be used.identity (Optional[str]) – (optional) If set,
channelmust be set andexternal_idcan’t be used. Used in conjunction withchannelto uniquely identify the specified channel identity.**kwargs –
Additional parameters for the request.
- Returns:
A paginator for iterating through the contacts.
- Return type:
Paginator[ListContactsResponse, ContactResponse]
For detailed documentation, visit https://developers.sinch.com/docs/conversation/.
- create(channel_identities: ~typing.List[~sinch.domains.conversation.models.v1.types.channel_identity_dict.ChannelIdentityDict], language: ~typing.Literal['AF', 'SQ', 'AR', 'AZ', 'BN', 'BG', 'CA', 'ZH', 'ZH_CN', 'ZH_HK', 'ZH_TW', 'HR', 'CS', 'DA', 'NL', 'EN', 'EN_GB', 'EN_US', 'ET', 'FIL', 'FI', 'FR', 'DE', 'EL', 'GU', 'HA', 'HE', 'HI', 'HU', 'ID', 'GA', 'IT', 'JA', 'KN', 'KK', 'KO', 'LO', 'LV', 'LT', 'MK', 'MS', 'ML', 'MR', 'NB', 'FA', 'PL', 'PT', 'PT_BR', 'PT_PT', 'PA', 'RO', 'RU', 'SR', 'SK', 'SL', 'ES', 'ES_AR', 'ES_ES', 'ES_MX', 'SW', 'SV', 'TA', 'TE', 'TH', 'TR', 'UK', 'UR', 'UZ', 'VI', 'ZU'] | ~typing.Annotated[str, ~pydantic.types.Strict(strict=True)], channel_priority: ~typing.List[~typing.Literal['WHATSAPP', 'RCS', 'SMS', 'MESSENGER', 'VIBERBM', 'MMS', 'INSTAGRAM', 'TELEGRAM', 'KAKAOTALK', 'KAKAOTALKCHAT', 'LINE', 'WECHAT', 'APPLEBC'] | ~typing.Annotated[str, ~pydantic.types.Strict(strict=True)]] | None | ~sinch.core.sentinel.Unset = <sinch.core.sentinel.Unset object>, display_name: str | None | ~sinch.core.sentinel.Unset = <sinch.core.sentinel.Unset object>, email: str | None | ~sinch.core.sentinel.Unset = <sinch.core.sentinel.Unset object>, external_id: str | None | ~sinch.core.sentinel.Unset = <sinch.core.sentinel.Unset object>, metadata: str | None | ~sinch.core.sentinel.Unset = <sinch.core.sentinel.Unset object>, **kwargs) ContactResponse[source]
Most Conversation API contacts are created automatically when a message is sent to a new recipient. You can also create a new contact manually using this API call.
- Parameters:
channel_identities (List[ChannelIdentityDict]) – (required) List of channel identities. Must contain at least one item.
language (ContactLanguageType) – (required) The language of the contact.
channel_priority (UnsetOr[Optional[List[ConversationChannelType]]]) – (optional) List of channels defining the channel priority. The channel at the top of the list is tried first.
display_name (UnsetOr[Optional[str]]) – (optional) The display name. A default ‘Unknown’ will be assigned by the server if left empty.
email (UnsetOr[Optional[str]]) – (optional) Email of the contact.
external_id (UnsetOr[Optional[str]]) – (optional) Contact identifier in an external system.
metadata (UnsetOr[Optional[str]]) – (optional) Metadata associated with the contact. Up to 1024 characters long.
**kwargs –
Additional parameters for the request.
- Returns:
The created contact.
- Return type:
For detailed documentation, visit https://developers.sinch.com/docs/conversation/.
- get(
- contact_id: str,
- **kwargs,
Returns a specific contact as specified by the contact ID. Note the following:
If a WhatsApp contact is returned, the
display_namefield of that contact may be populated with the WhatsApp display name (if the name is already stored on the server and thedisplay_namefield has not been overwritten by the user).If you receive an Inbound Message callback for an MO message on the Instagram channel, the corresponding payload will not include the Instagram username. You may use the
contact_idandchannel_identityvalues included in the callback to retrieve the username (detailed in thedisplay_namefield) with this operation.
- Parameters:
contact_id (str) – (required) The unique ID of the contact to retrieve.
**kwargs –
Additional parameters for the request.
- Returns:
The contact details.
- Return type:
For detailed documentation, visit https://developers.sinch.com/docs/conversation/.
- delete(contact_id: str, **kwargs) None[source]
Delete a contact as specified by the contact ID.
- Parameters:
contact_id (str) – (required) The unique ID of the contact to delete.
**kwargs –
Additional parameters for the request.
- Returns:
None
- Return type:
None
For detailed documentation, visit https://developers.sinch.com/docs/conversation/.
- update(
- contact_id: str,
- channel_identities: List[ChannelIdentityDict] | None | Unset = <sinch.core.sentinel.Unset object>,
- channel_priority: Literal['WHATSAPP',
- 'RCS',
- 'SMS',
- 'MESSENGER',
- 'VIBERBM',
- 'MMS',
- 'INSTAGRAM',
- 'TELEGRAM',
- 'KAKAOTALK',
- 'KAKAOTALKCHAT',
- 'LINE',
- 'WECHAT',
- 'APPLEBC'] | ~typing.Annotated[str,
- ~pydantic.types.Strict(strict=True)]] | None | ~sinch.core.sentinel.Unset = <sinch.core.sentinel.Unset object>,
- display_name: str | None | Unset = <sinch.core.sentinel.Unset object>,
- email: str | None | Unset = <sinch.core.sentinel.Unset object>,
- external_id: str | None | Unset = <sinch.core.sentinel.Unset object>,
- language: Literal['AF',
- 'SQ',
- 'AR',
- 'AZ',
- 'BN',
- 'BG',
- 'CA',
- 'ZH',
- 'ZH_CN',
- 'ZH_HK',
- 'ZH_TW',
- 'HR',
- 'CS',
- 'DA',
- 'NL',
- 'EN',
- 'EN_GB',
- 'EN_US',
- 'ET',
- 'FIL',
- 'FI',
- 'FR',
- 'DE',
- 'EL',
- 'GU',
- 'HA',
- 'HE',
- 'HI',
- 'HU',
- 'ID',
- 'GA',
- 'IT',
- 'JA',
- 'KN',
- 'KK',
- 'KO',
- 'LO',
- 'LV',
- 'LT',
- 'MK',
- 'MS',
- 'ML',
- 'MR',
- 'NB',
- 'FA',
- 'PL',
- 'PT',
- 'PT_BR',
- 'PT_PT',
- 'PA',
- 'RO',
- 'RU',
- 'SR',
- 'SK',
- 'SL',
- 'ES',
- 'ES_AR',
- 'ES_ES',
- 'ES_MX',
- 'SW',
- 'SV',
- 'TA',
- 'TE',
- 'TH',
- 'TR',
- 'UK',
- 'UR',
- 'UZ',
- 'VI',
- 'ZU'] | ~typing.Annotated[str,
- ~pydantic.types.Strict(strict=True)] | ~sinch.core.sentinel.Unset = <sinch.core.sentinel.Unset object>,
- metadata: str | None | Unset = <sinch.core.sentinel.Unset object>,
- **kwargs,
Updates a contact as specified by the contact ID.
Omitted parameters are left untouched on the server; passing
Noneexplicitly clears the field.- Parameters:
contact_id (str) – (required) The unique ID of the contact to update.
channel_identities (UnsetOr[Optional[List[ChannelIdentityDict]]]) – (optional) List of channel identities.
channel_priority (UnsetOr[Optional[List[ConversationChannelType]]]) – (optional) List of channels defining the channel priority.
display_name (UnsetOr[Optional[str]]) – (optional) The display name of the contact.
email (UnsetOr[Optional[str]]) – (optional) Email of the contact.
external_id (UnsetOr[Optional[str]]) – (optional) Contact identifier in an external system.
language (UnsetOr[ContactLanguageType]) – (optional) The language of the contact.
metadata (UnsetOr[Optional[str]]) – (optional) Metadata associated with the contact. Up to 1024 characters long.
**kwargs –
Additional parameters for the request.
- Returns:
The updated contact.
- Return type:
For detailed documentation, visit https://developers.sinch.com/docs/conversation/.
- merge_contact(
- destination_id: str,
- source_id: str,
- strategy: Annotated[str,
- ~pydantic.types.Strict(strict=True)] | None | ~sinch.core.sentinel.Unset = <sinch.core.sentinel.Unset object>,
- **kwargs,
The remaining contact will contain all conversations that the removed contact did. If both contacts had conversations within the same App, messages from the removed contact will be merged into corresponding active conversations in the destination contact. Channel identities will be moved from the source contact to the destination contact only for channels that weren’t present there before. Moved channel identities will be placed at the bottom of the channel priority list. Optional fields from the source contact will be copied only if corresponding fields in the destination contact are empty. The contact being removed cannot be referenced after this call.
- Parameters:
destination_id (str) – (required) The unique ID of the contact that should be kept when merging two contacts.
source_id (str) – (required) The ID of the contact that should be removed.
strategy (UnsetOr[Optional[ConversationMergeStrategyType]]) – (optional) The merge strategy to apply. The server default is
MERGE.**kwargs –
Additional parameters for the request.
- Returns:
The merged (destination) contact.
- Return type:
For detailed documentation, visit https://developers.sinch.com/docs/conversation/.
- get_channel_profile(
- app_id: str,
- channel: Literal['MESSENGER', 'INSTAGRAM', 'VIBER', 'LINE'] | Annotated[str, Strict(strict=True)],
- recipient: RecipientIdentifiedByDict | RecipientContactIdDict,
- **kwargs,
Get user profile from a specific channel. Only supported on
MESSENGER,INSTAGRAM,VIBERandLINEchannels. Note that, in order to retrieve a WhatsApp display name, you can use the get or list contact operations instead, which will populate thedisplay_namefield of each returned contact with the WhatsApp display name (if the name is already stored on the server and thedisplay_namefield has not been overwritten by the user).- Parameters:
app_id (str) – (required) The ID of the app.
channel (GetChannelProfileConversationChannelType) – (required) The channel. Must be one of the supported channels for this operation.
recipient (RecipientDict) – (required) The recipient to retrieve the channel profile for.
**kwargs –
Additional parameters for the request.
- Returns:
The channel profile.
- Return type:
For detailed documentation, visit https://developers.sinch.com/docs/conversation/.
- get_channel_profile_by_contact_id(
- app_id: str,
- channel: Literal['MESSENGER', 'INSTAGRAM', 'VIBER', 'LINE'] | Annotated[str, Strict(strict=True)],
- contact_id: str,
- **kwargs,
Get user profile from a specific channel. Only supported on
MESSENGER,INSTAGRAM,VIBERandLINEchannels. Note that, in order to retrieve a WhatsApp display name, you can use the get or list contact operations instead, which will populate thedisplay_namefield of each returned contact with the WhatsApp display name (if the name is already stored on the server and thedisplay_namefield has not been overwritten by the user).- Parameters:
app_id (str) – (required) The ID of the app.
channel (GetChannelProfileConversationChannelType) – (required) The channel. Must be one of the supported channels for this operation.
contact_id (str) – (required) The contact_id to retrieve the channel profile for.
**kwargs –
Additional parameters for the request.
- Returns:
The channel profile.
- Return type:
For detailed documentation, visit https://developers.sinch.com/docs/conversation/.
- get_channel_profile_by_channel_identity(
- app_id: str,
- channel: Literal['MESSENGER', 'INSTAGRAM', 'VIBER', 'LINE'] | Annotated[str, Strict(strict=True)],
- recipient_identities: List[ChannelRecipientIdentityDict],
- **kwargs,
Get user profile from a specific channel. Only supported on
MESSENGER,INSTAGRAM,VIBERandLINEchannels. Note that, in order to retrieve a WhatsApp display name, you can use the get or list contact operations instead, which will populate thedisplay_namefield of each returned contact with the WhatsApp display name (if the name is already stored on the server and thedisplay_namefield has not been overwritten by the user).- Parameters:
app_id (str) – (required) The ID of the app.
channel (GetChannelProfileConversationChannelType) – (required) The channel. Must be one of the supported channels for this operation.
recipient_identities (List[ChannelRecipientIdentityDict]) – (required) The recipient_identities to retrieve the channel profile for.
**kwargs –
Additional parameters for the request.
- Returns:
The channel profile.
- Return type:
For detailed documentation, visit https://developers.sinch.com/docs/conversation/.
- list_identity_conflicts(
- page_size: int | None = None,
- page_token: str | None = None,
- **kwargs,
Lists contact identity conflicts across supported SIM-based channels (SMS, MMS, RCS). Use this to identify contact records sharing the same identity (e.g., phone number), which must be resolved before enabling the Unified Contact ID feature.
- Parameters:
page_size (Optional[int]) – (optional) Maximum number of conflicts to return (max 20).
page_token (Optional[str]) – (optional) Pagination token for retrieving next page.
**kwargs –
Additional parameters for the request.
- Returns:
A paginator for iterating through the contact identity conflicts.
- Return type:
Paginator[ListIdentityConflictsResponse, ContactIdentityConflict]
For detailed documentation, visit https://developers.sinch.com/docs/conversation/.
- class sinch.domains.conversation.api.v1.Messages(sinch)[source]
Bases:
BaseConversation- delete(
- message_id: str,
- messages_source: Literal['CONVERSATION_SOURCE', 'DISPATCH_SOURCE'] | Annotated[str, Strict(strict=True)] | None = None,
- **kwargs,
- Delete a specific message by its ID. Note that this operation deletes the message from Conversation API storage;
this operation does not affect messages already delivered to recipients’ handsets. Also note that removing all messages of a conversation will not automatically delete the conversation.
- Parameters:
message_id (str) – The unique ID of the message. (required)
messages_source (Optional[MessageSourceType]) – Specifies the message source for which the request will be processed. Used for operations on messages in Dispatch Mode. Defaults to CONVERSATION_SOURCE when not specified. For more information, see [Processing Modes](https://developers.sinch.com/docs/conversation/processing-modes/). (optional)
**kwargs –
Additional parameters for the request.
- Returns:
None
- Return type:
None
For detailed documentation, visit https://developers.sinch.com/docs/conversation/.
- get(
- message_id: str,
- messages_source: Literal['CONVERSATION_SOURCE', 'DISPATCH_SOURCE'] | Annotated[str, Strict(strict=True)] | None = None,
- **kwargs,
Retrieves a specific message by its ID.
- Parameters:
message_id (str) – The unique ID of the message. (required)
messages_source (Optional[MessageSourceType]) – Specifies the message source for which the request will be processed. Used for operations on messages in Dispatch Mode. Defaults to CONVERSATION_SOURCE when not specified. For more information, see [Processing Modes](https://developers.sinch.com/docs/conversation/processing-modes/). (optional)
**kwargs –
Additional parameters for the request.
- Returns:
ConversationMessageResponse
- Return type:
ConversationMessageResponse
For detailed documentation, visit https://developers.sinch.com/docs/conversation/.
- list(
- page_size: int | None = None,
- page_token: str | None = None,
- conversation_id: str | None = None,
- contact_id: str | None = None,
- app_id: str | None = None,
- channel_identity: str | None = None,
- start_time: datetime | None = None,
- end_time: datetime | None = None,
- view: Literal['WITH_METADATA', 'WITHOUT_METADATA'] | Annotated[str, Strict(strict=True)] | None = None,
- messages_source: Literal['CONVERSATION_SOURCE', 'DISPATCH_SOURCE'] | Annotated[str, Strict(strict=True)] | None = None,
- only_recipient_originated: bool | None = None,
- channel: Literal['WHATSAPP', 'RCS', 'SMS', 'MESSENGER', 'VIBERBM', 'MMS', 'INSTAGRAM', 'TELEGRAM', 'KAKAOTALK', 'KAKAOTALKCHAT', 'LINE', 'WECHAT', 'APPLEBC'] | Annotated[str, Strict(strict=True)] | None = None,
- direction: Literal['TO_APP', 'TO_CONTACT'] | Annotated[str, Strict(strict=True)] | None = None,
- **kwargs,
List messages sent or received via particular Processing Modes. The messages are ordered by their accept_time property in descending order.
- Parameters:
page_size (Optional[int]) – Maximum number of messages to fetch. Defaults to 10, maximum is 1000.
page_token (Optional[str]) – Next page token previously returned if any.
conversation_id (Optional[str]) – Filter messages by conversation ID.
contact_id (Optional[str]) – Filter messages by contact ID.
app_id (Optional[str]) – Filter messages by app ID.
channel_identity (Optional[str]) – Channel identity of the contact.
start_time (Optional[datetime]) – Filter messages with accept_time after this timestamp.
end_time (Optional[datetime]) – Filter messages with accept_time before this timestamp.
view (Optional[ConversationMessagesViewType]) – Messages view type. WITH_METADATA or WITHOUT_METADATA.
messages_source (Optional[MessageSourceType]) – Specifies the message source for the request.
only_recipient_originated (Optional[bool]) – Only fetch recipient-originated messages.
channel (Optional[ConversationChannelType]) – Only fetch messages from the specified channel.
direction (Optional[ConversationDirectionType]) – Only fetch messages with the specified direction. TO_APP or TO_CONTACT.
**kwargs –
Additional parameters for the request.
- Returns:
TokenBasedPaginator with ConversationMessageResponse items
- Return type:
Paginator[ListMessagesResponse, ConversationMessageResponse]
For detailed documentation, visit https://developers.sinch.com/docs/conversation/.
- list_last_messages_by_channel_identity(
- channel_identities: List[str] | None = None,
- contact_ids: List[str] | None = None,
- app_id: str | None = None,
- messages_source: Literal['CONVERSATION_SOURCE', 'DISPATCH_SOURCE'] | Annotated[str, Strict(strict=True)] | None = None,
- page_size: int | None = None,
- page_token: str | None = None,
- view: Literal['WITH_METADATA', 'WITHOUT_METADATA'] | Annotated[str, Strict(strict=True)] | None = None,
- start_time: datetime | None = None,
- end_time: datetime | None = None,
- channel: Literal['WHATSAPP', 'RCS', 'SMS', 'MESSENGER', 'VIBERBM', 'MMS', 'INSTAGRAM', 'TELEGRAM', 'KAKAOTALK', 'KAKAOTALKCHAT', 'LINE', 'WECHAT', 'APPLEBC'] | Annotated[str, Strict(strict=True)] | None = None,
- direction: Literal['TO_APP', 'TO_CONTACT'] | Annotated[str, Strict(strict=True)] | None = None,
- **kwargs,
Retrieves the last message sent to specified channel identities. In CONVERSATION_SOURCE mode, you can query either by channel_identities or by contact_ids. Note: Use either contact_ids OR channel_identities per request, not both. DISPATCH_SOURCE mode does not support contact_ids.
- Parameters:
channel_identities (Optional[List[str]]) – Optional. Filter messages by channel_identity.
contact_ids (Optional[List[str]]) – Optional. Resource name (id) of the contact. CONVERSATION_SOURCE: list last messages by contact_id. DISPATCH_SOURCE: unsupported.
app_id (Optional[str]) – Optional. Resource name (id) of the app.
messages_source (Optional[MessageSourceType]) – Specifies the message source for the request.
page_size (Optional[int]) – Optional. Maximum number of messages to fetch. Defaults to 10, maximum is 1000.
page_token (Optional[str]) – Optional. Next page token previously returned if any.
view (Optional[ConversationMessagesViewType]) – Optional. Specifies the representation (WITH_METADATA or WITHOUT_METADATA). Default WITH_METADATA.
start_time (Optional[datetime]) – Optional. Only fetch messages with accept_time after this date.
end_time (Optional[datetime]) – Optional. Only fetch messages with accept_time before this date.
channel (Optional[ConversationChannelType]) – Optional. Only fetch messages from the specified channel.
direction (Optional[ConversationDirectionType]) – Optional. Only fetch messages with the specified direction (TO_APP or TO_CONTACT).
- Return type:
Paginator[ListMessagesResponse, AppMessageResponse | ContactMessageResponse]
# Code review: :param **kwargs is invalid Sphinx syntax; use kwargs or document as “Additional keyword arguments”. :param kwargs: Additional parameters for the request. :type kwargs: dict
- Returns:
TokenBasedPaginator with ConversationMessageResponse items
- Return type:
Paginator[ListMessagesResponse, ConversationMessageResponse]
- Parameters:
channel_identities (List[str] | None)
contact_ids (List[str] | None)
app_id (str | None)
messages_source (Literal['CONVERSATION_SOURCE', 'DISPATCH_SOURCE'] | ~typing.Annotated[str, ~pydantic.types.Strict(strict=True)] | None)
page_size (int | None)
page_token (str | None)
view (Literal['WITH_METADATA', 'WITHOUT_METADATA'] | ~typing.Annotated[str, ~pydantic.types.Strict(strict=True)] | None)
start_time (datetime | None)
end_time (datetime | None)
channel (Literal['WHATSAPP', 'RCS', 'SMS', 'MESSENGER', 'VIBERBM', 'MMS', 'INSTAGRAM', 'TELEGRAM', 'KAKAOTALK', 'KAKAOTALKCHAT', 'LINE', 'WECHAT', 'APPLEBC'] | ~typing.Annotated[str, ~pydantic.types.Strict(strict=True)] | None)
direction (Literal['TO_APP', 'TO_CONTACT'] | ~typing.Annotated[str, ~pydantic.types.Strict(strict=True)] | None)
For detailed documentation, visit https://developers.sinch.com/docs/conversation/.
- update(
- message_id: str,
- metadata: str,
- messages_source: Literal['CONVERSATION_SOURCE', 'DISPATCH_SOURCE'] | Annotated[str, Strict(strict=True)] | None = None,
- **kwargs,
Update a specific message metadata by its ID.
- Parameters:
message_id (str) – The unique ID of the message. (required)
metadata (str) – Metadata that should be associated with the message. (required)
messages_source (Optional[MessageSourceType]) – Specifies the message source for which the request will be processed. Used for operations on messages in Dispatch Mode. Defaults to CONVERSATION_SOURCE when not specified. For more information, see [Processing Modes](https://developers.sinch.com/docs/conversation/processing-modes/). (optional)
**kwargs –
Additional parameters for the request.
- Returns:
ConversationMessageResponse
- Return type:
ConversationMessageResponse
For detailed documentation, visit https://developers.sinch.com/docs/conversation/.
- send(
- app_id: str,
- message: SendMessageRequestBodyDict | dict,
- contact_id: str | None = None,
- recipient_identities: List[ChannelRecipientIdentityDict] | None = None,
- ttl: str | int | None = None,
- event_destination_target: str | None = None,
- channel_priority_order: List[Literal['WHATSAPP', 'RCS', 'SMS', 'MESSENGER', 'VIBERBM', 'MMS', 'INSTAGRAM', 'TELEGRAM', 'KAKAOTALK', 'KAKAOTALKCHAT', 'LINE', 'WECHAT', 'APPLEBC'] | Annotated[str, Strict(strict=True)]] | None = None,
- channel_properties: Dict[str, str] | None = None,
- message_metadata: str | None = None,
- conversation_metadata: Dict[str, Any] | None = None,
- queue: Literal['NORMAL_PRIORITY', 'HIGH_PRIORITY'] | Annotated[str, Strict(strict=True)] | None = None,
- processing_strategy: Literal['DEFAULT', 'DISPATCH_ONLY'] | Annotated[str, Strict(strict=True)] | None = None,
- correlation_id: str | None = None,
- conversation_metadata_update_strategy: Literal['REPLACE', 'MERGE_PATCH'] | Annotated[str, Strict(strict=True)] | None = None,
- message_content_type: Literal['CONTENT_UNKNOWN', 'CONTENT_MARKETING', 'CONTENT_NOTIFICATION'] | Annotated[str, Strict(strict=True)] | None = None,
- **kwargs,
Send a message from a Conversation app to a contact associated with that app. If the recipient is not associated with an existing contact, a new contact will be created. The message is added to the active conversation with the contact if a conversation already exists. If no active conversation exists a new one is started automatically.
- Parameters:
app_id (str) – The ID of the Conversation API app sending the message.
message (Union[SendMessageRequestBodyDict, dict]) – The message content to send. Can be a SendMessageRequestBodyDict or a dict.
contact_id (Optional[str]) – The contact ID of the recipient. Either contact_id or recipient_identities must be provided.
recipient_identities (Optional[List[ChannelRecipientIdentityDict]]) – List of channel identities for the recipient. Either contact_id or recipient_identities must be provided.
ttl (Optional[Union[str, int]]) – The timeout allotted for sending the message. Can be seconds (int) or a string like ’10s’.
event_destination_target (Optional[str]) – Overwrites the default event destination target for delivery receipts for this message.
channel_priority_order (Optional[List[ConversationChannelType]]) – Explicitly define the channels and order in which they are tried when sending the message.
channel_properties (Optional[Dict[str, str]]) – Channel-specific properties. The key in the map must point to a valid channel property key.
message_metadata (Optional[str]) – Metadata that should be associated with the message. Up to 1024 characters long.
conversation_metadata (Optional[Dict[str, Any]]) – Metadata that will be associated with the conversation. Up to 2048 characters long.
queue (Optional[MessageQueueType]) – Select the priority type for the message. Can be ‘NORMAL_PRIORITY’ or ‘HIGH_PRIORITY’.
processing_strategy (Optional[ProcessingStrategyType]) – Overrides the app’s Processing Mode. Can be ‘DEFAULT’ or ‘DISPATCH_ONLY’.
correlation_id (Optional[str]) – An arbitrary identifier that will be propagated to callbacks related to this message. Up to 128 characters long.
conversation_metadata_update_strategy (Optional[MetadataUpdateStrategyType]) – Update strategy for the conversation_metadata field. Can be ‘REPLACE’ or ‘MERGE_PATCH’.
message_content_type (Optional[MessageContentType]) – Classifies the message content for use with consent management. Can be ‘CONTENT_UNKNOWN’, ‘CONTENT_MARKETING’, or ‘CONTENT_NOTIFICATION’.
**kwargs –
Additional parameters for the request.
- Returns:
SendMessageResponse
- Return type:
For detailed documentation, visit https://developers.sinch.com/docs/conversation/.
- send_text_message(
- app_id: str,
- text: str,
- contact_id: str | None = None,
- recipient_identities: List[ChannelRecipientIdentityDict] | None = None,
- ttl: str | int | None = None,
- event_destination_target: str | None = None,
- channel_priority_order: List[Literal['WHATSAPP', 'RCS', 'SMS', 'MESSENGER', 'VIBERBM', 'MMS', 'INSTAGRAM', 'TELEGRAM', 'KAKAOTALK', 'KAKAOTALKCHAT', 'LINE', 'WECHAT', 'APPLEBC'] | Annotated[str, Strict(strict=True)]] | None = None,
- channel_properties: Dict[str, str] | None = None,
- message_metadata: str | None = None,
- conversation_metadata: Dict[str, Any] | None = None,
- queue: Literal['NORMAL_PRIORITY', 'HIGH_PRIORITY'] | Annotated[str, Strict(strict=True)] | None = None,
- processing_strategy: Literal['DEFAULT', 'DISPATCH_ONLY'] | Annotated[str, Strict(strict=True)] | None = None,
- correlation_id: str | None = None,
- conversation_metadata_update_strategy: Literal['REPLACE', 'MERGE_PATCH'] | Annotated[str, Strict(strict=True)] | None = None,
- message_content_type: Literal['CONTENT_UNKNOWN', 'CONTENT_MARKETING', 'CONTENT_NOTIFICATION'] | Annotated[str, Strict(strict=True)] | None = None,
- **kwargs,
Send a text message from a Conversation app to a contact associated with that app. If the recipient is not associated with an existing contact, a new contact will be created. The message is added to the active conversation with the contact if a conversation already exists. If no active conversation exists a new one is started automatically.
- Parameters:
app_id (str) – The ID of the Conversation API app sending the message.
contact_id (Optional[str]) – The contact ID of the recipient. Either contact_id or recipient_identities must be provided.
recipient_identities (Optional[List[ChannelRecipientIdentityDict]]) – List of channel identities for the recipient. Either contact_id or recipient_identities must be provided.
text (str) – The text content of the message.
ttl (Optional[Union[str, int]]) – The timeout allotted for sending the message. Can be seconds (int) or a string like ’10s’.
event_destination_target (Optional[str]) – Overwrites the default event destination target for delivery receipts for this message.
channel_priority_order (Optional[List[ConversationChannelType]]) – Explicitly define the channels and order in which they are tried when sending the message.
channel_properties (Optional[Dict[str, str]]) – Channel-specific properties. The key in the map must point to a valid channel property key.
message_metadata (Optional[str]) – Metadata that should be associated with the message. Up to 1024 characters long.
conversation_metadata (Optional[Dict[str, Any]]) – Metadata that will be associated with the conversation. Up to 2048 characters long.
queue (Optional[MessageQueueType]) – Select the priority type for the message. Can be ‘NORMAL_PRIORITY’ or ‘HIGH_PRIORITY’.
processing_strategy (Optional[ProcessingStrategyType]) – Overrides the app’s Processing Mode. Can be ‘DEFAULT’ or ‘DISPATCH_ONLY’.
correlation_id (Optional[str]) – An arbitrary identifier that will be propagated to callbacks related to this message. Up to 128 characters long.
conversation_metadata_update_strategy (Optional[MetadataUpdateStrategyType]) – Update strategy for the conversation_metadata field. Can be ‘REPLACE’ or ‘MERGE_PATCH’.
message_content_type (Optional[MessageContentType]) – Classifies the message content for use with consent management. Can be ‘CONTENT_UNKNOWN’, ‘CONTENT_MARKETING’, or ‘CONTENT_NOTIFICATION’.
**kwargs –
Additional parameters for the message body (e.g., agent, etc.).
- Returns:
SendMessageResponse
- Return type:
For detailed documentation, visit https://developers.sinch.com/docs/conversation/.
- send_card_message(
- app_id: str,
- card_message: CardMessageDict,
- contact_id: str | None = None,
- recipient_identities: List[ChannelRecipientIdentityDict] | None = None,
- ttl: str | int | None = None,
- event_destination_target: str | None = None,
- channel_priority_order: List[Literal['WHATSAPP', 'RCS', 'SMS', 'MESSENGER', 'VIBERBM', 'MMS', 'INSTAGRAM', 'TELEGRAM', 'KAKAOTALK', 'KAKAOTALKCHAT', 'LINE', 'WECHAT', 'APPLEBC'] | Annotated[str, Strict(strict=True)]] | None = None,
- channel_properties: Dict[str, str] | None = None,
- message_metadata: str | None = None,
- conversation_metadata: Dict[str, Any] | None = None,
- queue: Literal['NORMAL_PRIORITY', 'HIGH_PRIORITY'] | Annotated[str, Strict(strict=True)] | None = None,
- processing_strategy: Literal['DEFAULT', 'DISPATCH_ONLY'] | Annotated[str, Strict(strict=True)] | None = None,
- correlation_id: str | None = None,
- conversation_metadata_update_strategy: Literal['REPLACE', 'MERGE_PATCH'] | Annotated[str, Strict(strict=True)] | None = None,
- message_content_type: Literal['CONTENT_UNKNOWN', 'CONTENT_MARKETING', 'CONTENT_NOTIFICATION'] | Annotated[str, Strict(strict=True)] | None = None,
- **kwargs,
Send a card message from a Conversation app to a contact associated with that app. If the recipient is not associated with an existing contact, a new contact will be created. The message is added to the active conversation with the contact if a conversation already exists. If no active conversation exists a new one is started automatically.
- Parameters:
app_id (str) – The ID of the Conversation API app sending the message.
contact_id (Optional[str]) – The contact ID of the recipient. Either contact_id or recipient_identities must be provided.
recipient_identities (Optional[List[ChannelRecipientIdentityDict]]) – List of channel identities for the recipient. Either contact_id or recipient_identities must be provided.
card_message (CardMessageDict) – The card message content.
ttl (Optional[Union[str, int]]) – The timeout allotted for sending the message. Can be seconds (int) or a string like ’10s’.
event_destination_target (Optional[str]) – Overwrites the default event destination target for delivery receipts for this message.
channel_priority_order (Optional[List[ConversationChannelType]]) – Explicitly define the channels and order in which they are tried when sending the message.
channel_properties (Optional[Dict[str, str]]) – Channel-specific properties. The key in the map must point to a valid channel property key.
message_metadata (Optional[str]) – Metadata that should be associated with the message. Up to 1024 characters long.
conversation_metadata (Optional[Dict[str, Any]]) – Metadata that will be associated with the conversation. Up to 2048 characters long.
queue (Optional[MessageQueueType]) – Select the priority type for the message. Can be ‘NORMAL_PRIORITY’ or ‘HIGH_PRIORITY’.
processing_strategy (Optional[ProcessingStrategyType]) – Overrides the app’s Processing Mode. Can be ‘DEFAULT’ or ‘DISPATCH_ONLY’.
correlation_id (Optional[str]) – An arbitrary identifier that will be propagated to callbacks related to this message. Up to 128 characters long.
conversation_metadata_update_strategy (Optional[MetadataUpdateStrategyType]) – Update strategy for the conversation_metadata field. Can be ‘REPLACE’ or ‘MERGE_PATCH’.
message_content_type (Optional[MessageContentType]) – Classifies the message content for use with consent management. Can be ‘CONTENT_UNKNOWN’, ‘CONTENT_MARKETING’, or ‘CONTENT_NOTIFICATION’.
**kwargs –
Additional parameters for the message body (e.g., agent, etc.).
- Returns:
SendMessageResponse
- Return type:
For detailed documentation, visit https://developers.sinch.com/docs/conversation/.
- send_carousel_message(
- app_id: str,
- carousel_message: CarouselMessageDict,
- contact_id: str | None = None,
- recipient_identities: List[ChannelRecipientIdentityDict] | None = None,
- ttl: str | int | None = None,
- event_destination_target: str | None = None,
- channel_priority_order: List[Literal['WHATSAPP', 'RCS', 'SMS', 'MESSENGER', 'VIBERBM', 'MMS', 'INSTAGRAM', 'TELEGRAM', 'KAKAOTALK', 'KAKAOTALKCHAT', 'LINE', 'WECHAT', 'APPLEBC'] | Annotated[str, Strict(strict=True)]] | None = None,
- channel_properties: Dict[str, str] | None = None,
- message_metadata: str | None = None,
- conversation_metadata: Dict[str, Any] | None = None,
- queue: Literal['NORMAL_PRIORITY', 'HIGH_PRIORITY'] | Annotated[str, Strict(strict=True)] | None = None,
- processing_strategy: Literal['DEFAULT', 'DISPATCH_ONLY'] | Annotated[str, Strict(strict=True)] | None = None,
- correlation_id: str | None = None,
- conversation_metadata_update_strategy: Literal['REPLACE', 'MERGE_PATCH'] | Annotated[str, Strict(strict=True)] | None = None,
- message_content_type: Literal['CONTENT_UNKNOWN', 'CONTENT_MARKETING', 'CONTENT_NOTIFICATION'] | Annotated[str, Strict(strict=True)] | None = None,
- **kwargs,
Send a carousel message from a Conversation app to a contact associated with that app. If the recipient is not associated with an existing contact, a new contact will be created. The message is added to the active conversation with the contact if a conversation already exists. If no active conversation exists a new one is started automatically.
- Parameters:
app_id (str) – The ID of the Conversation API app sending the message.
contact_id (Optional[str]) – The contact ID of the recipient. Either contact_id or recipient_identities must be provided.
recipient_identities (Optional[List[ChannelRecipientIdentityDict]]) – List of channel identities for the recipient. Either contact_id or recipient_identities must be provided.
carousel_message (CarouselMessageDict) – The carousel message content.
ttl (Optional[Union[str, int]]) – The timeout allotted for sending the message. Can be seconds (int) or a string like ’10s’.
event_destination_target (Optional[str]) – Overwrites the default event destination target for delivery receipts for this message.
channel_priority_order (Optional[List[ConversationChannelType]]) – Explicitly define the channels and order in which they are tried when sending the message.
channel_properties (Optional[Dict[str, str]]) – Channel-specific properties. The key in the map must point to a valid channel property key.
message_metadata (Optional[str]) – Metadata that should be associated with the message. Up to 1024 characters long.
conversation_metadata (Optional[Dict[str, Any]]) – Metadata that will be associated with the conversation. Up to 2048 characters long.
queue (Optional[MessageQueueType]) – Select the priority type for the message. Can be ‘NORMAL_PRIORITY’ or ‘HIGH_PRIORITY’.
processing_strategy (Optional[ProcessingStrategyType]) – Overrides the app’s Processing Mode. Can be ‘DEFAULT’ or ‘DISPATCH_ONLY’.
correlation_id (Optional[str]) – An arbitrary identifier that will be propagated to callbacks related to this message. Up to 128 characters long.
conversation_metadata_update_strategy (Optional[MetadataUpdateStrategyType]) – Update strategy for the conversation_metadata field. Can be ‘REPLACE’ or ‘MERGE_PATCH’.
message_content_type (Optional[MessageContentType]) – Classifies the message content for use with consent management. Can be ‘CONTENT_UNKNOWN’, ‘CONTENT_MARKETING’, or ‘CONTENT_NOTIFICATION’.
**kwargs –
Additional parameters for the message body (e.g., agent, etc.).
- Returns:
SendMessageResponse
- Return type:
For detailed documentation, visit https://developers.sinch.com/docs/conversation/.
- send_choice_message(
- app_id: str,
- choice_message: ChoiceMessageDict,
- contact_id: str | None = None,
- recipient_identities: List[ChannelRecipientIdentityDict] | None = None,
- ttl: str | int | None = None,
- event_destination_target: str | None = None,
- channel_priority_order: List[Literal['WHATSAPP', 'RCS', 'SMS', 'MESSENGER', 'VIBERBM', 'MMS', 'INSTAGRAM', 'TELEGRAM', 'KAKAOTALK', 'KAKAOTALKCHAT', 'LINE', 'WECHAT', 'APPLEBC'] | Annotated[str, Strict(strict=True)]] | None = None,
- channel_properties: Dict[str, str] | None = None,
- message_metadata: str | None = None,
- conversation_metadata: Dict[str, Any] | None = None,
- queue: Literal['NORMAL_PRIORITY', 'HIGH_PRIORITY'] | Annotated[str, Strict(strict=True)] | None = None,
- processing_strategy: Literal['DEFAULT', 'DISPATCH_ONLY'] | Annotated[str, Strict(strict=True)] | None = None,
- correlation_id: str | None = None,
- conversation_metadata_update_strategy: Literal['REPLACE', 'MERGE_PATCH'] | Annotated[str, Strict(strict=True)] | None = None,
- message_content_type: Literal['CONTENT_UNKNOWN', 'CONTENT_MARKETING', 'CONTENT_NOTIFICATION'] | Annotated[str, Strict(strict=True)] | None = None,
- **kwargs,
Send a choice message from a Conversation app to a contact associated with that app. If the recipient is not associated with an existing contact, a new contact will be created. The message is added to the active conversation with the contact if a conversation already exists. If no active conversation exists a new one is started automatically.
- Parameters:
app_id (str) – The ID of the Conversation API app sending the message.
contact_id (Optional[str]) – The contact ID of the recipient. Either contact_id or recipient_identities must be provided.
recipient_identities (Optional[List[ChannelRecipientIdentityDict]]) – List of channel identities for the recipient. Either contact_id or recipient_identities must be provided.
choice_message (ChoiceMessageDict) – The choice message content.
ttl (Optional[Union[str, int]]) – The timeout allotted for sending the message. Can be seconds (int) or a string like ’10s’.
event_destination_target (Optional[str]) – Overwrites the default event destination target for delivery receipts for this message.
channel_priority_order (Optional[List[ConversationChannelType]]) – Explicitly define the channels and order in which they are tried when sending the message.
channel_properties (Optional[Dict[str, str]]) – Channel-specific properties. The key in the map must point to a valid channel property key.
message_metadata (Optional[str]) – Metadata that should be associated with the message. Up to 1024 characters long.
conversation_metadata (Optional[Dict[str, Any]]) – Metadata that will be associated with the conversation. Up to 2048 characters long.
queue (Optional[MessageQueueType]) – Select the priority type for the message. Can be ‘NORMAL_PRIORITY’ or ‘HIGH_PRIORITY’.
processing_strategy (Optional[ProcessingStrategyType]) – Overrides the app’s Processing Mode. Can be ‘DEFAULT’ or ‘DISPATCH_ONLY’.
correlation_id (Optional[str]) – An arbitrary identifier that will be propagated to callbacks related to this message. Up to 128 characters long.
conversation_metadata_update_strategy (Optional[MetadataUpdateStrategyType]) – Update strategy for the conversation_metadata field. Can be ‘REPLACE’ or ‘MERGE_PATCH’.
message_content_type (Optional[MessageContentType]) – Classifies the message content for use with consent management. Can be ‘CONTENT_UNKNOWN’, ‘CONTENT_MARKETING’, or ‘CONTENT_NOTIFICATION’.
**kwargs –
Additional parameters for the message body (e.g., agent, etc.).
- Returns:
SendMessageResponse
- Return type:
For detailed documentation, visit https://developers.sinch.com/docs/conversation/.
- send_contact_info_message(
- app_id: str,
- contact_info_message: ContactInfoMessageDict,
- contact_id: str | None = None,
- recipient_identities: List[ChannelRecipientIdentityDict] | None = None,
- ttl: str | int | None = None,
- event_destination_target: str | None = None,
- channel_priority_order: List[Literal['WHATSAPP', 'RCS', 'SMS', 'MESSENGER', 'VIBERBM', 'MMS', 'INSTAGRAM', 'TELEGRAM', 'KAKAOTALK', 'KAKAOTALKCHAT', 'LINE', 'WECHAT', 'APPLEBC'] | Annotated[str, Strict(strict=True)]] | None = None,
- channel_properties: Dict[str, str] | None = None,
- message_metadata: str | None = None,
- conversation_metadata: Dict[str, Any] | None = None,
- queue: Literal['NORMAL_PRIORITY', 'HIGH_PRIORITY'] | Annotated[str, Strict(strict=True)] | None = None,
- processing_strategy: Literal['DEFAULT', 'DISPATCH_ONLY'] | Annotated[str, Strict(strict=True)] | None = None,
- correlation_id: str | None = None,
- conversation_metadata_update_strategy: Literal['REPLACE', 'MERGE_PATCH'] | Annotated[str, Strict(strict=True)] | None = None,
- message_content_type: Literal['CONTENT_UNKNOWN', 'CONTENT_MARKETING', 'CONTENT_NOTIFICATION'] | Annotated[str, Strict(strict=True)] | None = None,
- **kwargs,
Send a contact info message from a Conversation app to a contact associated with that app. If the recipient is not associated with an existing contact, a new contact will be created. The message is added to the active conversation with the contact if a conversation already exists. If no active conversation exists a new one is started automatically.
- Parameters:
app_id (str) – The ID of the Conversation API app sending the message.
contact_id (Optional[str]) – The contact ID of the recipient. Either contact_id or recipient_identities must be provided.
recipient_identities (Optional[List[ChannelRecipientIdentityDict]]) – List of channel identities for the recipient. Either contact_id or recipient_identities must be provided.
contact_info_message (ContactInfoMessageDict) – The contact info message content.
ttl (Optional[Union[str, int]]) – The timeout allotted for sending the message. Can be seconds (int) or a string like ’10s’.
event_destination_target (Optional[str]) – Overwrites the default event destination target for delivery receipts for this message.
channel_priority_order (Optional[List[ConversationChannelType]]) – Explicitly define the channels and order in which they are tried when sending the message.
channel_properties (Optional[Dict[str, str]]) – Channel-specific properties. The key in the map must point to a valid channel property key.
message_metadata (Optional[str]) – Metadata that should be associated with the message. Up to 1024 characters long.
conversation_metadata (Optional[Dict[str, Any]]) – Metadata that will be associated with the conversation. Up to 2048 characters long.
queue (Optional[MessageQueueType]) – Select the priority type for the message. Can be ‘NORMAL_PRIORITY’ or ‘HIGH_PRIORITY’.
processing_strategy (Optional[ProcessingStrategyType]) – Overrides the app’s Processing Mode. Can be ‘DEFAULT’ or ‘DISPATCH_ONLY’.
correlation_id (Optional[str]) – An arbitrary identifier that will be propagated to callbacks related to this message. Up to 128 characters long.
conversation_metadata_update_strategy (Optional[MetadataUpdateStrategyType]) – Update strategy for the conversation_metadata field. Can be ‘REPLACE’ or ‘MERGE_PATCH’.
message_content_type (Optional[MessageContentType]) – Classifies the message content for use with consent management. Can be ‘CONTENT_UNKNOWN’, ‘CONTENT_MARKETING’, or ‘CONTENT_NOTIFICATION’.
**kwargs –
Additional parameters for the message body (e.g., agent, etc.).
- Returns:
SendMessageResponse
- Return type:
For detailed documentation, visit https://developers.sinch.com/docs/conversation/.
- send_list_message(
- app_id: str,
- list_message: ListMessageDict,
- contact_id: str | None = None,
- recipient_identities: List[ChannelRecipientIdentityDict] | None = None,
- ttl: str | int | None = None,
- event_destination_target: str | None = None,
- channel_priority_order: List[Literal['WHATSAPP', 'RCS', 'SMS', 'MESSENGER', 'VIBERBM', 'MMS', 'INSTAGRAM', 'TELEGRAM', 'KAKAOTALK', 'KAKAOTALKCHAT', 'LINE', 'WECHAT', 'APPLEBC'] | Annotated[str, Strict(strict=True)]] | None = None,
- channel_properties: Dict[str, str] | None = None,
- message_metadata: str | None = None,
- conversation_metadata: Dict[str, Any] | None = None,
- queue: Literal['NORMAL_PRIORITY', 'HIGH_PRIORITY'] | Annotated[str, Strict(strict=True)] | None = None,
- processing_strategy: Literal['DEFAULT', 'DISPATCH_ONLY'] | Annotated[str, Strict(strict=True)] | None = None,
- correlation_id: str | None = None,
- conversation_metadata_update_strategy: Literal['REPLACE', 'MERGE_PATCH'] | Annotated[str, Strict(strict=True)] | None = None,
- message_content_type: Literal['CONTENT_UNKNOWN', 'CONTENT_MARKETING', 'CONTENT_NOTIFICATION'] | Annotated[str, Strict(strict=True)] | None = None,
- **kwargs,
Send a list message from a Conversation app to a contact associated with that app. If the recipient is not associated with an existing contact, a new contact will be created. The message is added to the active conversation with the contact if a conversation already exists. If no active conversation exists a new one is started automatically.
- Parameters:
app_id (str) – The ID of the Conversation API app sending the message.
contact_id (Optional[str]) – The contact ID of the recipient. Either contact_id or recipient_identities must be provided.
recipient_identities (Optional[List[ChannelRecipientIdentityDict]]) – List of channel identities for the recipient. Either contact_id or recipient_identities must be provided.
list_message (ListMessageDict) – The list message content.
ttl (Optional[Union[str, int]]) – The timeout allotted for sending the message. Can be seconds (int) or a string like ’10s’.
event_destination_target (Optional[str]) – Overwrites the default event destination target for delivery receipts for this message.
channel_priority_order (Optional[List[ConversationChannelType]]) – Explicitly define the channels and order in which they are tried when sending the message.
channel_properties (Optional[Dict[str, str]]) – Channel-specific properties. The key in the map must point to a valid channel property key.
message_metadata (Optional[str]) – Metadata that should be associated with the message. Up to 1024 characters long.
conversation_metadata (Optional[Dict[str, Any]]) – Metadata that will be associated with the conversation. Up to 2048 characters long.
queue (Optional[MessageQueueType]) – Select the priority type for the message. Can be ‘NORMAL_PRIORITY’ or ‘HIGH_PRIORITY’.
processing_strategy (Optional[ProcessingStrategyType]) – Overrides the app’s Processing Mode. Can be ‘DEFAULT’ or ‘DISPATCH_ONLY’.
correlation_id (Optional[str]) – An arbitrary identifier that will be propagated to callbacks related to this message. Up to 128 characters long.
conversation_metadata_update_strategy (Optional[MetadataUpdateStrategyType]) – Update strategy for the conversation_metadata field. Can be ‘REPLACE’ or ‘MERGE_PATCH’.
message_content_type (Optional[MessageContentType]) – Classifies the message content for use with consent management. Can be ‘CONTENT_UNKNOWN’, ‘CONTENT_MARKETING’, or ‘CONTENT_NOTIFICATION’.
**kwargs –
Additional parameters for the message body (e.g., agent, etc.).
- Returns:
SendMessageResponse
- Return type:
For detailed documentation, visit https://developers.sinch.com/docs/conversation/.
- send_location_message(
- app_id: str,
- location_message: LocationMessageDict,
- contact_id: str | None = None,
- recipient_identities: List[ChannelRecipientIdentityDict] | None = None,
- ttl: str | int | None = None,
- event_destination_target: str | None = None,
- channel_priority_order: List[Literal['WHATSAPP', 'RCS', 'SMS', 'MESSENGER', 'VIBERBM', 'MMS', 'INSTAGRAM', 'TELEGRAM', 'KAKAOTALK', 'KAKAOTALKCHAT', 'LINE', 'WECHAT', 'APPLEBC'] | Annotated[str, Strict(strict=True)]] | None = None,
- channel_properties: Dict[str, str] | None = None,
- message_metadata: str | None = None,
- conversation_metadata: Dict[str, Any] | None = None,
- queue: Literal['NORMAL_PRIORITY', 'HIGH_PRIORITY'] | Annotated[str, Strict(strict=True)] | None = None,
- processing_strategy: Literal['DEFAULT', 'DISPATCH_ONLY'] | Annotated[str, Strict(strict=True)] | None = None,
- correlation_id: str | None = None,
- conversation_metadata_update_strategy: Literal['REPLACE', 'MERGE_PATCH'] | Annotated[str, Strict(strict=True)] | None = None,
- message_content_type: Literal['CONTENT_UNKNOWN', 'CONTENT_MARKETING', 'CONTENT_NOTIFICATION'] | Annotated[str, Strict(strict=True)] | None = None,
- **kwargs,
Send a location message from a Conversation app to a contact associated with that app. If the recipient is not associated with an existing contact, a new contact will be created. The message is added to the active conversation with the contact if a conversation already exists. If no active conversation exists a new one is started automatically.
- Parameters:
app_id (str) – The ID of the Conversation API app sending the message.
contact_id (Optional[str]) – The contact ID of the recipient. Either contact_id or recipient_identities must be provided.
recipient_identities (Optional[List[ChannelRecipientIdentityDict]]) – List of channel identities for the recipient. Either contact_id or recipient_identities must be provided.
location_message (LocationMessageDict) – The location message content.
ttl (Optional[Union[str, int]]) – The timeout allotted for sending the message. Can be seconds (int) or a string like ’10s’.
event_destination_target (Optional[str]) – Overwrites the default event destination target for delivery receipts for this message.
channel_priority_order (Optional[List[ConversationChannelType]]) – Explicitly define the channels and order in which they are tried when sending the message.
channel_properties (Optional[Dict[str, str]]) – Channel-specific properties. The key in the map must point to a valid channel property key.
message_metadata (Optional[str]) – Metadata that should be associated with the message. Up to 1024 characters long.
conversation_metadata (Optional[Dict[str, Any]]) – Metadata that will be associated with the conversation. Up to 2048 characters long.
queue (Optional[MessageQueueType]) – Select the priority type for the message. Can be ‘NORMAL_PRIORITY’ or ‘HIGH_PRIORITY’.
processing_strategy (Optional[ProcessingStrategyType]) – Overrides the app’s Processing Mode. Can be ‘DEFAULT’ or ‘DISPATCH_ONLY’.
correlation_id (Optional[str]) – An arbitrary identifier that will be propagated to callbacks related to this message. Up to 128 characters long.
conversation_metadata_update_strategy (Optional[MetadataUpdateStrategyType]) – Update strategy for the conversation_metadata field. Can be ‘REPLACE’ or ‘MERGE_PATCH’.
message_content_type (Optional[MessageContentType]) – Classifies the message content for use with consent management. Can be ‘CONTENT_UNKNOWN’, ‘CONTENT_MARKETING’, or ‘CONTENT_NOTIFICATION’.
**kwargs –
Additional parameters for the message body (e.g., agent, etc.).
- Returns:
SendMessageResponse
- Return type:
For detailed documentation, visit https://developers.sinch.com/docs/conversation/.
- send_media_message(
- app_id: str,
- media_message: MediaPropertiesDict,
- contact_id: str | None = None,
- recipient_identities: List[ChannelRecipientIdentityDict] | None = None,
- ttl: str | int | None = None,
- event_destination_target: str | None = None,
- channel_priority_order: List[Literal['WHATSAPP', 'RCS', 'SMS', 'MESSENGER', 'VIBERBM', 'MMS', 'INSTAGRAM', 'TELEGRAM', 'KAKAOTALK', 'KAKAOTALKCHAT', 'LINE', 'WECHAT', 'APPLEBC'] | Annotated[str, Strict(strict=True)]] | None = None,
- channel_properties: Dict[str, str] | None = None,
- message_metadata: str | None = None,
- conversation_metadata: Dict[str, Any] | None = None,
- queue: Literal['NORMAL_PRIORITY', 'HIGH_PRIORITY'] | Annotated[str, Strict(strict=True)] | None = None,
- processing_strategy: Literal['DEFAULT', 'DISPATCH_ONLY'] | Annotated[str, Strict(strict=True)] | None = None,
- correlation_id: str | None = None,
- conversation_metadata_update_strategy: Literal['REPLACE', 'MERGE_PATCH'] | Annotated[str, Strict(strict=True)] | None = None,
- message_content_type: Literal['CONTENT_UNKNOWN', 'CONTENT_MARKETING', 'CONTENT_NOTIFICATION'] | Annotated[str, Strict(strict=True)] | None = None,
- **kwargs,
Send a media message from a Conversation app to a contact associated with that app. If the recipient is not associated with an existing contact, a new contact will be created. The message is added to the active conversation with the contact if a conversation already exists. If no active conversation exists a new one is started automatically.
- Parameters:
app_id (str) – The ID of the Conversation API app sending the message.
contact_id (Optional[str]) – The contact ID of the recipient. Either contact_id or recipient_identities must be provided.
recipient_identities (Optional[List[ChannelRecipientIdentityDict]]) – List of channel identities for the recipient. Either contact_id or recipient_identities must be provided.
media_message (MediaPropertiesDict) – The media message content.
ttl (Optional[Union[str, int]]) – The timeout allotted for sending the message. Can be seconds (int) or a string like ’10s’.
event_destination_target (Optional[str]) – Overwrites the default event destination target for delivery receipts for this message.
channel_priority_order (Optional[List[ConversationChannelType]]) – Explicitly define the channels and order in which they are tried when sending the message.
channel_properties (Optional[Dict[str, str]]) – Channel-specific properties. The key in the map must point to a valid channel property key.
message_metadata (Optional[str]) – Metadata that should be associated with the message. Up to 1024 characters long.
conversation_metadata (Optional[Dict[str, Any]]) – Metadata that will be associated with the conversation. Up to 2048 characters long.
queue (Optional[MessageQueueType]) – Select the priority type for the message. Can be ‘NORMAL_PRIORITY’ or ‘HIGH_PRIORITY’.
processing_strategy (Optional[ProcessingStrategyType]) – Overrides the app’s Processing Mode. Can be ‘DEFAULT’ or ‘DISPATCH_ONLY’.
correlation_id (Optional[str]) – An arbitrary identifier that will be propagated to callbacks related to this message. Up to 128 characters long.
conversation_metadata_update_strategy (Optional[MetadataUpdateStrategyType]) – Update strategy for the conversation_metadata field. Can be ‘REPLACE’ or ‘MERGE_PATCH’.
message_content_type (Optional[MessageContentType]) – Classifies the message content for use with consent management. Can be ‘CONTENT_UNKNOWN’, ‘CONTENT_MARKETING’, or ‘CONTENT_NOTIFICATION’.
**kwargs –
Additional parameters for the message body (e.g., agent, etc.).
- Returns:
SendMessageResponse
- Return type:
For detailed documentation, visit https://developers.sinch.com/docs/conversation/.
- send_template_message(
- app_id: str,
- template_message: TemplateMessageDict,
- contact_id: str | None = None,
- recipient_identities: List[ChannelRecipientIdentityDict] | None = None,
- ttl: str | int | None = None,
- event_destination_target: str | None = None,
- channel_priority_order: List[Literal['WHATSAPP', 'RCS', 'SMS', 'MESSENGER', 'VIBERBM', 'MMS', 'INSTAGRAM', 'TELEGRAM', 'KAKAOTALK', 'KAKAOTALKCHAT', 'LINE', 'WECHAT', 'APPLEBC'] | Annotated[str, Strict(strict=True)]] | None = None,
- channel_properties: Dict[str, str] | None = None,
- message_metadata: str | None = None,
- conversation_metadata: Dict[str, Any] | None = None,
- queue: Literal['NORMAL_PRIORITY', 'HIGH_PRIORITY'] | Annotated[str, Strict(strict=True)] | None = None,
- processing_strategy: Literal['DEFAULT', 'DISPATCH_ONLY'] | Annotated[str, Strict(strict=True)] | None = None,
- correlation_id: str | None = None,
- conversation_metadata_update_strategy: Literal['REPLACE', 'MERGE_PATCH'] | Annotated[str, Strict(strict=True)] | None = None,
- message_content_type: Literal['CONTENT_UNKNOWN', 'CONTENT_MARKETING', 'CONTENT_NOTIFICATION'] | Annotated[str, Strict(strict=True)] | None = None,
- **kwargs,
Send a template message from a Conversation app to a contact associated with that app. If the recipient is not associated with an existing contact, a new contact will be created. The message is added to the active conversation with the contact if a conversation already exists. If no active conversation exists a new one is started automatically.
- Parameters:
app_id (str) – The ID of the Conversation API app sending the message.
contact_id (Optional[str]) – The contact ID of the recipient. Either contact_id or recipient_identities must be provided.
recipient_identities (Optional[List[ChannelRecipientIdentityDict]]) – List of channel identities for the recipient. Either contact_id or recipient_identities must be provided.
template_message (TemplateMessageDict) – The template message content.
ttl (Optional[Union[str, int]]) – The timeout allotted for sending the message. Can be seconds (int) or a string like ’10s’.
event_destination_target (Optional[str]) – Overwrites the default event destination target for delivery receipts for this message.
channel_priority_order (Optional[List[ConversationChannelType]]) – Explicitly define the channels and order in which they are tried when sending the message.
channel_properties (Optional[Dict[str, str]]) – Channel-specific properties. The key in the map must point to a valid channel property key.
message_metadata (Optional[str]) – Metadata that should be associated with the message. Up to 1024 characters long.
conversation_metadata (Optional[Dict[str, Any]]) – Metadata that will be associated with the conversation. Up to 2048 characters long.
queue (Optional[MessageQueueType]) – Select the priority type for the message. Can be ‘NORMAL_PRIORITY’ or ‘HIGH_PRIORITY’.
processing_strategy (Optional[ProcessingStrategyType]) – Overrides the app’s Processing Mode. Can be ‘DEFAULT’ or ‘DISPATCH_ONLY’.
correlation_id (Optional[str]) – An arbitrary identifier that will be propagated to callbacks related to this message. Up to 128 characters long.
conversation_metadata_update_strategy (Optional[MetadataUpdateStrategyType]) – Update strategy for the conversation_metadata field. Can be ‘REPLACE’ or ‘MERGE_PATCH’.
message_content_type (Optional[MessageContentType]) – Classifies the message content for use with consent management. Can be ‘CONTENT_UNKNOWN’, ‘CONTENT_MARKETING’, or ‘CONTENT_NOTIFICATION’.
**kwargs –
Additional parameters for the message body (e.g., agent, etc.).
- Returns:
SendMessageResponse
- Return type:
For detailed documentation, visit https://developers.sinch.com/docs/conversation/.