Skip to main content

campaigns

Creates, updates, deletes, gets or lists a campaigns resource.

Overview

Namecampaigns
TypeResource
Idaws.pinpoint.campaigns

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
additional_treatmentsarrayAn array of responses, one for each treatment that you defined for the campaign, in addition to the default treatment.
application_idstringThe unique identifier for the application that the campaign applies to.
arnstringThe Amazon Resource Name (ARN) of the campaign.
creation_datestringThe date, in ISO 8601 format, when the campaign was created.
custom_delivery_configurationobjectThe delivery configuration settings for sending the campaign through a custom channel.
default_stateobjectThe current status of the campaign's default treatment. This value exists only for campaigns that have more than one treatment.
descriptionstringThe custom description of the campaign.
holdout_percentintegerThe allocated percentage of users (segment members) who shouldn't receive messages from the campaign.
hookobjectThe settings for the AWS Lambda function to use as a code hook for the campaign. You can use this hook to customize the segment that's used by the campaign.
idstringThe unique identifier for the campaign.
is_pausedbooleanSpecifies whether the campaign is paused. A paused campaign doesn't run unless you resume it by changing this value to false.
last_modified_datestringThe date, in ISO 8601 format, when the campaign was last modified.
limitsobjectThe messaging limits for the campaign.
message_configurationobjectThe message configuration settings for the campaign.
namestringThe name of the campaign.
priorityintegerDefines the priority of the campaign, used to decide the order of messages displayed to user if there are multiple messages scheduled to be displayed at the same moment.
scheduleobjectThe schedule settings for the campaign.
segment_idstringThe unique identifier for the segment that's associated with the campaign.
segment_versionintegerThe version number of the segment that's associated with the campaign.
stateobjectThe current status of the campaign.
template_configurationobjectThe message template that’s used for the campaign.
treatment_descriptionstringThe custom description of the default treatment for the campaign.
treatment_namestringThe custom name of the default treatment for the campaign, if the campaign has multiple treatments. A treatment is a variation of a campaign that's used for A/B testing.
versionintegerThe version number of the campaign.
tagsobjectA string-to-string map of key-value pairs that identifies the tags that are associated with the campaign. Each tag consists of a required tag key and an associated tag value.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_campaignselectapplication-id, campaign-id, regionRetrieves information about the status, configuration, and other settings for a campaign.
get_campaignsselectapplication-id, regionpage-size, tokenRetrieves information about the status, configuration, and other settings for all the campaigns that are associated with an application.
create_campaigninsertapplication-id, region, WriteCampaignRequestCreates a new campaign for an application or updates the settings of an existing campaign for an application.
update_campaignupdateapplication-id, campaign-id, region, WriteCampaignRequestUpdates the configuration and other settings for a campaign.
delete_campaigndeleteapplication-id, campaign-id, regionDeletes a campaign from an application.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
application-idstringThe unique identifier for the application. This identifier is displayed as the Project ID on the Amazon Pinpoint console.
campaign-idstringThe unique identifier for the campaign.
regionstringAWS region (default: us-east-1)
page-sizestringThe maximum number of items to include in each page of a paginated response. This parameter is not supported for application, campaign, and journey metrics.
tokenstringThe NextToken string that specifies which page of results to return in a paginated response.

SELECT examples

Retrieves information about the status, configuration, and other settings for a campaign.

SELECT
additional_treatments,
application_id,
arn,
creation_date,
custom_delivery_configuration,
default_state,
description,
holdout_percent,
hook,
id,
is_paused,
last_modified_date,
limits,
message_configuration,
name,
priority,
schedule,
segment_id,
segment_version,
state,
template_configuration,
treatment_description,
treatment_name,
version,
tags
FROM aws.pinpoint.campaigns
WHERE `application-id` = '{{ application-id }}' -- required
AND `campaign-id` = '{{ campaign-id }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates a new campaign for an application or updates the settings of an existing campaign for an application.

INSERT INTO aws.pinpoint.campaigns (
WriteCampaignRequest,
`application-id`,
region
)
SELECT
'{{ WriteCampaignRequest }}' /* required */,
'{{ application-id }}',
'{{ region }}'
RETURNING
campaign_response
;

UPDATE examples

Updates the configuration and other settings for a campaign.

UPDATE aws.pinpoint.campaigns
SET
WriteCampaignRequest = '{{ WriteCampaignRequest }}'
WHERE
`application-id` = '{{ application-id }}' --required
AND `campaign-id` = '{{ campaign-id }}' --required
AND region = '{{ region }}' --required
AND WriteCampaignRequest = '{{ WriteCampaignRequest }}' --required
RETURNING
campaign_response;

DELETE examples

Deletes a campaign from an application.

DELETE FROM aws.pinpoint.campaigns
WHERE `application-id` = '{{ application-id }}' --required
AND `campaign-id` = '{{ campaign-id }}' --required
AND region = '{{ region }}' --required
;