Skip to Content
Mutation APIFetching customers

Fetching customers

Customers are all persons who have interacted with your content. Meaning all persons who have read, clicked, shared, bookmarked, or commented on content items. A customer profile is created for each person. You can manage these profiles in Prepr. With this, we enable you to segment and personalize content for your customers.

Before calling a REST API endpoint to fetch customers, add the REST API scope customers to your mutation API access token. Check out the authorization guide for more details. Pass this access token in the Authorization header as a token when making the request.

To fetch content items, send a GET request to the https://customers.prepr.io/ endpoint and include your filter criteria in the request payload.

The Customer object

To expand the customer object when querying a customer add the field name below in the fields parameter.

{ "id" : "234h-432847-x23498-763x4-324x234", "first_name": "Jhon", "last_name": "Doe", "date_of_birth": "2000-12-01", "email" : "[email protected]", "phone" : "31641356222", "tags": { "items": [ { "body": "Amsterdam" } ] } }
field nametyperequireddescription
idString--
first_nameStringfalseLists the first name of the customer.
last_nameStringfalseLists the last name of the customer.
date_of_birthStringfalseLists the date of birth of the customer. Format: Y-m-d.
emailStringfalseEmail address of the customer.
phoneStringfalsePhone number of the customer.
reference_idStringfalseLists the reference_id of the customer.
tagsObjectfalseLists tags of the customer.
segmentsObjectfalseLists the segment the customer is in.

Fetching all customers

If you want to fetch all customers, simply use the endpoint below.

GET https://customers.prepr.io/ Authorization: Bearer <YOUR-ACCESS-TOKEN> Content-Type: application/json

Check out the Filtering customers guide on how to apply filters.

Query by ID

Since IDs are unique in Prepr, you can find the customer you want using the id argument. The example below fetches one customer with the ID 535c1e-4d52-4794-9136-71e28f2ce4c1 and includes the custom, email, phone, and tags fields.

GET https://customers.prepr.io/535c1e-4d52-4794-9136-71e28f2ce4c1?fields=custom,email,phone,tags Authorization: Bearer <YOUR-ACCESS-TOKEN> Content-Type: application/json
Last updated on