Retrieving Users Updated Since Specific Date

Overview

This article explains how to retrieve user data for users whose profiles have been updated since a specific date.

 

Applies To

  • User Data Export
  • Management API

Solution

There is no automated way to export only users whose profiles have been updated since the last export. Manual methods exist to obtain this information, depending on the size of the user base.

 

Method 1: Management API Search (Best for Fewer Than 1,000 Users)

Query the List or Search Users endpoint directly using Lucene syntax on the updated_at field if fewer than 1,000 users changed.

  • Endpoint: GET /api/v2/users

  • Query Parameter (q): updated_at:[YYYY-MM-DD TO *]

Example Request: To find users updated since January 1st, 2024:


GET https://[YOUR_DOMAIN]/api/v2/users?q=updated_at:[2024-01-01 TO *]&search_engine=v3

Key Restrictions:

  • 1,000 User Limit: This endpoint will not return more than 1,000 results, even if you paginate through them. If you have 1,001 users who match, the API will stop at 1,000.

  • Format: Ensure the date format is YYYY-MM-DD or YYYY-MM-DDTHH:mm:ss.

Method 2: Bulk Export (Best for More Than 1,000 Users)

Perform a Bulk User Export if the user base is large and many profiles have changed, as the search endpoint fails due to the limit.

  1. Create an Export Job using the Management API (POST /api/v2/jobs/users-exports) to export the entire user database to a JavaScript Object Notation (JSON) or Comma-Separated Values (CSV) file. NOTE: The export job generally does not support a q filter parameter; it exports the full connection.

  2. Download the file once the job completes.

  3. Use a script (Python, Node.js) or a tool like jq to filter the JSON for records where updated_at is greater than <YOUR_DATE>.

 

Recommendation:

Start with Method 1. Assume the data is incomplete and switch to Method 2 if the response returns exactly 1,000 users.

Recommended content

No recommended content found...