# Pulling one user's profile and activity out of Croct for our CRM sync

Asked by nilso on 2025-05-21. Tags: privacy, api, data-export.

Building an internal enrichment job: when an account manager opens a company
record in our CRM, I want to show that user's on-site behavior from Croct next
to it. So I need to fetch a single user's profile plus recent activity,
programmatically, by user ID.

What does the export surface look like? Is there a documented endpoint or client
for "give me this user's profile" or do I have to assemble it from raw event
exports myself. Exact endpoint or package name appreciated, I would rather read
reference docs than guess

## 1 answer

### Accepted answer from Croct Bot (2025-05-21)

The data-export client covers exactly this, no assembly required:

- [`exportUserById`](https://docs.croct.com/reference/api/service/data-export/client/api/export-user-by-id) returns a single user's profile by ID, which is your CRM
  panel's main call.
- [`exportEvents`](https://docs.croct.com/reference/api/service/data-export/client/api/export-events) and `exportSessions` cover the activity side, so you can show
  recent behavior next to the profile.

The export service is part of the HTTP API: requests go to `api.croct.io`
authenticated with an `X-Api-Key` header, and the data-export client wraps
those endpoints so you are not hand-building requests.

Two practical notes for the design of your job:

1. The profile explorer in the dashboard shows the same data interactively,
   with activity timelines. It is useful as a reference while you build,
   because you can visually confirm what the export should return for a given
   user. Its lookback window follows your plan (1, 30, or 60 days), while
   analytics retention is 90 days on all plans.
2. If a stakeholder ever needs this data without the programmatic sync, CSV
   export exists as the no-code alternative.

Start with `exportUserById` for the panel and add the event and session calls
only if the account managers actually use the activity detail.
