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,
) → AppCustomResponse[source]
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,
) → AppResponse

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 exposes channel_credentials as a channel-keyed model. Set to True to get the raw AppResponse with channel_credentials as 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,
) → AppCustomResponse[source]
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,
) → AppResponse

Updates a particular app as specified by the App ID. Note that this is a PATCH operation, 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 its channel_credentials map, and send the updated map here).

Omitted parameters are left untouched on the server; passing None explicitly 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 exposes channel_credentials as a channel-keyed model. Set to True to get the raw AppResponse with channel_credentials as 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,
) → AppCustomResponse[source]
get(
app_id: str,
*,
raw_response: Literal[True],
**kwargs,
) → AppResponse

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 exposes channel_credentials as a channel-keyed model. Set to True to get the raw AppResponse with channel_credentials as 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,
) → Paginator[ListAppsCustomResponse, AppCustomResponse][source]
list(
*,
raw_response: Literal[True],
**kwargs,
) → Paginator[ListAppsResponse, AppResponse]

List all apps for the current project.

Parameters:

raw_response (bool) – When False (default) each app exposes channel_credentials as a channel-keyed model. Set to True to iterate raw AppResponse objects with channel_credentials as 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.Capability(sinch)[source]

Bases: BaseConversation

lookup(
app_id: str,
contact_id: str | None = None,
recipient_identities: List[ChannelRecipientIdentityDict] | None = None,
request_id: str | None | Unset = <sinch.core.sentinel.Unset object>,
**kwargs,
) → LookupCapabilityResponse[source]

Capability lookup. This method is asynchronous - it immediately returns the requested Capability registration. Capability check is then delivered as a callback to registered event destinations with trigger CAPABILITY for every reachable channel.

Parameters:
  • app_id (str) – (required) The ID of the app to use for capability lookup.

  • contact_id (Optional[str]) – The ID of the recipient contact. Either contact_id or recipient_identities must be provided.

  • recipient_identities (Optional[List[ChannelRecipientIdentityDict]]) – Channel identities of the recipient. Either contact_id or recipient_identities must be provided.

  • request_id (UnsetOr[Optional[str]]) – (optional) ID for the asynchronous response, will be generated if not set. Currently this field is not used for idempotency.

  • **kwargs –

    Additional parameters for the request.

Returns:

The registered capability lookup.

Return type:

LookupCapabilityResponse

For detailed documentation, visit https://developers.sinch.com/docs/conversation/.

class sinch.domains.conversation.api.v1.Consents(sinch)[source]

Bases: BaseConversation

list_identities(
app_id: str,
list_type: Literal['OPT_OUT_ALL', 'OPT_OUT_MARKETING', 'OPT_OUT_NOTIFICATION'] | Annotated[str, Strict(strict=True)],
page_size: int | None = None,
page_token: str | None = None,
**kwargs,
) → Paginator[ListConsentIdentitiesResponse, ConsentIdentityResponse][source]

Get all identities contained within a consent list for a given project id, app id, and list type.

Parameters:
  • app_id (str) – (required) The unique ID of the app.

  • list_type (ConsentsListType) – (required) The consent list type. One of OPT_OUT_ALL, OPT_OUT_MARKETING and OPT_OUT_NOTIFICATION.

  • page_size (Optional[int]) – (optional) The maximum number of records to fetch. The server default is 10 and the maximum is 50.

  • page_token (Optional[str]) – (optional) A page token, received from a previous call. Provide this to retrieve a subsequent page.

  • **kwargs –

    Additional parameters for the request.

Returns:

A paginator for iterating through the identities of the consent list.

Return type:

Paginator[ListConsentIdentitiesResponse, ConsentIdentityResponse]

For detailed documentation, visit https://developers.sinch.com/docs/conversation/.

list_audit_records(
app_id: str,
identity: str,
**kwargs,
) → AuditRecordsResponse[source]

Get all audit records associated with the given identity from the consent lists within the specified project and app.

Parameters:
  • app_id (str) – (required) The unique ID of the app.

  • identity (str) – (required) An identity to use on Consent audit records queries.

  • **kwargs –

    Additional parameters for the request.

Returns:

The identity and its audit records.

Return type:

