---
title: "Get contacts by time filters"
method: GET
path: "/api/public/contacts"
tags: ["Contact"]
---

# Get contacts by time filters

`GET /api/public/contacts`

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.

## Query parameters

- `days` number
- `created_after` string, date-time
- `updated_after` string, date-time
- `limit` number
- `offset` number
- `stage_id` string, uuid
- `pipeline_id` string, uuid
- `custom_field_key` string
- `custom_field_value` string
- `entity_type` 'ticket' | 'customer'
- `with_utm_events` boolean

## Headers

- `x-api-key` string, required

## Response `200`

Contacts retrieved successfully.

- object[]
  - `id` string
  - `name` string
  - `phone` string
  - `email` string
  - `platform` string
  - `last_message_at` string
  - `chat_status` string
  - `created_at` string
  - `updated_at` string
  - `client_id` string
  - `ai_customer_id` string, nullable
  - `default_stage_id` string, nullable
  - `blocked` boolean
  - `is_chat_read` boolean
  - `active_ticket_v2` object, nullable
    - `id` string
    - `current_stage_id` string, nullable
  - `utm_events` object[] — Marketing attribution events recorded for this contact, oldest first. Only present when with_utm_events=true; otherwise the key is omitted.
    - `id` string
    - `created_at` string, nullable
    - `customer_id` string, nullable
    - `integration_type` string, nullable
    - `ad_id` string, nullable
    - `referrer_url` string, nullable
    - `search_keyword` string, nullable

## Other responses

- `400` — Bad request - Invalid parameters or custom field not found/incompatible.
- `401` — Unauthorized - Invalid or missing API key.

---

[API](https://skmtc.net/vambe/apis/vambe-ai-api.md) · [All operations](https://skmtc.net/vambe/apis/vambe-ai-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/vambe/vambe-ai-api/versions/e206709d4be5/schema)
