POST /contacts/v1/contacts

Overview 

Creates a new contact with the specified information in the specified attribute groups.

JSON Parameters 

NameTypeDescription
contactKeystringPrimary address for the contact. You must provide either a value for contactKey or contactID.
contactIDstringUnique ID for the contact. You must provide either a value for contactKey or contactID.
attributeSetsarrayRequiredArray of information used to create a new contact
attributeSets.namestringRequiredName of attribute group to which to add the contact information
attributeSets.valuesarrayName and value pairs indicating the attribute and applicable value

Usage 

Example Request

The request must include at least one of the attribute sets to create a new contact:

  • Email Addresses (You must also include this attribute set if you include Email Demographics)
  • MobileConnect Demographics (You must include a country code for the Locale value)
  • MobilePush Demographics (You must include an ApplicationID value)
  • LINE Addresses and LINE Subscriptions (You must also include these attribute sets if you include LINE Demographics)

Each call accepts only one instance of each attribute set.

You must also include values for contactKey and HTML Enabled.

Change @example.com to a valid domain.

1Host: https://YOUR_SUBDOMAIN.rest.marketingcloudapis.com
2POST /contacts/v1/contacts
3Content-Type: application/json
4Authorization: Bearer YOUR_ACCESS_TOKEN
5
6{
7    "contactKey": "acruz@example.com",
8    "attributeSets": [{
9        "name": "Email Addresses",
10        "items": [{
11            "values": [{
12                "name": "Email Address",
13                "value": "acruz@example.com"
14            },
15            {
16                "name": "HTML Enabled",
17                "value": true
18            }]
19        }]
20    },
21    {
22        "name": "Email Demographics",
23        "items": [{
24            "values": [{
25                "name": "Last Name",
26                "value": "Cruz"
27            },
28            {
29                "name": "First Name",
30                "value": "Angela"
31            },
32            {
33                "name": "Text Profile Attribute",
34                "value": "value 1"
35            },
36            {
37                "name": "Number Profile Attribute",
38                "value": 12345
39            }]
40        }]
41    },
42    {
43        "name": "MobileConnect Demographics",
44        "items": [{
45            "values": [{
46                "name": "Mobile Number",
47                "value": "317-531-5555"
48            },
49            {
50                "name": "Locale",
51                "value": "US"
52            },
53            {
54                "name": "Status",
55                "value": 1
56            }]
57        }]
58    },
59    {
60        "name": "MobilePush Demographics",
61        "items": [{
62            "values": [{
63                "name": "Device ID",
64                "value": 958405948
65            },
66            {
67                "name": "Application",
68                "value": 958405948
69            }]
70        }]
71    },
72    {
73        "name": "GroupConnect LINE Addresses",
74        "items": [{
75            "values": [{
76                "name": "Address ID",
77                "value": "addressId_from_api"
78            }
79           ]
80        }]
81    },
82    {
83
84        "name": "GroupConnect LINE Subscriptions",
85        "items": [{
86            "values": [{
87                "name": "Address ID",
88                "value": "addressId_from_api"
89             },
90             {
91                "name": "Channel ID",
92                "value": "1234567890"
93            }]
94        }]
95    },
96    {
97        "name": "GroupConnect LINE Demographics",
98        "items": [{
99            "values": [{
100                "name": "Address ID",
101                "value": "addressId_from_api"
102            },
103            {
104                "name": "Display Name",
105                "value": "display_name"
106            },
107            {
108                "name": "Picture Url",
109                "value": "picture_url"
110            },
111            {
112                "name": "Status Message",
113                "value": "status_message"
114            }]
115        }]
116    }
117  ]
118}

Example Response

1200 (OK)
2Content-Type: application/json
3{
4    "operationStatus": "OK",
5    "rowsAffetcted": 1,
6    "contactKey": "acruz@example.com",
7    "contactId": 12345678,
8    "contactTypeID": 0,
9    "isNewContactKey": false,
10    "requestServiceMessageID": "8b51b524-28c1-46fc-9a44-02fca5b0a08c",
11    "hasErrors": false,
12    "resultMessages": [],
13    "serviceMessageID": "80676c59-ceb9-48aa-ad35-81e150094a17"
14}