AuditRecordsResponse

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,
) → Paginator[ListContactsResponse, ContactResponse][source]

List all contacts in the project. Note that, if a WhatsApp contact is returned, the display_name field of that contact may be populated with the WhatsApp display name (if the name is already stored on the server and the display_name field 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, channel and identity can’t be used.

  • channel (Optional[ConversationChannelType]) – (optional) Specifies a channel. If set, identity must be set and external_id can’t be used.

  • identity (Optional[str]) – (optional) If set, channel must be set and external_id can’t be used. Used in conjunction with channel to 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:

ContactResponse

For detailed documentation, visit https://developers.sinch.com/docs/conversation/.

get(
contact_id: str,
**kwargs,
) → ContactResponse[source]

Returns a specific contact as specified by the contact ID. Note the following:

  • If a WhatsApp contact is returned, the display_name field of that contact may be populated with the WhatsApp display name (if the name is already stored on the server and the display_name field 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_id and channel_identity values included in the callback to retrieve the username (detailed in the display_name field) 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:

ContactResponse

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,
) → ContactResponse[source]

Updates a contact as specified by the contact ID.

Omitted parameters are left untouched on the server; passing None explicitly 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:

ContactResponse

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,
) → ContactResponse[source]

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:

ContactResponse

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,
) → GetChannelProfileResponse[source]

Get user profile from a specific channel. Only supported on MESSENGER, INSTAGRAM, VIBER and LINE channels. Note that, in order to retrieve a WhatsApp display name, you can use the get or list contact operations instead, which will populate the display_name field of each returned contact with the WhatsApp display name (if the name is already stored on the server and the display_name field 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:

GetChannelProfileResponse

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,
) → GetChannelProfileResponse[source]

Get user profile from a specific channel. Only supported on MESSENGER, INSTAGRAM, VIBER and LINE channels. Note that, in order to retrieve a WhatsApp display name, you can use the get or list contact operations instead, which will populate the display_name field of each returned contact with the WhatsApp display name (if the name is already stored on the server and the display_name field 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:

GetChannelProfileResponse

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,
) → GetChannelProfileResponse[source]

