Skip to main content
GET
/
public-api
/
v1
/
contacts
List Contacts
curl --request GET \
  --url https://app.cometly.com/public-api/v1/contacts \
  --header 'Authorization: Bearer <token>'
{
  "data": [
    {}
  ],
  "path": "<string>",
  "per_page": 123,
  "next_cursor": {},
  "next_page_url": {},
  "prev_cursor": {},
  "prev_page_url": {},
  "message": "<string>"
}

Overview

This endpoint allows you to retrieve a paginated list of contacts from Cometly within a specific date range. Each contact includes primary data from the profile (email, name, phone, location). For complete contact information including all associated emails, phones, names, and locations from merged profiles, use the individual contact endpoint GET /contacts/. Results are cursor-paginated for efficient data retrieval and ordered by ID (newest first).

Query Parameters

Required Parameters

start_date
string
required
Start date and time for filtering contacts by creation date in YYYY-MM-DD HH:MM:SS format. The date is interpreted in your space’s timezone.Example: 2024-01-15 00:00:00
end_date
string
required
End date and time for filtering contacts by creation date in YYYY-MM-DD HH:MM:SS format. Must be after start_date. The date is interpreted in your space’s timezone.Example: 2024-01-15 23:59:59

Optional Parameters

per_page
integer
default:"200"
Number of contacts to return per page. Minimum: 1, Maximum: 5000
cursor
string
Pagination cursor from a previous response. Use this to fetch the next page of results.
include_comet_tokens
boolean
default:"0"
When set to 1, includes the last 5 comet tokens for each contact, ordered by most recent first. Accepts 1 or 0.
include_all_emails
boolean
default:"0"
When set to 1, includes all email addresses associated with the contact (including emails from merged profiles). Accepts 1 or 0.
include_custom_fields
boolean
default:"0"
When set to 1, includes all 30 custom field columns for each contact. Fields 1-15 are text, 16-25 are numeric, 26-30 are date. Accepts 1 or 0.
use_custom_field_labels
boolean
default:"0"
When set to 1, custom field keys in the response will use the user-defined labels (e.g. "Customer Age") instead of the raw column names (e.g. "profile_field_1"). Only applies when include_custom_fields=1. Fields without a configured label will keep their raw column name. Accepts 1 or 0.
custom_field_filters
array
Filter contacts by their custom profile field values. Array of AND-joined conditions. Each condition is { "field": "profile_field_N", "operator": "<op>", "value": <val> }, or for ranges { "field": "profile_field_N", "operator": "between", "start": <a>, "end": <b> }. The field must reference a custom field slot that has been configured with a label in your space (e.g. profile_field_5). Maximum 10 conditions per request.Operator vocabulary by field type:
Slot rangeTypeValid operators
profile_field_1profile_field_15textequal_to, not_equal_to, contains, not_contains, starts_with, ends_with, contains_word, any, unknown
profile_field_16profile_field_25numberequal_to, not_equal_to, greater_than, greater_than_or_equal_to, less_than, less_than_or_equal_to, any, unknown
profile_field_26profile_field_30dateequal_to, between, greater_than, less_than, age_greater_than, age_equal_to, age_less_than, any, unknown
any matches contacts where the field has a value; unknown matches contacts where the field is empty or unset. For numeric fields, any requires a value greater than 0unknown matches 0 or unset. Date comparisons (equal_to, greater_than, less_than, between) are evaluated in your space’s configured timezone; equal_to matches the full calendar day. not_equal_to and not_contains do not include contacts where the field is unset — add a separate unknown condition if you need those.Example query string: custom_field_filters[0][field]=profile_field_5&custom_field_filters[0][operator]=equal_to&custom_field_filters[0][value]=Premium

Response

Success Response

The response follows Laravel’s cursor pagination structure:
data
array
Array of contact objects. Each contact includes:
  • id (integer): The unique identifier of the contact
  • email (string|null): Primary email address
  • name (string|null): Primary name
  • phone (string|null): Primary phone number
  • location (string|null): Primary location
  • comet_tokens (array): Array of comet tokens (only included when include_comet_tokens=1)
  • emails (array): Array of all email addresses associated with the contact, including emails from merged profiles (only included when include_all_emails=1)
  • profile_field_1 through profile_field_30: Custom field values (only included when include_custom_fields=1). Fields 1-15 are text (string|null), 16-25 are numeric (number|null), 26-30 are date (string|null)
