Associate Contact Record with Custom Object on POST Create

I’m using the Hubspot API to create a Custom Object in Hubspot. This is working as intended. But I’d like to associate a Contact to the Custom Object. I see documentation on how to do this with the API as a seperate step- but I wasn’t sure if I could create the Custom Object AND create the association with one API call?
Right now I pass a JSON object with the properties key to the

https://api.hubapi.com/crm/v3/objects/:objectType endpoint via a POST.

I was wondering if I could add on an “associations” key to that JSON object to have the association be created at the same time as the custom object?

In my mind it would look something like this:

const JSONtoPOST = {
 'properties': {
 'name': 'example'
 },
 'associations': {
 'contacts': {
 'results': [
 {
 'id': '12345678',
 'type': 'contact_to_custom_object',
 },
 ],
 },
 }
}

Hey, @EBirdsall :waving_hand: Thanks for the question! You are not missing an avail be option. You’ll need to make two calls here. I agree, having an all-in-one option would be fantastic.

Have fun building! — Jaycee

Hi @EBirdsall @Jaycee_Lewis

I stumbled upon your question while providing support on a recent related community post. As per my answer on the related post, it seems this is now possible :grinning_face_with_smiling_eyes:

Just thought I’d flag in case it’s still relevant for you.