API reference
Account
The account is the X account a key belongs to. Read it to check a key, change its settings, restart the sync of its X inbox or give Gemlead its X Chat passcode. The owner's time zone, language and name are shared by all their X accounts.
The account object
The X account a key belongs to. A key works on one X account, and an owner with several X accounts has a key for each.
Attributes
- objectstringAlways
account. - idstringUnique identifier for the account.
- usernamestringThe X username, without the @.
- namestringThe display name on X.
- profile_image_urlstring or nullThe profile picture's URL.
- planstringThe owner's plan.
businessenterprise
{
"object": "account",
"id": "a9PzK2vRtM",
"username": "acme",
"name": "Acme",
"profile_image_url": "https://pbs.twimg.com/profile_images/1180044592/acme_400x400.jpg",
"plan": "business"
}Retrieve the account
Returns the X account the key belongs to. A good first call to check a key.
Returns
An account object.
Errors
- The key is wrong.
- The account's owner is on the Free or Starter plan.
curl https://gemlead.ai/api/v1/account \
-H "Authorization: Bearer $GEMLEAD_API_KEY"{
"object": "account",
"id": "a9PzK2vRtM",
"username": "acme",
"name": "Acme",
"profile_image_url": "https://pbs.twimg.com/profile_images/1180044592/acme_400x400.jpg",
"plan": "business"
}Refresh the X profile
Reads the account's X profile again, for a new name or photo.
Returns
The account object.
Errors
- The X account's session expired. Reconnect it in the app, then try again.
- X or a Gemlead service did not answer. Nothing changed, try again in a minute.
curl -X POST \
https://gemlead.ai/api/v1/account/refresh_profile \
-H "Authorization: Bearer $GEMLEAD_API_KEY"{
"object": "account",
"id": "a9PzK2vRtM",
"username": "acme",
"name": "Acme",
"profile_image_url": "https://pbs.twimg.com/profile_images/1180044592/acme_400x400.jpg",
"plan": "business"
}The account settings object
How the account syncs its X inbox, whether its DMs are paused, and its owner's profile. The owner's time zone, language and name are shared by all their X accounts.
Attributes
- objectstringAlways
account_settings. - account_idstringThe account's ID.
- syncobjectThe sync of the X inbox into Gemlead.
- dms_paused_untilstring or nullWhile X limits the account, when its DMs start again, ISO 8601.
- ownerobjectThe owner of the account.
{
"object": "account_settings",
"account_id": "a9PzK2vRtM",
"sync": {
"all_conversations": true,
"status": "done",
"conversations": 1342
},
"dms_paused_until": null,
"owner": {
"first_name": "Alex",
"last_name": "Martin",
"timezone": "Europe/Paris",
"language": "en"
}
}curl https://gemlead.ai/api/v1/account/settings \
-H "Authorization: Bearer $GEMLEAD_API_KEY"{
"object": "account_settings",
"account_id": "a9PzK2vRtM",
"sync": {
"all_conversations": true,
"status": "done",
"conversations": 1342
},
"dms_paused_until": null,
"owner": {
"first_name": "Alex",
"last_name": "Martin",
"timezone": "Europe/Paris",
"language": "en"
}
}Update account settings
Changes the settings you send and keeps the others.
Body parameters
- sync_all_conversationsboolean
truesyncs every conversation of the X inbox and walks it again now.falsekeeps the conversations with leads only. - timezonestringThe owner's IANA time zone, like
Europe/Paris. Charts and daily counts follow it. - languagestringThe owner's app language.
enfresitderuptnlja - first_namestringThe owner's first name, up to 60 characters.
- last_namestringThe owner's last name, up to 60 characters.
Returns
The updated account settings object.
Errors
- A parameter has a value the API does not accept.
paramnames it. - The body has a field this endpoint does not take.
- The X account's session expired. Reconnect it in the app, then try again.
curl -X PATCH https://gemlead.ai/api/v1/account/settings \
-H "Authorization: Bearer $GEMLEAD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"timezone": "Europe/Paris"
}'{
"object": "account_settings",
"account_id": "a9PzK2vRtM",
"sync": {
"all_conversations": true,
"status": "done",
"conversations": 1342
},
"dms_paused_until": null,
"owner": {
"first_name": "Alex",
"last_name": "Martin",
"timezone": "Europe/Paris",
"language": "en"
}
}Restart the inbox sync
Walks the X inbox again from the start, to bring back conversations Gemlead missed.
Returns
Errors
- The X account's session expired. Reconnect it in the app, then try again.
curl -X POST https://gemlead.ai/api/v1/account/sync/restart \
-H "Authorization: Bearer $GEMLEAD_API_KEY"{
"object": "account_settings",
"account_id": "a9PzK2vRtM",
"sync": {
"all_conversations": true,
"status": "syncing",
"conversations": 1342
},
"dms_paused_until": null,
"owner": {
"first_name": "Alex",
"last_name": "Martin",
"timezone": "Europe/Paris",
"language": "en"
}
}Pause the inbox sync
Pauses the sync of the X inbox.
Returns
Errors
- The X account's session expired. Reconnect it in the app, then try again.
curl -X POST https://gemlead.ai/api/v1/account/sync/pause \
-H "Authorization: Bearer $GEMLEAD_API_KEY"{
"object": "account_settings",
"account_id": "a9PzK2vRtM",
"sync": {
"all_conversations": true,
"status": "paused",
"conversations": 1342
},
"dms_paused_until": null,
"owner": {
"first_name": "Alex",
"last_name": "Martin",
"timezone": "Europe/Paris",
"language": "en"
}
}Resume the inbox sync
Resumes a paused sync of the X inbox.
Returns
Errors
- The X account's session expired. Reconnect it in the app, then try again.
curl -X POST https://gemlead.ai/api/v1/account/sync/resume \
-H "Authorization: Bearer $GEMLEAD_API_KEY"{
"object": "account_settings",
"account_id": "a9PzK2vRtM",
"sync": {
"all_conversations": true,
"status": "syncing",
"conversations": 1342
},
"dms_paused_until": null,
"owner": {
"first_name": "Alex",
"last_name": "Martin",
"timezone": "Europe/Paris",
"language": "en"
}
}The X Chat object
X Chat is X's encrypted inbox. Gemlead reads its messages once it has the account's 4 digit X Chat passcode. Connecting X Chat happens in the app.
Attributes
- objectstringAlways
x_chat. - connectedboolean
truewhen the account is connected to X Chat in the app. - passcode_setboolean
truewhen Gemlead has the X Chat passcode. The passcode itself is never returned. - unlockobject or nullThe decryption of the X Chat history after the passcode,
nullwhen none ran.
{
"object": "x_chat",
"connected": true,
"passcode_set": true,
"unlock": {
"running": false,
"total": 214,
"done": 214,
"finished_at": "2026-11-06T07:58:30.000Z"
}
}Retrieve X Chat
Returns whether the account is connected to X Chat, whether Gemlead has its passcode, and how far the decryption of its history went.
Returns
An X Chat object.
curl https://gemlead.ai/api/v1/account/x_chat \
-H "Authorization: Bearer $GEMLEAD_API_KEY"{
"object": "x_chat",
"connected": true,
"passcode_set": true,
"unlock": {
"running": false,
"total": 214,
"done": 214,
"finished_at": "2026-11-06T07:58:30.000Z"
}
}The passcode result
What setting or removing the X Chat passcode returns.
Attributes
- objectstringAlways
x_chat. - passcode_setboolean
truewhen Gemlead keeps a passcode. - unlockedboolean
truewhen X accepted the passcode and Gemlead can read the encrypted messages. - reasonstringOnly when it did not unlock, why.
passcodemeans X refused the passcode, and Gemlead removes it. - remaining_attemptsinteger or nullOnly when it did not unlock, the tries X still allows, when X says.
{
"object": "x_chat",
"passcode_set": false,
"unlocked": false,
"reason": "passcode",
"remaining_attempts": 3
}Set the X Chat passcode
write scopeGives Gemlead the account's X Chat passcode, then unlocks the encrypted messages with it. You can try 5 times an hour, X counts every try. REST only. No MCP tool sets or removes a passcode, by design, so a passcode never goes through an AI chat.
Body parameters
- passcodestringRequiredThe X Chat passcode, 4 digits like
4821.
Returns
A passcode result, with reason and remaining_attempts when X refused the passcode.
Errors
- A required parameter is missing.
paramnames it. - A parameter has a value the API does not accept.
paramnames it. - More than 5 tries in the hour on the account.
- X or a Gemlead service did not answer. Nothing changed, try again in a minute.
curl -X PUT \
https://gemlead.ai/api/v1/account/x_chat/passcode \
-H "Authorization: Bearer $GEMLEAD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"passcode": "4821"
}'{
"object": "x_chat",
"passcode_set": true,
"unlocked": true
}Remove the X Chat passcode
write scopeRemoves the passcode from Gemlead. New X Chat messages stay encrypted until you set it again. REST only. No MCP tool sets or removes a passcode, by design, so a passcode never goes through an AI chat.
Returns
A passcode result, passcode_set at false.
curl -X DELETE \
https://gemlead.ai/api/v1/account/x_chat/passcode \
-H "Authorization: Bearer $GEMLEAD_API_KEY"{
"object": "x_chat",
"passcode_set": false,
"unlocked": false
}