POST /crm/v3/objects/contacts

Dear Community Members,
My usecase is to create a contact by using the POST /crm/v3/objects/contacts API
Addendum : We have a website and have a Newsletter Subscription section in our website. So i would like to employee POST /crm/v3/objects/contacts API to be invoked whenever a user enters his/her email Id in our form present in the Website.
So far i have an hapikey
Performed a test call using the following
POST https://api.hubapi.com/crm/v3/objects/contacts?hapikey={{hapikey}}

{

“properties”: [

{

  "property": "firstname",

  "value": "Alice"

},

{

  "property": "lastname",

  "value": "Test"

},

{

  "property": "email",

  "value": "alice-test@hubspot.com"

}

]

}

Resposne that i am getting is as follows

{

"status": "error",

"message": "Invalid input JSON on line 2, column 17: Cannot deserialize instance of \`java.util.LinkedHashMap\` out of START\_ARRAY token",

"correlationId": "cdd965ea-51ca-4c4a-b9e6-5c598e72b564"

}

Could someone assist me by letting me know , what am i doing wrong here ?
Thanks
Titus

Hey @titusrobyk,

When looking to use the CRM v3 API | Contacts, the POST body format should be something like this:

{
 "properties": {
 "firstname": "Alice",
 "lastname": "Test",
 "email": "alice-test@hubspot.com"
 }
}

The POST body format that you’re currently using is only supported on the Contacts v1 API.

Thank you Wendy , I was able to run the API
But i have another query

How do i use the property names in api request payload ?
Is there a link in which i could lookup ?
i tried using contact_owner , reponse says its not present

Hey @titusrobyk,

When looking to set the contact owner via the contact v3 endpoint, you’d need to use the property internal name and in this case, the contact owner property internal name is hubspot_owner_id.

You can retrieve property internal name by going to:

Settings > Properties > Search for the property i.e. contact owner > Hover over and click ‘Edit’

Beside the property name, click on ‘</>’ and you should be able to see the internal name:

@WendyGoh Once again , Thanks alot !!