Get user profile from a specific channel. Only supported on MESSENGER, INSTAGRAM, VIBER and LINE channels. Note that, in order to retrieve a WhatsApp display name, you can use the get or list contact operations instead, which will populate the display_name field of each returned contact with the WhatsApp display name (if the name is already stored on the server and the display_name field 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:

GetChannelProfileResponse

For detailed documentation, visit https://developers.sinch.com/docs/conversation/.

list_identity_conflicts(
page_size: int | None = None,
page_token: str | None = None,
**kwargs,
) → Paginator[ListIdentityConflictsResponse, ContactIdentityConflict][source]

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.Conversations(sinch)[source]

Bases: BaseConversation

list(
app_id: str | None = None,
contact_id: str | None = None,
only_active: bool | None = None,
page_size: int | None = None,
page_token: str | None = None,
active_channel: Literal['WHATSAPP', 'RCS', 'SMS', 'MESSENGER', 'VIBERBM', 'MMS', 'INSTAGRAM', 'TELEGRAM', 'KAKAOTALK', 'KAKAOTALKCHAT', 'LINE', 'WECHAT', 'APPLEBC'] | Annotated[str, Strict(strict=True)] | None = None,
**kwargs,
) → Paginator[ListConversationsResponse, ConversationResponse][source]

This operation lists all conversations that are associated with an app and/or a contact. Note that either app_id or contact_id is required in order for the operation to function correctly.

Parameters:
  • app_id (Optional[str]) – (optional) The ID of the app involved in the conversations.

  • contact_id (Optional[str]) – (optional) The ID of the contact involved in the conversations.

  • only_active (Optional[bool]) – (optional) Set to True to list only active conversations, False to list only inactive ones.

  • page_size (Optional[int]) – (optional) The maximum number of conversations to fetch. The server default is 10 and the maximum is 20.

  • page_token (Optional[str]) – (optional) Next page token previously returned if any.

  • active_channel (Optional[ConversationChannelType]) – (optional) Only fetch conversations from the active_channel.

  • **kwargs –

    Additional parameters for the request.

Returns:

A paginator for iterating through the conversations.

Return type:

Paginator[ListConversationsResponse, ConversationResponse]

For detailed documentation, visit https://developers.sinch.com/docs/conversation/.

create(
app_id: str,
contact_id: str,
active: bool | None | Unset = <sinch.core.sentinel.Unset object>,
active_channel: 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>,
metadata_json: Dict[str,
~typing.Any] | None | ~sinch.core.sentinel.Unset=<sinch.core.sentinel.Unset object>,
correlation_id: str | None | Unset = <sinch.core.sentinel.Unset object>,
**kwargs,
) → ConversationResponse[source]

Creates a new empty conversation. In Conversation mode, it is generally not needed to create a conversation explicitly since sending or receiving a message automatically creates a new conversation if it does not already exist between the given app and contact. Creating empty conversation is useful if the metadata of the conversation should be populated when the first message in the conversation is a contact message or the first message in the conversation comes out-of-band and needs to be injected with InjectMessage endpoint.

Parameters:
  • app_id (str) – (required) The ID of the participating app.

  • contact_id (str) – (required) The ID of the participating contact.

  • active (UnsetOr[Optional[bool]]) – (optional) Flag for whether this conversation is active.

  • active_channel (UnsetOr[Optional[ConversationChannelType]]) – (optional) The active channel of the conversation.

  • metadata_json (UnsetOr[Optional[Dict[str, Any]]]) – (optional) Arbitrary data set by the Conversation API clients. A valid JSON object.

  • correlation_id (UnsetOr[Optional[str]]) – (optional) Arbitrary correlation ID related to the MT message set by the Conversation API user.

  • **kwargs –

    Additional parameters for the request.

Returns:

The created conversation.

Return type:

ConversationResponse

For detailed documentation, visit https://developers.sinch.com/docs/conversation/.

get(
conversation_id: str,
**kwargs,
) → ConversationResponse[source]

Retrieves a conversation by id. A conversation has two participating entities, an app and a contact.

Parameters:
  • conversation_id (str) – (required) The unique ID of the conversation.

  • **kwargs –

    Additional parameters for the request.

Returns:

The conversation.

Return type:

ConversationResponse

For detailed documentation, visit https://developers.sinch.com/docs/conversation/.

delete(conversation_id: str, **kwargs) → None[source]

Deletes a conversation together with all the messages sent as part of the conversation.

Parameters:
  • conversation_id (str) – (required) The unique ID of the conversation.

  • **kwargs –

    Additional parameters for the request.

Returns:

None

Return type:

None

For detailed documentation, visit https://developers.sinch.com/docs/conversation/.

update(
conversation_id: str,
active: bool | None | Unset = <sinch.core.sentinel.Unset object>,
active_channel: 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>,
app_id: str | None | Unset = <sinch.core.sentinel.Unset object>,
contact_id: str | None | Unset = <sinch.core.sentinel.Unset object>,
metadata_json: Dict[str,
~typing.Any] | None | ~sinch.core.sentinel.Unset=<sinch.core.sentinel.Unset object>,
correlation_id: str | None | Unset = <sinch.core.sentinel.Unset object>,
metadata_update_strategy: Literal['REPLACE',
'MERGE_PATCH'] | ~typing.Annotated[str,
~pydantic.types.Strict(strict=True)] | None = None,
**kwargs,
) → ConversationResponse[source]

This operation updates a conversation which can, for instance, be used to update the metadata associated with a conversation.

Omitted parameters are left untouched on the server; passing None explicitly clears the field.

Parameters:
  • conversation_id (str) – (required) The unique ID of the conversation.

  • active (UnsetOr[Optional[bool]]) – (optional) Flag for whether this conversation is active.

  • active_channel (UnsetOr[Optional[ConversationChannelType]]) – (optional) The active channel of the conversation.

  • app_id (UnsetOr[Optional[str]]) – (optional) The ID of the participating app.

  • contact_id (UnsetOr[Optional[str]]) – (optional) The ID of the participating contact.

  • metadata_json (UnsetOr[Optional[Dict[str, Any]]]) – (optional) Arbitrary data set by the Conversation API clients. A valid JSON object.

  • correlation_id (UnsetOr[Optional[str]]) – (optional) Arbitrary correlation ID related to the MT message set by the Conversation API user.

  • metadata_update_strategy (Optional[MetadataUpdateStrategyType]) – (optional) Update strategy for the conversation_metadata field. The server default is REPLACE.

  • **kwargs –

    Additional parameters for the request.

Returns:

The updated conversation.

Return type:

ConversationResponse

For detailed documentation, visit https://developers.sinch.com/docs/conversation/.

list_recent(
app_id: str,
only_active: bool | None = None,
page_size: int | None = None,
page_token: str | None = None,
order: Literal['ASC', 'DESC'] | str | None = None,
**kwargs,
) → Paginator[ListRecentConversationsResponse, RecentConversationResponse][source]

This operation lists conversations and their most recent message, ordered by when the most recent message was sent for that conversation.

Parameters:
  • app_id (str) – (required) The application ID.

  • only_active (Optional[bool]) – (optional) True if only active conversations should be listed. The server default is False.

  • page_size (Optional[int]) – (optional) The maximum number of conversations to fetch. The server default is 10 and the maximum value is 50.

  • page_token (Optional[str]) – (optional) Next page token previously returned if any.

  • order (Optional[Union[Literal["ASC", "DESC"], str]]) – (optional) Whether to sort conversations by newest message first (DESC) or oldest (ASC). The server default is DESC.

  • **kwargs –

    Additional parameters for the request.

Returns:

A paginator for iterating through the recent conversations.

Return type:

Paginator[ListRecentConversationsResponse, RecentConversationResponse]

For detailed documentation, visit https://developers.sinch.com/docs/conversation/.

stop_active(conversation_id: str, **kwargs) → None[source]

This operation stops the referenced conversation, if the conversation is still active. In Conversation mode, a new conversation will be created if a new message is exchanged between the app or contact that was part of the stopped conversation.

Parameters:
  • conversation_id (str) – (required) The unique ID of the conversation.

  • **kwargs –

    Additional parameters for the request.

Returns:

None

Return type:

None

For detailed documentation, visit https://developers.sinch.com/docs/conversation/.

inject_message(conversation_id: str, contact_id: str, channel_identity: ~sinch.domains.conversation.models.v1.types.channel_identity_dict.ChannelIdentityDict, direction: ~typing.Literal['TO_APP', 'TO_CONTACT'] | ~typing.Annotated[str, ~pydantic.types.Strict(strict=True)], accept_time: ~datetime.datetime, app_message: ~sinch.domains.conversation.models.v1.messages.types.app_message_dict.AppMessageDict | ~sinch.core.sentinel.Unset = <sinch.core.sentinel.Unset object>, contact_message: ~sinch.domains.conversation.models.v1.messages.types.contact_message_dict.ContactMessageDict | ~sinch.core.sentinel.Unset = <sinch.core.sentinel.Unset object>, sender_id: str | None | ~sinch.core.sentinel.Unset = <sinch.core.sentinel.Unset object>, processing_mode: ~typing.Literal['CONVERSATION', 'DISPATCH'] | ~typing.Annotated[str, ~pydantic.types.Strict(strict=True)] | None | ~sinch.core.sentinel.Unset = <sinch.core.sentinel.Unset object>, metadata: str | None | ~sinch.core.sentinel.Unset = <sinch.core.sentinel.Unset object>, **kwargs) → None[source]

This operation injects a conversation message in to a specific conversation.

Set exactly one of app_message or contact_message; otherwise a ValueError is raised.

Parameters:
  • conversation_id (str) – (required) The ID of the conversation.

  • contact_id (str) – (required) The ID of the contact registered in the conversation provided.

  • channel_identity (ChannelIdentityDict) – (required) The channel identity of the contact.

  • direction (ConversationDirectionType) – (required) The direction of the message flow: TO_APP or TO_CONTACT.

  • accept_time (datetime) – (required) The processed time of the message in UTC timezone. Must be less than current_time and greater than (current_time - 30 days).

  • app_message (UnsetOr[AppMessageDict]) – (optional) A message originating from a Conversation API app.

  • contact_message (UnsetOr[ContactMessageDict]) – (optional) A message originating from a contact.

  • sender_id (UnsetOr[Optional[str]]) – (optional) For Contact Messages (MO messages), the sender ID represents the recipient to which the message was sent.

  • processing_mode (UnsetOr[Optional[ProcessingModeType]]) – (optional) Whether or not Conversation API should store contacts and conversations for the app.

  • metadata (UnsetOr[Optional[str]]) – (optional) Metadata associated with the contact. Up to 1024 characters long.

  • **kwargs –

    Additional parameters for the request.

Returns:

None

Return type:

None

For detailed documentation, visit https://developers.sinch.com/docs/conversation/.

inject_event(
conversation_id: str,
app_event: AppEventDict,
accept_time: datetime,
contact_id: str | None | Unset = <sinch.core.sentinel.Unset object>,
channel_identity: ChannelIdentityDict | None | Unset = <sinch.core.sentinel.Unset object>,
processing_mode: Literal['CONVERSATION',
'DISPATCH'] | ~typing.Annotated[str,
~pydantic.types.Strict(strict=True)] | None | ~sinch.core.sentinel.Unset = <sinch.core.sentinel.Unset object>,
**kwargs,
) → InjectEventResponse[source]

This operation injects a conversation event in to a specific conversation. It only supports injecting App events in CONVERSATION mode.

Parameters:
  • conversation_id (str) – (required) The unique ID of the conversation.

  • app_event (AppEventDict) – (required) The event originating from an app. Set exactly one event type key.

  • accept_time (datetime) – (required) The processed time of the event in UTC timezone. Must be less than current_time and greater than (current_time - 30 days).

  • contact_id (UnsetOr[Optional[str]]) – (optional) The ID of the contact.

  • channel_identity (UnsetOr[Optional[ChannelIdentityDict]]) – (optional) The channel identity of the contact.

  • processing_mode (UnsetOr[Optional[ProcessingModeType]]) – (optional) Whether or not Conversation API should store contacts and conversations for the app.

  • **kwargs –

    Additional parameters for the request.

Returns:

The ID and accepted time of the injected event.

Return type:

InjectEventResponse

For detailed documentation, visit https://developers.sinch.com/docs/conversation/.

class sinch.domains.conversation.api.v1.EventDestinations(sinch)[source]

Bases: BaseConversation

create(
app_id: str,
target: str,
client_credentials: ClientCredentialsDict | None | Unset = <sinch.core.sentinel.Unset object>,
secret: str | None | Unset = <sinch.core.sentinel.Unset object>,
target_type: Literal['DISMISS',
'HTTP'] | ~typing.Annotated[str,
~pydantic.types.Strict(strict=True)] | None | ~sinch.core.sentinel.Unset = <sinch.core.sentinel.Unset object>,
triggers: Literal['UNSPECIFIED_TRIGGER',
'MESSAGE_DELIVERY',
'EVENT_DELIVERY',
'MESSAGE_INBOUND',
'EVENT_INBOUND',
'CONVERSATION_START',
'CONVERSATION_STOP',
'CONTACT_CREATE',
'CONTACT_DELETE',
'CONTACT_MERGE',
'CONTACT_UPDATE',
'UNSUPPORTED',
'OPT_IN',
'OPT_OUT',
'CAPABILITY',
'CONVERSATION_DELETE',
'CONTACT_IDENTITIES_DUPLICATION',
'CHANNEL_EVENT',
'SMART_CONVERSATION',
'MESSAGE_INBOUND_SMART_CONVERSATION_REDACTION',
'RECORD_NOTIFICATION',
'MESSAGE_SUBMIT'] | ~typing.Annotated[str,
~pydantic.types.Strict(strict=True)]] | None | ~sinch.core.sentinel.Unset = <sinch.core.sentinel.Unset object>,
**kwargs,
) → EventDestinationResponse[source]

