Deal data model

A deal represents an opportunity with companies and/or contacts

View field support, webhooks, and list parameters for each integration on the Supported Integrations page.

FieldTypeRequiredDescription
idstringNoUnique identifier for this deal object
created_atstring (date-time)NoThe date that this deal object was created (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
updated_atstring (date-time)NoThe last date that this deal object was updated (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
namestringNoThe name of this deal
amountnumberNoThe potential amount that deal could be worth
currencystringNoThe currency for the deal amount (3 letter ISO code; eg. USD)
closed_atstring (date-time)NoThe date that this deal closed (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
closing_atstring (date-time)Noexpected closing date (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
stagesCrmReference[]No
stages[].idstringNo
stages[].namestringNo
stages[].typestringNo
pipelinesCrmReference[]No
pipelines[].idstringNo
pipelines[].namestringNo
pipelines[].typestringNo
sourcestringNoThe source for this deal
probabilitynumberNo
tagsstring[]No
lost_reasonstringNo
won_reasonstringNo
user_idstringNo(reference to HrisEmployee)
contact_idsstring[]No(reference to CrmContact)
company_idsstring[]No(reference to CrmCompany)
descriptionstringNo
metadataCrmMetadata[]No
metadata[].idstringNo
metadata[].slugstringNo
metadata[].valueobjectNo
metadata[].namespacestringNo
metadata[].formatenumNoValues: TEXT, NUMBER, DATE, BOOLEAN, FILE, TEXTAREA, SINGLE_SELECT, MULTIPLE_SELECT, MEASUREMENT, PRICE, YES_NO, CURRENCY, URL
metadata[].extra_dataobjectNo

TypeScript

TypeScript
export type CrmDeal = {
	id?: string; // Unique identifier for this deal object
	created_at?: string-time; // The date that this deal object was created (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
	updated_at?: string-time; // The last date that this deal object was updated (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
	name?: string; // The name of this deal
	amount?: number; // The potential amount that deal could be worth
	currency?: string; // The currency for the deal amount (3 letter ISO code; eg. USD)
	closed_at?: string-time; // The date that this deal closed (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
	closing_at?: string-time; // expected closing date (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
	stages?: [];
	pipelines?: [];
	source?: string; // The source for this deal
	probability?: number;
	tags?: string[];
	lost_reason?: string;
	won_reason?: string;
	user_id?: string; // (reference to HrisEmployee)
	contact_ids?: string[]; // (reference to CrmContact)
	company_ids?: string[]; // (reference to CrmCompany)
	description?: string;
	metadata?: [];
	raw?: any; // The raw data returned by the integration for this deal
} 

Zod

Zod
import { z } from 'zod';

export const ZodCrmDeal = z.object({
	id: z.string().optional().describe("Unique identifier for this deal object"),
	created_at: z.string-time().optional().describe("The date that this deal object was created (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"),
	updated_at: z.string-time().optional().describe("The last date that this deal object was updated (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"),
	name: z.string().optional().describe("The name of this deal"),
	amount: z.number().optional().describe("The potential amount that deal could be worth"),
	currency: z.string().optional().describe("The currency for the deal amount (3 letter ISO code; eg. USD)"),
	closed_at: z.string-time().optional().describe("The date that this deal closed (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"),
	closing_at: z.string-time().optional().describe("expected closing date (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"),
	stages: z.array().optional(),
	pipelines: z.array().optional(),
	source: z.string().optional().describe("The source for this deal"),
	probability: z.number().optional(),
	tags: z.array().optional(),
	lost_reason: z.string().optional(),
	won_reason: z.string().optional(),
	user_id: z.string().optional().describe("(reference to HrisEmployee)"),
	contact_ids: z.array().optional().describe("(reference to CrmContact)"),
	company_ids: z.array().optional().describe("(reference to CrmCompany)"),
	description: z.string().optional(),
	metadata: z.array().optional(),

});

Python

Python
import dataclasses

@dataclasses.dataclass
class CrmDeal:
	"""Unique identifier for this deal object"""
	id: Optional[str]
	"""The date that this deal object was created (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"""
	created_at: Optional[str]
	"""The last date that this deal object was updated (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"""
	updated_at: Optional[str]
	"""The name of this deal"""
	name: Optional[str]
	"""The potential amount that deal could be worth"""
	amount: Optional[int]
	"""The currency for the deal amount (3 letter ISO code; eg. USD)"""
	currency: Optional[str]
	"""The date that this deal closed (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"""
	closed_at: Optional[str]
	"""expected closing date (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"""
	closing_at: Optional[str]
	stages: Optional[PropertyCrmDealStages]
	pipelines: Optional[PropertyCrmDealPipelines]
	"""The source for this deal"""
	source: Optional[str]
	probability: Optional[int]
	tags: Optional[List[List[str]]]
	lost_reason: Optional[str]
	won_reason: Optional[str]
	"""(reference to HrisEmployee)"""
	user_id: Optional[str]
	"""(reference to CrmContact)"""
	contact_ids: Optional[List[List[str]]]
	"""(reference to CrmCompany)"""
	company_ids: Optional[List[List[str]]]
	description: Optional[str]
	metadata: Optional[PropertyCrmDealMetadata]
Are we missing anything? Let us know
Was this page helpful?