AWS End User Messaging Social

2026/09/17 - AWS End User Messaging Social - 3 new1 updated api methods

Changes  Add support for WhatsApp Calling APIs.

SendWhatsAppCallEvent (new) Link ¶

Sends a WhatsApp calling event, such as connecting or terminating a call, for a business phone number. This operation passes the event through to Meta. To use this operation, the origination phone number must belong to a WhatsApp Business Account that is linked to your Amazon Web Services account.

See also: AWS API Documentation

Request Syntax

client.send_whats_app_call_event(
    originationPhoneNumberId='string',
    metaApiVersion='string',
    callEvent=b'bytes'
)
type originationPhoneNumberId:

string

param originationPhoneNumberId:

[REQUIRED]

The unique identifier of the origination phone number for the call. The phone number identifiers are formatted as phone-number-id-01234567890123456789012345678901. Use GetLinkedWhatsAppBusinessAccount to find a phone number's ID.

type metaApiVersion:

string

param metaApiVersion:

[REQUIRED]

The version of the Meta Graph API to use for the request.

type callEvent:

bytes

param callEvent:

[REQUIRED]

The call event payload to send, as a JSON blob in the format defined by the Meta calling API.

rtype:

dict

returns:

Response Syntax

{
    'callId': 'string'
}

Response Structure

  • (dict) --

    • callId (string) --

      The unique identifier that Meta assigns to the call.

GetWhatsAppCallPermission (new) Link ¶

Retrieves the current calling permission for a WhatsApp end user, along with the calling actions the business is allowed to take with that user. Provide the destination phone number or the business-scoped user ID to identify the end user.

See also: AWS API Documentation

Request Syntax

client.get_whats_app_call_permission(
    originationPhoneNumberId='string',
    destinationPhoneNumber='string',
    endUserBsuid='string'
)
type originationPhoneNumberId:

string

param originationPhoneNumberId:

[REQUIRED]

The unique identifier of the business phone number for which to retrieve the calling permission. The phone number identifiers are formatted as phone-number-id-01234567890123456789012345678901.

type destinationPhoneNumber:

string

param destinationPhoneNumber:

The end user's phone number, in E.164 format, for which to retrieve the calling permission.

type endUserBsuid:

string

param endUserBsuid:

The business-scoped user identifier (BSUID) of the end user for which to retrieve the calling permission.

rtype:

dict

returns:

Response Syntax

{
    'permission': {
        'status': 'string',
        'expirationTime': datetime(2015, 1, 1)
    },
    'actions': [
        {
            'actionName': 'string',
            'canPerformAction': True|False,
            'limits': [
                {
                    'timePeriod': 'string',
                    'maxAllowed': 123,
                    'currentUsage': 123,
                    'limitExpirationTime': datetime(2015, 1, 1)
                },
            ]
        },
    ]
}

Response Structure

  • (dict) --

    • permission (dict) --

      The current calling permission state for the end user.

      • status (string) --

        The permission status for the end user.

      • expirationTime (datetime) --

        The time when a temporary permission expires. This value is absent for permanent permissions and when there is no permission.

    • actions (list) --

      The calling actions the business can take with the end user, and any limits that apply to each action.

      • (dict) --

        Describes a single calling action the business can take with an end user, including whether the action is currently allowed and any limits that apply to it. Returned as an item in the actions list from GetWhatsAppCallPermission.

        • actionName (string) --

          The name of the calling action.

        • canPerformAction (boolean) --

          Specifies whether the business can currently perform the action.

        • limits (list) --

          The time-bound limits that apply to the action.

          • (dict) --

            A time-bound restriction on a calling action, such as the number of calls allowed within a time period.

            • timePeriod (string) --

              The time period over which the limit applies, as an ISO 8601 duration.

            • maxAllowed (integer) --

              The maximum number of times the action is allowed within the time period.

            • currentUsage (integer) --

              The number of times the action has been used within the current time period.

            • limitExpirationTime (datetime) --

              The time when the limit resets. This value is present only when the current usage has reached the maximum allowed.

UpdateLinkedWhatsAppBusinessAccountPhoneNumber (new) Link ¶

Updates the calling settings for a linked WhatsApp business phone number, such as whether calling is enabled and the hours during which the business accepts calls.

See also: AWS API Documentation

Request Syntax