Creates an event destination for receiving events on specific triggers. You can create up to 5 event destinations per app.

Parameters:
  • app_id (str) – The app that this event destination belongs to.

  • target (str) – The target url where events should be sent to. Maximum URL length is 742. The conversation-api.*.sinch.com subdomains are forbidden.

  • client_credentials (UnsetOr[Optional[ClientCredentialsDict]]) – Optional. Used for OAuth2 authentication.

  • secret (UnsetOr[Optional[str]]) – Optional secret used to sign the contents of the events.

  • target_type (UnsetOr[Optional[EventDestinationTargetType]]) – The type of the target.

  • triggers (UnsetOr[Optional[List[EventDestinationTriggerType]]]) – The triggers that result in an event being sent to the target.

  • **kwargs –

    Additional parameters for the request.

Returns:

The created event destination.

Return type:

EventDestinationResponse

For detailed documentation, visit https://developers.sinch.com/docs/conversation/.

list(
app_id: str,
**kwargs,
) → Paginator[ListEventDestinationsResponse, EventDestinationResponse][source]

List all event destinations for a given app as specified by the App ID.

Parameters:
  • app_id (str) – The ID of the app.

  • **kwargs –

    Additional parameters for the request.

Returns:

A paginator for iterating through the event destinations.

Return type:

