Call Types#

class pywa.types.calls.CallingSettings#

Represents the calling settings for a business phone number.

Variables:
  • status (pywa.types.calls.CallingSettingsStatus | None) – Enable or disable the Calling API for the given business phone number.

  • call_icon_visibility (pywa.types.calls.CallIconVisibility | None) – Configure whether the WhatsApp call button icon displays for users when chatting with the business. See Call Icon Visibility for more details.

  • call_icons (pywa.types.calls.CallIcons | None) – Configure the visibility of call icons based on user countries.

  • call_hours (pywa.types.calls.CallHours | None) – Allows you to specify and trigger call settings for incoming calls based on your timezone, business operating hours, and holiday schedules.

  • callback_permission_status (pywa.types.calls.CallbackPermissionStatus | None) – Configure whether a WhatsApp user is prompted with a call permission request after calling your business.

  • sip (pywa.types.calls.SIPSettings | None) – Configure call signaling via signal initiation protocol (SIP). Note: When SIP is enabled, you cannot use calling related endpoints and will not receive calling related webhooks.

class pywa.types.calls.CallingSettingsStatus#

Represents the status of calling settings.

class pywa.types.calls.CallIconVisibility#

Represents the visibility of the call icon.

class pywa.types.calls.CallbackPermissionStatus#

Represents the status of callback permission.

class pywa.types.calls.SIPServer#

Represents a SIP server configuration.

Variables:
  • hostname (str) – The host name of the SIP server. Requests must use TLS.

  • port (int | None) – The port within your SIP server that will accept requests. Requests must use TLS. Default port is 5061.

  • request_uri_user_params (dict[str, str] | None) – An optional field for passing any parameters you want included in the user portion of the request URI used in our SIP INVITE to your SIP server.

  • sip_user_password (str | None) – The password for the SIP user (only if include_sip_credentials is True).

  • app_id (int) – The app ID that configures the SIP server.

class pywa.types.calls.SIPStatus#

Represents the status of SIP (Session Initiation Protocol).

class pywa.types.calls.STRPKeyExchangeProtocol#

Represents the SRTP key exchange protocol.

Variables:
  • DTLS – Datagram Transport Layer Security (DTLS) is used for key exchange.

  • SDES – Session Description Protocol Security Descriptions (SDES) is used for key exchange.

class pywa.types.calls.CallHours#

Represents the call hours settings for a business.

  • Maximum of 2 entries allowed per day of week

  • open_time must be before close_time

  • Overlapping entries not allowed

Variables:
class pywa.types.calls.WeekDay#

Represents a day of the week with its opening and closing times.

  • You can use the subclasses for specific days (e.g., Monday, Tuesday, etc.) to create instances with predefined day names.

Variables:
  • day_of_week (str) – The day of the week (e.g., β€œMONDAY”, β€œTUESDAY”).

  • open_time (datetime.time) – The opening time in 24-hour format (e.g., β€œ0400” for 4:00 AM).

  • close_time (datetime.time) – The closing time in 24-hour format (e.g., β€œ2200” for 10:00 PM).

class pywa.types.calls.Monday#

Bases: WeekDay

Represents Monday with its opening and closing times.

class pywa.types.calls.Tuesday#

Bases: WeekDay

Represents Tuesday with its opening and closing times.

class pywa.types.calls.Wednesday#

Bases: WeekDay

Represents Wednesday with its opening and closing times.

class pywa.types.calls.Thursday#

Bases: WeekDay

Represents Thursday with its opening and closing times.

class pywa.types.calls.Friday#

Bases: WeekDay

Represents Friday with its opening and closing times.

class pywa.types.calls.Saturday#

Bases: WeekDay

Represents Saturday with its opening and closing times.

class pywa.types.calls.Sunday#

Bases: WeekDay

Represents Sunday with its opening and closing times.

class pywa.types.calls.HolidaySchedule#

Represents a holiday schedule with a date and opening/closing times.

Variables:
  • date (datetime.date) – The date of the holiday.

  • start_time (datetime.time) – The opening time in 24-hour format (e.g., β€œ0000” for midnight).

  • end_time (datetime.time) – The closing time in 24-hour format (e.g., β€œ2359” for 11:59 PM).

class pywa.types.calls.CallPermissions#

Represents the call permissions to specific WhatsApp user.

Variables:
class pywa.types.calls.CallPermission#

Represents a call permission with its status and expiration time.

Variables:
class pywa.types.calls.CallPermissionStatus#

Represents the status of a call permission.

Variables:
  • NO_PERMISSION – No permission granted.

  • TEMPORARY – Temporary permission granted.

class pywa.types.calls.CallPermissionAction#

Represents an action that can be performed with the call permission.

Variables:
  • action_name (str) – The name of the action (e.g., β€œsend_call_permission_request”).

  • can_perform_action (bool) – Whether the action can be performed.

  • limits (list[pywa.types.calls.CallPermissionActionLimit]) – A list of limits associated with the action.

class pywa.types.calls.CallPermissionActionLimit#

Represents a limit for a specific action that can be performed with the call permission.

Variables:
  • time_period (str) – The time period for which the limit applies, represented in ISO 8601 format (e.g., β€œPT24H” for 24 hours).

  • max_allowed (int) – The maximum number of actions allowed within the specified time period.

  • current_usage (int) – The current number of actions taken within the specified time period.

  • limit_expiration_time (datetime.datetime | None) – The Unix time at which the limit will expire in UTC timezone (optional).