Here is the request body we are trying to send, which is actually from the API documentation
{
"name": "newcustomproperty",
"label": "A New Custom Property",
"description": "A new property for you",
"groupName": "contactinformation",
"type": "string",
"fieldType": "text",
"formField": true,
"displayOrder": 6,
"options": []
}
Not sure what to check from here. The only thing I noted was that the response from the API refers to a "v2" API url, so wondering if the request format has changed somehow?
How are you making this request? When I copy and paste the example from the Developer Docs into Postman to test this, with a method of POST to this URL https://api.hubapi.com/properties/v1/contacts/properties?hapikey=my_hapikey_here
I get a 200 success message and the property is created. Make sure you also have the Content-Type set to application/json as a header.
As per the docs:
Returns a 400 error with more details in the response body if there is any other
problem with the data.
I think the v2 error listed is a red herring, as I tried submitting a POST request without the content type set to application/json, and got a 415 Unsupported Media type error very similarly formatted to the error you have above.