Paginator[ListEventDestinationsResponse, EventDestinationResponse]

For detailed documentation, visit https://developers.sinch.com/docs/conversation/.

get(
event_destination_id: str,
**kwargs,
) → EventDestinationResponse[source]

Get an event destination as specified by the event destination ID.

Parameters:
  • event_destination_id (str) – The ID of the event destination to retrieve.

  • **kwargs –

    Additional parameters for the request.

Returns:

The event destination details.

Return type:

EventDestinationResponse

For detailed documentation, visit https://developers.sinch.com/docs/conversation/.

update(
event_destination_id: str,
app_id: str | Unset = <sinch.core.sentinel.Unset object>,
target: str | Unset = <sinch.core.sentinel.Unset object>,
client_credentials: ClientCredentialsDict | None | Unset = <sinch.core.sentinel.Unset object>,
secret: str | None | Unset = <sinch.core.sentinel.Unset object>,
target_type: Literal['DISMISS',
'HTTP'] | ~typing.Annotated[str,
~pydantic.types.Strict(strict=True)] | None | ~sinch.core.sentinel.Unset = <sinch.core.sentinel.Unset object>,
triggers: Literal['UNSPECIFIED_TRIGGER',
'MESSAGE_DELIVERY',
'EVENT_DELIVERY',
'MESSAGE_INBOUND',
'EVENT_INBOUND',
'CONVERSATION_START',
'CONVERSATION_STOP',
'CONTACT_CREATE',
'CONTACT_DELETE',
'CONTACT_MERGE',
'CONTACT_UPDATE',
'UNSUPPORTED',
'OPT_IN',
'OPT_OUT',
'CAPABILITY',
'CONVERSATION_DELETE',
'CONTACT_IDENTITIES_DUPLICATION',
'CHANNEL_EVENT',
'SMART_CONVERSATION',
'MESSAGE_INBOUND_SMART_CONVERSATION_REDACTION',
'RECORD_NOTIFICATION',
'MESSAGE_SUBMIT'] | ~typing.Annotated[str,
~pydantic.types.Strict(strict=True)]] | None | ~sinch.core.sentinel.Unset = <sinch.core.sentinel.Unset object>,
**kwargs,
) → EventDestinationResponse[source]

