API reference
Exports
An export builds one file with every lead that matches your filters, for the pulls too big to page through. Create it, then retrieve it until its status is ready and download its url. You can create 10 exports an hour per account.
With type set to conversations, the file holds every DM conversation of the account instead, each with its lead and every message from the first one. It is made to study your DMs in bulk, with an AI assistant or your own code, to see which opener gets replies and which answer moves a lead past an objection. Gemlead keeps its own copy of every DM in sync with X, edits and deletions included, so the file is built from that copy without a call to X and 1 500 conversations are ready in under a minute.
The export object
A file of leads or of conversations built in the background, for the big pulls pagination is too slow for.
Attributes
- idstringUnique identifier for the export.
- objectstringAlways
export. - typestringWhat the file holds, leads or conversations with their messages.
leadsconversations - statusstring
processingwhile the file is built, thenreadyorfailed.expiredonce its link is gone.processingreadyfailedexpired - formatstringThe file's format,
csvorjsonlfor leads,jsonlormarkdownfor conversations.csvjsonlmarkdown - filtersobjectThe filters the export was created with, as in List leads or List conversations.
- row_countintegerLeads or conversations in the file. It grows while the file is built. 100 000 leads or 20 000 conversations at most.
- total_countinteger or nullFor a conversations export without filters, how many conversations the file will hold, counted when the build starts.
nullotherwise. - urlstring or nullWhere to download the file, once ready. It works for 24 hours, until
expires_at. - expires_atstring or nullWhen
urlstops working, ISO 8601. - created_atstringWhen the export was created, ISO 8601.
{
"id": "e4TnW8yHqA",
"object": "export",
"type": "leads",
"status": "ready",
"format": "csv",
"filters": {
"hot": true,
"persona": "lvWBPnytpS"
},
"row_count": 2134,
"total_count": null,
"url": "https://parsefiles.back4app.com/7Hn2kQ9xWm4LpR8tV3bZc6YdF1sJ0aUe/5f1c9e2b7a4d8c3e6f0b9a2d1c4e7f8a_gemlead-leads-e4TnW8yHqA.csv",
"expires_at": "2026-11-07T07:45:12.904Z",
"created_at": "2026-11-06T07:45:12.904Z"
}Create an export
Starts building a file of leads or of conversations. It answers at once with the export in processing.
Body parameters
- typestringWhat to export. Defaults to
leads.leadsconversations - formatstringThe file's format. For leads
csvorjsonl,csvby default. For conversationsjsonlormarkdown,jsonlby default.csvjsonlmarkdown - filtersobjectThe leads to export, with the filters of List leads. For conversations, only
personaandunread, as in List conversations.
Returns
An export object with the status processing, and the HTTP status 202.
Errors
- A required parameter is missing.
paramnames it. - A parameter has a value the API does not accept.
paramnames it. - More than 10 exports in the last hour on the account.
curl -X POST https://gemlead.ai/api/v1/exports \
-H "Authorization: Bearer $GEMLEAD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"format": "csv",
"filters": {
"hot": true,
"persona": "lvWBPnytpS"
}
}'{
"id": "e4TnW8yHqA",
"object": "export",
"type": "leads",
"status": "processing",
"format": "csv",
"filters": {
"hot": true,
"persona": "lvWBPnytpS"
},
"row_count": 0,
"total_count": null,
"url": null,
"expires_at": null,
"created_at": "2026-11-06T07:45:12.904Z"
}List exports
Returns your exports, newest first.
Query parameters
- limitintegerHow many objects to return, from 1 to 100. Defaults to 25.
- cursorstringThe
next_cursorof the previous page, to get the page after it. See Pagination.
Returns
A list of export objects.
curl https://gemlead.ai/api/v1/exports \
-H "Authorization: Bearer $GEMLEAD_API_KEY"{
"object": "list",
"data": [
{
"id": "e4TnW8yHqA",
"object": "export",
"type": "leads",
"status": "ready",
"format": "csv",
"filters": {
"hot": true,
"persona": "lvWBPnytpS"
},
"row_count": 2134,
"total_count": null,
"url": "https://parsefiles.back4app.com/7Hn2kQ9xWm4LpR8tV3bZc6YdF1sJ0aUe/5f1c9e2b7a4d8c3e6f0b9a2d1c4e7f8a_gemlead-leads-e4TnW8yHqA.csv",
"expires_at": "2026-11-07T07:45:12.904Z",
"created_at": "2026-11-06T07:45:12.904Z"
}
],
"has_more": false,
"next_cursor": null
}Retrieve an export
Returns an export. Retrieve it every few seconds until status is ready, then download url.
Path parameters
- idstringRequiredThe export's ID.
Returns
An export object.
Errors
- No export with this ID on the key's account.
curl https://gemlead.ai/api/v1/exports/e4TnW8yHqA \
-H "Authorization: Bearer $GEMLEAD_API_KEY"{
"id": "e4TnW8yHqA",
"object": "export",
"type": "leads",
"status": "ready",
"format": "csv",
"filters": {
"hot": true,
"persona": "lvWBPnytpS"
},
"row_count": 2134,
"total_count": null,
"url": "https://parsefiles.back4app.com/7Hn2kQ9xWm4LpR8tV3bZc6YdF1sJ0aUe/5f1c9e2b7a4d8c3e6f0b9a2d1c4e7f8a_gemlead-leads-e4TnW8yHqA.csv",
"expires_at": "2026-11-07T07:45:12.904Z",
"created_at": "2026-11-06T07:45:12.904Z"
}A conversation in the file
Each line of a jsonl file of conversations, the latest conversation first. It is the conversation object with its whole thread, its lead and history. A markdown file holds the same, as one transcript per conversation.
Attributes
- idstringUnique identifier for the conversation.
- objectstringAlways
conversation. - lead_idstringThe lead you are talking to.
- profileobjectThe lead's X profile, as on the lead object.
- personaobject or nullThe lead's persona.
- columnobject or nullThe column of your Conversations board the conversation sits in.
- unreadbooleanTrue when the lead's last message is not read yet.
- messages_countintegerMessages in
messages. - first_message_atstring or nullWhen the first message was sent, ISO 8601.
- last_message_atstring or nullWhen the last message was sent, ISO 8601.
- last_messageobject or nullThe last message.
- leadobject or nullThe lead object, with its score, status, persona and campaign.
- historystring
completewhenmessagesis the whole thread.recentwhile Gemlead holds only the latest messages of a long thread, before it reads the rest from X once.completerecent - messagesarray of objectsEvery message of the thread, oldest first, with its direction, text, time, media and reactions. Media links work for 24 hours.
{
"id": "msgOtJ8dvT",
"object": "conversation",
"lead_id": "msgOtJ8dvT",
"profile": {
"x_user_id": "1460283925",
"username": "jane_builds",
"name": "Jane Doe",
"bio": "Runs a paid trading community. Daily setups, no hype.",
"followers_count": 12400,
"following_count": 380,
"location": "Austin, TX",
"website": "https://janedoe.com",
"profile_image_url": "https://pbs.twimg.com/profile_images/1460283925/jane_400x400.jpg",
"verified": true,
"url": "https://x.com/jane_builds"
},
"unread": false,
"last_message_at": "2026-11-06T08:12:44.000Z",
"messages_count": 1,
"last_message": {
"id": "1985321409876543210",
"object": "message",
"direction": "inbound",
"text": "Yes, I want to charge for my Discord. How does it work?",
"created_at": "2026-11-06T08:12:44.000Z",
"media": [],
"reactions": [],
"encrypted": false,
"reply_to_message_id": null
},
"persona": {
"id": "lvWBPnytpS",
"name": "Tipsters"
},
"column": {
"id": "q7m2xk4p",
"name": "Interested"
},
"first_message_at": "2026-11-06T08:12:44.000Z",
"lead": {
"id": "msgOtJ8dvT",
"object": "lead",
"profile": {
"x_user_id": "1460283925",
"username": "jane_builds",
"name": "Jane Doe",
"bio": "Runs a paid trading community. Daily setups, no hype.",
"followers_count": 12400,
"following_count": 380,
"location": "Austin, TX",
"website": "https://janedoe.com",
"profile_image_url": "https://pbs.twimg.com/profile_images/1460283925/jane_400x400.jpg",
"verified": true,
"url": "https://x.com/jane_builds"
},
"score": 86,
"score_reason": "Runs a paid trading community and asks how to collect payments for it.",
"hot": true,
"status": "scored",
"persona": {
"id": "lvWBPnytpS",
"name": "Tipsters"
},
"campaign": null,
"conversation_id": null,
"locked_to": null,
"found_at": "2026-11-05T14:02:11.482Z",
"scored_at": "2026-11-05T14:03:40.117Z",
"updated_at": "2026-11-05T14:03:40.117Z",
"metadata": {}
},
"history": "complete",
"messages": [
{
"id": "1985321409876543210",
"object": "message",
"direction": "inbound",
"text": "Yes, I want to charge for my Discord. How does it work?",
"created_at": "2026-11-06T08:12:44.000Z",
"media": [],
"reactions": [],
"encrypted": false,
"reply_to_message_id": null
}
]
}