profiles
Creates, updates, deletes, gets or lists a profiles resource.
Overview
| Name | profiles |
| Type | Resource |
| Id | aws.customer_profiles.profiles |
Fields
The following fields are returned by SELECT queries:
- batch_get_profile
- search_profiles
| Name | Datatype | Description |
|---|---|---|
errors | array | For information about the errors that are common to all actions, see Common Errors. |
profiles | array | Array of Profile Objects. |
| Name | Datatype | Description |
|---|---|---|
items | array | The list of Profiles matching the search criteria. |
next_token | string | The pagination token from the previous SearchProfiles API call. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
batch_get_profile | select | domain_name, region | Get a batch of profiles. | |
search_profiles | select | domain_name, region | next-token, max-results | Searches for profiles within a specific domain using one or more predefined search keys (e.g., _fullName, _phone, _email, _account, etc.) and/or custom-defined search keys. A search key is a data type pair that consists of a KeyName and Values list. This operation supports searching for profiles with a minimum of 1 key-value(s) pair and up to 5 key-value(s) pairs using either AND or OR logic. |
create_profile | insert | domain_name, region | Creates a standard profile. A standard profile represents the following attributes for a customer profile in a domain. | |
add_profile_key | update | domain_name, region, ProfileId, KeyName | Associates a new key value with a specific profile, such as a Contact Record ContactId. A profile object can have a single unique key and any number of additional keys that can be used to identify the profile that it belongs to. | |
update_profile | update | domain_name, region, ProfileId | Updates the properties of a profile. The ProfileId is required for updating a customer profile. When calling the UpdateProfile API, specifying an empty string value means that any existing value will be removed. Not specifying a string value means that any value already there will be kept. | |
delete_profile_key | delete | domain_name, region | Removes a searchable key from a customer profile. | |
delete_profile | delete | domain_name, region | Deletes the standard customer profile and all data pertaining to the profile. | |
merge_profiles | exec | domain_name, region, MainProfileId, ProfileIdsToBeMerged | Runs an AWS Lambda job that does the following: All the profileKeys in the ProfileToBeMerged will be moved to the main profile. All the objects in the ProfileToBeMerged will be moved to the main profile. All the ProfileToBeMerged will be deleted at the end. All the profileKeys in the ProfileIdsToBeMerged will be moved to the main profile. Standard fields are merged as follows: Fields are always "union"-ed if there are no conflicts in standard fields or attributeKeys. When there are conflicting fields: If no SourceProfileIds entry is specified, the main Profile value is always taken. If a SourceProfileIds entry is specified, the specified profileId is always taken, even if it is a NULL value. You can use MergeProfiles together with GetMatches, which returns potentially matching profiles, or use it with the results of another matching system. After profiles have been merged, they cannot be separated (unmerged). |
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.
| Name | Datatype | Description |
|---|---|---|
domain_name | string | The unique name of the domain. |
region | string | AWS region (default: us-east-1) |
max-results | integer | The maximum number of objects returned per page. The default is 20 if this parameter is not included in the request. |
next-token | string | The pagination token from the previous SearchProfiles API call. |
SELECT examples
- batch_get_profile
- search_profiles
Get a batch of profiles.
SELECT
errors,
profiles
FROM aws.customer_profiles.profiles
WHERE domain_name = '{{ domain_name }}' -- required
AND region = '{{ region }}' -- required
;
Searches for profiles within a specific domain using one or more predefined search keys (e.g., _fullName, _phone, _email, _account, etc.) and/or custom-defined search keys. A search key is a data type pair that consists of a KeyName and Values list. This operation supports searching for profiles with a minimum of 1 key-value(s) pair and up to 5 key-value(s) pairs using either AND or OR logic.
SELECT
items,
next_token
FROM aws.customer_profiles.profiles
WHERE domain_name = '{{ domain_name }}' -- required
AND region = '{{ region }}' -- required
AND `next-token` = '{{ next-token }}'
AND `max-results` = '{{ max-results }}'
;
INSERT examples
- create_profile
- Manifest
Creates a standard profile. A standard profile represents the following attributes for a customer profile in a domain.
INSERT INTO aws.customer_profiles.profiles (
AccountNumber,
AdditionalInformation,
PartyType,
BusinessName,
FirstName,
MiddleName,
LastName,
BirthDate,
Gender,
PhoneNumber,
MobilePhoneNumber,
HomePhoneNumber,
BusinessPhoneNumber,
EmailAddress,
PersonalEmailAddress,
BusinessEmailAddress,
Address,
ShippingAddress,
MailingAddress,
BillingAddress,
Attributes,
PartyTypeString,
GenderString,
ProfileType,
EngagementPreferences,
domain_name,
region
)
SELECT
'{{ AccountNumber }}',
'{{ AdditionalInformation }}',
'{{ PartyType }}',
'{{ BusinessName }}',
'{{ FirstName }}',
'{{ MiddleName }}',
'{{ LastName }}',
'{{ BirthDate }}',
'{{ Gender }}',
'{{ PhoneNumber }}',
'{{ MobilePhoneNumber }}',
'{{ HomePhoneNumber }}',
'{{ BusinessPhoneNumber }}',
'{{ EmailAddress }}',
'{{ PersonalEmailAddress }}',
'{{ BusinessEmailAddress }}',
'{{ Address }}',
'{{ ShippingAddress }}',
'{{ MailingAddress }}',
'{{ BillingAddress }}',
'{{ Attributes }}',
'{{ PartyTypeString }}',
'{{ GenderString }}',
'{{ ProfileType }}',
'{{ EngagementPreferences }}',
'{{ domain_name }}',
'{{ region }}'
RETURNING
profile_id
;
# Description fields are for documentation purposes
- name: profiles
props:
- name: domain_name
value: "{{ domain_name }}"
description: Required parameter for the profiles resource.
- name: region
value: "{{ region }}"
description: Required parameter for the profiles resource.
- name: AccountNumber
value: "{{ AccountNumber }}"
- name: AdditionalInformation
value: "{{ AdditionalInformation }}"
- name: PartyType
value: "{{ PartyType }}"
valid_values: ['INDIVIDUAL', 'BUSINESS', 'OTHER']
- name: BusinessName
value: "{{ BusinessName }}"
- name: FirstName
value: "{{ FirstName }}"
- name: MiddleName
value: "{{ MiddleName }}"
- name: LastName
value: "{{ LastName }}"
- name: BirthDate
value: "{{ BirthDate }}"
- name: Gender
value: "{{ Gender }}"
valid_values: ['MALE', 'FEMALE', 'UNSPECIFIED']
- name: PhoneNumber
value: "{{ PhoneNumber }}"
- name: MobilePhoneNumber
value: "{{ MobilePhoneNumber }}"
- name: HomePhoneNumber
value: "{{ HomePhoneNumber }}"
- name: BusinessPhoneNumber
value: "{{ BusinessPhoneNumber }}"
- name: EmailAddress
value: "{{ EmailAddress }}"
- name: PersonalEmailAddress
value: "{{ PersonalEmailAddress }}"
- name: BusinessEmailAddress
value: "{{ BusinessEmailAddress }}"
- name: Address
description: |
A generic address associated with the customer that is not mailing, shipping, or billing.
value:
Address1: "{{ Address1 }}"
Address2: "{{ Address2 }}"
Address3: "{{ Address3 }}"
Address4: "{{ Address4 }}"
City: "{{ City }}"
County: "{{ County }}"
State: "{{ State }}"
Province: "{{ Province }}"
Country: "{{ Country }}"
PostalCode: "{{ PostalCode }}"
- name: ShippingAddress
description: |
A generic address associated with the customer that is not mailing, shipping, or billing.
value:
Address1: "{{ Address1 }}"
Address2: "{{ Address2 }}"
Address3: "{{ Address3 }}"
Address4: "{{ Address4 }}"
City: "{{ City }}"
County: "{{ County }}"
State: "{{ State }}"
Province: "{{ Province }}"
Country: "{{ Country }}"
PostalCode: "{{ PostalCode }}"
- name: MailingAddress
description: |
A generic address associated with the customer that is not mailing, shipping, or billing.
value:
Address1: "{{ Address1 }}"
Address2: "{{ Address2 }}"
Address3: "{{ Address3 }}"
Address4: "{{ Address4 }}"
City: "{{ City }}"
County: "{{ County }}"
State: "{{ State }}"
Province: "{{ Province }}"
Country: "{{ Country }}"
PostalCode: "{{ PostalCode }}"
- name: BillingAddress
description: |
A generic address associated with the customer that is not mailing, shipping, or billing.
value:
Address1: "{{ Address1 }}"
Address2: "{{ Address2 }}"
Address3: "{{ Address3 }}"
Address4: "{{ Address4 }}"
City: "{{ City }}"
County: "{{ County }}"
State: "{{ State }}"
Province: "{{ Province }}"
Country: "{{ Country }}"
PostalCode: "{{ PostalCode }}"
- name: Attributes
value: "{{ Attributes }}"
- name: PartyTypeString
value: "{{ PartyTypeString }}"
- name: GenderString
value: "{{ GenderString }}"
- name: ProfileType
value: "{{ ProfileType }}"
valid_values: ['ACCOUNT_PROFILE', 'PROFILE']
- name: EngagementPreferences
description: |
Object that defines users preferred methods of engagement.
value:
Phone:
- KeyName: "{{ KeyName }}"
KeyValue: "{{ KeyValue }}"
ProfileId: "{{ ProfileId }}"
ContactType: "{{ ContactType }}"
Email:
- KeyName: "{{ KeyName }}"
KeyValue: "{{ KeyValue }}"
ProfileId: "{{ ProfileId }}"
ContactType: "{{ ContactType }}"
UPDATE examples
- add_profile_key
- update_profile
Associates a new key value with a specific profile, such as a Contact Record ContactId. A profile object can have a single unique key and any number of additional keys that can be used to identify the profile that it belongs to.
UPDATE aws.customer_profiles.profiles
SET
ProfileId = '{{ ProfileId }}',
KeyName = '{{ KeyName }}',
Values = '{{ Values }}'
WHERE
domain_name = '{{ domain_name }}' --required
AND region = '{{ region }}' --required
AND ProfileId = '{{ ProfileId }}' --required
AND KeyName = '{{ KeyName }}' --required
RETURNING
key_name,
values;
Updates the properties of a profile. The ProfileId is required for updating a customer profile. When calling the UpdateProfile API, specifying an empty string value means that any existing value will be removed. Not specifying a string value means that any value already there will be kept.
UPDATE aws.customer_profiles.profiles
SET
ProfileId = '{{ ProfileId }}',
AdditionalInformation = '{{ AdditionalInformation }}',
AccountNumber = '{{ AccountNumber }}',
PartyType = '{{ PartyType }}',
BusinessName = '{{ BusinessName }}',
FirstName = '{{ FirstName }}',
MiddleName = '{{ MiddleName }}',
LastName = '{{ LastName }}',
BirthDate = '{{ BirthDate }}',
Gender = '{{ Gender }}',
PhoneNumber = '{{ PhoneNumber }}',
MobilePhoneNumber = '{{ MobilePhoneNumber }}',
HomePhoneNumber = '{{ HomePhoneNumber }}',
BusinessPhoneNumber = '{{ BusinessPhoneNumber }}',
EmailAddress = '{{ EmailAddress }}',
PersonalEmailAddress = '{{ PersonalEmailAddress }}',
BusinessEmailAddress = '{{ BusinessEmailAddress }}',
Address = '{{ Address }}',
ShippingAddress = '{{ ShippingAddress }}',
MailingAddress = '{{ MailingAddress }}',
BillingAddress = '{{ BillingAddress }}',
Attributes = '{{ Attributes }}',
PartyTypeString = '{{ PartyTypeString }}',
GenderString = '{{ GenderString }}',
ProfileType = '{{ ProfileType }}',
EngagementPreferences = '{{ EngagementPreferences }}'
WHERE
domain_name = '{{ domain_name }}' --required
AND region = '{{ region }}' --required
AND ProfileId = '{{ ProfileId }}' --required
RETURNING
profile_id;
DELETE examples
- delete_profile_key
- delete_profile
Removes a searchable key from a customer profile.
DELETE FROM aws.customer_profiles.profiles
WHERE domain_name = '{{ domain_name }}' --required
AND region = '{{ region }}' --required
;
Deletes the standard customer profile and all data pertaining to the profile.
DELETE FROM aws.customer_profiles.profiles
WHERE domain_name = '{{ domain_name }}' --required
AND region = '{{ region }}' --required
;
Lifecycle Methods
- merge_profiles
Runs an AWS Lambda job that does the following: All the profileKeys in the ProfileToBeMerged will be moved to the main profile. All the objects in the ProfileToBeMerged will be moved to the main profile. All the ProfileToBeMerged will be deleted at the end. All the profileKeys in the ProfileIdsToBeMerged will be moved to the main profile. Standard fields are merged as follows: Fields are always "union"-ed if there are no conflicts in standard fields or attributeKeys. When there are conflicting fields: If no SourceProfileIds entry is specified, the main Profile value is always taken. If a SourceProfileIds entry is specified, the specified profileId is always taken, even if it is a NULL value. You can use MergeProfiles together with GetMatches, which returns potentially matching profiles, or use it with the results of another matching system. After profiles have been merged, they cannot be separated (unmerged).
EXEC aws.customer_profiles.profiles.merge_profiles
@domain_name='{{ domain_name }}' --required,
@region='{{ region }}' --required
@@json=
'{
"MainProfileId": "{{ MainProfileId }}",
"ProfileIdsToBeMerged": "{{ ProfileIdsToBeMerged }}",
"FieldSourceProfileIds": "{{ FieldSourceProfileIds }}"
}'
;