Updates an existing event destination as specified by the event destination ID.

Omitted parameters are left untouched on the server; passing None explicitly clears the field.

Parameters:
  • event_destination_id (str) – The ID of the event destination to update.

  • app_id (UnsetOr[Optional[str]]) – The app that this event destination belongs to.

  • target (UnsetOr[Optional[str]]) – The target url where events should be sent to.

  • client_credentials (UnsetOr[Optional[ClientCredentialsDict]]) – Optional. Used for OAuth2 authentication.

  • secret (UnsetOr[Optional[str]]) – Optional secret used to sign the contents of the events.

  • target_type (UnsetOr[Optional[EventDestinationTargetType]]) – The type of the target.

  • triggers (UnsetOr[Optional[List[EventDestinationTriggerType]]]) – The triggers that result in an event being sent to the target.

  • **kwargs –

    Additional parameters for the request.

Returns:

The updated event destination.

Return type:

EventDestinationResponse

For detailed documentation, visit https://developers.sinch.com/docs/conversation/.

delete(event_destination_id: str, **kwargs) → None[source]

Deletes an event destination as specified by the event destination ID.

Parameters:
  • event_destination_id (str) – The ID of the event destination to delete.

  • **kwargs –

    Additional parameters for the request.

Returns:

None

Return type:

