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 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 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
Number of contacts to return per page. Minimum: 1, Maximum: 5000
Pagination cursor from a previous response. Use this to fetch the next page of results.
When set to 1, includes the last 5 comet tokens for each contact, ordered by most recent first. Accepts 1 or 0.
Response
Success Response
The response follows Laravel’s cursor pagination structure:
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)
The base URL path for the endpoint
Cursor for the next page of results. null if there are no more pages.
Full URL for the next page of results. null if there are no more pages.
Cursor for the previous page of results. null if on the first page.
Full URL for the previous page of results. null if on the first page.
Error Response
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"
# 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 Code | Description |
|---|
| 200 | Contacts successfully retrieved |
| 401 | Missing or invalid API key |
| 403 | API key doesn’t have permission or subscription is inactive |
| 422 | Invalid parameters provided (check error message for details) |
| 429 | Too 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.