client.update_linked_whats_app_business_account_phone_number(
    id='string',
    callSettings={
        'callEnabled': True|False,
        'callHours': {
            'enabled': True|False,
            'timezone': 'string',
            'weeklyOperatingHours': [
                {
                    'dayOfWeek': 'MONDAY'|'TUESDAY'|'WEDNESDAY'|'THURSDAY'|'FRIDAY'|'SATURDAY'|'SUNDAY',
                    'openTime': {
                        'hours': 123,
                        'minutes': 123
                    },
                    'closeTime': {
                        'hours': 123,
                        'minutes': 123
                    }
                },
            ],
            'holidaySchedule': [
                {
                    'date': 'string',
                    'startTime': {
                        'hours': 123,
                        'minutes': 123
                    },
                    'endTime': {
                        'hours': 123,
                        'minutes': 123
                    }
                },
            ]
        },
        'callIconVisibility': 'string',
        'callbackPermissionStatus': 'string'
    }
)
type id:

string

param id:

[REQUIRED]

The unique identifier of the phone number to update. The phone number identifiers are formatted as phone-number-id-01234567890123456789012345678901.

type callSettings:

dict

param callSettings:

[REQUIRED]

The calling settings to apply to the phone number.

  • callEnabled (boolean) -- [REQUIRED]

    Specifies whether calling is enabled for the phone number.

  • callHours (dict) --

    The hours during which the business accepts calls on the phone number.

    • enabled (boolean) -- [REQUIRED]

      Specifies whether call hours are enforced. When disabled, the business accepts calls at any time.

    • timezone (string) -- [REQUIRED]

      The IANA time zone in which the operating hours are interpreted, such as America/New_York.

    • weeklyOperatingHours (list) -- [REQUIRED]

      The weekly schedule of hours during which the business accepts calls.

      • (dict) --

        A single entry in a weekly calling schedule, defining the open and close times for one day of the week.

        • dayOfWeek (string) -- [REQUIRED]

          The day of the week that the entry applies to.

        • openTime (dict) -- [REQUIRED]

          The time of day when the business begins accepting calls.

          • hours (integer) -- [REQUIRED]

            The hour of the day, from 0 to 23.

          • minutes (integer) -- [REQUIRED]

            The minute of the hour, from 0 to 59.

        • closeTime (dict) -- [REQUIRED]

          The time of day when the business stops accepting calls.

          • hours (integer) -- [REQUIRED]

            The hour of the day, from 0 to 23.

          • minutes (integer) -- [REQUIRED]

            The minute of the hour, from 0 to 59.

    • holidaySchedule (list) --

      Date-specific overrides to the weekly operating hours, such as holidays.

      • (dict) --

        A date-specific override to the weekly operating hours, such as a holiday.

        • date (string) -- [REQUIRED]

          The date that the override applies to, in ISO 8601 format ( YYYY-MM-DD).

        • startTime (dict) -- [REQUIRED]

          The time of day when the business begins accepting calls on the override date.

          • hours (integer) -- [REQUIRED]

            The hour of the day, from 0 to 23.

          • minutes (integer) -- [REQUIRED]

            The minute of the hour, from 0 to 59.

        • endTime (dict) -- [REQUIRED]

          The time of day when the business stops accepting calls on the override date.

          • hours (integer) -- [REQUIRED]

            The hour of the day, from 0 to 23.

          • minutes (integer) -- [REQUIRED]

            The minute of the hour, from 0 to 59.

  • callIconVisibility (string) --

    The visibility setting for the call icon shown to end users in WhatsApp.

  • callbackPermissionStatus (string) --

    The callback permission status for the phone number.

rtype:

dict

returns:

Response Syntax

{
    'phoneNumberId': 'string'
}

Response Structure

  • (dict) --

    • phoneNumberId (string) --

      The unique identifier of the phone number that was updated.

GetLinkedWhatsAppBusinessAccountPhoneNumber (updated) Link ¶
Changes (response)
{'callSettings': {'callEnabled': 'boolean',
                  'callHours': {'enabled': 'boolean',
                                'holidaySchedule': [{'date': 'string',
                                                     'endTime': {'hours': 'integer',
                                                                 'minutes': 'integer'},
                                                     'startTime': {'hours': 'integer',
                                                                   'minutes': 'integer'}}],
                                'timezone': 'string',
                                'weeklyOperatingHours': [{'closeTime': {'hours': 'integer',
                                                                        'minutes': 'integer'},
                                                          'dayOfWeek': 'MONDAY '
                                                                       '| '
                                                                       'TUESDAY '
                                                                       '| '
                                                                       'WEDNESDAY '
                                                                       '| '
                                                                       'THURSDAY '
                                                                       '| '
                                                                       'FRIDAY '
                                                                       '| '
                                                                       'SATURDAY '
                                                                       '| '
                                                                       'SUNDAY',
                                                          'openTime': {'hours': 'integer',
                                                                       'minutes': 'integer'}}]},
                  'callIconVisibility': 'string',
                  'callbackPermissionStatus': 'string'}}

Retrieve the WABA account id and phone number details of a WhatsApp business account phone number.

See also: AWS API Documentation

