Last updated on October 23, 2026
Post a record
Create a record in an end customer's HubSpot, or update the one that already matches.
What post does
post creates a record or updates the one that already matches. For a contact, the match is on email unless you name another property with uniqueBy. Because it is an update when the record exists, a repeated call is safe.
post works on HubSpot only for now.
const result = await appnigma.post({
endCustomerId: "lawfirm-123",
platform: "hubspot",
object: "contact",
record: { email: "jane@firm.com", firstname: "Jane", lastname: "Doe" },
});
console.log(result.created ? "created" : "updated", result.id);result = client.post(
end_customer_id: "lawfirm-123",
platform: "hubspot",
object: "contact",
record: { "email" => "jane@firm.com", "firstname" => "Jane", "lastname" => "Doe" }
)
puts "#{result[:created] ? "created" : "updated"} #{result[:id]}"result = client.post(
end_customer_id="lawfirm-123",
platform="hubspot",
object="contact",
record={"email": "jane@firm.com", "firstname": "Jane", "lastname": "Doe"},
)
print("created" if result["created"] else "updated", result["id"])What you send
Names are shown as in TypeScript. Ruby and Python use the same names in snake case: end_customer_id, unique_by.
Your own id for your customer. 1 to 100 characters of letters, digits, dot, dash or underscore.
Only hubspot for now.
contact, company or deal.
The record's properties, by the platform's own property names. Each value is text, a number, true or false, or null. In Ruby, write the property names as strings. The record must include the uniqueBy property with a non-empty text value.
The property that identifies the record, so a repeat is an update. Optional for a contact, where it is email unless you name another. Required for a company and for a deal: name a property the platform treats as unique.
What you get back
The platform's id for the record.
true when the record was created, false when an existing one was updated.
When it fails
post is tried again only when that is safe: the API could not be reached, it answered with a server error, or it said to slow down. By default it is made up to three times. See Retries and time limits.
The failures you are most likely to see here:
END_CUSTOMER_NOT_FOUND: that end customer has not connected HubSpot yet. See Connecting an end customer.CONNECTION_NEEDS_RECONNECT: the end customer has to approve again. Send them a new connect link.
Every code is on Errors.