# Help with Custom Code to Log Meetings When Custom Object Is Created

**URL:** <https://community.hubspot.com/t/help-with-custom-code-to-log-meetings-when-custom-object-is-created/126857>\
**Category:** APIs & Integrations\
**Tags:** workflows\
**Created:** [February 26, 2025, 3:45am UTC](https://community.hubspot.com/t/help-with-custom-code-to-log-meetings-when-custom-object-is-created/126857 "2025-02-26T03:45:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AChristian8](https://avatars.discourse-cdn.com/v4/letter/a/f6c823/32.png) [@AChristian8](https://community.hubspot.com/u/AChristian8)\
**Post date:** [February 26, 2025, 3:45am UTC](https://community.hubspot.com/t/help-with-custom-code-to-log-meetings-when-custom-object-is-created/126857/1 "2025-02-26T03:45:05Z")

</div>

Hello,

I’m using a workflow to trigger an action when a new custom object is created. The goal is to automatically log a meeting associated with the contact and company linked to the custom object.

However, I’m facing errors with the timestamp and metadata when using custom code to log the meeting.

### What I Need Help With:

1. Timestamp: The hs\_timestamp field is causing validation errors. How should I format this field for logging a meeting?
2. Metadata: I keep getting the error “metadata cannot be null”. What metadata is required when logging a meeting?

Any help with the custom code to resolve these issues would be greatly appreciated. Or if you have a different proposed solution that would get the same outcome.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![MichaelMa](https://avatars.discourse-cdn.com/v4/letter/m/b5ac83/32.png) [@MichaelMa](https://community.hubspot.com/u/MichaelMa)\
**Post date:** [February 26, 2025, 1:40pm UTC](https://community.hubspot.com/t/help-with-custom-code-to-log-meetings-when-custom-object-is-created/126857/2 "2025-02-26T13:40:59Z")

</div>

datetime Fields, which hs\_timestamp is, are generally in the Unix Timestamp format so you would need to convert the value into that.

Not sure on the Metadata error. Did you check the payload of your request to make sure it’s not missing any required data? Missing any required associations? There is this post:

[https://community.hubspot.com/t5/APIs-Integrations/API-Create-Engagement-Metadata/m-p/335961](https://community.hubspot.com/t5/APIs-Integrations/API-Create-Engagement-Metadata/m-p/335961)

Willson put what seems like a “minimum” payload to create an engagement. You might want to start from there or if you can, post the payload here so we can view it.
