

# Export your unified customer profile data
Set up real-time export

Amazon Connect Customer Profiles provides real-time data export of unified customer profiles to an Amazon Kinesis Data Stream. You can enable data streaming and automatically receive data for new profiles and updates to existing profiles into your Amazon Kinesis Data Stream.

You can keep your source systems data, such as CRMs and marketing automation tools, up-to-date with the latest information from Amazon Connect Customer Profiles. For example, when a customer calls your contact center to update their address, an agent can make the change to add the new customer address, and the updated profile information is sent to a Kinesis Data Stream in real-time.

To set this up, you need to enable **Data export** in the Customer Profiles console.

## Enable real-time export


**To enable data streaming for your domain**

1. Open the Amazon Connect Customer Profiles console.

1. Select the **Data export** tab and choose **Enable data streaming**  
![\[Real-time data export enable Kinesis data stream.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/enable-real-time-export-1.png)

1. Choose **Enable data streaming** and select an existing Kinesis data stream from the drop-down menu, or choose **create a new Kinesis data stream** to open the Kinesis console and create the stream. For more information, see [Creating and Managing Streams](https://docs.aws.amazon.com/streams/latest/dev/working-with-streams.html).  
![\[Real-time data export enable Kinesis data stream.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/enable-real-time-export-2.png)

1. Choose the **Enable data streaming** button to save your settings.

## Disable real-time export


**To disable data streaming for your domain**

1. Open the Amazon Connect Customer Profiles console.

1. Select the **Data export** tab and choose **Disable data streaming**.  
![\[Real-time data export disable Kinesis data stream.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/disable-real-time-export-1.png)

## Real-time export Kinesis payload


**Sample output event in JSON**

```
{
    "SchemaVersion": 0,
    "EventId": "eventId",
    "EventTimestamp": "2020-01-01T00:00:00Z",
    "EventType": "CREATED",
    "DomainName": "domainName",
    "ObjectTypeName": "objectTypeName",
    "AssociatedProfileId": "associatedProfileId",
    "ProfileObjectUniqueKey": "profileObjectUniqueKey",
    "Object": {
        "map": {
            "k1": [
                "a",
                "b",
                "c"
            ]
        }
    },
    "IsMessageRealTime": true
}
```

**SchemaVersion**  
The current version of the schema.

**EventId**  
The unique event ID.

**EventTimestamp**  
Timestamp of the event using the ISO8601 standard.

**EventType**  
The type of event exported.  
Values: CREATED, UPDATED, HEALTH\$1CHECK  
+ CREATED: The export event was for CreateProfile.
+ UPDATED: The export event was for a UpdateProfile.
+ HEALTH\$1CHECK: The export event was for a HealthCheck event to make sure Customer Profiles could successfully `putEvent` in Kinesis Stream.

**DomainName**  
The domain the event belongs to. `/Domain` of the event

**ObjectTypeName**  
Object type of the event  
Values: `_profile`, `_asset`, `_order`, `_case`. You can also use predefined template name such as `Salesforce-Account` or a custom defined object name that you can create using the [ PutProfileObjectType](https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_PutProfileObjectType.html) API.

**AssociatedProfileId**  
ID of the Standard Profile that the Object is associated to. It is only present if the object type is not `_profile`

**ProfileObjectUniqueKey**  
The unique identifier of the ProfileObject generated by the service.  
Type: String

**Object**  
The Standard Profile or Standard Profile Object itself.

**IsMessageRealTime**  
Flag to inform if the message is real-time or was re-driven.

**Sample payload in JSON**

```
{
    "SchemaVersion": 0,
    "EventId": "6049bf39-0000-0000-0000-b75656dd51a8",
    "EventTimestamp": "2023-02-24T07:17:05.356Z",
    "EventType": "UPDATED",
    "DomainName": "SampleDomain",
    "ObjectTypeName": "Salesforce-Account",
    "AssociatedProfileId": "5ffcee99ab0000000000b3ae01225e40",
    "ProfileObjectUniqueKey": "cNo77ZI0000000000pCPB7RQcqfeBaRfBwrzW2MMbws=",
    "Object": {
        "Id": "0012v00002kVKVuAAO",
        "IsDeleted": false,
        "Name": "Company A",
        "Phone": "+12065551234",
        "PhotoUrl": "/services/images/photo/0012v00002kVKVuAAO",
        "OwnerId": "0052v00000fmQ7sAAE",
        "CreatedDate": "2019-12-13T07:56:04.000+0000",
        "CreatedById": "0052v00000fmQ7sAAE",
        "LastModifiedDate": "2023-02-22T20:29:43.000+0000",
        "LastModifiedById": "0052v00000fmQ7sAAE",
        "SystemModstamp": "2023-02-22T20:29:43.000+0000",
        "LastActivityDate": "2020-03-18",
        "LastViewedDate": "2023-02-23T00:09:49.000+0000",
        "LastReferencedDate": "2023-02-23T00:09:49.000+0000",
        "CleanStatus": "Pending"
    },
    "IsMessageRealTime": true
}
```

# Troubleshoot real-time event exporting to your Kinesis Data Stream


There may be a delay when first exporting events to your Kinesis Data Stream. This is due to the time it takes to propagate IAM permissions for the service-linked role. When an actual issue occurs, the streaming status can enter an error state.

![\[Events unable to reach the destination Kinesis Data Stream, entering an error state.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/real-time-export-troubleshooting.png)


The following sections display the possible error messages that you may encounter. It also provides the cause and resolution for each issue.

## Error: The Kinesis Data Stream is not Active. Please check the configuration and recreate the event stream later


The destination Kinesis Data Stream is not in `ACTIVE` state. This can happen when your Kinesis Data Stream is being created or being deleted. To resolve the error, make sure your Kinesis Data Stream is in ACTIVE state and re-enable the data streaming setting.

## Error: The Kinesis Data Stream does not exist. Please recreate the event stream with valid Kinesis Data Stream destination


The destination Kinesis Data Stream is deleted. To resolve the error, re-enable data streaming with an existing Kinesis Data Stream as the destination.

## Error: The Kinesis Data Stream is being throttled. Please consider provision higher Kinesis throughput appropriately


The destination Kinesis Data Stream is being throttled (under-provisioned). To resolve the error, make sure the destination Kinesis Data Stream has enough shard count and then re-enable data streaming.

## Error: The KMS key used to encrypt Kinesis Data Stream is being throttled. Please consider increasing the KMS request quota appropriately


The KMS key used by Kinesis Data Stream is being throttled. To resolve the error, re-enable data streaming.

## Error: Check the KMS Key configuration of you Kinesis Data Stream


Customer Profiles cannot access the KMS key used by Kinesis Data Stream. This can happen when your KMS key has a key policy that denies access from Customer Profiles service-linked role, or the key is not in Enabled status. To resolve the error, make sure the KMS key policy does not deny access from Customer Profiles service-linked role, and the key is in Enabled status. Re-enable data streaming to resolve the error.