path
string
The base URL path for the endpoint
per_page
integer
Number of items per page
next_cursor
string | null
Cursor for the next page of results. null if there are no more pages.
next_page_url
string | null
Full URL for the next page of results. null if there are no more pages.
prev_cursor
string | null
Cursor for the previous page of results. null if on the first page.
prev_page_url
string | null
Full URL for the previous page of results. null if on the first page.

Error Response

message
string
Error description explaining what went wrong

Example Requests

# Basic request
curl -G "https://app.cometly.com/public-api/v1/contacts" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d "start_date=2024-01-15 00:00:00" \
  -d "end_date=2024-01-15 23:59:59"

# Include comet tokens
curl -G "https://app.cometly.com/public-api/v1/contacts" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d "start_date=2024-01-15 00:00:00" \
  -d "end_date=2024-01-15 23:59:59" \
  -d "include_comet_tokens=1"

# Include all emails
curl -G "https://app.cometly.com/public-api/v1/contacts" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d "start_date=2024-01-15 00:00:00" \
  -d "end_date=2024-01-15 23:59:59" \
  -d "include_all_emails=1"

# Filter by custom field value
curl -G "https://app.cometly.com/public-api/v1/contacts" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d "start_date=2024-01-15 00:00:00" \
  -d "end_date=2024-01-15 23:59:59" \
  -d "custom_field_filters[0][field]=profile_field_5" \
  -d "custom_field_filters[0][operator]=equal_to" \
  -d "custom_field_filters[0][value]=Premium"

# Pagination request using cursor
curl -G "https://app.cometly.com/public-api/v1/contacts" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d "start_date=2024-01-15 00:00:00" \
  -d "end_date=2024-01-15 23:59:59" \
  -d "cursor=eyJpZCI6MTIzNDU..."

Status Codes

Status CodeDescription
200Contacts successfully retrieved
401Missing or invalid API key
403API key doesn’t have permission or subscription is inactive
422Invalid parameters provided (check error message for details)
429Too many requests - rate limit exceeded. See Rate Limiting

Notes

  • Rate Limit: This endpoint has a limit of 15 requests per minute per Space. See Rate Limiting for details.
  • Primary Data Only: This endpoint returns primary contact data (email, name, phone, location) from the profiles table for efficient browsing.
  • Complete Contact Data: For full contact information including all associated emails, phones, names, and locations from merged profiles, use GET /contacts/.
  • Performance: This endpoint uses a single efficient query, making it ideal for listing and browsing large numbers of contacts.
  • Ordering: Results are ordered by ID in descending order (newest first).
  • Pagination: Cursor pagination is used for efficient traversal of large result sets.
  • Comet Tokens: Use the include_comet_tokens=1 query parameter to include the last 5 comet tokens for each contact. This parameter is optional and defaults to 0.
  • All Emails: Use the include_all_emails=1 query parameter to include all email addresses for each contact, including emails from merged profiles. This parameter is optional and defaults to 0.
  • Custom Fields: Use the include_custom_fields=1 query parameter to include all 30 custom fields in the response. Fields 1-15 are text, 16-25 are numeric, 26-30 are date. This parameter is optional and defaults to 0.
  • Custom Field Labels: Use use_custom_field_labels=1 alongside include_custom_fields=1 to replace raw column names (profile_field_1) with user-defined labels (e.g. Customer Age). Fields without a configured label will retain their raw column name.
  • Custom Field Filters: Use custom_field_filters to narrow results to contacts whose custom profile fields match specified values. Conditions AND together; up to 10 per request. Slots that haven’t been configured with a label in your space cannot be filtered against and will be rejected with a 422. Age operators (age_greater_than, age_equal_to, age_less_than) accept a whole-number day count and are supported on date fields (profile_field_26profile_field_30). The _ and \ characters in text filter values are treated as literals, not LIKE wildcards.