APIs & Integrations

DanielleS1
Participant

Creating a New Contact Property Value Through API

Our site is custom-built and we send contact information through an API on form submission.  Is it possible to define a new value for an already created contact property (e.g. multiple checkboxes) through the API? 

 

Or is there another way to eliminate defining over 50 versions in the contact property options upon creation?

 

Thank you!

0 Upvotes
1 Reply 1
dennisedson
HubSpot Product Team
HubSpot Product Team

Creating a New Contact Property Value Through API

@DanielleS1 

I am not 100% clear on the ask, but I will take a stab

You can use the properties api to update an existing property.

If you had a property called how_awesome_is_dennis (internal name) that had a select value options of

very

very very

super

and you forgot to add the correct option: the most awesome

you would do a patch request like this

PATCH https://api.hubapi.com/crm/v3/properties/how_awesome_is_dennis/?hapikey=YOUR_HUBSPOT_API_KEY

JSON body

{
"options": [
    {
      "label": "Very",
      "description": "Choice number one",
      "value": "very",
      "displayOrder": 1,
      "hidden": false
    },
    {
      "label": "very very",
      "description": "Choice number two",
      "value": "very very",
      "displayOrder": 2,
      "hidden": false
    },
    {
      "label": "super",
      "description": "Choice number three",
      "value": "super",
      "displayOrder": 3,
      "hidden": false
    },
    {
      "label": "the most awesome",
      "description": "Choice number four",
      "value": "the most awesome",
      "displayOrder": 4,
      "hidden": false
    }
  ]
}
0 Upvotes