# Can't create property with fieldType 'html' via API

**URL:** <https://community.hubspot.com/t/cant-create-property-with-fieldtype-html-via-api/115477>\
**Category:** APIs & Integrations\
**Tags:** contacts\
**Created:** [August 29, 2024, 4:42pm UTC](https://community.hubspot.com/t/cant-create-property-with-fieldtype-html-via-api/115477 "2024-08-29T16:42:47Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonpos](https://avatars.discourse-cdn.com/v4/letter/j/ea666f/32.png) [@jonpos](https://community.hubspot.com/u/jonpos)\
**Post date:** [August 29, 2024, 4:42pm UTC](https://community.hubspot.com/t/cant-create-property-with-fieldtype-html-via-api/115477/1 "2024-08-29T16:42:47Z")

</div>

I’m unable to create a property with fieldType = html in the API.

The documentation here: [Accounts Dashboard | HubSpot](https://developers.hubspot.com/docs/api/crm/properties)

Says that I should be able to (and indeed, I am able to do so manually through the application).

I found this post from a couple years ago that seems to have gone unresolved?: [https://community.hubspot.com/t5/APIs-Integrations/Can-not-create-properties-with-FieldType-quot-html-quot-for/m-p/694448](https://community.hubspot.com/t5/APIs-Integrations/Can-not-create-properties-with-FieldType-quot-html-quot-for/m-p/694448)

Can someone help?

Thanks!

---

<div class="post-metadata">

**Author:** ![KhushbooP11](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/khushboop11/32/8252_2.png) [@KhushbooP11](https://community.hubspot.com/u/KhushbooP11)\
**Post date:** [August 29, 2024, 6:18pm UTC](https://community.hubspot.com/t/cant-create-property-with-fieldtype-html-via-api/115477/2 "2024-08-29T18:18:27Z")

</div>

Hi @jonpos,

You’re having trouble creating a property with fieldType = html through the HubSpot API.  
1. Sometimes, HubSpot’s API might not support certain features or field types that are available in the manual UI. This could be due to limitations or specific use cases that the API is designed to handle.  
2. The documentation may not be fully updated or might not reflect the exact capabilities of the API. It’s worth checking if there are any API version updates or changes that might have affected this functionality.  
3. A common workaround in such scenarios is to create the property manually through the HubSpot UI and then use the API to manage or update it. This might not be ideal, but it can serve as a temporary solution.

4. Since you’ve already encountered a similar unresolved issue in the community forum, I recommend contacting HubSpot support directly. They can provide more detailed guidance or escalate the issue if it’s a bug or limitation that needs to be addressed.  
In the meantime, please make sure you’re using the latest API version and double-check the field type and options you’re trying to set via the API. Sometimes, minor adjustments in the payload structure can make a difference.

I hope it helps, let me know if you need to [talk](https://calendly.com/khushboo-pokhriyal/30min?month=2024-08)!

Khushboo Pokhriyal

Growth & Operations

GroRapid Labs

[LinkedIn |](https://www.linkedin.com/in/khushboopokhriyal)9315044754 | [Email |](mailto:khushboo.pokhriyal@grorapid.com)[Website](https://www.grorapidlabs.com/)

---

<div class="post-metadata">

**Author:** ![JFenchel](https://avatars.discourse-cdn.com/v4/letter/j/439d5e/32.png) [@JFenchel](https://community.hubspot.com/u/JFenchel)\
**Post date:** [August 29, 2024, 9:48pm UTC](https://community.hubspot.com/t/cant-create-property-with-fieldtype-html-via-api/115477/3 "2024-08-29T21:48:18Z")

</div>

TLDR: set type=“string” and field\_type=“html”

I think have a solution here, I just tested it on my own HS. First I read a rich text (html) property to see what the values were set to, then I tried to imitate those values in the call to create the property. I believe the import part is to set type=“string” and field\_type=“html” but I’m not sure whether you’re allowed to have html be form properties or other things like that. So here is the full return from my api get call in case it’s helpful.

```lia-code-sample
 'results': [{'archived': False,
 'archived_at': None,
 'calculated': False,
 'calculation_formula': None,
 'created_at': datetime.datetime(2024, 4, 26, 13, 55, 25, 153000, tzinfo=tzutc()),
 'created_user_id': 'XXXXXXXXXX',
 'description': '',
 'display_order': -1,
 'external_options': False,
 'field_type': 'html',
 'form_field': False,
 'group_name': 'deal_properties',
 'has_unique_value': False,
 'hidden': False,
 'hubspot_defined': None,
 'label': 'XXXXXXXXXXX',
 'modification_metadata': {'archivable': True,
 'read_only_definition': False,
 'read_only_options': None,
 'read_only_value': False},
 'name': 'XXXXXXXXXXXXX',
 'options': [],
 'referenced_object_type': None,
 'show_currency_symbol': False,
 'type': 'string',
 'updated_at': datetime.datetime(2024, 4, 26, 13, 55, 25, 153000, tzinfo=tzutc()),
 'updated_user_id': 'XXXXXXXXXXXXX'}]

```

---

<div class="post-metadata">

**Author:** ![JFenchel](https://avatars.discourse-cdn.com/v4/letter/j/439d5e/32.png) [@JFenchel](https://community.hubspot.com/u/JFenchel)\
**Post date:** [August 29, 2024, 10:00pm UTC](https://community.hubspot.com/t/cant-create-property-with-fieldtype-html-via-api/115477/4 "2024-08-29T22:00:25Z")

</div>

Here’s the code I used to make the property (assuming you have a HubSpot client already activated with a Hapi Key

```lia-code-sample
property_create = PropertyCreate(hidden=False, display_order=2, description="Test test test", label="TestContactProperty", type="string", form_field=False, group_name="contactinformation", name="testtesttesttest", has_unique_value=False, field_type="html")
try:
 api_response = client.crm.properties.core_api.create(object_type="contact", property_create=property_create)
 pprint(api_response)
except ApiException as e:
 print("Exception when calling core_api->create: %s\n" % e)

```

---

<div class="post-metadata">

**Author:** ![jonpos](https://avatars.discourse-cdn.com/v4/letter/j/ea666f/32.png) [@jonpos](https://community.hubspot.com/u/jonpos)\
**Post date:** [September 3, 2024, 6:55pm UTC](https://community.hubspot.com/t/cant-create-property-with-fieldtype-html-via-api/115477/5 "2024-09-03T18:55:26Z")

</div>

Thanks! I think the issue might be that I’m using v2 instead of v3 of the API. I didn’t realize this until just now when debugging, the library we’re using is using v2 :(. Trying to do another test now to see if that solves it.

thanks so much for your help thus far!

---

<div class="post-metadata">

**Author:** ![JFenchel](https://avatars.discourse-cdn.com/v4/letter/j/439d5e/32.png) [@JFenchel](https://community.hubspot.com/u/JFenchel)\
**Post date:** [September 3, 2024, 7:20pm UTC](https://community.hubspot.com/t/cant-create-property-with-fieldtype-html-via-api/115477/6 "2024-09-03T19:20:39Z")

</div>

That’s probably it. my original call was to a contact property and then I retested on a deal property, so they should both work. Alternatively it could be your hubspot subscription types, but either of those should probably show up in the error messages.

---

<div class="post-metadata">

**Author:** ![jonpos](https://avatars.discourse-cdn.com/v4/letter/j/ea666f/32.png) [@jonpos](https://community.hubspot.com/u/jonpos)\
**Post date:** [September 4, 2024, 5:50pm UTC](https://community.hubspot.com/t/cant-create-property-with-fieldtype-html-via-api/115477/7 "2024-09-04T17:50:33Z")

</div>

OK, i finally confirmed it -- this is an issue with v2 vs v3 of the API. V3, the call works fine. Unfortunately for me, I’ve built everything on v2, ha.

Thanks for your help, really appreciate it. The error message doesn’t say that its a v2 vs v3 thing, which would have been nice. Anyway, we’re all set now, so thanks for your help -- would not have figured this out without chatting with you!

---

<div class="post-metadata">

**Author:** ![jonpos](https://avatars.discourse-cdn.com/v4/letter/j/ea666f/32.png) [@jonpos](https://community.hubspot.com/u/jonpos)\
**Post date:** [September 3, 2024, 3:35pm UTC](https://community.hubspot.com/t/cant-create-property-with-fieldtype-html-via-api/115477/8 "2024-09-03T15:35:06Z")

</div>

Interesting -- I actually already am setting the type to ‘string’, but I wonder if i’m missing something else? What other attributes did you set with the create call? I am setting:

name

label

description

groupName

type = “string”

fieldType = “html”

and that’s it… so maybe something else you are including is satisfying the validation check, and i’m getting an erroneous message?

---

<div class="post-metadata">

**Author:** ![jonpos](https://avatars.discourse-cdn.com/v4/letter/j/ea666f/32.png) [@jonpos](https://community.hubspot.com/u/jonpos)\
**Post date:** [September 3, 2024, 3:42pm UTC](https://community.hubspot.com/t/cant-create-property-with-fieldtype-html-via-api/115477/9 "2024-09-03T15:42:31Z")

</div>

Also, I’m creating this on a contact vs a Deal in your example. I don’t know why that would matter…but maybe?

---

<div class="post-metadata">

**Author:** ![JFenchel](https://avatars.discourse-cdn.com/v4/letter/j/439d5e/32.png) [@JFenchel](https://community.hubspot.com/u/JFenchel)\
**Post date:** [September 3, 2024, 4:52pm UTC](https://community.hubspot.com/t/cant-create-property-with-fieldtype-html-via-api/115477/10 "2024-09-03T16:52:31Z")

</div>

I just tested mine with deals and it’s working. What error message are you getting back when you make the call? One thing that happened for me when trying to switch to deal was that I had trouble getting the right group name. What are you using for groupName? I believe it has to be the internal value, and I’m not finding an easy way to check the internal value of a group name except by making an API call to an existing property with that group name). Alternatively, maybe you have to explicitly exclude it from forms or something.

---

<div class="post-metadata">

**Author:** ![jonpos](https://avatars.discourse-cdn.com/v4/letter/j/ea666f/32.png) [@jonpos](https://community.hubspot.com/u/jonpos)\
**Post date:** [September 3, 2024, 6:13pm UTC](https://community.hubspot.com/t/cant-create-property-with-fieldtype-html-via-api/115477/11 "2024-09-03T18:13:23Z")

</div>

Are you able to create this on a contact? I haven’t tried deal, I need this on a contact. I just tried to explicitly set

“formField” = false

per your thought and

“showCurrencySymbol” = false

because thats what it was on a manually created rich text field, but neither of those changes made it work…
