Skip to main content

API: Load members of target audience

Written by Domonkos Horváth

With an authenticated user (see https://how.cambuildr.com/en/articles/5161332-api-authentication) it is possible to load the members of a target audience:

GET <cambuildr-url>/api/v1/groups/<target-audience-id>/people

The people are returned paginated. Page size and page number can be defined with the query parameters page_nr and page_size.

The response contains the people of the audience and their total_count. page_nr starts at 0, page_size defaults to 30 and is capped at 100. The calling user needs the permission to edit target audiences. Add fields=address if you also need each person's addresses.

Custom fields are not part of this response

This endpoint returns the person's core fields only — custom field values are not included. To read people together with their custom fields, use the people endpoint instead:

GET <cambuildr-url>/api/v1/people?fields=custom&page_nr=0&page_size=100

It returns each person with their custom field values and their addresses, and requires the permission to view people. This endpoint has no target audience filter, so if you need both the audience membership and the custom field values, combine the two calls on your side.

Alternatives to polling this endpoint

  • Push instead of poll. If you want every new member delivered to your own system as it happens, build a workflow with the Call a webhook action rather than polling this endpoint — see Workflows: automating what happens after someone acts.

  • One-off extracts. For a single extract of an audience, including custom fields, use the CSV export on the target audience — see Export a target audience.

Did this answer your question?