Upsert a CRM record into a Zeeg custom object: match on an attribute to update an existing record or create a new one. Ideal for sync and bulk imports.
{
"message": "The given data was invalid.",
"errors": {
"field_name": [
"The field_name field is required."
]
}
}
Creates or updates a record depending on whether a matching record already exists. This is the recommended endpoint for sync pipelines and bulk imports.
Match found → updates the existing record and returns 200 OK.
No match → creates a new record and returns 201 Created.
Path parameter
Parameter
Type
Description
objectSlug
string
The slug of the custom CRM object to assert into (e.g. products, deals).
Query parameter
Parameter
Type
Required
Description
matchingAttribute
string
Yes
The attribute slug used to look up an existing record. The API searches for a record where this attribute’s value exactly equals the value you send in the request body.
Request body
A flat JSON object of attribute slug → value pairs. The value of matchingAttribute must be included in the body — it is both the lookup key and the new value to persist.
The entire body is applied to the record (create or update). Attributes you omit are set to null on create, and left unchanged on update.
How matching works
The API performs exact equality matching on the matchingAttribute value. Only one record is ever matched. If multiple records somehow share the same value (e.g. before you marked the attribute as unique), the first match is used.
PUT /v2/crm/products?matchingAttribute=sku
The above searches for a record where sku = <value from body>.
Choosing the right matching attribute
Pick an attribute that uniquely identifies a record in your source system — an external ID, a product SKU, a deal number, an email address. Mark it as isUnique on the object schema to prevent collisions.
PUT /v2/crm/deals?matchingAttribute=external_idPUT /v2/crm/products?matchingAttribute=skuPUT /v2/crm/subscriptions?matchingAttribute=stripe_subscription_id
Uniqueness constraints
If another attribute on the record is marked isUnique, the assert will fail with 400 if you try to assign a value that already belongs to a different record. You can always re-assert the same unique value back onto the same record without error.
Error: matching value is empty
If the value of matchingAttribute in the request body is null or an empty string, the API returns 400 Bad Request. Always include a non-empty value for the matching attribute.
Example: bulk product sync
Your external catalog has 10,000 products. Run assert in a loop:
PUT /v2/crm/products?matchingAttribute=sku{ "sku": "JACKET-042", "price": 89, "inventory_count": 200, "in_stock": true}
First run: all products are created (201). Subsequent runs: existing products are updated with latest prices (200). No pre-check needed — the API handles it.
Distinguishing create vs. update
Check the HTTP status code in the response:
Status
Meaning
201 Created
No match was found; a new record was created.
200 OK
A matching record was found and updated.
When to use this endpoint
Periodic sync jobs — push updated records from an external system on a schedule.
Webhook-driven updates — handle incoming webhooks that may create or update a record depending on whether it exists.
Bulk initial import — send all records from a legacy system without checking for duplicates first.
Idempotent writes — retry failed requests safely; asserting the same data again results in an update (200) with no duplicate.
Authorizations
Authorization
string
header
required
Path Parameters
objectSlug
string
required
Slug of the custom CRM object.
Query Parameters
matchingAttribute
string
required
Attribute slug to use when searching for an existing record. Uses exact equality matching.
Body
application/json
Flat object of attribute slug → value pairs.
Response
Updated — a record with the matching attribute value was found and updated
success
boolean
Example:
true
status
integer
Example:
200
record
object
A record for a custom CRM object.
Hide child attributes
record.id
string<uuid>
required
Unique identifier for the record.
Example:
"c1d2e3f4-a5b6-7890-cdef-123456789012"
record.objectSlug
string
required
Slug of the CRM object this record belongs to.
Example:
"products"
record.attributes
object
required
Key/value pairs for the custom attributes defined on the object. Keys are attribute slugs.
{
"message": "The given data was invalid.",
"errors": {
"field_name": [
"The field_name field is required."
]
}
}
{"docsConfig":{"theme":"luma","$schema":"https://mintlify.com/docs.json","name":"Zeeg Developer Hub","description":"Zeeg Developer Hub: REST API reference, guides, and webhooks for building scheduling, booking, and AI-agent integrations on the Zeeg platform.","colors":{"primary":"#6C63FF","light":"#8B83FF","dark":"#4F46E5"},"logo":"https://mintcdn.com/zeeg/9voKLLkajreclhp4/images/Zeeglogo(Original).svg?fit=max\u0026auto=format\u0026n=9voKLLkajreclhp4\u0026q=85\u0026s=321632804eda4b3cff044941f9ccadda","favicon":"https://mintcdn.com/zeeg/9voKLLkajreclhp4/images/favicon.ico?fit=max\u0026auto=format\u0026n=9voKLLkajreclhp4\u0026q=85\u0026s=ee885974552f141091cdd615c5c15345","api":{"openapi":"openapi.yaml","params":{"expanded":"all"},"playground":{"display":"interactive","proxy":false},"examples":{"defaults":"required"},"mdx":{"auth":{"method":"bearer"},"server":"https://api.zeeg.me/v2"}},"appearance":{"default":"system"},"background":{"decoration":"gradient","color":{"dark":"#0f1117"}},"navbar":{"links":[{"href":"https://app.zeeg.me","label":"Dashboard"}],"primary":{"type":"button","label":"Get API Key","href":"https://app.zeeg.me/account/settings/api-access"}},"footer":{"socials":{"linkedin":"https://www.linkedin.com/company/zeeg","x":"https://www.twitter.com/zeeg_me","youtube":"https://www.youtube.com/@zeeg_me","instagram":"https://www.instagram.com/zeeg.me"},"links":[{"header":"Product","items":[{"label":"Pricing","href":"https://zeeg.me/en/pricing"},{"label":"Help Center","href":"https://zeeg.me/en/help"},{"label":"System Status","href":"https://status.zeeg.me"}]},{"header":"Legal","items":[{"label":"Terms of Service","href":"https://zeeg.me/en/legal/terms"},{"label":"Privacy Policy","href":"https://zeeg.me/en/legal/privacy"},{"label":"Imprint","href":"https://zeeg.me/en/legal/imprint"}]}]},"search":{"prompt":"Search endpoints, guides, and more..."},"seo":{"metatags":{"og:site_name":"Zeeg Developer Hub","og:type":"website","og:locale":"en_US","og:url":"https://developer.zeeg.me","twitter:card":"summary_large_image","twitter:site":"@zeeg_me","author":"Zeeg","robots":"index, follow","googlebot":"index, follow"},"indexing":"all"},"fonts":{"family":"Inter"},"icons":{"library":"fontawesome"},"styling":{"eyebrows":"section","latex":false},"integrations":{"gtm":{"tagId":"GTM-5XJGGJP"}},"errors":{"404":{"redirect":false,"title":"Page not found","description":"The page you're looking for doesn't exist. Try the [API Reference](/api/workspaces-teams/check-logged-in-user) or [Quickstart](/quickstart)."}},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"interaction":{"drilldown":true},"metadata":{"timestamp":true},"markdown":{"schema":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"zeeg","hasAudioNarration":false,"actualSubdomain":"zeeg","customDomains":["developer.zeeg.me"],"gitSource":{"type":"github","owner":"zeeg","repo":"api-docs","deployBranch":"master","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6b01a0ee0abeee4b6ea228b5","clientVersion":"0.0.4270","searchFilterCounts":[{"language":"default","tag":"API Reference","count":216},{"language":"default","tag":"CRM","count":27},{"language":"default","tag":"Scheduling Pages","count":19},{"language":"default","tag":"Availability Schedule","count":15},{"language":"default","tag":"Guides","count":14},{"language":"default","tag":"Routing Forms","count":12},{"language":"default","tag":"Workspaces \u0026 Teams","count":12},{"language":"default","tag":"Forms","count":8},{"language":"default","tag":"Documentation","count":8},{"language":"default","tag":"Objects","count":7}],"searchSettings":{"maxResults":10}},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"api/crm/assert-a-crm-record","slug":"/api/crm/assert-a-crm-record","pageMetadata":{"title":"Assert a CRM Record (Upsert)","description":"Upsert a CRM record into a Zeeg custom object: match on an attribute to update an existing record or create a new one. Ideal for sync and bulk imports.","openapi":"PUT /crm/{objectSlug}","href":"/api/crm/assert-a-crm-record"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Upsert a CRM record into a Zeeg custom object: match on an attribute to update an existing record or create a new one. Ideal for sync and bulk imports.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,em:`em`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Creates or updates a record depending on whether a matching record already exists. This is the recommended endpoint for sync pipelines and bulk imports.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Match found`}),` → updates the existing record and returns `,_jsx(_components.code,{children:`200 OK`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`No match`}),` → creates a new record and returns `,_jsx(_components.code,{children:`201 Created`}),`.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`path-parameter`,children:`Path parameter`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Parameter`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Description`})]})}),_jsx(_components.tbody,{children:_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`objectSlug`})}),_jsx(_components.td,{children:`string`}),_jsxs(_components.td,{children:[`The slug of the custom CRM object to assert into (e.g. `,_jsx(_components.code,{children:`products`}),`, `,_jsx(_components.code,{children:`deals`}),`).`]})]})})]}),`\n`,_jsx(Heading,{level:`2`,id:`query-parameter`,children:`Query parameter`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Parameter`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Required`}),_jsx(_components.th,{children:`Description`})]})}),_jsx(_components.tbody,{children:_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`matchingAttribute`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Yes`}),_jsx(_components.td,{children:`The attribute slug used to look up an existing record. The API searches for a record where this attribute’s value exactly equals the value you send in the request body.`})]})})]}),`\n`,_jsx(Heading,{level:`2`,id:`request-body`,children:`Request body`}),`\n`,_jsxs(_components.p,{children:[`A flat JSON object of attribute slug → value pairs. The value of `,_jsx(_components.code,{children:`matchingAttribute`}),` must be included in the body — it is both the lookup key and the new value to persist.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"sku\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"DRESS-001\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"price\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`35`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"inventory_count\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`80`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The entire body is applied to the record (create or update). Attributes you omit are set to `,_jsx(_components.code,{children:`null`}),` on create, and left unchanged on update.`]}),`\n`,_jsx(Heading,{level:`2`,id:`how-matching-works`,children:`How matching works`}),`\n`,_jsxs(_components.p,{children:[`The API performs exact equality matching on the `,_jsx(_components.code,{children:`matchingAttribute`}),` value. Only one record is ever matched. If multiple records somehow share the same value (e.g. before you marked the attribute as unique), the first match is used.`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`PUT /v2/crm/products?matchingAttribute=sku`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[`The above searches for a record where `,_jsx(_components.code,{children:`sku = \u003cvalue from body>`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`choosing-the-right-matching-attribute`,children:`Choosing the right matching attribute`}),`\n`,_jsxs(_components.p,{children:[`Pick an attribute that uniquely identifies a record in your source system — an external ID, a product SKU, a deal number, an email address. Mark it as `,_jsx(_components.code,{children:`isUnique`}),` on the object schema to prevent collisions.`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`4`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`PUT /v2/crm/deals?matchingAttribute=external_id`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`PUT /v2/crm/products?matchingAttribute=sku`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`PUT /v2/crm/subscriptions?matchingAttribute=stripe_subscription_id`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`2`,id:`uniqueness-constraints`,children:`Uniqueness constraints`}),`\n`,_jsxs(_components.p,{children:[`If another attribute on the record is marked `,_jsx(_components.code,{children:`isUnique`}),`, the assert will fail with `,_jsx(_components.code,{children:`400`}),` if you try to assign a value that already belongs to a `,_jsx(_components.em,{children:`different`}),` record. You can always re-assert the same unique value back onto the same record without error.`]}),`\n`,_jsx(Heading,{level:`2`,id:`error-matching-value-is-empty`,children:`Error: matching value is empty`}),`\n`,_jsxs(_components.p,{children:[`If the value of `,_jsx(_components.code,{children:`matchingAttribute`}),` in the request body is `,_jsx(_components.code,{children:`null`}),` or an empty string, the API returns `,_jsx(_components.code,{children:`400 Bad Request`}),`. Always include a non-empty value for the matching attribute.`]}),`\n`,_jsx(Heading,{level:`2`,id:`example-bulk-product-sync`,children:`Example: bulk product sync`}),`\n`,_jsx(_components.p,{children:`Your external catalog has 10,000 products. Run assert in a loop:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`PUT /v`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`/crm/products?matchingAttribute=sku`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"sku\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"JACKET-042\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"price\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`89`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"inventory_count\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`200`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"in_stock\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`First run: all products are created (201). Subsequent runs: existing products are updated with latest prices (200). No pre-check needed — the API handles it.`}),`\n`,_jsx(Heading,{level:`2`,id:`distinguishing-create-vs-update`,children:`Distinguishing create vs. update`}),`\n`,_jsx(_components.p,{children:`Check the HTTP status code in the response:`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Status`}),_jsx(_components.th,{children:`Meaning`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`201 Created`})}),_jsx(_components.td,{children:`No match was found; a new record was created.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`200 OK`})}),_jsx(_components.td,{children:`A matching record was found and updated.`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`when-to-use-this-endpoint`,children:`When to use this endpoint`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Periodic sync jobs`}),` — push updated records from an external system on a schedule.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Webhook-driven updates`}),` — handle incoming webhooks that may create or update a record depending on whether it exists.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Bulk initial import`}),` — send all records from a legacy system without checking for duplicates first.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Idempotent writes`}),` — retry failed requests safely; asserting the same data again results in an update (200) with no duplicate.`]}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Assert a CRM Record (Upsert)","description":"Upsert a CRM record into a Zeeg custom object: match on an attribute to update an existing record or create a new one. Ideal for sync and bulk imports.","openapi":"PUT /crm/{objectSlug}","href":"/api/crm/assert-a-crm-record"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Path parameter","slug":"path-parameter","depth":2,"children":[]},{"title":"Query parameter","slug":"query-parameter","depth":2,"children":[]},{"title":"Request body","slug":"request-body","depth":2,"children":[]},{"title":"How matching works","slug":"how-matching-works","depth":2,"children":[]},{"title":"Choosing the right matching attribute","slug":"choosing-the-right-matching-attribute","depth":2,"children":[]},{"title":"Uniqueness constraints","slug":"uniqueness-constraints","depth":2,"children":[]},{"title":"Error: matching value is empty","slug":"error-matching-value-is-empty","depth":2,"children":[]},{"title":"Example: bulk product sync","slug":"example-bulk-product-sync","depth":2,"children":[]},{"title":"Distinguishing create vs. update","slug":"distinguishing-create-vs-update","depth":2,"children":[]},{"title":"When to use this endpoint","slug":"when-to-use-this-endpoint","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"summary":"Assert a CRM record (upsert)","tags":["CRM - Records"],"operationId":"put-crm-record","description":"Upsert a CRM record into a Zeeg custom object: match on an attribute to update an existing record or create a new one. Ideal for sync and bulk imports.","security":["3bb0013a-277a-4126-a575-9b22de0a0409"],"parameters":["e48ec127-3081-485d-8d70-e3ed65cf12d0","f24e7b1f-df86-40c9-9974-d1b7a0607fd9"],"requestBody":"a9d92cce-e737-4a4e-bcfc-4d480a7fde0a","responses":{"200":"b62f9744-26fa-4fc4-b14a-9ea57dd34b52","201":"3e2ea82f-4aab-4e8c-b885-929e3ac57bc0","400":"429ac8c7-18f6-47de-9e6b-c213aeaf2116","401":"77dc2f16-9eca-4d84-a61b-270bf44f4773","403":"e6d857db-4f81-4403-8cf4-436606ed7d66","422":"54344afc-02d9-45a8-add3-c89fbfa98329"},"method":"put","type":"path","servers":["dcff1800-0618-4dfd-b78a-57d290938438"],"path":"/crm/{objectSlug}","baseUrlOptions":["https://api.zeeg.me/v2"],"title":"Assert a CRM record (upsert)","codeSamples":[],"requiredOnlyExamples":true,"requestExampleType":"generated","responseExampleType":"generated","disableProxy":true},"dependencies":{"parameters":{"e48ec127-3081-485d-8d70-e3ed65cf12d0":{"name":"objectSlug","in":"path","required":true,"schema":{"type":"string","isRequired":true,"description":"Slug of the custom CRM object.","uniqueKey":"","typeLabel":"string"},"description":"Slug of the custom CRM object.","example":"products"},"f24e7b1f-df86-40c9-9974-d1b7a0607fd9":{"name":"matchingAttribute","in":"query","required":true,"schema":{"type":"string","isRequired":true,"description":"Attribute slug to use when searching for an existing record. Uses exact equality matching.","uniqueKey":"","typeLabel":"string"},"description":"Attribute slug to use when searching for an existing record. Uses exact equality matching.","example":"sku"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"description":"Flat object of attribute slug → value pairs.","example":{"sku":"DRESS-001","price":29,"inventory_count":150},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"sku":"DRESS-001","price":29,"inventory_count":150}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"b62f9744-26fa-4fc4-b14a-9ea57dd34b52":{"description":"Updated — a record with the matching attribute value was found and updated","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true,"uniqueKey":"success","typeLabel":"boolean"},"status":{"type":"integer","example":200,"uniqueKey":"status","typeLabel":"integer"},"record":{"type":"object","description":"A record for a custom CRM object.","required":["id","objectSlug","attributes","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier for the record.","example":"c1d2e3f4-a5b6-7890-cdef-123456789012","isRequired":true,"uniqueKey":"record.id","typeLabel":"string\u003cuuid>"},"objectSlug":{"type":"string","description":"Slug of the CRM object this record belongs to.","example":"products","isRequired":true,"uniqueKey":"record.objectSlug","typeLabel":"string"},"attributes":{"type":"object","description":"Key/value pairs for the custom attributes defined on the object. Keys are attribute slugs.","additionalProperties":true,"example":{"sku":"DRESS-001","price":29,"inventory_count":150},"isRequired":true,"uniqueKey":"record.attributes","typeLabel":"object"},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp when the record was created.","example":"2025-06-01T10:00:00+00:00","isRequired":true,"uniqueKey":"record.createdAt","typeLabel":"string\u003cdate-time>"},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp when the record was last updated.","example":"2025-06-01T12:00:00+00:00","isRequired":true,"uniqueKey":"record.updatedAt","typeLabel":"string\u003cdate-time>"}},"uniqueKey":"record","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"success":true,"status":200,"record":{"id":"c1d2e3f4-a5b6-7890-cdef-123456789012","objectSlug":"products","attributes":{"sku":"DRESS-001","price":29,"inventory_count":150},"createdAt":"2025-06-01T10:00:00+00:00","updatedAt":"2025-06-01T12:00:00+00:00"}}}},"exampleType":"generated"}},"exampleType":"generated"},"3e2ea82f-4aab-4e8c-b885-929e3ac57bc0":{"description":"Created — no record with the matching attribute value was found; a new one was created","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true,"uniqueKey":"success","typeLabel":"boolean"},"status":{"type":"integer","example":201,"uniqueKey":"status","typeLabel":"integer"},"record":{"type":"object","description":"A record for a custom CRM object.","required":["id","objectSlug","attributes","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier for the record.","example":"c1d2e3f4-a5b6-7890-cdef-123456789012","isRequired":true,"uniqueKey":"record.id","typeLabel":"string\u003cuuid>"},"objectSlug":{"type":"string","description":"Slug of the CRM object this record belongs to.","example":"products","isRequired":true,"uniqueKey":"record.objectSlug","typeLabel":"string"},"attributes":{"type":"object","description":"Key/value pairs for the custom attributes defined on the object. Keys are attribute slugs.","additionalProperties":true,"example":{"sku":"DRESS-001","price":29,"inventory_count":150},"isRequired":true,"uniqueKey":"record.attributes","typeLabel":"object"},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp when the record was created.","example":"2025-06-01T10:00:00+00:00","isRequired":true,"uniqueKey":"record.createdAt","typeLabel":"string\u003cdate-time>"},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp when the record was last updated.","example":"2025-06-01T12:00:00+00:00","isRequired":true,"uniqueKey":"record.updatedAt","typeLabel":"string\u003cdate-time>"}},"uniqueKey":"record","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"success":true,"status":201,"record":{"id":"c1d2e3f4-a5b6-7890-cdef-123456789012","objectSlug":"products","attributes":{"sku":"DRESS-001","price":29,"inventory_count":150},"createdAt":"2025-06-01T10:00:00+00:00","updatedAt":"2025-06-01T12:00:00+00:00"}}}},"exampleType":"generated"}},"exampleType":"generated"},"429ac8c7-18f6-47de-9e6b-c213aeaf2116":{"description":"Bad Request — matching attribute value is empty or attribute validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","uniqueKey":"success","typeLabel":"boolean"},"message":{"type":"string","uniqueKey":"message","typeLabel":"string"},"status":{"type":"integer","uniqueKey":"status","typeLabel":"integer"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"success":true,"message":"\u003cstring>","status":123}}},"exampleType":"generated"}},"exampleType":"generated"},"77dc2f16-9eca-4d84-a61b-270bf44f4773":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Unauthenticated.","uniqueKey":"message","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Unauthenticated":{"title":"Unauthenticated","value":{"message":"Unauthenticated."}}},"exampleType":"examples"}},"exampleType":"examples"},"e6d857db-4f81-4403-8cf4-436606ed7d66":{"description":"Forbidden — missing scope or CRM not enabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string","uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","uniqueKey":"error.message","typeLabel":"string"},"error_id":{"type":"string","uniqueKey":"error.error_id","typeLabel":"string"},"required_scopes":{"type":"array","items":{"type":"string","uniqueKey":"error.required_scopes.items.[INDEX]","typeLabel":"string"},"uniqueKey":"error.required_scopes","typeLabel":"string[]"}},"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Missing scope":{"title":"Missing scope","value":{"error":{"type":"insufficient_scope","message":"Your token is missing the required scope: crm:write.","error_id":"b5237933-07ac-41e5-8a1a-33e7c48c995f","required_scopes":["crm:write"]}}}},"exampleType":"examples"}},"exampleType":"examples"},"54344afc-02d9-45a8-add3-c89fbfa98329":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"The given data was invalid.","uniqueKey":"message","typeLabel":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string","uniqueKey":"errors.additionalProperties.items.[INDEX]","typeLabel":"string"},"uniqueKey":"errors.additionalProperties","typeLabel":"string[]"},"example":{"field_name":["The field_name field is required."]},"uniqueKey":"errors","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"message":"The given data was invalid.","errors":{"field_name":["The field_name field is required."]}}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"3bb0013a-277a-4126-a575-9b22de0a0409":{"bearer":{"type":"http","scheme":"bearer","description":"","scopes":[],"schemeName":"bearer"}}},"servers":{"dcff1800-0618-4dfd-b78a-57d290938438":{"url":"https://api.zeeg.me/v2","description":"Production"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","description":"","scopes":[],"schemeName":"bearer"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearer","name":"Authorization"}],"title":"bearer"}]},"originalFileLocation":"api-reference/openapi.json"},"subdomain":"zeeg","siteName":"Zeeg Developer Hub","title":"Assert a CRM Record (Upsert) - Zeeg Developer Hub","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-13T17:46:01.191Z","gitLastModified":"2026-06-11T13:33:37.000Z","originalFileLocation":"api/crm/assert-a-crm-record.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Upsert a CRM record into a Zeeg custom object: match on an attribute to update an existing record or create a new one. Ideal for sync and bulk imports.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Zeeg Developer Hub\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003cmeta data-mint-head name=\"robots\" content=\"index, follow\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/zeeg/ghjkS0QJHhQPDpab/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/zeeg/ghjkS0QJHhQPDpab/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/zeeg/ghjkS0QJHhQPDpab/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/zeeg/ghjkS0QJHhQPDpab/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/zeeg/ghjkS0QJHhQPDpab/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/zeeg/ghjkS0QJHhQPDpab/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/zeeg/ghjkS0QJHhQPDpab/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/zeeg/ghjkS0QJHhQPDpab/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/zeeg/ghjkS0QJHhQPDpab/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Assert a CRM Record (Upsert) - Zeeg Developer Hub\">\u003cmeta data-mint-head property=\"og:description\" content=\"Upsert a CRM record into a Zeeg custom object: match on an attribute to update an existing record or create a new one. Ideal for sync and bulk imports.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Zeeg Developer Hub\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://developer.zeeg.me/api/crm/assert-a-crm-record\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://zeeg.mintlify.site/_mintlify/api/og/v2?division=Records\u0026amp;title=Assert+a+CRM+Record+%28Upsert%29\u0026amp;description=Upsert+a+CRM+record+into+a+Zeeg+custom+object%3A+match+on+an+attribute+to+update+an+existing+record+or+create+a+new+one.+Ideal+for+sync+and+bulk+imports.\u0026amp;theme=902e11371c50c4af37ea8b4f\u0026amp;signature=b5c6003ea431fe3809d72ac70657571ebdb254c953f5d71f8dbba2863b6cf8b1\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Assert a CRM Record (Upsert) - Zeeg Developer Hub\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Upsert a CRM record into a Zeeg custom object: match on an attribute to update an existing record or create a new one. Ideal for sync and bulk imports.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://zeeg.mintlify.site/_mintlify/api/og/v2?division=Records\u0026amp;title=Assert+a+CRM+Record+%28Upsert%29\u0026amp;description=Upsert+a+CRM+record+into+a+Zeeg+custom+object%3A+match+on+an+attribute+to+update+an+existing+record+or+create+a+new+one.+Ideal+for+sync+and+bulk+imports.\u0026amp;theme=902e11371c50c4af37ea8b4f\u0026amp;signature=b5c6003ea431fe3809d72ac70657571ebdb254c953f5d71f8dbba2863b6cf8b1\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/zeeg/ghjkS0QJHhQPDpab/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Zeeg Developer Hub\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#6C63FF\">\u003cmeta data-mint-head name=\"og:locale\" content=\"en_US\">\u003cmeta data-mint-head name=\"author\" content=\"Zeeg\">\u003cmeta data-mint-head name=\"googlebot\" content=\"index, follow\">\u003clink data-mint-head rel=\"canonical\" href=\"https://developer.zeeg.me/api/crm/assert-a-crm-record\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api/crm/assert-a-crm-record.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://developer.zeeg.me/#organization\",\"name\":\"Zeeg Developer Hub\",\"url\":\"https://developer.zeeg.me\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/zeeg/9voKLLkajreclhp4/images/Zeeglogo(Original).svg?fit=max\u0026auto=format\u0026n=9voKLLkajreclhp4\u0026q=85\u0026s=321632804eda4b3cff044941f9ccadda\"}},{\"@type\":\"WebSite\",\"@id\":\"https://developer.zeeg.me#website\",\"name\":\"Zeeg Developer Hub\",\"url\":\"https://developer.zeeg.me\",\"publisher\":{\"@id\":\"https://developer.zeeg.me/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://developer.zeeg.me/api/crm/assert-a-crm-record#webpage\",\"url\":\"https://developer.zeeg.me/api/crm/assert-a-crm-record\",\"name\":\"Assert a CRM Record (Upsert)\",\"description\":\"Upsert a CRM record into a Zeeg custom object: match on an attribute to update an existing record or create a new one. Ideal for sync and bulk imports.\",\"dateModified\":\"2026-06-11T13:33:37.000Z\",\"isPartOf\":{\"@id\":\"https://developer.zeeg.me#website\"},\"breadcrumb\":{\"@id\":\"https://developer.zeeg.me/api/crm/assert-a-crm-record#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://developer.zeeg.me/api/crm/assert-a-crm-record#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"API Reference\",\"item\":\"https://developer.zeeg.me/api/scheduled-events/list-scheduled-events\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"CRM\",\"item\":\"https://developer.zeeg.me/api/crm/overview\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Records\",\"item\":\"https://developer.zeeg.me/api/crm/list-crm-records\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Assert a CRM Record (Upsert)\",\"item\":\"https://developer.zeeg.me/api/crm/assert-a-crm-record\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://developer.zeeg.me/api/crm/assert-a-crm-record#apireference\",\"headline\":\"Assert a CRM Record (Upsert)\",\"name\":\"Assert a CRM Record (Upsert)\",\"description\":\"Upsert a CRM record into a Zeeg custom object: match on an attribute to update an existing record or create a new one. Ideal for sync and bulk imports.\",\"url\":\"https://developer.zeeg.me/api/crm/assert-a-crm-record\",\"mainEntityOfPage\":{\"@id\":\"https://developer.zeeg.me/api/crm/assert-a-crm-record#webpage\"},\"dateModified\":\"2026-06-11T13:33:37.000Z\",\"publisher\":{\"@id\":\"https://developer.zeeg.me/#organization\"},\"isPartOf\":{\"@id\":\"https://developer.zeeg.me#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Zeeg Developer Hub\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Zeeg Developer Hub\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api/crm/assert-a-crm-record.md","siteName":"Zeeg Developer Hub","nav":{"global":null,"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/introduction"}]},{"tab":"Guides","pages":[{"title":"Guides","href":"/guides/booking-flow"}]},{"tab":"API Reference","groups":[{"group":"API Reference","pages":[{"group":"Scheduled Events","expanded":false,"pages":[{"title":"List Scheduled Events","openapi":"GET /scheduled-events","href":"/api/scheduled-events/list-scheduled-events"},{"title":"Get a Scheduled Event","openapi":"GET /scheduled-events/{uuid}","href":"/api/scheduled-events/get-a-scheduled-event"},{"title":"Get Reschedule Availability","openapi":"GET /scheduled-events/{uuid}/reschedule-availability","href":"/api/scheduled-events/get-reschedule-availability"},{"title":"Reschedule a Scheduled Event","openapi":"PUT /scheduled-events/{uuid}/reschedule","href":"/api/scheduled-events/reschedule-a-scheduled-event"},{"title":"Cancel a Scheduled Event","openapi":"PUT /scheduled-events/{uuid}/cancel","href":"/api/scheduled-events/cancel-a-scheduled-event"},{"title":"Cancel a Scheduled Invitee","openapi":"PUT /scheduled-invitees/{uuid}/cancel","href":"/api/scheduled-events/cancel-a-scheduled-invitee"},{"title":"Handover a Scheduled Event","openapi":"PUT /scheduled-events/{uuid}/handover","href":"/api/scheduled-events/handover-a-scheduled-event"}]},{"group":"Scheduling Pages","expanded":false,"pages":[{"title":"List Scheduling Pages","openapi":"GET /event-types","href":"/api/scheduling-pages/list-scheduling-pages"},{"title":"Get a Scheduling Page","openapi":"GET /event-types/{uuid}","href":"/api/scheduling-pages/get-a-scheduling-page"},{"title":"Create a Scheduling Page","openapi":"POST /event-types","href":"/api/scheduling-pages/create-a-scheduling-page"},{"title":"Update a Scheduling Page","openapi":"PATCH /event-types/{uuid}","href":"/api/scheduling-pages/update-a-scheduling-page"},{"title":"Duplicate a Scheduling Page","openapi":"POST /event-types/{uuid}/duplicate","href":"/api/scheduling-pages/duplicate-a-scheduling-page"},{"title":"Delete a Scheduling Page","openapi":"DELETE /event-types/{uuid}","href":"/api/scheduling-pages/delete-a-scheduling-page"},{"title":"Get Scheduling Page Questions","openapi":"GET /event-types/{uuid}/questions","href":"/api/scheduling-pages/get-scheduling-page-questions"},{"title":"Replace Scheduling Page Questions","openapi":"PUT /event-types/{uuid}/questions","href":"/api/scheduling-pages/replace-scheduling-page-questions"},{"title":"Get Scheduling Page Notifications","openapi":"GET /event-types/{uuid}/notifications","href":"/api/scheduling-pages/get-scheduling-page-notifications"},{"title":"Update Scheduling Page Notifications","openapi":"PATCH /event-types/{uuid}/notifications","href":"/api/scheduling-pages/update-scheduling-page-notifications"},{"title":"Toggle Scheduling Page Status","openapi":"PUT /event-types/{uuid}/status","href":"/api/scheduling-pages/toggle-scheduling-page-status"},{"title":"List Event Page Dates","openapi":"GET /event-types/{uuid}/sessions","href":"/api/scheduling-pages/list-event-page-dates"},{"title":"Add Event Page Dates","openapi":"POST /event-types/{uuid}/sessions","href":"/api/scheduling-pages/add-event-page-dates"},{"title":"Change an Event Page Date","openapi":"PUT /event-types/{uuid}/sessions/{sessionUuid}","href":"/api/scheduling-pages/update-an-event-page-date"},{"title":"Remove an Event Page Date","openapi":"DELETE /event-types/{uuid}/sessions/{sessionUuid}","href":"/api/scheduling-pages/delete-an-event-page-date"},{"title":"Get a Single-Use Scheduling Link","openapi":"GET /event-types/{uuid}/single-use-link","href":"/api/scheduling-pages/get-a-single-use-scheduling-link"},{"title":"Get Available Time Slots","openapi":"GET /availability/{ownerSlug}/event-types/{eventTypeSlug}","href":"/api/scheduling-pages/get-available-time-slots"},{"title":"Get Available Time Slots by ID","openapi":"GET /event-types/{uuid}/availability","href":"/api/scheduling-pages/get-available-time-slots-by-id"},{"title":"Create an Event","openapi":"POST /event","href":"/api/scheduling-pages/create-an-event"}]},{"group":"Availability Schedule","expanded":false,"pages":[{"title":"Get All Availability Schedules","openapi":"GET /schedules","href":"/api/availability/get-all-availability-schedules"},{"title":"Get Default Availability Schedule","openapi":"GET /schedules/default","href":"/api/availability/get-default-availability-schedule"},{"title":"Update Default Availability Schedule","openapi":"PATCH /schedules/default","href":"/api/availability/update-default-availability-schedule"},{"title":"Get Availability Schedule by UUID","openapi":"GET /schedules/{uuid}","href":"/api/availability/get-availability-schedule-by-uuid"},{"title":"Update Availability Schedule by UUID","openapi":"PATCH /schedules/{uuid}","href":"/api/availability/update-availability-schedule-by-uuid"},{"title":"List Time-Off Periods","openapi":"GET /time-off","href":"/api/availability/list-time-off-periods"},{"title":"Create Time-Off Periods","openapi":"POST /time-off","href":"/api/availability/create-time-off-periods"},{"title":"Update Time-Off Period","openapi":"PATCH /time-off/{uuid}","href":"/api/availability/update-time-off-period"},{"title":"Delete Time-Off Period","openapi":"DELETE /time-off/{uuid}","href":"/api/availability/delete-time-off-period"},{"title":"List Holiday Categories","openapi":"GET /holidays/categories","href":"/api/holidays/list-holiday-categories"},{"title":"Preview Holidays for a Category","openapi":"GET /holidays/preview","href":"/api/holidays/preview-holidays"},{"title":"List Holiday Subscriptions","openapi":"GET /holidays/subscriptions","href":"/api/holidays/list-holiday-subscriptions"},{"title":"Create Holiday Subscriptions","openapi":"POST /holidays/subscriptions","href":"/api/holidays/create-holiday-subscriptions"},{"title":"Delete a Holiday Subscription","openapi":"DELETE /holidays/subscriptions/{id}","href":"/api/holidays/delete-holiday-subscription"},{"title":"Toggle Holiday Overrides","openapi":"PUT /holidays/subscriptions/{id}/overrides","href":"/api/holidays/toggle-holiday-overrides"}]},{"group":"Webhooks","expanded":false,"pages":[{"title":"Create Webhook Subscription","openapi":"POST /webhooks","href":"/api/webhooks/create-webhook-subscription"},{"title":"List Webhook Subscriptions","openapi":"GET /webhooks/scope/{scope}","href":"/api/webhooks/list-webhook-subscriptions"},{"title":"Get Webhook Subscription","openapi":"GET /webhooks/{uuid}","href":"/api/webhooks/get-webhook-subscription"},{"title":"Delete Webhook Subscription","openapi":"DELETE /webhooks/{uuid}","href":"/api/webhooks/delete-webhook-subscription"}]},{"group":"Notes","expanded":false,"pages":[{"title":"Create a Note","openapi":"POST /notes","href":"/api/notes/create-a-note"},{"title":"List Notes by Event","openapi":"GET /notes/event/{uuid}","href":"/api/notes/list-notes-by-event"},{"title":"Get a Note","openapi":"GET /notes/{id}","href":"/api/notes/get-a-note"},{"title":"Update a Note","openapi":"PUT /notes/{id}","href":"/api/notes/update-a-note"},{"title":"Delete a Note","openapi":"DELETE /notes/{id}","href":"/api/notes/delete-a-note"}]},{"group":"Workspaces \u0026 Teams","expanded":false,"pages":[{"title":"Check Logged-in User","openapi":"GET /whoami","href":"/api/workspaces-teams/check-logged-in-user"},{"title":"List Users in a Workspace","openapi":"GET /organizations/users","href":"/api/workspaces-teams/list-users-in-a-workspace"},{"title":"List Teams","openapi":"GET /teams","href":"/api/workspaces-teams/list-teams"},{"title":"Create a Team","openapi":"POST /teams","href":"/api/workspaces-teams/create-a-team"},{"title":"Update a Team","openapi":"PATCH /teams/{teamId}","href":"/api/workspaces-teams/update-a-team"},{"title":"Delete a Team","openapi":"DELETE /teams/{teamId}","href":"/api/workspaces-teams/delete-a-team"},{"title":"List Team Members","openapi":"GET /teams/{teamId}/members","href":"/api/workspaces-teams/list-team-members"},{"title":"Add a Team Member","openapi":"POST /teams/{teamId}/members","href":"/api/workspaces-teams/add-a-team-member"},{"title":"Remove a Team Member","openapi":"DELETE /teams/{teamId}/members/{memberId}","href":"/api/workspaces-teams/remove-a-team-member"},{"title":"Invite People to the Workspace","openapi":"POST /organizations/invitations","href":"/api/workspaces-teams/invite-people"},{"title":"List Pending Invitations","openapi":"GET /organizations/invitations","href":"/api/workspaces-teams/list-invitations"},{"title":"Revoke an Invitation","openapi":"DELETE /organizations/invitations/{invitationId}","href":"/api/workspaces-teams/revoke-an-invitation"}]},{"group":"AI Agent","expanded":false,"pages":[{"title":"Create Outbound Call","openapi":"POST /agents/{agentUuid}/outbound-calls","href":"/api/ai-agent/create-outbound-call"},{"title":"List AI Agents","openapi":"GET /agents","href":"/api/ai-agent/list-agents"},{"title":"List Agent Calls","openapi":"GET /agents/{agentUuid}/calls","href":"/api/ai-agent/list-agent-calls"},{"title":"Get Agent Call","openapi":"GET /agent-calls/{callId}","href":"/api/ai-agent/get-agent-call"}]},{"group":"Webhook Payloads","expanded":false,"pages":[{"title":"Event Webhook Payload","href":"/api/webhook-payloads/event-webhook-payload"},{"title":"Routing Form Webhook Payload","href":"/api/webhook-payloads/routing-form-webhook-payload"},{"title":"AI Agent Call Webhook Payload","href":"/api/webhook-payloads/ai-agent-call-webhook-payload"}]},{"group":"CRM","expanded":false,"pages":[{"title":"CRM Overview","href":"/api/crm/overview"},{"group":"Objects","pages":[{"title":"List CRM Objects","openapi":"GET /crm/objects","href":"/api/crm/list-crm-objects"},{"title":"Get a CRM Object","openapi":"GET /crm/objects/{slug}","href":"/api/crm/get-a-crm-object"},{"title":"Create a CRM Object","openapi":"POST /crm/objects","href":"/api/crm/create-a-crm-object"},{"title":"Update a CRM Object","openapi":"PATCH /crm/objects/{slug}","href":"/api/crm/update-a-crm-object"},{"title":"Delete a CRM Object","openapi":"DELETE /crm/objects/{slug}","href":"/api/crm/delete-a-crm-object"},{"title":"Add Attribute to CRM Object","openapi":"POST /crm/objects/{slug}/attributes","href":"/api/crm/add-attribute-to-crm-object"},{"title":"Update CRM Object Attribute","openapi":"PATCH /crm/objects/{slug}/attributes/{attributeKey}","href":"/api/crm/update-crm-object-attribute"}]},{"group":"Companies","pages":[{"title":"List CRM Companies","openapi":"GET /crm/companies","href":"/api/crm/list-crm-companies"},{"title":"Get a CRM Company","openapi":"GET /crm/companies/{id}","href":"/api/crm/get-a-crm-company"},{"title":"Create a CRM Company","openapi":"POST /crm/companies","href":"/api/crm/create-a-crm-company"},{"title":"Assert a CRM Company","openapi":"PUT /crm/companies","href":"/api/crm/assert-a-crm-company"},{"title":"Patch a CRM Company","openapi":"PATCH /crm/companies/{id}","href":"/api/crm/patch-a-crm-company"},{"title":"Delete a CRM Company","openapi":"DELETE /crm/companies/{id}","href":"/api/crm/delete-a-crm-company"}]},{"group":"People","pages":[{"title":"List CRM People","openapi":"GET /crm/people","href":"/api/crm/list-crm-people"},{"title":"Get a CRM Person","openapi":"GET /crm/people/{id}","href":"/api/crm/get-a-crm-person"},{"title":"Create a CRM Person","openapi":"POST /crm/people","href":"/api/crm/create-a-crm-person"},{"title":"Assert a CRM Person","openapi":"PUT /crm/people","href":"/api/crm/update-a-crm-person"},{"title":"Patch a CRM Person","openapi":"PATCH /crm/people/{id}","href":"/api/crm/patch-a-crm-person"},{"title":"Delete a CRM Person","openapi":"DELETE /crm/people/{id}","href":"/api/crm/delete-a-crm-person"}]},{"group":"Records","pages":[{"title":"List CRM Records","openapi":"GET /crm/{objectSlug}","href":"/api/crm/list-crm-records"},{"title":"Get a CRM Record","openapi":"GET /crm/{objectSlug}/{recordId}","href":"/api/crm/get-a-crm-record"},{"title":"Create a CRM Record","description":"Create a new record in a custom Zeeg CRM object by slug, setting typed attribute values that are validated on submit, and get back a generated record UUID","openapi":"POST /crm/{objectSlug}","href":"/api/crm/create-a-crm-record"},{"title":"Assert a CRM Record (Upsert)","openapi":"PUT /crm/{objectSlug}","href":"/api/crm/assert-a-crm-record"},{"title":"Patch a CRM Record","description":"Update a CRM record by ID via the Zeeg CRM API by sending only the attributes to change; every other field on the record stays untouched.","openapi":"PATCH /crm/{objectSlug}/{recordId}","href":"/api/crm/patch-a-crm-record"},{"title":"Delete a CRM Record","openapi":"DELETE /crm/{objectSlug}/{recordId}","href":"/api/crm/delete-a-crm-record"},{"title":"Update a CRM Record Relation","openapi":"PATCH /crm/{objectSlug}/{recordId}/relation","href":"/api/crm/update-relation-crm-record"}]}]},{"group":"Routing Forms","expanded":false,"pages":[{"title":"Routing Forms Overview","href":"/api/routing-forms/overview"},{"group":"Forms","pages":[{"title":"List Routing Forms","openapi":"GET /routing-forms","href":"/api/routing-forms/list-routing-forms"},{"title":"Get a Routing Form","openapi":"GET /routing-forms/{id}","href":"/api/routing-forms/get-a-routing-form"},{"title":"Create a Routing Form","openapi":"POST /routing-forms","href":"/api/routing-forms/create-a-routing-form"},{"title":"Update a Routing Form","openapi":"PATCH /routing-forms/{id}","href":"/api/routing-forms/update-a-routing-form"},{"title":"Duplicate a Routing Form","openapi":"POST /routing-forms/{id}/duplicate","href":"/api/routing-forms/duplicate-a-routing-form"},{"title":"Replace Routing Form Questions","openapi":"PUT /routing-forms/{id}/inputs","href":"/api/routing-forms/replace-routing-form-questions"},{"title":"Replace Routing Form Routes","openapi":"PUT /routing-forms/{id}/routes","href":"/api/routing-forms/replace-routing-form-routes"},{"title":"Delete a Routing Form","openapi":"DELETE /routing-forms/{id}","href":"/api/routing-forms/delete-a-routing-form"}]},{"group":"Submissions","pages":[{"title":"List Routing Form Submissions","openapi":"GET /routing-form-submissions","href":"/api/routing-forms/list-routing-form-submissions"},{"title":"Get a Routing Form Submission","openapi":"GET /routing-form-submissions/{id}","href":"/api/routing-forms/get-a-routing-form-submission"},{"title":"Delete a Routing Form Submission","openapi":"DELETE /routing-form-submissions/{id}","href":"/api/routing-forms/delete-a-routing-form-submission"}]}]}]}]}]},"basePath":"","title":"Assert a CRM Record (Upsert) - Zeeg Developer Hub","deploymentId":"dpl_DyXGnKeCjZyA3sUdfMJ7FjkdBefg","buildId":"dpl_DyXGnKeCjZyA3sUdfMJ7FjkdBefg","dynamics":["c2aa737661","b0f84f53ff","a9bb46feb3","2b790eda92"],"chunks":["OpenApiReferenceProvider-CiUHMMOm.js","snippetPresets-BgfXU7Bw.js","utils-DWvOwgy_.js","style-to-object-BY3JEAdk.js","utils-BN7RXSMJ.js","v4-DIgz8zy6.js","addUniqueKeysToSchema-CFw8bq89.js","conditional-requirements-CFM0id0Q.js","cloneDeep-CAwdfOU2.js","_Uint8Array-BJr8e-ZL.js","isObject-FP1Yky1u.js","Page-CVJ-f_k1.js","CodeSnippet-D_HwgQO_.js","DynamicMarkdown-CQM9Bhbv.js","SectionHeading-DpbrP8nQ.js","icon-BPCgijHy.js","ApiExamples-XX0UgMZK.js","usePlaygroundInputsStore-DXDFSa1V.js","shallow-CdX5aREi.js","isEqual-CoOaxexF.js","CodeSnippets-Cg2wpzWm.js","getApiPlaygroundDisplay-CmCoerhe.js","MethodPill-GQ8DuY0c.js","getPastedJson-Cb5mT31m.js","Check2Icon-a7bUI6e8.js","axios-CsQoIw0U.js","Markdown-CX2QY19L.js","AssistantPageLink-CY3bFglh.js","dist-Dl6_zDnT.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js"]}