While the standard /v2/users/export route will only allow let you to export 50 users at a time (before you have to page), the /v2/users/export/search route will allow you to export up to 5,000 contacts (but it can only export their Element ID, first name, last name, and email…you cannot specify columns to pull).
URL
POST https://{{client}}.api.451.io/v2/users/export/search
Headers
- Authentication = Bearer {{api_key}}
- Feature = {{feature}}
Body Schema
In general, there are two ways you can build a schema for exporting data out of Element:
-
Pre-defined/Element Segment GUID (recommended)
{
"item": {
"segment": "",
"project": [],
"per_page": #,
"last_id": ""
}
}
- Using a Segment GUID allows you to build the segment in the UI and then pass the ID of said segment here to more easily construct your request. An example of this is below.
-
Inline Segment
{
"item": {
"segment": [
"users": {
"filters": {
"type":"",
"target":"",
"operator":""
"value":""
}
}
],
"project": [],
"per_page": #,
"last_id": ""
}
}
- An example of this is below.
Here is a description of what the other properties mean/how to set them:
- "project" : [array] - (optional, default:[_id]) The fields you want to list for each user, there is a very limited amount of fields you can project (if you need more, you’ll need to use the standard /v2/users/export route):
- _id
- first_name
- last_name
- email
- "per_page" : integer - (optional, default:5000) How many users information you want to retrieve for a single request. Cannot be more than the default value.
- "last_id" : "string" - (optional, default:null) This is used to access next pages in the result set, for first page it must be NULL or not specified, on each page received you will get under “meta.next_last_id” the value you need to specify to pull the next page. You will find the last page when there are no rows in page content or “meta.next_last_id” value is empty in response.
Example 1 - Using Segment GUID
Example 2 - Using Inline Segment