None

For detailed documentation, visit https://developers.sinch.com/docs/conversation/.

class sinch.domains.conversation.api.v1.Events(sinch)[source]

Bases: BaseConversation

send(
app_id: str,
event: AppEventDict,
contact_id: str | None = None,
recipient_identities: List[ChannelRecipientIdentityDict] | None = None,
event_destination_target: str | None | Unset = <sinch.core.sentinel.Unset object>,
channel_priority_order: 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>,
event_metadata: str | None | Unset = <sinch.core.sentinel.Unset object>,
queue: Literal['NORMAL_PRIORITY',
'HIGH_PRIORITY'] | ~typing.Annotated[str,
~pydantic.types.Strict(strict=True)] | None | ~sinch.core.sentinel.Unset = <sinch.core.sentinel.Unset object>,
**kwargs,
) → SendEventResponse[source]

Sends an event to the referenced contact from the referenced app. Note that this operation enqueues the event in a queue so a successful response only indicates that the event has been queued.

Parameters:
  • app_id (str) – The ID of the app sending the event.

  • event (AppEventDict) – The event to be sent. Set exactly one event type key.

  • contact_id (Optional[str]) – The ID of the recipient contact. Either contact_id or recipient_identities must be provided.

  • recipient_identities (Optional[List[ChannelRecipientIdentityDict]]) – Channel identities of the recipient. Either contact_id or recipient_identities must be provided.

  • event_destination_target (UnsetOr[Optional[str]]) – Overwrites the default event destination target for delivery receipts for this event.

  • channel_priority_order (UnsetOr[Optional[List[ConversationChannelType]]]) – Optional. A single element array that dictates on what channel should the Conversation API try to send the event.

  • event_metadata (UnsetOr[Optional[str]]) – Optional. Metadata that should be associated to the event.

  • queue (UnsetOr[Optional[MessageQueueType]]) – Select the priority type for the event.

  • **kwargs –

    Additional parameters for the request.

Returns:

The accepted event.

Return type:

SendEventResponse

For detailed documentation, visit https://developers.sinch.com/docs/conversation/.

get(
event_id: str,
**kwargs,
) → ConversationEventResponse[source]

Get event from ID.

Parameters:
  • event_id (str) – The unique ID of the event.

  • **kwargs –

    Additional parameters for the request.

Returns:

The event.

Return type:

ConversationEventResponse

For detailed documentation, visit https://developers.sinch.com/docs/conversation/.

delete(event_id: str, **kwargs) → None[source]

Delete a specific event by its ID.

Parameters:
  • event_id (str) – The unique ID of the event.

  • **kwargs –

    Additional parameters for the request.

Returns:

None

Return type:

None

For detailed documentation, visit https://developers.sinch.com/docs/conversation/.

list(
conversation_id: str | None = None,
contact_id: str | None = None,
page_size: int | None = None,
page_token: str | None = None,
**kwargs,
) → Paginator[ListEventsResponse, ConversationEventResponse][source]

List all events in a project.

Parameters:
  • conversation_id (Optional[str]) – Resource name (id) of the conversation. One of conversation_id or contact_id needs to be present.

  • contact_id (Optional[str]) – Resource name (id) of the contact. One of conversation_id or contact_id needs to be present.

  • page_size (Optional[int]) – Maximum number of events to fetch. Defaults to 10 and the maximum is 20.

  • page_token (Optional[str]) – Next page token previously returned if any.

  • **kwargs –

    Additional parameters for the request.

Returns:

A paginator for iterating through the events.

Return type:

Paginator[ListEventsResponse, ConversationEventResponse]

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,
) → None[source]
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,
) → ResolveUnion object at 0x7ff1ca2c6e10>][source]

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,
) → ResolveUnion object at 0x7ff1ca2c6e10>]][source]

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,
) → ResolveUnion object at 0x7ff1ca2c6e10>]][source]

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, Annotated[AppMessageResponse | ContactMessageResponse, <sinch.core.models.internal.unions.ResolveUnion object at 0x7ff1ca2c6e10>]]