Request Syntax

client.get_linked_whatsapp_business_account_phone_number(
    id='string'
)
type id:

string

param id:

[REQUIRED]

The unique identifier of the phone number. Phone number identifiers are formatted as phone-number-id-01234567890123456789012345678901. Use GetLinkedWhatsAppBusinessAccount to find a phone number's id.

rtype:

dict

returns:

Response Syntax

{
    'phoneNumber': {
        'arn': 'string',
        'phoneNumber': 'string',
        'phoneNumberId': 'string',
        'metaPhoneNumberId': 'string',
        'displayPhoneNumberName': 'string',
        'displayPhoneNumber': 'string',
        'qualityRating': 'string',
        'dataLocalizationRegion': 'string'
    },
    'linkedWhatsAppBusinessAccountId': 'string',
    'callSettings': {
        'callEnabled': True|False,
        'callHours': {
            'enabled': True|False,
            'timezone': 'string',
            'weeklyOperatingHours': [
                {
                    'dayOfWeek': 'MONDAY'|'TUESDAY'|'WEDNESDAY'|'THURSDAY'|'FRIDAY'|'SATURDAY'|'SUNDAY',
                    'openTime': {
                        'hours': 123,
                        'minutes': 123
                    },
                    'closeTime': {
                        'hours': 123,
                        'minutes': 123
                    }
                },
            ],
            'holidaySchedule': [
                {
                    'date': 'string',
                    'startTime': {
                        'hours': 123,
                        'minutes': 123
                    },
                    'endTime': {
                        'hours': 123,
                        'minutes': 123
                    }
                },
            ]
        },
        'callIconVisibility': 'string',
        'callbackPermissionStatus': 'string'
    }
}

Response Structure

  • (dict) --

    • phoneNumber (dict) --

      The details of your WhatsApp phone number.

      • arn (string) --

        The ARN of the WhatsApp phone number.

      • phoneNumber (string) --

        The phone number for sending WhatsApp.

      • phoneNumberId (string) --

        The phone number ID. Phone number identifiers are formatted as phone-number-id-01234567890123456789012345678901.

      • metaPhoneNumberId (string) --

        The phone number ID from Meta.

      • displayPhoneNumberName (string) --

        The display name for this phone number.

      • displayPhoneNumber (string) --

        The phone number that appears in the recipients display.

      • qualityRating (string) --

        The quality rating of the phone number.

      • dataLocalizationRegion (string) --

        The geographic region where the WhatsApp phone number's data is stored and processed.

    • linkedWhatsAppBusinessAccountId (string) --

      The WABA identifier linked to the phone number, formatted as waba-01234567890123456789012345678901.

    • callSettings (dict) --

      The calling settings configured for the phone number. This value is absent when calling is not configured.

      • callEnabled (boolean) --

        Specifies whether calling is enabled for the phone number.

      • callHours (dict) --

        The hours during which the business accepts calls on the phone number.

        • enabled (boolean) --

          Specifies whether call hours are enforced. When disabled, the business accepts calls at any time.

        • timezone (string) --

          The IANA time zone in which the operating hours are interpreted, such as America/New_York.

        • weeklyOperatingHours (list) --

          The weekly schedule of hours during which the business accepts calls.

          • (dict) --

            A single entry in a weekly calling schedule, defining the open and close times for one day of the week.

            • dayOfWeek (string) --

              The day of the week that the entry applies to.

            • openTime (dict) --

              The time of day when the business begins accepting calls.

              • hours (integer) --

                The hour of the day, from 0 to 23.

              • minutes (integer) --

                The minute of the hour, from 0 to 59.

            • closeTime (dict) --

              The time of day when the business stops accepting calls.

              • hours (integer) --

                The hour of the day, from 0 to 23.

              • minutes (integer) --

                The minute of the hour, from 0 to 59.

        • holidaySchedule (list) --

          Date-specific overrides to the weekly operating hours, such as holidays.

          • (dict) --

            A date-specific override to the weekly operating hours, such as a holiday.

            • date (string) --

              The date that the override applies to, in ISO 8601 format ( YYYY-MM-DD).

            • startTime (dict) --

              The time of day when the business begins accepting calls on the override date.

              • hours (integer) --

                The hour of the day, from 0 to 23.

              • minutes (integer) --

                The minute of the hour, from 0 to 59.

            • endTime (dict) --

              The time of day when the business stops accepting calls on the override date.

              • hours (integer) --

                The hour of the day, from 0 to 23.

              • minutes (integer) --

                The minute of the hour, from 0 to 59.

      • callIconVisibility (string) --

        The visibility setting for the call icon shown to end users in WhatsApp.

      • callbackPermissionStatus (string) --

        The callback permission status for the phone number.