Criar, atualizar, consultar e apagar contatos via API externa
Contatos
Identifique o contato com external_id, document ou phone (pelo menos um). Ordem de busca: external_id → document → phone (telefone normalizado BR).Na criação, name e phone são obrigatórios.
Não envie peti9_id numérico (400). Use external_id como texto opaco do seu ERP.
Cada PUT/DELETE externo bem-sucedido gera auditoria (contact_external_api_audit_logs, retenção 90 dias). Admins veem o histórico no modal do contato no CRM.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"ConnectVets Docs","colors":{"primary":"#0F766E","light":"#14B8A6","dark":"#115E59"},"logo":{"light":"https://mintcdn.com/connectvets-603d2e36/M1Ap4vDFMghBbB7Q/img/Logo_Black.png?fit=max\u0026auto=format\u0026n=M1Ap4vDFMghBbB7Q\u0026q=85\u0026s=536ec4068d9ef2ed38ef4ec725da3fda","dark":"https://mintcdn.com/connectvets-603d2e36/M1Ap4vDFMghBbB7Q/img/Logo_White.png?fit=max\u0026auto=format\u0026n=M1Ap4vDFMghBbB7Q\u0026q=85\u0026s=e147681874082c4a40eeaa15cc080ffd"},"favicon":"https://mintcdn.com/connectvets-603d2e36/M1Ap4vDFMghBbB7Q/img/Logo_Black.png?fit=max\u0026auto=format\u0026n=M1Ap4vDFMghBbB7Q\u0026q=85\u0026s=536ec4068d9ef2ed38ef4ec725da3fda","navbar":{"links":[{"href":"https://connectvets.com.br","label":"ConnectVets"}]},"footer":{"socials":{"website":"https://connectvets.com.br","discord":"https://discord.gg/uN4NxUGk"}},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"connectvets-603d2e36","hasAudioNarration":false,"actualSubdomain":"connectvets-603d2e36","customDomains":["docs.connectvets.com.br"],"gitSource":{"type":"github","owner":"connectvets","repo":"platform","deployBranch":"main","contentDirectory":"apps/docs","isPrivate":true,"mountPath":"","label":"","_id":"6b10b7869ffae5051c40146b"},"entitlements":{},"buildId":"6b1180754ca2328e301b5cf2","clientVersion":"0.0.4436","searchFilterCounts":[{"language":"default","tag":"Notes","count":22},{"language":"default","tag":"Flow","count":15},{"language":"default","tag":"API Reference","count":9},{"language":"default","tag":"Começar","count":7},{"language":"default","tag":"Conceitos","count":4},{"language":"default","tag":"Exemplos","count":3},{"language":"default","tag":"Integração","count":3},{"language":"default","tag":"Contatos","count":2},{"language":"default","tag":"Inteligência artificial","count":2},{"language":"default","tag":"Integração com ERP","count":2}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","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":"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":"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":"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":"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":"turbopuffer-dual-write","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":"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":"auth-vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"flow/api-reference/contacts","slug":"/flow/api-reference/contacts","pageMetadata":{"title":"Contatos","description":"Criar, atualizar, consultar e apagar contatos via API externa","href":"/flow/api-reference/contacts"},"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: \"Criar, atualizar, consultar e apagar contatos via API externa\"\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={a:`a`,code:`code`,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,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`1`,id:`contatos`,children:`Contatos`}),`\n`,_jsxs(_components.p,{children:[`Identifique o contato com `,_jsx(_components.strong,{children:_jsx(_components.code,{children:`external_id`})}),`, `,_jsx(_components.strong,{children:_jsx(_components.code,{children:`document`})}),` ou `,_jsx(_components.strong,{children:_jsx(_components.code,{children:`phone`})}),` (pelo menos um). Ordem de busca: `,_jsx(_components.code,{children:`external_id`}),` → `,_jsx(_components.code,{children:`document`}),` → `,_jsx(_components.code,{children:`phone`}),` (telefone normalizado BR).`]}),`\n`,_jsxs(_components.p,{children:[`Na criação, `,_jsx(_components.code,{children:`name`}),` e `,_jsx(_components.code,{children:`phone`}),` são obrigatórios.`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Não envie `,_jsx(_components.code,{children:`peti9_id`}),` numérico (`,_jsx(_components.strong,{children:`400`}),`). Use `,_jsx(_components.code,{children:`external_id`}),` como texto opaco do seu ERP.`]})}),`\n`,_jsxs(_components.p,{children:[`Veja também a `,_jsx(_components.a,{href:`/flow/api-reference/sync-policy`,children:`política de sincronização`}),` (`,_jsx(_components.code,{children:`flow`}),` vs `,_jsx(_components.code,{children:`erp`}),`).`]}),`\n`,_jsxs(Heading,{level:`2`,id:`put-…/contacts-—-upsert`,children:[_jsx(_components.code,{children:`PUT …/contacts`}),` — upsert`]}),`\n`,_jsxs(_components.p,{children:[`Scope: `,_jsx(_components.code,{children:`contacts:write`})]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`13`,language:`http`,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:`http`,children:_jsxs(_components.code,{language:`http`,numberOfLines:`13`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`PUT`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` https://api.connectvets.com.br/flow/v1/external/workspaces/{workspace_id}/contacts`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`Authorization`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` Bearer flow_live_\u003csecret>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`Content-Type`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` application/json`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\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:` \"external_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"erp-cust-8821\"`}),_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:` \"document\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"12345678901\"`}),_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:` \"phone\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"+5511999999999\"`}),_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:` \"name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Maria\"`}),_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:` \"email\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"[email protected]\"`}),_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:` \"address\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Rua Exemplo, 100\"`}),_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:` \"source\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"ERP\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`campos`,children:`Campos`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Campo`}),_jsx(_components.th,{children:`Tipo`}),_jsx(_components.th,{children:`Criar`}),_jsx(_components.th,{children:`Atualizar`}),_jsxs(_components.th,{children:[`Limpar (`,_jsx(_components.code,{children:`null`}),`)`]})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`external_id`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Opcional`}),_jsx(_components.td,{children:`Define/atualiza`}),_jsx(_components.td,{children:`Limpa coluna anulável`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`document`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Opcional`}),_jsx(_components.td,{children:`Define/atualiza`}),_jsx(_components.td,{children:`Limpa`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`phone`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Obrigatório na criação`}),_jsxs(_components.td,{children:[`Normalizado BR; `,_jsx(_components.strong,{children:`409`}),` se duplicado`]}),_jsx(_components.td,{children:`—`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`name`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Obrigatório na criação`}),_jsx(_components.td,{children:`Conforme política flow/erp`}),_jsx(_components.td,{children:`—`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`email`}),`, `,_jsx(_components.code,{children:`address`}),`, `,_jsx(_components.code,{children:`source`}),`, `,_jsx(_components.code,{children:`profile_pic_url`})]}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Opcional`}),_jsx(_components.td,{children:`Conforme política`}),_jsx(_components.td,{children:`Limpa`})]})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`códigos-http`,children:`Códigos HTTP`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Código`}),_jsx(_components.th,{children:`Significado`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`200`}),_jsx(_components.td,{children:`Contato atualizado`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`201`}),_jsx(_components.td,{children:`Contato criado (ou restaurado)`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:`Dados inválidos ou campo legado rejeitado`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`401`}),_jsx(_components.td,{children:`Token ausente ou inválido`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`403`}),_jsx(_components.td,{children:`Sem permissão, workspace ou billing`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`409`}),_jsxs(_components.td,{children:[`Telefone ou `,_jsx(_components.code,{children:`external_id`}),` duplicado`]})]})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`warnings`,children:`Warnings`}),`\n`,_jsxs(_components.p,{children:[`Resposta `,_jsx(_components.strong,{children:`2xx`}),` significa que o contato foi gravado. Se houver `,_jsx(_components.code,{children:`warnings`}),`, nome ou telefone do payload podem não ter sido aplicados (política Flow):`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`name_not_applied_user_edited_in_flow`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`phone_not_applied_user_edited_in_flow`})}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`curl-completo`,children:`cURL completo`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`shellscript`,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:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`8`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` FLOW_BASE_URL`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://api.connectvets.com.br/flow/v1\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` TOKEN`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"flow_live_\u003ccole_aqui>\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` WORKSPACE_ID`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"$(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -sS`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$FLOW_BASE_URL`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/external/me\" `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`-H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$TOKEN`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\" `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`|`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:` jq`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -r`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` .workspace_id)\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -sS`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` PUT`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$FLOW_BASE_URL`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/external/workspaces/`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$WORKSPACE_ID`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/contacts\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$TOKEN`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{\"external_id\":\"erp-1\",\"document\":\"12345678901\",\"name\":\"João\",\"phone\":\"+5511987654321\"}'`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`consultar-e-apagar`,children:`Consultar e apagar`}),`\n`,_jsx(Heading,{level:`3`,id:`get-…/contacts/contact_id`,children:_jsx(_components.code,{children:`GET …/contacts/:contact_id`})}),`\n`,_jsxs(_components.p,{children:[`Scope: `,_jsx(_components.code,{children:`contacts:read`}),` — devolve uma projeção limitada do contato (sem pets, `,_jsx(_components.code,{children:`peti9_id`}),`, etc.).`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`http`,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:`http`,children:_jsxs(_components.code,{language:`http`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`GET`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` https://api.connectvets.com.br/flow/v1/external/workspaces/{workspace_id}/contacts/{contact_id}`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`Authorization`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` Bearer flow_live_\u003csecret>`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`delete-…/contacts/contact_id`,children:_jsx(_components.code,{children:`DELETE …/contacts/:contact_id`})}),`\n`,_jsxs(_components.p,{children:[`Scope: `,_jsx(_components.code,{children:`contacts:delete`}),` — soft-delete; responde `,_jsx(_components.strong,{children:`204`}),` mesmo se o contato já estiver apagado (idempotente).`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`http`,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:`http`,children:_jsxs(_components.code,{language:`http`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`DELETE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` https://api.connectvets.com.br/flow/v1/external/workspaces/{workspace_id}/contacts/{contact_id}`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`Authorization`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` Bearer flow_live_\u003csecret>`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`auditoria`,children:`Auditoria`}),`\n`,_jsxs(_components.p,{children:[`Cada PUT/DELETE externo bem-sucedido gera auditoria (`,_jsx(_components.code,{children:`contact_external_api_audit_logs`}),`, retenção `,_jsx(_components.strong,{children:`90 dias`}),`). Admins veem o histórico no modal do contato no CRM.`]})]})}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":"Contatos","description":"Criar, atualizar, consultar e apagar contatos via API externa","href":"/flow/api-reference/contacts"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Contatos","slug":"contatos","depth":1,"children":[]},{"title":"PUT …/contacts — upsert","slug":"put-…/contacts-—-upsert","depth":2,"children":[{"title":"Campos","slug":"campos","depth":3,"children":[]},{"title":"Códigos HTTP","slug":"códigos-http","depth":3,"children":[]},{"title":"Warnings","slug":"warnings","depth":3,"children":[]},{"title":"cURL completo","slug":"curl-completo","depth":3,"children":[]}]},{"title":"Consultar e apagar","slug":"consultar-e-apagar","depth":2,"children":[{"title":"GET …/contacts/:contact_id","slug":"get-…/contacts/contact_id","depth":3,"children":[]},{"title":"DELETE …/contacts/:contact_id","slug":"delete-…/contacts/contact_id","depth":3,"children":[]}]},{"title":"Auditoria","slug":"auditoria","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"connectvets-603d2e36","siteName":"ConnectVets Docs","title":"Contatos - ConnectVets Docs","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-07-20T22:27:32.108Z","originalFileLocation":"flow/api-reference/contacts.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=\"Criar, atualizar, consultar e apagar contatos via API externa\">\u003cmeta data-mint-head name=\"application-name\" content=\"ConnectVets Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/connectvets-603d2e36/U_whWC7TS_IKM0NR/_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/connectvets-603d2e36/U_whWC7TS_IKM0NR/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/connectvets-603d2e36/U_whWC7TS_IKM0NR/_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/connectvets-603d2e36/U_whWC7TS_IKM0NR/_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/connectvets-603d2e36/U_whWC7TS_IKM0NR/_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/connectvets-603d2e36/U_whWC7TS_IKM0NR/_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/connectvets-603d2e36/U_whWC7TS_IKM0NR/_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/connectvets-603d2e36/U_whWC7TS_IKM0NR/_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/connectvets-603d2e36/U_whWC7TS_IKM0NR/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Contatos - ConnectVets Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Criar, atualizar, consultar e apagar contatos via API externa\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"ConnectVets Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.connectvets.com.br/flow/api-reference/contacts\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://connectvets-603d2e36.mintlify.site/_mintlify/api/og/v2?division=Contatos\u0026amp;title=Contatos\u0026amp;description=Criar%2C+atualizar%2C+consultar+e+apagar+contatos+via+API+externa\u0026amp;theme=3cb23ac488c90225356fa24c\u0026amp;signature=445c682c4339177fc6c62fe585e304443c451d3bf75e0da92eda70d01a2b9bc2\">\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=\"Contatos - ConnectVets Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Criar, atualizar, consultar e apagar contatos via API externa\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://connectvets-603d2e36.mintlify.site/_mintlify/api/og/v2?division=Contatos\u0026amp;title=Contatos\u0026amp;description=Criar%2C+atualizar%2C+consultar+e+apagar+contatos+via+API+externa\u0026amp;theme=3cb23ac488c90225356fa24c\u0026amp;signature=445c682c4339177fc6c62fe585e304443c451d3bf75e0da92eda70d01a2b9bc2\">\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/connectvets-603d2e36/U_whWC7TS_IKM0NR/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"ConnectVets Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0F766E\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.connectvets.com.br/flow/api-reference/contacts\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/flow/api-reference/contacts.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.connectvets.com.br/#organization\",\"name\":\"ConnectVets Docs\",\"url\":\"https://docs.connectvets.com.br\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/connectvets-603d2e36/M1Ap4vDFMghBbB7Q/img/Logo_Black.png?fit=max\u0026auto=format\u0026n=M1Ap4vDFMghBbB7Q\u0026q=85\u0026s=536ec4068d9ef2ed38ef4ec725da3fda\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.connectvets.com.br#website\",\"name\":\"ConnectVets Docs\",\"url\":\"https://docs.connectvets.com.br\",\"publisher\":{\"@id\":\"https://docs.connectvets.com.br/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.connectvets.com.br/flow/api-reference/contacts#webpage\",\"url\":\"https://docs.connectvets.com.br/flow/api-reference/contacts\",\"name\":\"Contatos\",\"description\":\"Criar, atualizar, consultar e apagar contatos via API externa\",\"dateModified\":\"2026-07-20T22:27:32.108Z\",\"isPartOf\":{\"@id\":\"https://docs.connectvets.com.br#website\"},\"breadcrumb\":{\"@id\":\"https://docs.connectvets.com.br/flow/api-reference/contacts#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.connectvets.com.br/flow/api-reference/contacts#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"ConnectVets Docs\",\"item\":\"https://docs.connectvets.com.br\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Contatos\",\"item\":\"https://docs.connectvets.com.br/flow/api-reference/contacts\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.connectvets.com.br/flow/api-reference/contacts#article\",\"headline\":\"Contatos\",\"name\":\"Contatos\",\"description\":\"Criar, atualizar, consultar e apagar contatos via API externa\",\"url\":\"https://docs.connectvets.com.br/flow/api-reference/contacts\",\"mainEntityOfPage\":{\"@id\":\"https://docs.connectvets.com.br/flow/api-reference/contacts#webpage\"},\"dateModified\":\"2026-07-20T22:27:32.108Z\",\"publisher\":{\"@id\":\"https://docs.connectvets.com.br/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.connectvets.com.br#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"ConnectVets Docs\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"ConnectVets Docs\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/flow/api-reference/contacts.md","siteName":"ConnectVets Docs","nav":{"global":null,"tabs":[{"tab":"Início","pages":[{"title":"Início","href":""}]},{"tab":"Notes","pages":[{"title":"Notes","href":"/notes/introduction"}]},{"tab":"Flow","groups":[{"group":"Começar","pages":[{"title":"Flow API","href":"/flow/introduction"},{"title":"Início rápido","href":"/flow/quickstart"},{"title":"Autenticação","href":"/flow/authentication"},{"title":"Permissões (scopes)","href":"/flow/scopes"}]},{"group":"Perfil da empresa","pages":[{"title":"Importar profissionais por planilha","href":"/flow/company-profile/professionals-import"}]},{"group":"Integração com ERP","pages":[{"title":"Integrar seu ERP ao Flow","href":"/flow/integration/erp-getting-started"},{"title":"Checklist de homologação do ERP","href":"/flow/integration/erp-checklist"}]},{"group":"Workspaces","pages":[{"title":"Workspaces","description":"Descobrir o workspace_id a partir da API key","href":"/flow/api-reference/workspaces"}]},{"group":"Contatos","pages":[{"title":"Contatos","href":"/flow/api-reference/contacts"},{"title":"Política de sync","description":"Quem vence quando ERP e equipe editam o mesmo contato","href":"/flow/api-reference/sync-policy"}]},{"group":"Pesquisa de satisfação","pages":[{"title":"Pesquisa de satisfação","href":"/flow/api-reference/satisfaction-surveys"}]},{"group":"Eventos","pages":[{"title":"Webhooks","href":"/flow/webhooks"}]},{"group":"Inteligência artificial","pages":[{"title":"MCP (agentes de IA)","href":"/flow/mcp"},{"title":"Sync da IA e auditoria de conhecimento","href":"/flow/connectia/sync-and-knowledge-audit"}]},{"group":"Referência","pages":[{"title":"Erros e limites","href":"/flow/api-reference/errors"}]}]}]},"basePath":"","title":"Contatos - ConnectVets Docs","deploymentId":"dpl_AYyV3CY85Zsy44WzfDVuMiAS7PWU","buildId":"dpl_AYyV3CY85Zsy44WzfDVuMiAS7PWU","dynamics":[],"chunks":[]}