Hubspot : how to add a contact into a deal (or inverse)

I’m looking for it and it makes me crazy : I try but I can’t create a deal for a contact !!!
I can create a deal => easy
I can create a contact => easy
How could I create a deal with a contact ? (or maybe create a contact with a deal ?)

Somebody knows it ?

It looks like the current piece doesn’t include a contact dropdown for the deal action. I will add it to the roadmap to update the piece.

great, great, great
thank you @kishanprmr

Use custom code

Inputs :
dealId
contactId
hubspotApiKey

export const code = async (inputs: {
hubspotApiKey: string;
dealId: string;
contactId: string;
}) => {
const url = “https://api.hubapi.com/crm/v3/associations/deal/contact/batch/create”;

const body = {
inputs: [
{
from: { id: inputs.dealId },
to: { id: inputs.contactId },
type: “deal_to_contact” // :white_check_mark: correct format here
}
]
};

const response = await fetch(url, {
method: “POST”,
headers: {
“Content-Type”: “application/json”,
Authorization: Bearer ${inputs.hubspotApiKey},
},
body: JSON.stringify(body),
});

const text = await response.text();
const json = text ? JSON.parse(text) : null;

if (!response.ok) {
throw new Error(HubSpot error ${response.status}: ${JSON.stringify(json || text)});
}

return json || { success: true };
};

Enjoy :wink: