GET/ users/ ?search=:type&min=:timestamp&max=:timestamp
Find users by date
You can find users based on their first_seen, last_seen, last_contacted, or updated_at attributes. These results can be filtered by conditions defined in the request body.
Attributes
Optional unless marked required
- search
- An attribute through which you can search. 4 types to choose from:
first_seen,last_seen,last_contacted,updated_at(UNIX format) - min
- A start date of search in UNIX format.
- max
- An end date of search in UNIX format.
- with_email
- If value is set up to true results includes only users with emails.
- tags
- Ignored by the API: the results are the same with or without it.
The lookup value has to be in ISO-8601 format.
| Lookup | Description | Example usage |
|---|---|---|
| __lt | Lesser than | ?first_seen__lt=2019-05-16+00:00 |
| __lte | Lesser than or equal | ?first_seen__lte=2019-05-16+00:00 |
| __gt | Greater than | ?first_seen__gt=2019-05-16+00:00 |
| __gte | Greater than or equal | ?first_seen__gte=2019-05-16+00:00 |
The API doesn't reject wrong values here: a search that isn't one of the four types, no search at all, or a min or max that isn't a number are ignored, and the response lists every contact. A lookup with a value that isn't a date answers 400, for example {"first_seen__gte": ["Enter a valid date/time."]}.
Request
- cURL
- JavaScript
- PHP
- Python
curl -X GET "https://<your_app_subdomain>.user.com/api/public/users/?search=:type&min=:timestamp&max=:timestamp" \
-H "Authorization: Token <your_64_char_api_key>" \
-H "Accept: */*; version=2"
const response = await fetch(
"https://<your_app_subdomain>.user.com/api/public/users/?search=:type&min=:timestamp&max=:timestamp",
{
method: "GET",
headers: {
Authorization: "Token <your_64_char_api_key>",
Accept: "*/*; version=2",
},
},
);
const data = await response.json();
console.log(data);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://<your_app_subdomain>.user.com/api/public/users/?search=:type&min=:timestamp&max=:timestamp",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Token <your_64_char_api_key>",
"Accept: */*; version=2",
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
response = requests.get(
"https://<your_app_subdomain>.user.com/api/public/users/?search=:type&min=:timestamp&max=:timestamp",
headers={
"Authorization": "Token <your_64_char_api_key>",
"Accept": "*/*; version=2",
},
)
print(response.json())
Response examples
- 200 OK
{"count": 2,"next": null,"previous": null,"results": [{"id": 1948,"user_key": "g7lvoickax9e","name": "Alex Doe","email": "johndoe@example.com","gender": "unknown","status": "visitor","phone_number": null,"first_seen": null,"last_seen": null,"page_views": 0,"last_ip": null,"timezone": null,"city": null,"region": null,"country": null,"unsubscribed": true,"browser_language": null,"widget_language": null,"score": 0,"browser": null,"os_type": null,"resolution": null,"created_at": "2026-11-17T15:03:11.521862Z","updated_at": "2026-11-17T15:03:11.521871Z","companies": [],"gravatar_url": null,"lists": [],"tags": [],"notifications": true,"facebook_url": null,"linkedin_url": null,"twitter_url": null,"google_url": null,"last_contacted": null,"custom_id": "alex","web_push_subscription": false,"assigned_to": null,"most_active_time": null,"lt_opened_email": null,"lt_clicked_email": null,"email_mx_valid": true,"referrer": null,"last_heard_from": null,"spambounced": false,"softbounced": false,"hardbounced": false,"marked_email_as_spam": true,"email_opt_in": null,"email_tracking_optin": null},{"id": 1947,"user_key": "g7lvoickax9e","name": "Piotr","email": "johndoe@example.com","gender": "unknown","status": "visitor","phone_number": null,"first_seen": null,"last_seen": null,"page_views": 0,"last_ip": null,"timezone": null,"city": null,"region": null,"country": null,"unsubscribed": true,"browser_language": null,"widget_language": null,"score": 0,"browser": null,"os_type": null,"resolution": null,"created_at": "2026-11-17T15:00:48.168590Z","updated_at": "2026-11-17T15:00:48.168602Z","companies": [],"gravatar_url": null,"lists": [],"tags": ,1 item"notifications": true,"facebook_url": null,"linkedin_url": null,"twitter_url": null,"google_url": null,"last_contacted": null,"custom_id": "imported-contact-2","web_push_subscription": false,"assigned_to": null,"most_active_time": null,"lt_opened_email": null,"lt_clicked_email": null,"email_mx_valid": true,"referrer": null,"last_heard_from": null,"spambounced": false,"softbounced": false,"hardbounced": false,"marked_email_as_spam": true,"email_opt_in": null,"email_tracking_optin": null}]}Response fields
Fields returned in the 200 OK response body.
- count
- Number of results across all pages. It can lag behind recent changes; see Response pagination.
- next
- URL of the next page of results. null on the last page.
- previous
- URL of the previous page of results. null on the first page.
- results
- Results on this page.
- results[].
id - A unique identifier for the user which is given by User automatically.
- results[].
user_key - A unique identifier (12 random characters) for the user which is given by User automatically.
- results[].
name - Read-only attribute, made from the combination of the first_name and last_name attributes.
- results[].
email - A user email
- results[].
gender unknown(default),maleorfemale. Not detected automatically.- results[].
status userif the contact's email address has been sent to User through the code on your website, otherwisevisitor.- results[].
phone_number - A user phone number
- results[].
first_seen - A date for user's first website visit.
- results[].
last_seen - A date of last user's website visit.
- results[].
page_views - A total number of user's page visits occurrences.
- results[].
last_ip - An address IP (identifier assigned to each device, e.g., laptop, printer, mobile etc.) from the last user visit.
- results[].
timezone - A timezone of the user's browser.
- results[].
city - City of the contact's last visit, based on the IP address.
- results[].
region - Region of the contact's last visit, based on the IP address.
- results[].
country - Country of the contact's last visit, based on the IP address.
- results[].
unsubscribed - A flag true/false informing if user is unsubscribed from emails.
- results[].
browser_language - A user's browser language
- results[].
widget_language - Language of the chat widget for this contact, used when the widget is set to follow it;
nullif not set. - results[].
score - A number of points assinged to the user.
- results[].
browser - A name of user's browser last used to visit your website.
- results[].
os_type - An operating system of the user’s device
- results[].
resolution - A screen resolution of the device the user has visited your website.
- results[].
created_at - A creation date of a user.
- results[].
updated_at - A date of last user update.
- results[].
companies - Companies the contact is a member of, each with
id,nameandmember_since.- results[].
companies[]. name - Name of the company.
- results[].
companies[]. id - ID of the company.
- results[].
companies[]. member_since
- results[].
- results[].
gravatar_url - A user avatar url from gravatar.
- results[].
lists - Lists the contact is on, each with
id,nameanddescription.- results[].
lists[]. id - ID of the list.
- results[].
lists[]. name - Name of the list.
- results[].
lists[]. description - Description of the list.
- results[].
- results[].
tags - Tags on the contact, each with
idandname.- results[].
tags[]. id - ID of the tag.
- results[].
tags[]. name - Name of the tag.
- results[].
- results[].
notifications - A flag true/false informing if your team is receiving notifications about new chat messages from this user.
- results[].
facebook_url - A URL of user's Facebook profile.
- results[].
linkedin_url - A URL of user's LinkedIn profile.
- results[].
twitter_url - A URL of user's Twitter profile.
- results[].
google_url - A URL of user's Google+ profile.
- results[].
last_contacted - A date of last contact with user - any communication (email or chat, automated or otherwise) sent from your team to the user.
- results[].
custom_id - The unique identifier for the user which is provided by the client.
- results[].
web_push_subscription trueif the contact has at least one web push subscription.- results[].
assigned_to - ID of the agent group the contact is assigned to, or
null. - results[].
most_active_time - Most Active Time is an attribute that is based on historical data determined by the hours of previous use and the most likely active use. Time in this attribute is positioned in the UTC timezone, and there's no possible way to change the timezone for the attribute.
- results[].
lt_opened_email - When the contact last opened one of your emails.
- results[].
lt_clicked_email - When the contact last clicked a link in one of your emails.
- results[].
email_mx_valid - Whether the email address passed User's validation; set to
falseafter a hard bounce. - results[].
referrer - URL of the page the contact came to your website from.
- results[].
last_heard_from - When the contact last sent your team a message (chat or email). Emails count only once your inbox is connected over IMAP.
- results[].
spambounced trueonce an email to the contact bounced as spam.- results[].
softbounced trueonce an email to the contact soft-bounced.- results[].
hardbounced trueonce an email to the contact hard-bounced or was dropped.- results[].
marked_email_as_spam - Defaults to
trueand isn't changed when emails bounce; checkspambouncedfor spam bounces. - results[].
email_opt_in - Email marketing consent:
truegiven,falserefused,nullnot recorded. - results[].
email_tracking_optin - Consent to email open and click tracking:
truegiven,falserefused,nullnot recorded.
- results[].
note
Errors that can come from any endpoint (401, 429, 500, 502, 504) are described in HTTP response codes.