# 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,
) → ResolveUnion object at 0x7ff1ca2c6e10>][source]

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,
) → SendMessageResponse[source]

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:

SendMessageResponse

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,
) → SendMessageResponse[source]

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:

SendMessageResponse

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,
) → SendMessageResponse[source]

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:

SendMessageResponse

For detailed documentation, visit https://developers.sinch.com/docs/conversation/.

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:

SendMessageResponse

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,
) → SendMessageResponse[source]

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:

SendMessageResponse

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,
) → SendMessageResponse[source]

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:

SendMessageResponse

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,
) → SendMessageResponse[source]

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:

SendMessageResponse

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,
) → SendMessageResponse[source]

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:

SendMessageResponse

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,
) → SendMessageResponse[source]

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:

SendMessageResponse

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,
) → SendMessageResponse[source]

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:

SendMessageResponse

For detailed documentation, visit https://developers.sinch.com/docs/conversation/.

class sinch.domains.conversation.api.v1.ProjectSettings(sinch)[source]

Bases: BaseConversation

create(
contact_settings: ContactSettingsDict | Unset = <sinch.core.sentinel.Unset object>,
**kwargs,
) → ProjectSettingsResponse[source]

Creates initial settings for the project. Useful for enabling features like Unified Contact ID. For new projects with no existing contacts, you can enable Unified Contact ID immediately.

Parameters:
  • contact_settings (UnsetOr[ContactSettingsDict]) – (optional) Settings related to contact management for the project.

  • **kwargs –

    Additional parameters for the request.

Returns:

The created project settings.

Return type:

ProjectSettingsResponse

For detailed documentation, visit https://developers.sinch.com/docs/conversation/.

get(
**kwargs,
) → ProjectSettingsResponse[source]

Retrieves the current settings for the project, including contact management options such as Unified Contact ID.

Parameters:

**kwargs –

Additional parameters for the request.

Returns:

The current project settings.

Return type:

ProjectSettingsResponse

For detailed documentation, visit https://developers.sinch.com/docs/conversation/.

update(
contact_settings: ContactSettingsDict | Unset = <sinch.core.sentinel.Unset object>,
**kwargs,
) → ProjectSettingsResponse[source]

Updates project settings (e.g. enabling/disabling Unified Contact ID). For existing projects, you must resolve all identity conflicts before enabling Unified Contact ID.

Parameters:
  • contact_settings (UnsetOr[ContactSettingsDict]) – (optional) Settings related to contact management for the project.

  • **kwargs –

    Additional parameters for the request.

Returns:

The updated project settings.

Return type:

ProjectSettingsResponse

For detailed documentation, visit https://developers.sinch.com/docs/conversation/.

delete(**kwargs) → None[source]

Deletes all project-level settings for the project.

Parameters:

**kwargs –

Additional parameters for the request.

Returns:

None

Return type:

None

For detailed documentation, visit https://developers.sinch.com/docs/conversation/.

class sinch.domains.conversation.api.v1.Transcoding(sinch)[source]

Bases: BaseConversation

transcode_message(app_id: str, app_message: ~sinch.domains.conversation.models.v1.messages.types.app_message_dict.AppMessageDict, channels: ~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)]], from_: str | None | ~sinch.core.sentinel.Unset = <sinch.core.sentinel.Unset object>, to: str | None | ~sinch.core.sentinel.Unset = <sinch.core.sentinel.Unset object>, **kwargs) → TranscodeMessageResponse[source]

Transcodes the message from the Conversation API format to the channel-specific formats for the requested channels. No message is sent to the contact.

Parameters:
  • app_id (str) – (required) The ID of the app used to transcode the message.

  • app_message (AppMessageDict) – (required) The message to be transcoded.

  • channels (List[ConversationChannelType]) – (required) The list of channels for which the message shall be transcoded.

  • from (UnsetOr[Optional[str]]) – (optional) The sender of the message. Serialized as from.

  • to (UnsetOr[Optional[str]]) – (optional) The recipient of the message.

  • **kwargs –

    Additional parameters for the request.

  • from_ (str | None | Unset)

Returns:

The message transcoded for each requested channel, keyed by channel name.

Return type:

TranscodeMessageResponse

For detailed documentation, visit https://developers.sinch.com/docs/conversation/.