

# PutProfileObject
<a name="API_connect-customer-profiles_PutProfileObject"></a>

Adds additional objects to customer profiles of a given ObjectType.

When adding a specific profile object, like a Contact Record, an inferred profile can get created if it is not mapped to an existing profile. The resulting profile will only have a phone number populated in the standard ProfileObject. Any additional Contact Records with the same phone number will be mapped to the same inferred profile.

When a ProfileObject is created and if a ProfileObjectType already exists for the ProfileObject, it will provide data to a standard profile depending on the ProfileObjectType definition.

PutProfileObject needs an ObjectType, which can be created using PutProfileObjectType.

## Request Syntax
<a name="API_connect-customer-profiles_PutProfileObject_RequestSyntax"></a>

```
PUT /domains/DomainName/profiles/objects HTTP/1.1
Content-type: application/json

{
   "Object": "string",
   "ObjectTypeName": "string"
}
```

## URI Request Parameters
<a name="API_connect-customer-profiles_PutProfileObject_RequestParameters"></a>

The request uses the following URI parameters.

 ** [DomainName](#API_connect-customer-profiles_PutProfileObject_RequestSyntax) **   <a name="connect-connect-customer-profiles_PutProfileObject-request-uri-DomainName"></a>
The unique name of the domain.  
Length Constraints: Minimum length of 1. Maximum length of 64.  
Pattern: `^[a-zA-Z0-9_-]+$`   
Required: Yes

## Request Body
<a name="API_connect-customer-profiles_PutProfileObject_RequestBody"></a>

The request accepts the following data in JSON format.

 ** [Object](#API_connect-customer-profiles_PutProfileObject_RequestSyntax) **   <a name="connect-connect-customer-profiles_PutProfileObject-request-Object"></a>
A string that is serialized from a JSON object.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 256000.  
Required: Yes

 ** [ObjectTypeName](#API_connect-customer-profiles_PutProfileObject_RequestSyntax) **   <a name="connect-connect-customer-profiles_PutProfileObject-request-ObjectTypeName"></a>
The name of the profile object type.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 255.  
Pattern: `^[a-zA-Z_][a-zA-Z_0-9-]*$`   
Required: Yes

## Response Syntax
<a name="API_connect-customer-profiles_PutProfileObject_ResponseSyntax"></a>

```
HTTP/1.1 200
Content-type: application/json

{
   "ProfileObjectUniqueKey": "string"
}
```

## Response Elements
<a name="API_connect-customer-profiles_PutProfileObject_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [ProfileObjectUniqueKey](#API_connect-customer-profiles_PutProfileObject_ResponseSyntax) **   <a name="connect-connect-customer-profiles_PutProfileObject-response-ProfileObjectUniqueKey"></a>
The unique identifier of the profile object generated by the service.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 255.

## Errors
<a name="API_connect-customer-profiles_PutProfileObject_Errors"></a>

For information about the errors that are common to all actions, see [Common Errors](CommonErrors.md).

 ** AccessDeniedException **   
You do not have sufficient access to perform this action.  
HTTP Status Code: 403

 ** BadRequestException **   
The input you provided is invalid.  
HTTP Status Code: 400

 ** InternalServerException **   
An internal service error occurred.  
HTTP Status Code: 500

 ** ResourceNotFoundException **   
The requested resource does not exist, or access was denied.  
HTTP Status Code: 404

 ** ThrottlingException **   
You exceeded the maximum number of requests.  
HTTP Status Code: 429

## Examples
<a name="API_connect-customer-profiles_PutProfileObject_Examples"></a>

### Example 1: For a custom object
<a name="API_connect-customer-profiles_PutProfileObject_Example_1"></a>

This example illustrates one usage of PutProfileObject.

#### Sample Request
<a name="API_connect-customer-profiles_PutProfileObject_Example_1_Request"></a>

```
PUT /domains/ExampleDomainName/profiles/objects HTTP/1.1
Content-type: application/json

{
   "Object": "{\"firstName\": \"John\",\n       \"lastName\": \"Smith\",\n       \"isAlive\": true,\n       \"age\": 27,\n       \"address\": {\"streetAddress\": \"21 2nd Street\",\"city\": \"New York\",\"state\": \"NY\",\"postalCode\": \"10021-3100\"},\n       \"phoneNumbers\": [{\"type\": \"home\",\"number\": \"212 555-1234\"},\n                        {\"type\": \"office\",\"number\": \"646 555-4567\"}],\n       \"children\": [],\n       \"spouse\": null}",
   "ObjectTypeName": "MyCustomObjectName"
}
```

#### Sample Response
<a name="API_connect-customer-profiles_PutProfileObject_Example_1_Response"></a>

```
Content-type: application/json
{
   "ProfileObjectUniqueKey": "HashValueOfUniqueKeyOfTheProfileObject"
}
```

### Example 2: For a pre-defined object, like a Contact Record
<a name="API_connect-customer-profiles_PutProfileObject_Example_2"></a>

This example illustrates one usage of PutProfileObject.

#### Sample Request
<a name="API_connect-customer-profiles_PutProfileObject_Example_2_Request"></a>

```
PUT /domains/ExampleDomainName/profiles/objects HTTP/1.1
Content-type: application/json

{
   "Object": "{\n    \"mediaStreams\": [\n        {\n            \"type\": \"AUDIO\"\n        }\n    ],\n    \"queue\": null,\n    \"preDisconnectState\": null,\n    \"references\": null,\n    \"contactReferences\": null,\n    \"initialContactId\": null,\n    \"previousContactData\": null,\n    \"recordings\": null,\n    \"contactDetails\": null,\n    \"initialContactFlowId\": \"e1b44e46-a457-4230-a896-64473a2dbe7d\",\n    \"channel\": \"VOICE\",\n    \"attributes\": null,\n    \"customerEndpoint\": {\n        \"address\": null,\n        \"type\": \"VOIP\",\n        \"arn\": null\n    },\n    \"transferInfo\": null,\n    \"initiationMethod\": \"API\",\n    \"nextContactData\": null,\n    \"contactId\": \"9a3394ee-a0c4-448a-a329-9a148e53d8cd\",\n    \"initiationTimestamp\": 1603319514474,\n    \"connectedToSystemTimestamp\": 1603319517218,\n    \"disconnectTimestamp\": 1603319517000,\n    \"agentConnectionAttempts\": 0,\n    \"agent\": null,\n    \"systemEndpoint\": {\n        \"address\": \"e1b44e46-a457-4230-a896-64473a2dbe7d\",\n        \"type\": \"CONTACT_FLOW\",\n        \"arn\": null\n    },\n    \"instanceARN\": \"arn:aws:connect:us-west-2:941081270797:instance/fb129b8c-4a2f-4561-859b-cc190fa047b1\",\n    \"lastUpdateTimestamp\": 1603319579763,\n    \"disconnectReason\": \"CUSTOMER_DISCONNECT\",\n    \"awsaccountId\": \"941081270797\",\n    \"awscontactTraceRecordFormatVersion\": \"2019-01-23\"\n}",
   "ObjectTypeName": "CTR"
}
```

#### Sample Response
<a name="API_connect-customer-profiles_PutProfileObject_Example_2_Response"></a>

```
Content-type: application/json
{
   "ProfileObjectUniqueKey": "HashValueOfTheCTRContactId"
}
```

## See Also
<a name="API_connect-customer-profiles_PutProfileObject_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/customer-profiles-2020-08-15/PutProfileObject) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/customer-profiles-2020-08-15/PutProfileObject) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/customer-profiles-2020-08-15/PutProfileObject) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/customer-profiles-2020-08-15/PutProfileObject) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/customer-profiles-2020-08-15/PutProfileObject) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/customer-profiles-2020-08-15/PutProfileObject) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/customer-profiles-2020-08-15/PutProfileObject) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/customer-profiles-2020-08-15/PutProfileObject) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/customer-profiles-2020-08-15/PutProfileObject) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/customer-profiles-2020-08-15/PutProfileObject) 