Export user by ID
Export a single user by ID.
Example
Here is an example of how to export a single user by ID:
const userId = '6d5f1fe8-3f21-4bce-9afb-e1d11b610674';const url = new URL(`https://api.croct.io/export/user/${userId}`);
const response = await fetch(url, { headers: { 'X-Api-Key': '<API KEY>', },});
const user = await response.json();Headers
This endpoint requires the following HTTP headers:
- X-Api-Keystring
The API key of the application associated with the workspace from which to export the user.
Parameters
This endpoint accepts the following path parameters:
- userIdstring
The ID of the user in UUID format.
Response
This endpoint returns a JSON response with the following properties:
- userIdstring
The internal ID assigned to the user, unique across the workspace, in UUID format.
- externalUserIdstring|null
The external user ID used to identify the user on the application side.
Always null for anonymous users.
- firstNamestring|null
The user’s first name.
- lastNamestring|null
The user’s last name.
- birthDateinteger|null
The user’s birth date, in milliseconds since epoch.
- genderstring
The user’s gender.
These are the possible values and what they represent:
Value Description MALE Male gender. FEMALE Female gender. NEUTRAL Neither male nor female gender. UNKNOWN An unspecified gender. - emailstring|null
The user’s primary email address.
- alternateEmailstring|null
The user’s alternate email address.
- phonestring|null
The user’s primary phone number.
- alternatePhonestring|null
The user’s alternate phone number.
- addressUserAddress
- avatarstring|null
The URL of the user’s avatar image.
- companystring|null
The user’s company name.
- companyUrlstring|null
The user’s company website URL.
- jobTitlestring|null
The user’s job title.
- activitiesArray<string>
The user’s activities.
- interestsArray<string>
The user’s interests.
- customAttributesobject
Custom attributes associated with the user.
- lastModifiedTimeinteger
The timestamp when the user was last modified, in milliseconds since epoch.
Not updated on sync operations.
- statisticsUserStatistics
Example response
Here is an example of a JSON response from this endpoint:
{ "userId": "6d5f1fe8-3f21-4bce-9afb-e1d11b610674", "externalUserId": "d9e7908f-791a-4c4a-89ac-234502b8f817", "firstName": "Erick", "lastName": "Doe", "birthDate": 1440892800000, "gender": "MALE", "email": "erick.doe@croct.com", "alternateEmail": "erick.doe@gmail.com", "phone": "+5511999999999", "alternatePhone": "+551133333333", "address": { "street": "Rua Fidêncio Ramos", "district": "Vila Olímpia", "city": "São Paulo", "region": "São Paulo", "country": "BR", "postalCode": "04551-010" }, "avatar": "https://croct.com/erick.png", "company": "Croct", "companyUrl": "https://croct.com", "jobTitle": "Developer", "activities": ["clicked-banner"], "interests": ["credit-card"], "customAttributes": { "plan": "Pro", "subscriptionDate": "2025-01-01" }, "lastModifiedTime": 1440979201000, "statistics": { "orders": 10, "sessions": 200 }}If no user matches the given ID, the endpoint responds with a resource not found error.