ConnectCampaignServiceV2 / Client / create_campaign

create_campaign#

ConnectCampaignServiceV2.Client.create_campaign(**kwargs)#

Creates a campaign for the specified Amazon Connect account. This API is idempotent.

See also: AWS API Documentation

Request Syntax

response = client.create_campaign(
    name='string',
    connectInstanceId='string',
    channelSubtypeConfig={
        'telephony': {
            'capacity': 123.0,
            'connectQueueId': 'string',
            'outboundMode': {
                'progressive': {
                    'bandwidthAllocation': 123.0
                },
                'predictive': {
                    'bandwidthAllocation': 123.0
                },
                'agentless': {}

            },
            'defaultOutboundConfig': {
                'connectContactFlowId': 'string',
                'connectSourcePhoneNumber': 'string',
                'answerMachineDetectionConfig': {
                    'enableAnswerMachineDetection': True|False,
                    'awaitAnswerMachinePrompt': True|False
                }
            }
        },
        'sms': {
            'capacity': 123.0,
            'outboundMode': {
                'agentless': {}

            },
            'defaultOutboundConfig': {
                'connectSourcePhoneNumberArn': 'string',
                'wisdomTemplateArn': 'string'
            }
        },
        'email': {
            'capacity': 123.0,
            'outboundMode': {
                'agentless': {}

            },
            'defaultOutboundConfig': {
                'connectSourceEmailAddress': 'string',
                'sourceEmailAddressDisplayName': 'string',
                'wisdomTemplateArn': 'string'
            }
        }
    },
    source={
        'customerProfilesSegmentArn': 'string'
    },
    connectCampaignFlowArn='string',
    schedule={
        'startTime': datetime(2015, 1, 1),
        'endTime': datetime(2015, 1, 1),
        'refreshFrequency': 'string'
    },
    communicationTimeConfig={
        'localTimeZoneConfig': {
            'defaultTimeZone': 'string',
            'localTimeZoneDetection': [
                'ZIP_CODE'|'AREA_CODE',
            ]
        },
        'telephony': {
            'openHours': {
                'dailyHours': {
                    'string': [
                        {
                            'startTime': 'string',
                            'endTime': 'string'
                        },
                    ]
                }
            },
            'restrictedPeriods': {
                'restrictedPeriodList': [
                    {
                        'name': 'string',
                        'startDate': 'string',
                        'endDate': 'string'
                    },
                ]
            }
        },
        'sms': {
            'openHours': {
                'dailyHours': {
                    'string': [
                        {
                            'startTime': 'string',
                            'endTime': 'string'
                        },
                    ]
                }
            },
            'restrictedPeriods': {
                'restrictedPeriodList': [
                    {
                        'name': 'string',
                        'startDate': 'string',
                        'endDate': 'string'
                    },
                ]
            }
        },
        'email': {
            'openHours': {
                'dailyHours': {
                    'string': [
                        {
                            'startTime': 'string',
                            'endTime': 'string'
                        },
                    ]
                }
            },
            'restrictedPeriods': {
                'restrictedPeriodList': [
                    {
                        'name': 'string',
                        'startDate': 'string',
                        'endDate': 'string'
                    },
                ]
            }
        }
    },
    communicationLimitsOverride={
        'allChannelSubtypes': {
            'communicationLimitsList': [
                {
                    'maxCountPerRecipient': 123,
                    'frequency': 123,
                    'unit': 'DAY'
                },
            ]
        }
    },
    tags={
        'string': 'string'
    }
)
Parameters:
  • name (string) –

    [REQUIRED]

    The name of an Amazon Connect Campaign name.

  • connectInstanceId (string) –

    [REQUIRED]

    Amazon Connect Instance Id

  • channelSubtypeConfig (dict) –

    [REQUIRED]

    Campaign Channel Subtype config

    • telephony (dict) –

      Telephony Channel Subtype config

      • capacity (float) –

        Allocates outbound capacity for the specific channel subtype of this campaign between multiple active campaigns

      • connectQueueId (string) –

        The queue for the call. If you specify a queue, the phone displayed for caller ID is the phone number specified in the queue. If you do not specify a queue, the queue defined in the contact flow is used. If you do not specify a queue, you must specify a source phone number.

      • outboundMode (dict) – [REQUIRED]

        Telephony Outbound Mode

        Note

        This is a Tagged Union structure. Only one of the following top level keys can be set: progressive, predictive, agentless.

        • progressive (dict) –

          Progressive config

          • bandwidthAllocation (float) – [REQUIRED]

            The bandwidth allocation of a queue resource.

        • predictive (dict) –

          Predictive config

          • bandwidthAllocation (float) – [REQUIRED]

            The bandwidth allocation of a queue resource.

        • agentless (dict) –

          Agentless config

      • defaultOutboundConfig (dict) – [REQUIRED]

        Default Telephony Outbound config

        • connectContactFlowId (string) – [REQUIRED]

          The identifier of the contact flow for the outbound call.

        • connectSourcePhoneNumber (string) –

          The phone number associated with the Amazon Connect instance, in E.164 format. If you do not specify a source phone number, you must specify a queue.

        • answerMachineDetectionConfig (dict) –

          Answering Machine Detection config

          • enableAnswerMachineDetection (boolean) – [REQUIRED]

            Enable or disable answering machine detection

          • awaitAnswerMachinePrompt (boolean) –

            Enable or disable await answer machine prompt

    • sms (dict) –

      SMS Channel Subtype config

      • capacity (float) –

        Allocates outbound capacity for the specific channel subtype of this campaign between multiple active campaigns

      • outboundMode (dict) – [REQUIRED]

        SMS Outbound Mode

        Note

        This is a Tagged Union structure. Only one of the following top level keys can be set: agentless.

        • agentless (dict) –

          Agentless config

      • defaultOutboundConfig (dict) – [REQUIRED]

        Default SMS Outbound config

        • connectSourcePhoneNumberArn (string) – [REQUIRED]

          Amazon Resource Names(ARN)

        • wisdomTemplateArn (string) – [REQUIRED]

          Amazon Resource Names(ARN)

    • email (dict) –

      Email Channel Subtype config

      • capacity (float) –

        Allocates outbound capacity for the specific channel subtype of this campaign between multiple active campaigns

      • outboundMode (dict) – [REQUIRED]

        Email Outbound Mode

        Note

        This is a Tagged Union structure. Only one of the following top level keys can be set: agentless.

        • agentless (dict) –

          Agentless config

      • defaultOutboundConfig (dict) – [REQUIRED]

        Default Email Outbound config

        • connectSourceEmailAddress (string) – [REQUIRED]

          Source/Destination Email address used for Email messages

        • sourceEmailAddressDisplayName (string) –

          Display name for Email Address

        • wisdomTemplateArn (string) – [REQUIRED]

          Amazon Resource Names(ARN)

  • source (dict) –

    Source of the campaign

    Note

    This is a Tagged Union structure. Only one of the following top level keys can be set: customerProfilesSegmentArn.

    • customerProfilesSegmentArn (string) –

      Amazon Resource Names(ARN)

  • connectCampaignFlowArn (string) – Amazon Resource Names(ARN)

  • schedule (dict) –

    Campaign schedule

    • startTime (datetime) – [REQUIRED]

      Timestamp with no UTC offset or timezone

    • endTime (datetime) – [REQUIRED]

      Timestamp with no UTC offset or timezone

    • refreshFrequency (string) –

      Time duration in ISO 8601 format

  • communicationTimeConfig (dict) –

    Campaign communication time config

    • localTimeZoneConfig (dict) – [REQUIRED]

      Local time zone config

      • defaultTimeZone (string) –

        Time Zone Id in the IANA format

      • localTimeZoneDetection (list) –

        Local TimeZone Detection method list

        • (string) –

          Local TimeZone Detection method.

    • telephony (dict) –

      Time window config

      • openHours (dict) – [REQUIRED]

        Open Hours config

        Note

        This is a Tagged Union structure. Only one of the following top level keys can be set: dailyHours.

        • dailyHours (dict) –

          Daily Hours map

          • (string) –

            Day of week enum

            • (list) –

              List of time range

              • (dict) –

                Time range in 24 hour format

                • startTime (string) – [REQUIRED]

                  Time in ISO 8601 format, e.g. T23:11

                • endTime (string) – [REQUIRED]

                  Time in ISO 8601 format, e.g. T23:11

      • restrictedPeriods (dict) –

        Restricted period config

        Note

        This is a Tagged Union structure. Only one of the following top level keys can be set: restrictedPeriodList.

        • restrictedPeriodList (list) –

          List of restricted period

          • (dict) –

            Restricted period

            • name (string) –

              The name of a restricted period.

            • startDate (string) – [REQUIRED]

              Date in ISO 8601 format, e.g. 2024-01-01

            • endDate (string) – [REQUIRED]

              Date in ISO 8601 format, e.g. 2024-01-01

    • sms (dict) –

      Time window config

      • openHours (dict) – [REQUIRED]

        Open Hours config

        Note

        This is a Tagged Union structure. Only one of the following top level keys can be set: dailyHours.

        • dailyHours (dict) –

          Daily Hours map

          • (string) –

            Day of week enum

            • (list) –

              List of time range

              • (dict) –

                Time range in 24 hour format

                • startTime (string) – [REQUIRED]

                  Time in ISO 8601 format, e.g. T23:11

                • endTime (string) – [REQUIRED]

                  Time in ISO 8601 format, e.g. T23:11

      • restrictedPeriods (dict) –

        Restricted period config

        Note

        This is a Tagged Union structure. Only one of the following top level keys can be set: restrictedPeriodList.

        • restrictedPeriodList (list) –

          List of restricted period

          • (dict) –

            Restricted period

            • name (string) –

              The name of a restricted period.

            • startDate (string) – [REQUIRED]

              Date in ISO 8601 format, e.g. 2024-01-01

            • endDate (string) – [REQUIRED]

              Date in ISO 8601 format, e.g. 2024-01-01

    • email (dict) –

      Time window config

      • openHours (dict) – [REQUIRED]

        Open Hours config

        Note

        This is a Tagged Union structure. Only one of the following top level keys can be set: dailyHours.

        • dailyHours (dict) –

          Daily Hours map

          • (string) –

            Day of week enum

            • (list) –

              List of time range

              • (dict) –

                Time range in 24 hour format

                • startTime (string) – [REQUIRED]

                  Time in ISO 8601 format, e.g. T23:11

                • endTime (string) – [REQUIRED]

                  Time in ISO 8601 format, e.g. T23:11

      • restrictedPeriods (dict) –

        Restricted period config

        Note

        This is a Tagged Union structure. Only one of the following top level keys can be set: restrictedPeriodList.

        • restrictedPeriodList (list) –

          List of restricted period

          • (dict) –

            Restricted period

            • name (string) –

              The name of a restricted period.

            • startDate (string) – [REQUIRED]

              Date in ISO 8601 format, e.g. 2024-01-01

            • endDate (string) – [REQUIRED]

              Date in ISO 8601 format, e.g. 2024-01-01

  • communicationLimitsOverride (dict) –

    Communication limits config

    • allChannelSubtypes (dict) –

      Communication limits

      Note

      This is a Tagged Union structure. Only one of the following top level keys can be set: communicationLimitsList.

      • communicationLimitsList (list) –

        List of communication limit

        • (dict) –

          Communication Limit

          • maxCountPerRecipient (integer) – [REQUIRED]

            Maximum number of contacts allowed for a given target within the given frequency.

          • frequency (integer) – [REQUIRED]

            The number of days to consider with regards to this limit.

          • unit (string) – [REQUIRED]

            The communication limit time unit.

  • tags (dict) –

    Tag map with key and value.

    • (string) –

      The key of tag.

      • (string) –

        The value of tag.

Return type:

dict

Returns:

Response Syntax

{
    'id': 'string',
    'arn': 'string',
    'tags': {
        'string': 'string'
    }
}

Response Structure

  • (dict) –

    The response for Create Campaign API

    • id (string) –

      Identifier representing a Campaign

    • arn (string) –

      The resource name of an Amazon Connect campaign.

    • tags (dict) –

      Tag map with key and value.

      • (string) –

        The key of tag.

        • (string) –

          The value of tag.

Exceptions

  • ConnectCampaignServiceV2.Client.exceptions.InternalServerException

  • ConnectCampaignServiceV2.Client.exceptions.ResourceNotFoundException

  • ConnectCampaignServiceV2.Client.exceptions.ValidationException

  • ConnectCampaignServiceV2.Client.exceptions.ConflictException

  • ConnectCampaignServiceV2.Client.exceptions.AccessDeniedException

  • ConnectCampaignServiceV2.Client.exceptions.ServiceQuotaExceededException

  • ConnectCampaignServiceV2.Client.exceptions.ThrottlingException