Hello.
Im trying to use the /api/3/contacts endpoint to list contacts in a segment by using the segmentid query parameter.
I am able to get first page of contacts, but unable to get subsequent pages.
Seems that paginated related query parameters dont work, when using segmentid:
- offset
- id_greater
- exclude
Any help appreciated.
Hi Raul,
Here are a few workarounds you can try:
Option 1: Use the Segments API Instead of filtering contacts by segmentid, try using the segments endpoint:
GET /api/3/segments/{segmentId}/contacts
This endpoint should handle pagination correctly with standard parameters like limit
and offset
.
Option 2: Two-step approach
- First, get all contact IDs in the segment:
GET /api/3/segments/{segmentId}/contacts
- Then fetch contact details in batches using the contact IDs
Option 3: Increase limit per request As a temporary workaround, try increasing the limit
parameter to get more contacts per request (up to 100), reducing the number of pages you need to handle.
Option 4: Alternative filtering If the segment is based on tags or custom fields, consider using those filters directly on the contacts endpoint instead of segmentid, as other filters tend to work better with pagination.
This appears to be a bug in the API, so I’d also recommend submitting a support ticket to ActiveCampaign referencing this specific issue with segmentid pagination. They may have additional workarounds or a timeline for a fix.