# Getting error while creating EventDefinition

**URL:** <https://community.hubspot.com/t/getting-error-while-creating-eventdefinition/123344>\
**Category:** APIs & Integrations\
**Tags:** events\
**Created:** [January 6, 2025, 12:37pm UTC](https://community.hubspot.com/t/getting-error-while-creating-eventdefinition/123344 "2025-01-06T12:37:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MAttal](https://avatars.discourse-cdn.com/v4/letter/m/6a8cbe/32.png) [@MAttal](https://community.hubspot.com/u/MAttal)\
**Post date:** [January 6, 2025, 12:37pm UTC](https://community.hubspot.com/t/getting-error-while-creating-eventdefinition/123344/1 "2025-01-06T12:37:57Z")

</div>

Hello,  
I am getting an error while trying to create an `EventDefinition` using C# API. I have forked from `[https://github.com/boomandbucket/HubSpot.NET`](https://github.com/boomandbucket/HubSpot.NET%60) and customized it to work with CRUD methods for EventDefition. I am getting an error when trying to create an `EventDefinition`.  
The error I am getting is

`HubSpot.NET.Core.HubSpotException : Error from HubSpot, Response = {"status":"error","message":"Invalid input JSON on line 1, column 143. Some required fields were not set: [label]","correlationId":"4e24f2e8-7d6a-4dee-93e1-cd75cd67679f","category":"VALIDATION_ERROR"}`

The issue is not evident from the error message. This is the json generated.

`{"labels":{"singular":"test_event1","plural":"Test Events"},"name":"testevent12345","description":"test description","primaryObject":"CONTACT"}`

Any idea what could be wrong here?

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [January 7, 2025, 6:26pm UTC](https://community.hubspot.com/t/getting-error-while-creating-eventdefinition/123344/2 "2025-01-07T18:26:21Z")

</div>

Hey, @MAttal 👋 Thanks for your question. I am not a C# expert by any means. The error message is definitely complaining about your labels. One thing that stands out to me is your use of nested labels.

If we take a step back from the 3rd party repo you linked, can you create a custom event definition either from the on-page dev doc [**C# example**](https://developers.hubspot.com/docs/reference/api/analytics-and-events/custom-events/custom-event-definitions#post-%2Fevents%2Fv3%2Fevent-definitions) or using Postman?

Thanks for the additional information! — Jaycee
