Retrieve contacts filtered by activity (last message within N days), creation time, or update time. Works across all channels (WhatsApp, Instagram, etc.). At least one of days, created_after, or updated_after is required. For incremental sync, poll with updated_after set to the latest updated_at you have stored: the response includes both created_at and updated_at so you can tell new contacts (created_at > your cursor) apart from updated ones. Results are ordered ascending by updated_at (or created_at) when those filters are used, so you can page forward with limit/offset and advance your cursor safely. Optionally filter by custom field values.
GET
/
api
/
public
/
contacts
Get contacts by time filters
curl --request GET \ --url https://api.vambe.me/api/public/contacts \ --header 'x-api-key: <x-api-key>'
Retrieve contacts that had their last message within a specified number of days. This endpoint works across all communication channels (WhatsApp, Instagram, Web Chat, SMS, etc.) providing a unified view of recent contact activity.Perfect for identifying active contacts, tracking engagement, and filtering contacts by recency across your entire customer base.
The optional stage_id parameter filters contacts by their current pipeline stage. Only contacts with an active ticket in the specified stage will be returned.
Parameter
Type
Required
Description
stage_id
string
No
UUID of the pipeline stage to filter by
Stage Filtering: When stage_id is provided, only contacts with an active
ticket (active_ticket_v2) in that specific stage are returned. Contacts
without an active ticket or in a different stage are excluded.
The optional pipeline_id parameter filters contacts by the pipeline of their active ticketβs current stage.
Parameter
Type
Required
Description
pipeline_id
string
No
UUID of the pipeline to filter by
Pipeline Filtering: When pipeline_id is provided, only contacts with an active
ticket whose current stage belongs to that pipeline are returned. You can combine
pipeline_id with stage_id to filter by both.
// Good: Specific use caseconst getWeeklyActive = () => fetch('...?days=7');const getMonthlyActive = () => fetch('...?days=30');// Avoid: Unnecessarily large rangeconst getAll = () => fetch('...?days=365'); // Only if you need a full year
Specify "ticket" or "customer" to filter only by custom fields of that entity type. Only applies when custom_field_key and custom_field_value are provided.
Set to true to include the per-contact utm_events array (marketing attribution). Off by default β the key is omitted entirely unless requested, since it costs an extra lookup. Opt in only if you consume UTM attribution.
Marketing attribution events recorded for this contact, oldest first. Only present when with_utm_events=true; otherwise the key is omitted.
Show child attributes
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Welcome π","colors":{"primary":"#2563EB","light":"#93C5FD","dark":"#1E3A8A"},"logo":"https://mintcdn.com/vambe-f69d5806/_YFOlf0qgMJ8Che1/images/fb1a23e-small-Vambe_Logo_Panda-White4x.png?fit=max\u0026auto=format\u0026n=_YFOlf0qgMJ8Che1\u0026q=85\u0026s=c84b8be7abfa14dd8e1674a247b9cc0b","favicon":"https://mintcdn.com/vambe-f69d5806/_YFOlf0qgMJ8Che1/df9628f-small-2NorthAm_Ops.png?fit=max\u0026auto=format\u0026n=_YFOlf0qgMJ8Che1\u0026q=85\u0026s=5d02cd83d033a951fa6d8bce17f58e33","api":{"playground":{"display":"interactive"},"examples":{"defaults":"required","languages":["curl","javascript","python"]}},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"vambe-f69d5806","hasAudioNarration":false,"actualSubdomain":"vambe-f69d5806","customDomains":["docs.vambe.me"],"gitSource":{"type":"github","owner":"vambeai","repo":"vambeai-backend","deployBranch":"main","contentDirectory":"public/documentation","isPrivate":true,"mountPath":"","label":""},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6af4bc7c534545aef9fef3b1","clientVersion":"0.0.4111","searchFilterCounts":[{"language":"default","tag":"Messaging API","count":44},{"language":"default","tag":"CRM \u0026 Contacts","count":24},{"language":"default","tag":"Custom Ecommerce Apps","count":22},{"language":"default","tag":"Contact Management","count":16},{"language":"default","tag":"Webhooks","count":16},{"language":"default","tag":"Guides","count":12},{"language":"default","tag":"App management API","count":11},{"language":"default","tag":"Instagram Comment Automations","count":9},{"language":"default","tag":"Appointments","count":8},{"language":"default","tag":"Booking API","count":8}]},"assistantConfig":{},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"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":"llms-txt-v2","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":"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}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"img.sidebar-group-icon[src$=\"/icons/notepad-text-dashed.svg\"]{background-color:currentColor!important;object-position:-9999px 0;-webkit-mask:url(\"/images/icons/notepad-text-dashed.svg\") center / contain no-repeat;mask:url(\"/images/icons/notepad-text-dashed.svg\") center / contain no-repeat}"}],"page":{"pagePath":"reference/contact/get-contacts-by-days","slug":"/reference/contact/get-contacts-by-days","pageMetadata":{"openapi":"get /api/public/contacts","title":"Get contacts by time filters","description":"Retrieve contacts filtered by activity (last message within N days), creation time, or update time. Works across all channels (WhatsApp, Instagram, etc.). At least one of days, created_after, or updated_after is required. For incremental sync, poll with updated_after set to the latest updated_at you have stored: the response includes both created_at and updated_at so you can tell new contacts (created_at > your cursor) apart from updated ones. Results are ordered ascending by updated_at (or created_at) when those filters are used, so you can page forward with limit/offset and advance your cursor safely. Optionally filter by custom field values.","href":"/reference/contact/get-contacts-by-days"},"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: \"Retrieve contacts filtered by activity (last message within N days), creation time, or update time. Works across all channels (WhatsApp, Instagram, etc.). At least one of days, created_after, or updated_after is required. For incremental sync, poll with updated_after set to the latest updated_at you have stored: the response includes both created_at and updated_at so you can tell new contacts (created_at > your cursor) apart from updated ones. Results are ordered ascending by updated_at (or created_at) when those filters are used, so you can page forward with limit/offset and advance your cursor safely. Optionally filter by custom field values.\"\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,Note,Table}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`overview`,children:`Overview`}),`\n`,_jsx(_components.p,{children:`Retrieve contacts that had their last message within a specified number of days. This endpoint works across all communication channels (WhatsApp, Instagram, Web Chat, SMS, etc.) providing a unified view of recent contact activity.`}),`\n`,_jsx(_components.p,{children:`Perfect for identifying active contacts, tracking engagement, and filtering contacts by recency across your entire customer base.`}),`\n`,_jsx(Heading,{level:`2`,id:`use-cases`,children:`Use Cases`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Active Contacts Dashboard`}),`: Show contacts who messaged in the last 7, 30, or 90 days`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Engagement Metrics`}),`: Track how many contacts are actively engaging`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Re-engagement Campaigns`}),`: Find contacts who havenβt messaged recently`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Activity Reports`}),`: Generate reports of contact activity over time`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Cross-Channel Analytics`}),`: See all active contacts regardless of channel`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`CRM Sync`}),`: Export recently active contacts to external systems`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`authentication`,children:`Authentication`}),`\n`,_jsx(_components.p,{children:`This endpoint requires authentication using an API key. Include your API key in the request header:`}),`\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:`x-api-key: your_api_key_here`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`2`,id:`query-parameters`,children:`Query Parameters`}),`\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`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`days`})}),_jsx(_components.td,{children:`number`}),_jsx(_components.td,{children:`No`}),_jsx(_components.td,{children:`Filter contacts whose last message was within this many days (1-365)`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`created_after`})}),_jsx(_components.td,{children:`string (ISO 8601)`}),_jsx(_components.td,{children:`No`}),_jsx(_components.td,{children:`Return only contacts created strictly after this timestamp. Use for syncing newly created contacts.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`updated_after`})}),_jsx(_components.td,{children:`string (ISO 8601)`}),_jsx(_components.td,{children:`No`}),_jsx(_components.td,{children:`Return only contacts updated strictly after this timestamp. Use as a sync cursor to pull both new and modified contacts since the last poll.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`limit`})}),_jsx(_components.td,{children:`number`}),_jsx(_components.td,{children:`No`}),_jsx(_components.td,{children:`Maximum number of contacts to return (1-1000)`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`offset`})}),_jsx(_components.td,{children:`number`}),_jsx(_components.td,{children:`No`}),_jsx(_components.td,{children:`Number of contacts to skip, for pagination`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`stage_id`})}),_jsx(_components.td,{children:`string (UUID)`}),_jsx(_components.td,{children:`No`}),_jsx(_components.td,{children:`Stage ID to filter contacts by stage`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`pipeline_id`})}),_jsx(_components.td,{children:`string (UUID)`}),_jsx(_components.td,{children:`No`}),_jsx(_components.td,{children:`Pipeline ID to filter contacts by their active ticketβs pipeline`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`custom_field_key`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`No`}),_jsxs(_components.td,{children:[`The key of the custom field to filter by. Must be provided together with `,_jsx(_components.code,{children:`custom_field_value`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`custom_field_value`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`No`}),_jsxs(_components.td,{children:[`The value to match for the custom field. Must be provided together with `,_jsx(_components.code,{children:`custom_field_key`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`entity_type`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`No`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`\"ticket\"`}),` or `,_jsx(_components.code,{children:`\"customer\"`}),` β scopes the custom field filter to that entity type. Only applies with `,_jsx(_components.code,{children:`custom_field_key`}),`/`,_jsx(_components.code,{children:`custom_field_value`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`with_utm_events`})}),_jsx(_components.td,{children:`boolean`}),_jsx(_components.td,{children:`No`}),_jsxs(_components.td,{children:[`Set to `,_jsx(_components.code,{children:`true`}),` to include the per-contact `,_jsx(_components.code,{children:`utm_events`}),` array (marketing attribution). Off by default β the key is omitted entirely unless requested.`]})]})]})]}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`At least one time filter is required`}),`: you must provide `,_jsx(_components.code,{children:`days`}),`,\n`,_jsx(_components.code,{children:`created_after`}),`, or `,_jsx(_components.code,{children:`updated_after`}),`.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`response-structure`,children:`Response Structure`}),`\n`,_jsx(_components.p,{children:`Returns an array of contact objects:`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`id`})}),_jsx(_components.td,{children:`string (UUID)`}),_jsx(_components.td,{children:`Unique identifier for the contact`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`name`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Contactβs full name`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`phone`})}),_jsx(_components.td,{children:`string | null`}),_jsx(_components.td,{children:`Contactβs phone number`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`email`})}),_jsx(_components.td,{children:`string | null`}),_jsx(_components.td,{children:`Contactβs email address`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`platform`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Communication channel (whatsapp, instagram, etc.)`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`last_message_at`})}),_jsx(_components.td,{children:`string (ISO)`}),_jsx(_components.td,{children:`Timestamp of the last message sent/received`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`chat_status`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Current chat status (UNATTENDED, ATTENDED, etc.)`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`created_at`})}),_jsx(_components.td,{children:`string (ISO)`}),_jsx(_components.td,{children:`Contact creation timestamp`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`client_id`})}),_jsx(_components.td,{children:`string (UUID)`}),_jsx(_components.td,{children:`Your organization ID`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ai_customer_id`})}),_jsx(_components.td,{children:`string (UUID)`}),_jsx(_components.td,{children:`Associated customer profile ID`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`default_stage_id`})}),_jsx(_components.td,{children:`string (UUID)`}),_jsx(_components.td,{children:`Contactβs default pipeline stage`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`blocked`})}),_jsx(_components.td,{children:`boolean`}),_jsx(_components.td,{children:`Whether the contact is blocked`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`is_chat_read`})}),_jsx(_components.td,{children:`boolean`}),_jsx(_components.td,{children:`Whether the chat has been read by an agent`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`active_ticket_v2`})}),_jsx(_components.td,{children:`object | null`}),_jsx(_components.td,{children:`Active ticket information (see below)`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`utm_events`})}),_jsx(_components.td,{children:`array`}),_jsx(_components.td,{children:`Marketing attribution events for this contact (see below)`})]})]})]}),`\n`,_jsxs(Heading,{level:`3`,id:`active-ticket-object-active_ticket_v2`,children:[`Active Ticket Object (`,_jsx(_components.code,{children:`active_ticket_v2`}),`)`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`id`})}),_jsx(_components.td,{children:`string (UUID)`}),_jsx(_components.td,{children:`Unique identifier for the ticket`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`current_stage_id`})}),_jsx(_components.td,{children:`string | null`}),_jsx(_components.td,{children:`Current pipeline stage ID for the ticket`})]})]})]}),`\n`,_jsxs(Heading,{level:`3`,id:`utm-event-object-utm_events`,children:[`UTM Event Object (`,_jsx(_components.code,{children:`utm_events[]`}),`)`]}),`\n`,_jsx(_components.p,{children:`Marketing attribution events recorded for the contact, ordered oldest first. Empty array when the contact has no attribution events.`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`id`})}),_jsx(_components.td,{children:`string (UUID)`}),_jsx(_components.td,{children:`Unique identifier for the UTM event`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`created_at`})}),_jsx(_components.td,{children:`string (ISO) | null`}),_jsx(_components.td,{children:`When the attribution event was recorded`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`customer_id`})}),_jsx(_components.td,{children:`string (UUID) | null`}),_jsx(_components.td,{children:`Associated customer profile ID`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`integration_type`})}),_jsx(_components.td,{children:`string | null`}),_jsx(_components.td,{children:`Ad platform (facebook, google, tiktok, etc.)`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ad_id`})}),_jsx(_components.td,{children:`string | null`}),_jsx(_components.td,{children:`Ad identifier`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`referrer_url`})}),_jsx(_components.td,{children:`string | null`}),_jsx(_components.td,{children:`Landing / referrer URL that captured the contact`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`search_keyword`})}),_jsx(_components.td,{children:`string | null`}),_jsx(_components.td,{children:`Search keyword that triggered the ad`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`example-request`,children:`Example Request`}),`\n`,_jsx(Heading,{level:`3`,id:`basic-request-all-contacts`,children:`Basic Request (All Contacts)`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,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:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` --request GET \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://api.vambe.me/api/public/contacts?days=30'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` --header `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'x-api-key: your_api_key_here'`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`request-with-stage-filter`,children:`Request with Stage Filter`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,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:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` --request GET \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://api.vambe.me/api/public/contacts?days=30\u0026stage_id=123e4567-e89b-12d3-a456-426614174000'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` --header `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'x-api-key: your_api_key_here'`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`request-with-pipeline-filter`,children:`Request with Pipeline Filter`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,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:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` --request GET \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://api.vambe.me/api/public/contacts?days=30\u0026pipeline_id=123e4567-e89b-12d3-a456-426614174000'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` --header `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'x-api-key: your_api_key_here'`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`request-with-utm-events`,children:`Request with UTM Events`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,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:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` --request GET \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://api.vambe.me/api/public/contacts?days=30\u0026with_utm_events=true'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` --header `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'x-api-key: your_api_key_here'`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`example-response`,children:`Example Response`}),`\n`,_jsxs(_components.p,{children:[`The response below assumes `,_jsx(_components.code,{children:`with_utm_events=true`}),` was passed β without it, the `,_jsx(_components.code,{children:`utm_events`}),` key is omitted from every contact entirely.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`52`,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:`52`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`})}),`\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:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"df980fc8-b6db-4820-bf22-2969482d106d\"`}),_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 Rodriguez\"`}),_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:`\"+56912345678\"`}),_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:`\"maria.rodriguez@example.com\"`}),_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:` \"platform\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"whatsapp\"`}),_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:` \"last_message_at\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2024-09-30T14:25:33.000Z\"`}),_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:` \"chat_status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"ATTENDED\"`}),_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:` \"created_at\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2024-01-15T10:00:00.000Z\"`}),_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:` \"client_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"550e8400-e29b-41d4-a716-446655440000\"`}),_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:` \"ai_customer_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"660e8400-e29b-41d4-a716-446655440001\"`}),_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:` \"default_stage_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"770e8400-e29b-41d4-a716-446655440002\"`}),_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:` \"blocked\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`false`}),_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:` \"is_chat_read\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`}),_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:` \"active_ticket_v2\"`}),_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:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"bb0e8400-e29b-41d4-a716-446655440006\"`}),_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:` \"current_stage_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"cc0e8400-e29b-41d4-a716-446655440007\"`})]}),`\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:` \"utm_events\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\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:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"ee0e8400-e29b-41d4-a716-446655440009\"`}),_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:` \"created_at\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2024-01-14T22:05:11.000Z\"`}),_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:` \"customer_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"660e8400-e29b-41d4-a716-446655440001\"`}),_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:` \"integration_type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"facebook\"`}),_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:` \"ad_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"23854715623450123\"`}),_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:` \"referrer_url\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://example.com/landing?utm_campaign=spring\"`}),_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:` \"search_keyword\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\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:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"880e8400-e29b-41d4-a716-446655440003\"`}),_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:`\"Carlos Silva\"`}),_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:`\"+56987654321\"`}),_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:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`}),_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:` \"platform\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"instagram\"`}),_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:` \"last_message_at\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2024-09-29T18:10:22.000Z\"`}),_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:` \"chat_status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"UNATTENDED\"`}),_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:` \"created_at\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2024-03-20T09:30:00.000Z\"`}),_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:` \"client_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"550e8400-e29b-41d4-a716-446655440000\"`}),_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:` \"ai_customer_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"990e8400-e29b-41d4-a716-446655440004\"`}),_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:` \"default_stage_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"aa0e8400-e29b-41d4-a716-446655440005\"`}),_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:` \"blocked\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`false`}),_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:` \"is_chat_read\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`false`}),_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:` \"active_ticket_v2\"`}),_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:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"dd0e8400-e29b-41d4-a716-446655440008\"`}),_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:` \"current_stage_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`})]}),`\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:` \"utm_events\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: []`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`common-use-cases`,children:`Common Use Cases`}),`\n`,_jsx(Heading,{level:`3`,id:`1-get-contacts-from-last-7-days`,children:`1. Get Contacts from Last 7 Days`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`15`,language:`javascript`,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:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`15`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` getRecentContacts = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`async`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` () => {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` response = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` fetch(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://api.vambe.me/api/public/contacts?days=7'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` headers: {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'x-api-key'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'your_api_key_here'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` );`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` contacts = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` response.json();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` console.log(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`Found ${contacts.length} contacts active in the last 7 days`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` contacts;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`};`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`2-track-engagement-by-channel`,children:`2. Track Engagement by Channel`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`28`,language:`javascript`,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:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`28`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` getContactsByChannel = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`async`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (days) => {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` response = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` fetch(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" `https://api.vambe.me/api/public/contacts?days=${days}`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` headers: {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'x-api-key'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'your_api_key_here'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` );`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` contacts = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` response.json();`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Group by platform`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` byChannel = contacts.reduce((acc, contact) => {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` channel = contact.platform || `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'unknown'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (!acc[channel]) acc[channel] = [];`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` acc[channel].push(contact);`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` acc;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }, {});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` console.log(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Contacts by channel:'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, {`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` whatsapp: byChannel.whatsapp?.length || 0,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` instagram: byChannel.instagram?.length || 0,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` webchat: byChannel.webchat?.length || 0,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` byChannel;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`};`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`3-find-unattended-contacts`,children:`3. Find Unattended Contacts`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`21`,language:`javascript`,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:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`21`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` getUnattendedContacts = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`async`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (days) => {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` response = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` fetch(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" `https://api.vambe.me/api/public/contacts?days=${days}`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` headers: {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'x-api-key'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'your_api_key_here'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` );`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` contacts = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` response.json();`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Filter unattended`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` unattended = contacts.filter(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (c) => c.chat_status === `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'UNATTENDED'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` \u0026\u0026 !c.is_chat_read,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` );`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` console.log(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`${unattended.length} unattended contacts need attention`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` unattended;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`};`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`4-re-engagement-campaign-data`,children:`4. Re-engagement Campaign Data`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`24`,language:`javascript`,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:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`24`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` getContactsForReengagement = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`async`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` () => {`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Get contacts from 30-60 days ago (active before but not recently)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` recent30 = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` fetch(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://api.vambe.me/api/public/contacts?days=30'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\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:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` headers: { `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'x-api-key'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'your_api_key_here'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ).then((r) => r.json());`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` recent60 = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` fetch(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://api.vambe.me/api/public/contacts?days=60'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\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:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` headers: { `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'x-api-key'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'your_api_key_here'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ).then((r) => r.json());`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Contacts in 60 days but not in 30 days`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` recent30Ids = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`new`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Set(recent30.map((c) => c.id));`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` reengageTargets = recent60.filter((c) => !recent30Ids.has(c.id));`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` console.log(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`${reengageTargets.length} contacts for re-engagement campaign`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` reengageTargets;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`};`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`5-export-to-external-crm`,children:`5. Export to External CRM`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`34`,language:`javascript`,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:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`34`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` exportRecentContactsToCRM = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`async`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (days) => {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` response = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` fetch(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" `https://api.vambe.me/api/public/contacts?days=${days}`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` headers: {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'x-api-key'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'your_api_key_here'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` );`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` contacts = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` response.json();`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Export to external CRM`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` for`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` contact `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`of`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` contacts) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` fetch(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'https://external-crm.com/api/contacts/sync'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` method: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'POST'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` headers: {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Content-Type'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'application/json'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Authorization: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Bearer crm_token'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` body: JSON.stringify({`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` external_id: contact.id,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` name: contact.name,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` phone: contact.phone,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` email: contact.email,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` platform: contact.platform,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` last_activity: contact.last_message_at,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` status: contact.chat_status,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }),`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` console.log(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`Exported ${contacts.length} contacts to CRM`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`};`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`6-filter-contacts-by-pipeline-stage`,children:`6. Filter Contacts by Pipeline Stage`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`19`,language:`javascript`,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:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`19`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` getContactsByStage = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`async`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (days, stageId) => {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` response = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` fetch(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" `https://api.vambe.me/api/public/contacts?days=${days}\u0026stage_id=${stageId}`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` headers: {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'x-api-key'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'your_api_key_here'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` );`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` contacts = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` response.json();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` console.log(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`Found ${contacts.length} contacts in stage ${stageId}`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` contacts;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`};`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Example: Get all leads from the last 30 days`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` leadStageId = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'123e4567-e89b-12d3-a456-426614174000'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` leads = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` getContactsByStage(30, leadStageId);`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`7-activity-dashboard`,children:`7. Activity Dashboard`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`36`,language:`javascript`,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:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`36`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` buildActivityDashboard = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`async`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` () => {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` periods = [`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { label: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Today'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, days: 1 },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { label: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Last 7 days'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, days: 7 },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { label: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Last 30 days'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, days: 30 },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { label: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Last 90 days'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, days: 90 },`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ];`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` dashboard = {};`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` for`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` period `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`of`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` periods) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` response = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` fetch(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" `https://api.vambe.me/api/public/contacts?days=${period.days}`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` headers: {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'x-api-key'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'your_api_key_here'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` );`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` contacts = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` response.json();`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` dashboard[period.label] = {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` total: contacts.length,`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` unattended: contacts.filter((c) => c.chat_status === `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'UNATTENDED'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`).length,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` attended: contacts.filter((c) => c.chat_status === `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'ATTENDED'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`).length,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` byChannel: contacts.reduce((acc, c) => {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` acc[c.platform] = (acc[c.platform] || 0) + 1;`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` acc;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }, {}),`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` };`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` console.log(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Activity Dashboard:'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, dashboard);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` dashboard;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`};`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`query-parameters-details`,children:`Query Parameters Details`}),`\n`,_jsx(Heading,{level:`3`,id:`days-parameter`,children:`Days Parameter`}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`days`}),` parameter filters contacts where `,_jsx(_components.code,{children:`last_message_at`}),` is within the specified number of days from now:`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Days Value`}),_jsx(_components.th,{children:`Description`}),_jsx(_components.th,{children:`Use Case`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`1`})}),_jsx(_components.td,{children:`Last 24 hours`}),_jsx(_components.td,{children:`Todayβs activity`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`7`})}),_jsx(_components.td,{children:`Last week`}),_jsx(_components.td,{children:`Weekly engagement report`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`30`})}),_jsx(_components.td,{children:`Last month`}),_jsx(_components.td,{children:`Monthly active contacts`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`90`})}),_jsx(_components.td,{children:`Last quarter`}),_jsx(_components.td,{children:`Quarterly analysis`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`180`})}),_jsx(_components.td,{children:`Last 6 months`}),_jsx(_components.td,{children:`Semi-annual review`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`365`})}),_jsx(_components.td,{children:`Last year (maximum allowed)`}),_jsx(_components.td,{children:`Annual customer base analysis`})]})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`stage-id-parameter`,children:`Stage ID Parameter`}),`\n`,_jsxs(_components.p,{children:[`The optional `,_jsx(_components.code,{children:`stage_id`}),` parameter filters contacts by their current pipeline stage. Only contacts with an active ticket in the specified stage will be returned.`]}),`\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:`stage_id`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`No`}),_jsx(_components.td,{children:`UUID of the pipeline stage to filter by`})]})})]}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Stage Filtering`}),`: When `,_jsx(_components.code,{children:`stage_id`}),` is provided, only contacts with an active\nticket (`,_jsx(_components.code,{children:`active_ticket_v2`}),`) in that specific stage are returned. Contacts\nwithout an active ticket or in a different stage are excluded.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`pipeline-id-parameter`,children:`Pipeline ID Parameter`}),`\n`,_jsxs(_components.p,{children:[`The optional `,_jsx(_components.code,{children:`pipeline_id`}),` parameter filters contacts by the pipeline of their active ticketβs current stage.`]}),`\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:`pipeline_id`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`No`}),_jsx(_components.td,{children:`UUID of the pipeline to filter by`})]})})]}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Pipeline Filtering`}),`: When `,_jsx(_components.code,{children:`pipeline_id`}),` is provided, only contacts with an active\nticket whose current stage belongs to that pipeline are returned. You can combine\n`,_jsx(_components.code,{children:`pipeline_id`}),` with `,_jsx(_components.code,{children:`stage_id`}),` to filter by both.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`response-ordering`,children:`Response Ordering`}),`\n`,_jsxs(_components.p,{children:[`Contacts are returned ordered by `,_jsx(_components.code,{children:`last_message_at`}),` in `,_jsx(_components.strong,{children:`descending order`}),` (most recent first).`]}),`\n`,_jsx(Heading,{level:`2`,id:`cross-channel-support`,children:`Cross-Channel Support`}),`\n`,_jsxs(_components.p,{children:[`This endpoint returns contacts from `,_jsx(_components.strong,{children:`all channels`}),`:`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Platform`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`whatsapp`})}),_jsx(_components.td,{children:`WhatsApp Business API`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`web-whatsapp`})}),_jsx(_components.td,{children:`WhatsApp Web (QR)`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`instagram`})}),_jsx(_components.td,{children:`Instagram Direct Messages`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`webchat`})}),_jsx(_components.td,{children:`Web chat widget`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`sms`})}),_jsx(_components.td,{children:`SMS messages`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`messenger`})}),_jsx(_components.td,{children:`Facebook Messenger`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`tiktok`})}),_jsx(_components.td,{children:`TikTok Direct Messages`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`voice`})}),_jsx(_components.td,{children:`Voice calls`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`playground`})}),_jsx(_components.td,{children:`Test/playground channel`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`error-responses`,children:`Error Responses`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Status Code`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:`Bad Request - Invalid days parameter (must be 1-365)`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`401`}),_jsx(_components.td,{children:`Unauthorized - Invalid or missing API key`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`500`}),_jsx(_components.td,{children:`Internal Server Error - Something went wrong`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`important-notes`,children:`Important Notes`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Days Range`}),`: Must be between 1 and 365 days`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Null Values`}),`: Some fields like `,_jsx(_components.code,{children:`email`}),` or `,_jsx(_components.code,{children:`phone`}),` may be null`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Performance`}),`: Response time increases with larger `,_jsx(_components.code,{children:`days`}),` values`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`All Channels`}),`: Unlike the deprecated WhatsApp-specific endpoint, this returns contacts from ALL channels`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Contact Count`}),`: No pagination - returns all contacts matching the criteria`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Stage Filtering`}),`: When `,_jsx(_components.code,{children:`stage_id`}),` is provided, only contacts with an active ticket in that stage are returned`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Pipeline Filtering`}),`: When `,_jsx(_components.code,{children:`pipeline_id`}),` is provided, only contacts with an active ticket in a stage belonging to that pipeline are returned`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Combined Filters`}),`: `,_jsx(_components.code,{children:`days`}),`, `,_jsx(_components.code,{children:`stage_id`}),`, and `,_jsx(_components.code,{children:`pipeline_id`}),` can be used together to narrow down results`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Active Ticket`}),`: The `,_jsx(_components.code,{children:`active_ticket_v2`}),` object contains the current ticketβs `,_jsx(_components.code,{children:`id`}),` and `,_jsx(_components.code,{children:`current_stage_id`})]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`performance-considerations`,children:`Performance Considerations`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Cache Results`}),`: Consider caching responses for frequently used `,_jsx(_components.code,{children:`days`}),` values`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Large Datasets`}),`: For `,_jsx(_components.code,{children:`days`}),` values > 90, expect larger response sizes`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Rate Limiting`}),`: Be mindful of rate limits when making frequent requests`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`comparison-with-deprecated-endpoint`,children:`Comparison with Deprecated Endpoint`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Feature`}),_jsx(_components.th,{children:`New Endpoint (This)`}),_jsx(_components.th,{children:`Deprecated Endpoint`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Path`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`/api/public/contacts`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`/api/public/whatsapp/contact/contacts`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Channels`})}),_jsx(_components.td,{children:`All channels`}),_jsx(_components.td,{children:`WhatsApp only`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Response`})}),_jsx(_components.td,{children:`AI Contact objects`}),_jsx(_components.td,{children:`WhatsApp Contact objects`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Ordering`})}),_jsx(_components.td,{children:`By last_message_at DESC`}),_jsx(_components.td,{children:`Not specified`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Future Support`})}),_jsx(_components.td,{children:`β Active development`}),_jsx(_components.td,{children:`β Deprecated`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`related-endpoints`,children:`Related Endpoints`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsxs(_components.a,{href:`/reference/contact/get-info-of-an-ai-contact`,children:[`GET /api/public/contact/`,`/info`]}),` - Get detailed contact info`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/reference/customer/upsert-customer-info`,children:`POST /api/public/customer/upsert/info`}),` - Create or update contact`]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.a,{href:`/reference/contact/update-contact-metadata`,children:[`POST /api/public/contact/`,`/update-metadata`]}),` - Update contact metadata`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`best-practices`,children:`Best Practices`}),`\n`,_jsx(Heading,{level:`3`,id:`1-choose-appropriate-days-range`,children:`1. Choose Appropriate Days Range`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`javascript`,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:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`6`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Good: Specific use case`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` getWeeklyActive = () => fetch(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'...?days=7'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` getMonthlyActive = () => fetch(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'...?days=30'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Avoid: Unnecessarily large range`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` getAll = () => fetch(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'...?days=365'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`); `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Only if you need a full year`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`2-handle-empty-results`,children:`2. Handle Empty Results`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`javascript`,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:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` contacts = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` fetch(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'...?days=7'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`).then((r) => r.json());`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (contacts.length === 0) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` console.log(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'No contacts in the last 7 days'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`} `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`else`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` console.log(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`Found ${contacts.length} active contacts`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`3-filter-on-client-side`,children:`3. Filter on Client Side`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`14`,language:`javascript`,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:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`14`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` contacts = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` fetch(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'...?days=30'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`).then((r) => r.json());`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Filter by platform`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` whatsappContacts = contacts.filter((c) => c.platform === `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'whatsapp'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Filter by status`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` unread = contacts.filter((c) => !c.is_chat_read);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Filter by date range`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` thisWeek = contacts.filter((c) => {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` msgDate = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`new`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Date(c.last_message_at);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` sevenDaysAgo = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`new`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Date(Date.now() - 7 * 24 * 60 * 60 * 1000);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` msgDate > sevenDaysAgo;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\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":{"openapi":"get /api/public/contacts","title":"Get contacts by time filters","description":"Retrieve contacts filtered by activity (last message within N days), creation time, or update time. Works across all channels (WhatsApp, Instagram, etc.). At least one of days, created_after, or updated_after is required. For incremental sync, poll with updated_after set to the latest updated_at you have stored: the response includes both created_at and updated_at so you can tell new contacts (created_at > your cursor) apart from updated ones. Results are ordered ascending by updated_at (or created_at) when those filters are used, so you can page forward with limit/offset and advance your cursor safely. Optionally filter by custom field values.","href":"/reference/contact/get-contacts-by-days"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Overview","slug":"overview","depth":2,"children":[]},{"title":"Use Cases","slug":"use-cases","depth":2,"children":[]},{"title":"Authentication","slug":"authentication","depth":2,"children":[]},{"title":"Query Parameters","slug":"query-parameters","depth":2,"children":[]},{"title":"Response Structure","slug":"response-structure","depth":2,"children":[{"title":"Active Ticket Object (active_ticket_v2)","slug":"active-ticket-object-active_ticket_v2","depth":3,"children":[]},{"title":"UTM Event Object (utm_events[])","slug":"utm-event-object-utm_events","depth":3,"children":[]}]},{"title":"Example Request","slug":"example-request","depth":2,"children":[{"title":"Basic Request (All Contacts)","slug":"basic-request-all-contacts","depth":3,"children":[]},{"title":"Request with Stage Filter","slug":"request-with-stage-filter","depth":3,"children":[]},{"title":"Request with Pipeline Filter","slug":"request-with-pipeline-filter","depth":3,"children":[]},{"title":"Request with UTM Events","slug":"request-with-utm-events","depth":3,"children":[]}]},{"title":"Example Response","slug":"example-response","depth":2,"children":[]},{"title":"Common Use Cases","slug":"common-use-cases","depth":2,"children":[{"title":"1. Get Contacts from Last 7 Days","slug":"1-get-contacts-from-last-7-days","depth":3,"children":[]},{"title":"2. Track Engagement by Channel","slug":"2-track-engagement-by-channel","depth":3,"children":[]},{"title":"3. Find Unattended Contacts","slug":"3-find-unattended-contacts","depth":3,"children":[]},{"title":"4. Re-engagement Campaign Data","slug":"4-re-engagement-campaign-data","depth":3,"children":[]},{"title":"5. Export to External CRM","slug":"5-export-to-external-crm","depth":3,"children":[]},{"title":"6. Filter Contacts by Pipeline Stage","slug":"6-filter-contacts-by-pipeline-stage","depth":3,"children":[]},{"title":"7. Activity Dashboard","slug":"7-activity-dashboard","depth":3,"children":[]}]},{"title":"Query Parameters Details","slug":"query-parameters-details","depth":2,"children":[{"title":"Days Parameter","slug":"days-parameter","depth":3,"children":[]},{"title":"Stage ID Parameter","slug":"stage-id-parameter","depth":3,"children":[]},{"title":"Pipeline ID Parameter","slug":"pipeline-id-parameter","depth":3,"children":[]}]},{"title":"Response Ordering","slug":"response-ordering","depth":2,"children":[]},{"title":"Cross-Channel Support","slug":"cross-channel-support","depth":2,"children":[]},{"title":"Error Responses","slug":"error-responses","depth":2,"children":[]},{"title":"Important Notes","slug":"important-notes","depth":2,"children":[]},{"title":"Performance Considerations","slug":"performance-considerations","depth":2,"children":[]},{"title":"Comparison with Deprecated Endpoint","slug":"comparison-with-deprecated-endpoint","depth":2,"children":[]},{"title":"Related Endpoints","slug":"related-endpoints","depth":2,"children":[]},{"title":"Best Practices","slug":"best-practices","depth":2,"children":[{"title":"1. Choose Appropriate Days Range","slug":"1-choose-appropriate-days-range","depth":3,"children":[]},{"title":"2. Handle Empty Results","slug":"2-handle-empty-results","depth":3,"children":[]},{"title":"3. Filter on Client Side","slug":"3-filter-on-client-side","depth":3,"children":[]}]}],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"operationId":"PublicContactsController_getContacts","summary":"Get contacts by time filters","description":"Retrieve contacts filtered by activity (last message within N days), creation time, or update time. Works across all channels (WhatsApp, Instagram, etc.). At least one of days, created_after, or updated_after is required. For incremental sync, poll with updated_after set to the latest updated_at you have stored: the response includes both created_at and updated_at so you can tell new contacts (created_at > your cursor) apart from updated ones. Results are ordered ascending by updated_at (or created_at) when those filters are used, so you can page forward with limit/offset and advance your cursor safely. Optionally filter by custom field values.","parameters":["ac0e47eb-d333-49c3-a028-cf84a55cea91","c275b86b-570d-49e9-8356-9c4954eeb07e","850c0037-0c2c-46d3-8cca-4a486e4cec52","a3996a18-e592-4da9-a2b9-bd21e0d30a9e","ec6cc59e-d814-4f20-92b3-b709f56441a0","05528354-9c25-4525-841a-38bcbac297ee","4c67c08f-e561-4025-a945-214b61850c99","f5d4f70f-6c8d-446f-a72e-fbb2fd3ccd4b","365a94e3-1b49-4e02-84b0-b7f697f04cfc","49034c6c-7caf-4384-96fe-3e6d1b37487b","abf2a0e5-38d5-4e33-a0c2-57abf103134b","e7818e11-b686-416c-b3a3-6f630089f659"],"responses":{"200":"e3b9855a-bd1a-45b7-b91d-b8749e44d4dc","400":"db9cf4f6-9957-48a5-9f9b-0a95a95aed09","401":"5e038cfc-badf-48bc-bcb7-6b82bac0f545"},"tags":["Contact"],"method":"get","type":"path","servers":["02ff634b-bead-4bab-a088-7dd8b9769625"],"security":[],"path":"/api/public/contacts","baseUrlOptions":["https://api.vambe.me"],"title":"Get contacts by time filters","codeSamples":[],"requestExampleLanguages":["bash","javascript","python"],"requiredOnlyExamples":true,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{"ac0e47eb-d333-49c3-a028-cf84a55cea91":{"name":"days","required":false,"in":"query","description":"Filter contacts whose last message was within this many days (1-365)","schema":{"minimum":1,"maximum":365,"example":30,"type":"number","isRequired":false,"description":"Filter contacts whose last message was within this many days (1-365)","uniqueKey":"","typeLabel":"number"}},"c275b86b-570d-49e9-8356-9c4954eeb07e":{"name":"created_after","required":false,"in":"query","description":"Return only contacts created strictly after this ISO 8601 timestamp. Use for syncing newly created contacts.","schema":{"format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2024-01-15T10:00:00.000Z","type":"string","isRequired":false,"description":"Return only contacts created strictly after this ISO 8601 timestamp. Use for syncing newly created contacts.","uniqueKey":"","typeLabel":"string\u003cdate-time>"}},"850c0037-0c2c-46d3-8cca-4a486e4cec52":{"name":"updated_after","required":false,"in":"query","description":"Return only contacts updated strictly after this ISO 8601 timestamp. Use as a sync cursor to pull both new and modified contacts since the last poll.","schema":{"format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","example":"2024-01-15T10:00:00.000Z","type":"string","isRequired":false,"description":"Return only contacts updated strictly after this ISO 8601 timestamp. Use as a sync cursor to pull both new and modified contacts since the last poll.","uniqueKey":"","typeLabel":"string\u003cdate-time>"}},"a3996a18-e592-4da9-a2b9-bd21e0d30a9e":{"name":"limit","required":false,"in":"query","description":"Maximum number of contacts to return (1-1000)","schema":{"minimum":1,"maximum":1000,"example":100,"type":"number","isRequired":false,"description":"Maximum number of contacts to return (1-1000)","uniqueKey":"","typeLabel":"number"}},"ec6cc59e-d814-4f20-92b3-b709f56441a0":{"name":"offset","required":false,"in":"query","description":"Number of contacts to skip, for pagination","schema":{"minimum":0,"maximum":9007199254740991,"example":0,"type":"number","isRequired":false,"description":"Number of contacts to skip, for pagination","uniqueKey":"","typeLabel":"number"}},"05528354-9c25-4525-841a-38bcbac297ee":{"name":"stage_id","required":false,"in":"query","description":"Stage ID to filter contacts","schema":{"format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","example":"123e4567-e89b-12d3-a456-426614174000","type":"string","isRequired":false,"description":"Stage ID to filter contacts","uniqueKey":"","typeLabel":"string\u003cuuid>"}},"4c67c08f-e561-4025-a945-214b61850c99":{"name":"pipeline_id","required":false,"in":"query","description":"Pipeline ID to filter contacts by their active ticket stage","schema":{"format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","example":"123e4567-e89b-12d3-a456-426614174000","type":"string","isRequired":false,"description":"Pipeline ID to filter contacts by their active ticket stage","uniqueKey":"","typeLabel":"string\u003cuuid>"}},"f5d4f70f-6c8d-446f-a72e-fbb2fd3ccd4b":{"name":"custom_field_key","required":false,"in":"query","description":"The key of the custom field to filter by. Must be provided together with custom_field_value.","schema":{"minLength":1,"example":"status","type":"string","isRequired":false,"description":"The key of the custom field to filter by. Must be provided together with custom_field_value.","uniqueKey":"","typeLabel":"string"}},"365a94e3-1b49-4e02-84b0-b7f697f04cfc":{"name":"custom_field_value","required":false,"in":"query","description":"The value to match for the custom field. Must be provided together with custom_field_key.","schema":{"minLength":1,"example":"Active","type":"string","isRequired":false,"description":"The value to match for the custom field. Must be provided together with custom_field_key.","uniqueKey":"","typeLabel":"string"}},"49034c6c-7caf-4384-96fe-3e6d1b37487b":{"name":"entity_type","required":false,"in":"query","description":"Specify \"ticket\" or \"customer\" to filter only by custom fields of that entity type. Only applies when custom_field_key and custom_field_value are provided.","schema":{"enum":["ticket","customer"],"type":"string","isRequired":false,"description":"Specify \"ticket\" or \"customer\" to filter only by custom fields of that entity type. Only applies when custom_field_key and custom_field_value are provided.","uniqueKey":"","typeLabel":"enum\u003cstring>"}},"abf2a0e5-38d5-4e33-a0c2-57abf103134b":{"name":"with_utm_events","required":false,"in":"query","description":"Set to true to include the per-contact utm_events array (marketing attribution). Off by default β the key is omitted entirely unless requested, since it costs an extra lookup. Opt in only if you consume UTM attribution.","schema":{"type":"boolean","example":true,"isRequired":false,"description":"Set to true to include the per-contact utm_events array (marketing attribution). Off by default β the key is omitted entirely unless requested, since it costs an extra lookup. Opt in only if you consume UTM attribution.","uniqueKey":"","typeLabel":"boolean"}},"e7818e11-b686-416c-b3a3-6f630089f659":{"name":"x-api-key","in":"header","description":"API key needed to authorize the request","required":true,"schema":{"type":"string","isRequired":true,"description":"API key needed to authorize the request","uniqueKey":"","typeLabel":"string"}}},"responses":{"e3b9855a-bd1a-45b7-b91d-b8749e44d4dc":{"description":"Contacts retrieved successfully.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"df980fc8-b6db-4820-bf22-2969482d106d","uniqueKey":"items.[INDEX].id","typeLabel":"string"},"name":{"type":"string","example":"John Doe","uniqueKey":"items.[INDEX].name","typeLabel":"string"},"phone":{"type":"string","example":"+56912345678","uniqueKey":"items.[INDEX].phone","typeLabel":"string"},"email":{"type":"string","example":"john@example.com","uniqueKey":"items.[INDEX].email","typeLabel":"string"},"platform":{"type":"string","example":"whatsapp","uniqueKey":"items.[INDEX].platform","typeLabel":"string"},"last_message_at":{"type":"string","example":"2024-09-30T10:00:00.000Z","uniqueKey":"items.[INDEX].last_message_at","typeLabel":"string"},"chat_status":{"type":"string","example":"ATTENDED","uniqueKey":"items.[INDEX].chat_status","typeLabel":"string"},"created_at":{"type":"string","example":"2024-01-15T10:00:00.000Z","uniqueKey":"items.[INDEX].created_at","typeLabel":"string"},"updated_at":{"type":"string","example":"2024-01-16T09:30:00.000Z","uniqueKey":"items.[INDEX].updated_at","typeLabel":"string"},"client_id":{"type":"string","example":"123e4567-e89b-12d3-a456-426614174000","uniqueKey":"items.[INDEX].client_id","typeLabel":"string"},"ai_customer_id":{"oneOf":[{"type":"string","example":"123e4567-e89b-12d3-a456-426614174000","uniqueKey":"items.[INDEX].ai_customer_id.oneOf.0","typeLabel":"string"},{"type":"null","example":"123e4567-e89b-12d3-a456-426614174000","uniqueKey":"items.[INDEX].ai_customer_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"items.[INDEX].ai_customer_id","typeLabel":"string | null"},"default_stage_id":{"oneOf":[{"type":"string","example":"123e4567-e89b-12d3-a456-426614174000","uniqueKey":"items.[INDEX].default_stage_id.oneOf.0","typeLabel":"string"},{"type":"null","example":"123e4567-e89b-12d3-a456-426614174000","uniqueKey":"items.[INDEX].default_stage_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"items.[INDEX].default_stage_id","typeLabel":"string | null"},"blocked":{"type":"boolean","example":false,"uniqueKey":"items.[INDEX].blocked","typeLabel":"boolean"},"is_chat_read":{"type":"boolean","example":true,"uniqueKey":"items.[INDEX].is_chat_read","typeLabel":"boolean"},"active_ticket_v2":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","example":"123e4567-e89b-12d3-a456-426614174000","uniqueKey":"items.[INDEX].active_ticket_v2.oneOf.0.id","typeLabel":"string"},"current_stage_id":{"oneOf":[{"type":"string","example":"123e4567-e89b-12d3-a456-426614174000","uniqueKey":"items.[INDEX].active_ticket_v2.oneOf.0.current_stage_id.oneOf.0","typeLabel":"string"},{"type":"null","example":"123e4567-e89b-12d3-a456-426614174000","uniqueKey":"items.[INDEX].active_ticket_v2.oneOf.0.current_stage_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"items.[INDEX].active_ticket_v2.oneOf.0.current_stage_id","typeLabel":"string | null"}},"uniqueKey":"items.[INDEX].active_ticket_v2.oneOf.0","typeLabel":"object"},{"type":"null","properties":{"id":{"type":"string","example":"123e4567-e89b-12d3-a456-426614174000"},"current_stage_id":{"oneOf":[{"type":"string","example":"123e4567-e89b-12d3-a456-426614174000"},{"type":"null","example":"123e4567-e89b-12d3-a456-426614174000"}]}},"uniqueKey":"items.[INDEX].active_ticket_v2.oneOf.1","typeLabel":"null"}],"uniqueKey":"items.[INDEX].active_ticket_v2","typeLabel":"object | null"},"utm_events":{"type":"array","description":"Marketing attribution events recorded for this contact, oldest first. Only present when with_utm_events=true; otherwise the key is omitted.","items":{"type":"object","properties":{"id":{"type":"string","uniqueKey":"items.[INDEX].utm_events.items.[INDEX].id","typeLabel":"string"},"created_at":{"oneOf":[{"type":"string","example":"2024-01-15T10:00:00.000Z","uniqueKey":"items.[INDEX].utm_events.items.[INDEX].created_at.oneOf.0","typeLabel":"string"},{"type":"null","example":"2024-01-15T10:00:00.000Z","uniqueKey":"items.[INDEX].utm_events.items.[INDEX].created_at.oneOf.1","typeLabel":"null"}],"uniqueKey":"items.[INDEX].utm_events.items.[INDEX].created_at","typeLabel":"string | null"},"customer_id":{"oneOf":[{"type":"string","uniqueKey":"items.[INDEX].utm_events.items.[INDEX].customer_id.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"items.[INDEX].utm_events.items.[INDEX].customer_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"items.[INDEX].utm_events.items.[INDEX].customer_id","typeLabel":"string | null"},"integration_type":{"oneOf":[{"type":"string","example":"facebook","uniqueKey":"items.[INDEX].utm_events.items.[INDEX].integration_type.oneOf.0","typeLabel":"string"},{"type":"null","example":"facebook","uniqueKey":"items.[INDEX].utm_events.items.[INDEX].integration_type.oneOf.1","typeLabel":"null"}],"uniqueKey":"items.[INDEX].utm_events.items.[INDEX].integration_type","typeLabel":"string | null"},"ad_id":{"oneOf":[{"type":"string","uniqueKey":"items.[INDEX].utm_events.items.[INDEX].ad_id.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"items.[INDEX].utm_events.items.[INDEX].ad_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"items.[INDEX].utm_events.items.[INDEX].ad_id","typeLabel":"string | null"},"ad_source_click_id":{"oneOf":[{"type":"string","example":"Afj54mAZcKADkJbjUVSbmoapEcOGe2Ryzm...","uniqueKey":"items.[INDEX].utm_events.items.[INDEX].ad_source_click_id.oneOf.0","typeLabel":"string"},{"type":"null","example":"Afj54mAZcKADkJbjUVSbmoapEcOGe2Ryzm...","uniqueKey":"items.[INDEX].utm_events.items.[INDEX].ad_source_click_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"items.[INDEX].utm_events.items.[INDEX].ad_source_click_id","typeLabel":"string | null"},"referrer_url":{"oneOf":[{"type":"string","example":"https://example.com/landing","uniqueKey":"items.[INDEX].utm_events.items.[INDEX].referrer_url.oneOf.0","typeLabel":"string"},{"type":"null","example":"https://example.com/landing","uniqueKey":"items.[INDEX].utm_events.items.[INDEX].referrer_url.oneOf.1","typeLabel":"null"}],"uniqueKey":"items.[INDEX].utm_events.items.[INDEX].referrer_url","typeLabel":"string | null"},"search_keyword":{"oneOf":[{"type":"string","uniqueKey":"items.[INDEX].utm_events.items.[INDEX].search_keyword.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"items.[INDEX].utm_events.items.[INDEX].search_keyword.oneOf.1","typeLabel":"null"}],"uniqueKey":"items.[INDEX].utm_events.items.[INDEX].search_keyword","typeLabel":"string | null"}},"uniqueKey":"items.[INDEX].utm_events.items.[INDEX]","typeLabel":"object"},"uniqueKey":"items.[INDEX].utm_events","typeLabel":"object[]"}},"uniqueKey":"items.[INDEX]","typeLabel":"object"},"uniqueKey":"","typeLabel":"object[]"},"examples":{"Example":{"title":"Example","value":[{"id":"df980fc8-b6db-4820-bf22-2969482d106d","name":"John Doe","phone":"+56912345678","email":"john@example.com","platform":"whatsapp","last_message_at":"2024-09-30T10:00:00.000Z","chat_status":"ATTENDED","created_at":"2024-01-15T10:00:00.000Z","updated_at":"2024-01-16T09:30:00.000Z","client_id":"123e4567-e89b-12d3-a456-426614174000","ai_customer_id":"123e4567-e89b-12d3-a456-426614174000","default_stage_id":"123e4567-e89b-12d3-a456-426614174000","blocked":false,"is_chat_read":true,"active_ticket_v2":{"id":"123e4567-e89b-12d3-a456-426614174000","current_stage_id":"123e4567-e89b-12d3-a456-426614174000"},"utm_events":[{"id":"\u003cstring>","created_at":"2024-01-15T10:00:00.000Z","customer_id":"\u003cstring>","integration_type":"facebook","ad_id":"\u003cstring>","ad_source_click_id":"Afj54mAZcKADkJbjUVSbmoapEcOGe2Ryzm...","referrer_url":"https://example.com/landing","search_keyword":"\u003cstring>"}]}]}},"exampleType":"generated"}},"exampleType":"generated"},"db9cf4f6-9957-48a5-9f9b-0a95a95aed09":{"description":"Bad request - Invalid parameters or custom field not found/incompatible.","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"5e038cfc-badf-48bc-bcb7-6b82bac0f545":{"description":"Unauthorized - Invalid or missing API key.","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}}},"security":{},"servers":{"02ff634b-bead-4bab-a088-7dd8b9769625":{"url":"https://api.vambe.me","description":"Production Server"}}},"originalFileLocation":"openapi.json"},"subdomain":"vambe-f69d5806","siteName":"Welcome π","title":"Get contacts by time filters - Welcome π","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-07-01T16:23:10.711Z","originalFileLocation":"reference/contact/get-contacts-by-days.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=\"Retrieve contacts filtered by activity (last message within N days), creation time, or update time. Works across all channels (WhatsApp, Instagram, etc.). At least one of days, created_after, or updated_after is required. For incremental sync, poll with updated_after set to the latest updated_at you have stored: the response includes both created_at and updated_at so you can tell new contacts (created_at \u0026gt; your cursor) apart from updated ones. Results are ordered ascending by updated_at (or created_at) when those filters are used, so you can page forward with limit/offset and advance your cursor safely. Optionally filter by custom field values.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Welcome π\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/vambe-f69d5806/FNR-14vKPkm5-pk-/_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/vambe-f69d5806/FNR-14vKPkm5-pk-/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/vambe-f69d5806/FNR-14vKPkm5-pk-/_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/vambe-f69d5806/FNR-14vKPkm5-pk-/_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/vambe-f69d5806/FNR-14vKPkm5-pk-/_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/vambe-f69d5806/FNR-14vKPkm5-pk-/_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/vambe-f69d5806/FNR-14vKPkm5-pk-/_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/vambe-f69d5806/FNR-14vKPkm5-pk-/_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/vambe-f69d5806/FNR-14vKPkm5-pk-/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Get contacts by time filters - Welcome π\">\u003cmeta data-mint-head property=\"og:description\" content=\"Retrieve contacts filtered by activity (last message within N days), creation time, or update time. Works across all channels (WhatsApp, Instagram, etc.). At least one of days, created_after, or updated_after is required. For incremental sync, poll with updated_after set to the latest updated_at you have stored: the response includes both created_at and updated_at so you can tell new contacts (created_at \u0026gt; your cursor) apart from updated ones. Results are ordered ascending by updated_at (or created_at) when those filters are used, so you can page forward with limit/offset and advance your cursor safely. Optionally filter by custom field values.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Welcome π\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.vambe.me/reference/contact/get-contacts-by-days\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://vambe-f69d5806.mintlify.site/_mintlify/api/og/v2?division=Contact+Management\u0026amp;title=Get+contacts+by+time+filters\u0026amp;description=Retrieve+contacts+filtered+by+activity+%28last+message+within+N+days%29%2C+creation+time%2C+or+update+time.+Works+across+all+channels+%28WhatsApp%2C+Instagram%2C+etc.%29.+At+le\u0026amp;theme=9b7d6b35278e9470f56611a6\u0026amp;signature=c57224f3149db9961afef7d0c84474f04789d8733bbfc52ddde46126217892d3\">\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=\"Get contacts by time filters - Welcome π\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Retrieve contacts filtered by activity (last message within N days), creation time, or update time. Works across all channels (WhatsApp, Instagram, etc.). At least one of days, created_after, or updated_after is required. For incremental sync, poll with updated_after set to the latest updated_at you have stored: the response includes both created_at and updated_at so you can tell new contacts (created_at \u0026gt; your cursor) apart from updated ones. Results are ordered ascending by updated_at (or created_at) when those filters are used, so you can page forward with limit/offset and advance your cursor safely. Optionally filter by custom field values.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://vambe-f69d5806.mintlify.site/_mintlify/api/og/v2?division=Contact+Management\u0026amp;title=Get+contacts+by+time+filters\u0026amp;description=Retrieve+contacts+filtered+by+activity+%28last+message+within+N+days%29%2C+creation+time%2C+or+update+time.+Works+across+all+channels+%28WhatsApp%2C+Instagram%2C+etc.%29.+At+le\u0026amp;theme=9b7d6b35278e9470f56611a6\u0026amp;signature=c57224f3149db9961afef7d0c84474f04789d8733bbfc52ddde46126217892d3\">\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/vambe-f69d5806/FNR-14vKPkm5-pk-/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Welcome π\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#2563EB\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.vambe.me/reference/contact/get-contacts-by-days\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/reference/contact/get-contacts-by-days.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.vambe.me/#organization\",\"name\":\"Welcome π\",\"url\":\"https://docs.vambe.me\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/vambe-f69d5806/_YFOlf0qgMJ8Che1/images/fb1a23e-small-Vambe_Logo_Panda-White4x.png?fit=max\u0026auto=format\u0026n=_YFOlf0qgMJ8Che1\u0026q=85\u0026s=c84b8be7abfa14dd8e1674a247b9cc0b\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.vambe.me#website\",\"name\":\"Welcome π\",\"url\":\"https://docs.vambe.me\",\"publisher\":{\"@id\":\"https://docs.vambe.me/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.vambe.me/reference/contact/get-contacts-by-days#webpage\",\"url\":\"https://docs.vambe.me/reference/contact/get-contacts-by-days\",\"name\":\"Get contacts by time filters\",\"description\":\"Retrieve contacts filtered by activity (last message within N days), creation time, or update time. Works across all channels (WhatsApp, Instagram, etc.). At least one of days, created_after, or updated_after is required. For incremental sync, poll with updated_after set to the latest updated_at you have stored: the response includes both created_at and updated_at so you can tell new contacts (created_at > your cursor) apart from updated ones. Results are ordered ascending by updated_at (or created_at) when those filters are used, so you can page forward with limit/offset and advance your cursor safely. Optionally filter by custom field values.\",\"dateModified\":\"2026-07-01T16:23:10.711Z\",\"isPartOf\":{\"@id\":\"https://docs.vambe.me#website\"},\"breadcrumb\":{\"@id\":\"https://docs.vambe.me/reference/contact/get-contacts-by-days#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.vambe.me/reference/contact/get-contacts-by-days#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Welcome π\",\"item\":\"https://docs.vambe.me\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Get contacts by time filters\",\"item\":\"https://docs.vambe.me/reference/contact/get-contacts-by-days\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.vambe.me/reference/contact/get-contacts-by-days#apireference\",\"headline\":\"Get contacts by time filters\",\"name\":\"Get contacts by time filters\",\"description\":\"Retrieve contacts filtered by activity (last message within N days), creation time, or update time. Works across all channels (WhatsApp, Instagram, etc.). At least one of days, created_after, or updated_after is required. For incremental sync, poll with updated_after set to the latest updated_at you have stored: the response includes both created_at and updated_at so you can tell new contacts (created_at > your cursor) apart from updated ones. Results are ordered ascending by updated_at (or created_at) when those filters are used, so you can page forward with limit/offset and advance your cursor safely. Optionally filter by custom field values.\",\"url\":\"https://docs.vambe.me/reference/contact/get-contacts-by-days\",\"mainEntityOfPage\":{\"@id\":\"https://docs.vambe.me/reference/contact/get-contacts-by-days#webpage\"},\"dateModified\":\"2026-07-01T16:23:10.711Z\",\"publisher\":{\"@id\":\"https://docs.vambe.me/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.vambe.me#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Welcome π\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Welcome π\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/reference/contact/get-contacts-by-days.md","siteName":"Welcome π","nav":{"global":null,"tabs":[{"tab":"Guides","icon":"book-open","pages":[{"title":"Guides","href":"/docs/quickstart"}]},{"tab":"Messaging API","icon":"messages","pages":[{"title":"Messaging API","href":"/reference/campaigns/create-campaign"}]},{"tab":"CRM \u0026 Contacts","icon":"users","groups":[{"group":"Contact Management","icon":"user","expanded":false,"pages":[{"openapi":"get /api/public/contacts","title":"Get contacts by time filters","href":"/reference/contact/get-contacts-by-days"},{"openapi":"get /api/public/contacts/search","title":"Search contacts by phone or email","description":"Find contacts by phone number or email address. Searches across all channels. At least one search parameter is required.","href":"/reference/contact/search-contacts"},{"title":"Create Merge Customers By Ai Contact","openapi":"post /api/public/ai-customer/merge-customers/by-ai-contact","href":"/reference/ai-customer/post-api-public-ai-customer-merge-customers-by-ai-contact"},{"openapi":"post /api/public/customer/upsert/info","title":"Upsert a contact","href":"/reference/customer/upsert-customer-info"},{"openapi":"post /api/public/webchat/contact/add-metadata","title":"Add metadata for a webchat contact","href":"/reference/webchat/add-webchat-contact-metadata"},{"title":"Get all tags for an AI contact","openapi":"get /api/public/contact/tags/{aiContactId}","href":"/reference/contact/get-all-tags-for-an-ai-contact"},{"openapi":"get /api/public/contact/v3/{aiContactId}/messages","title":"Retrieve messages by AI contact with pagination","href":"/reference/contact/get-messages-paginated-v3"},{"openapi":"get /api/public/contact/v2/{aiContactId}/messages","title":"Retrieve messages by AI contact with pagination","href":"/reference/contact/get-messages-paginated"},{"openapi":"get /api/public/contact/whatsapp/{channelIdentifier}/info","title":"Retrieve info by channel identifier","href":"/reference/contact/retrieve-info-by-channel-identifier"},{"openapi":"get /api/public/contact/whatsapp/{channelIdentifier}/messages","title":"Retrieve messages by conversation","href":"/reference/contact/retrieve-messages-by-conversation"},{"openapi":"get /api/public/contact/{aiContactId}/conversations","title":"Retrieve conversations by AI contact","href":"/reference/contact/get-conversations"},{"openapi":"get /api/public/contact/{aiContactId}/info","title":"Get info of an AI contact","href":"/reference/contact/get-info-of-an-ai-contact"},{"openapi":"get /api/public/contact/{aiContactId}/messages","title":"Retrieve messages by AI contact","href":"/reference/contact/retrieve-messages-by-ai-contact"},{"openapi":"post /api/public/contact/{aiContactId}/update-metadata","title":"Update metadata to an AI contact","href":"/reference/contact/update-contact-metadata"},{"openapi":"patch /api/public/contact/tags/{aiContactId}","title":"Update all the tags from an AI contact","href":"/reference/tags/update-contact-tags"},{"openapi":"post /api/public/contact/{aiContactId}/assign-team-member/{teamMemberId}","title":"Assign an team member to an AI contact","href":"/reference/team-members/assign-team-member-to-contact"}]},{"group":"Pipeline \u0026 Stages","icon":"list-tree","expanded":false,"pages":[{"openapi":"get /api/public/pipeline","title":"Get Pipelines","href":"/reference/publicpipeline/get-pipelines"}]},{"group":"Tags \u0026 Labels","icon":"tags","expanded":false,"pages":[{"openapi":"get /api/public/tags","title":"Get all tags","href":"/reference/tags/get-all-tags"}]},{"group":"AI Run Logs","icon":"list-tree","expanded":false,"pages":[{"openapi":"get /api/public/run-logs","title":"Retrieve run logs by AI contact or by voice call","href":"/reference/run-logs/get-run-logs-by-ai-contact"}]},{"group":"Tickets \u0026 Support","icon":"ticket","expanded":false,"pages":[{"title":"List ticket feedbacks","openapi":"get /api/public/ticket-feedback","href":"/reference/ticket-feedback/list-ticket-feedbacks"}]},{"group":"Team Management","icon":"user-plus","expanded":false,"pages":[{"openapi":"get /api/public/team-members/all","title":"Get all team members","href":"/reference/team-members/get-all-team-members"}]},{"group":"Partners","icon":"handshake","expanded":false,"pages":[{"title":"List partner pipeline deals","openapi":"get /api/public/partners/pipeline","href":"/reference/public-partners/list-partner-pipeline-deals"},{"title":"Validate a partner code","openapi":"post /api/public/partners/auth/validate","href":"/reference/public-partners/validate-a-partner-code"}]},{"group":"Deprecated","icon":"clock","expanded":false,"pages":[{"title":"Get WhatsApp Contacts (Deprecated)","openapi":"get /api/public/whatsapp/contact/contacts","href":"/reference/whatsapp-contact/get-contacts"}]}]},{"tab":"Analytics \u0026 Reports","icon":"chart-line","pages":[{"title":"Analytics \u0026 Reports","href":"/reference/utm-events/create-custom-utm-event"}]},{"tab":"Knowledge Base","icon":"book-open","pages":[{"title":"Knowledge Base","href":"/reference/knowledge-base/get-folders"}]},{"tab":"Ecommerce","icon":"box","pages":[{"title":"Ecommerce","href":"/reference/product/get-product-blocks"}]},{"tab":"Appointments","icon":"calendar","pages":[{"title":"Appointments","href":"/reference/booking-url/get-api-public-booking-url-urlname"}]},{"tab":"Events","icon":"bolt","pages":[{"title":"Events","href":"/reference/events-api/ingest-a-customer-event"}]},{"tab":"Webhooks","icon":"webhook","pages":[{"title":"Webhooks","href":"/reference/webhooks/get-all-webhooks-for-the-authenticated-user"}]},{"tab":"Tasks","icon":"list-check","pages":[{"title":"Tasks","href":"/reference/tasks/get-tasks"}]},{"tab":"Custom Ecommerce Apps","icon":"puzzle-piece","pages":[{"title":"Custom Ecommerce Apps","href":"/docs/app-platform/introduction"}]}]},"basePath":"","title":"Get contacts by time filters - Welcome π","buildId":"dpl_DqYu5MPb49gWBBbUGgpHQUmCHY3P","deploymentId":"dpl_DqYu5MPb49gWBBbUGgpHQUmCHY3P","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-CybtLBIt.js","utils-BMLj2fvV.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-B6In562Y.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-Dr8Mfhp9.js","snippetPresets-2rmQvMVl.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","ApiExamples-WMqJYdZj.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-CJ-MlPHu.js","shallow-dY3TMRCk.js","getApiPlaygroundDisplay-v-1B2bKm.js","CodeSnippet-BDhiTB7U.js","CodeSnippets-D9hnzQcS.js","Page-C4GwDT3_.js","getPastedJson-Th2V45jI.js","icon-BQXch1W9.js","MethodPill-BCqUneP3.js","DuplicateIcon-Q_-bhurZ.js","createIcon-DUjLHRqp.js","DynamicMarkdown-B-f2cqXQ.js","SectionHeading-Da5NsV4v.js","axios-vUo_bRtp.js","Markdown-D13FWkIM.js","clsx-D3Isdib3.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-C-XZBk9h.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink--qIqmmVG.js"]}