API reference
API keys
An API key is a secret key of the X account, as on the app's API page. You can have 20 active keys per account. Read Authentication for how to send one.
A key's secret shows once, in the answer that makes or rolls it, and no call returns it again. Only a request made with an API key gets one. An AI app connected through OAuth cannot make or roll keys, Gemlead's in-app chat never sees a secret, and a key never gets more access than the key that makes it.
The owner and the team members who edit the settings manage the keys. A member rolls only the keys they made.
The API key object
A secret key of the X account, as the app's API page lists it. An X account has 20 active keys at most. The object never holds the secret, which only the answers of create and roll carry, once.
Attributes
- idstringUnique identifier for the key.
- objectstringAlways
api_key. - namestringThe key's name, like the tool that uses it, up to 60 characters.
- prefixstringThe secret's first 12 characters, like
gl_live_3Fk9, to tell keys apart. - scopesarray of stringsWhat the key may do,
read, orreadandwrite.readwrite - created_atstringWhen the key was made, ISO 8601.
- last_used_atstring or nullWhen the key last made a request, ISO 8601.
nulluntil it does. - currentboolean
truefor the key making this request. - secretstringThe whole key,
gl_live_and 24 letters and digits. Only in the answers of create and roll, once. No call returns it again, and Gemlead's in-app chat never sees it.
{
"id": "kY7mQ2pLxW",
"object": "api_key",
"name": "HubSpot sync",
"prefix": "gl_live_3Fk9",
"scopes": ["read"],
"created_at": "2026-09-14T09:21:05.300Z",
"last_used_at": "2026-11-06T07:45:12.904Z",
"current": false
}List API keys
Returns the X account's active API keys, as the API page lists them, without their secrets.
Returns
A list of API key objects, all in one page.
curl https://gemlead.ai/api/v1/api_keys \
-H "Authorization: Bearer $GEMLEAD_API_KEY"{
"object": "list",
"data": [
{
"id": "kY7mQ2pLxW",
"object": "api_key",
"name": "HubSpot sync",
"prefix": "gl_live_3Fk9",
"scopes": ["read"],
"created_at": "2026-09-14T09:21:05.300Z",
"last_used_at": "2026-11-06T07:45:12.904Z",
"current": false
},
{
"id": "Wq2xT9vLmC",
"object": "api_key",
"name": "Claude Code",
"prefix": "gl_live_Hn5r",
"scopes": ["read", "write"],
"created_at": "2026-09-14T09:21:05.300Z",
"last_used_at": "2026-11-06T07:45:12.904Z",
"current": true
}
],
"has_more": false,
"next_cursor": null
}Create an API key
Makes an API key for the X account. Its secret is in this answer only, so store it now. An Idempotency-Key is ignored here, so the secret is never kept for a replay.
Body parameters
- namestringThe key's name, like the tool that uses it, up to 60 characters. Defaults to
API key. - scopesarray of strings
read, the default, orreadandwrite. Askingwritegives both. Never more than the calling key has.readwrite
Returns
The new API key object with its secret, shown this once, and a message.
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 already has 20 active keys. Revoke one first.
- 403forbiddenThe call came from an AI app connected through OAuth, which cannot make keys since a key would outlive its access, or from a team member's key whose role can only view the settings.
curl -X POST https://gemlead.ai/api/v1/api_keys \
-H "Authorization: Bearer $GEMLEAD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Zapier",
"scopes": ["read", "write"]
}'{
"id": "Pz4vN8kRtB",
"object": "api_key",
"name": "Zapier",
"prefix": "gl_live_8Wd2",
"scopes": ["read", "write"],
"created_at": "2026-11-06T09:02:44.000Z",
"last_used_at": null,
"current": false,
"secret": "gl_live_8Wd2Lm4XqR7tKp9VzN3cYb6F",
"message": "Copy the secret now: it is shown this once and never again."
}Roll an API key
Gives a key a new secret and keeps its name, access and ID. The old secret stops working at once, the calling key's own included, so deploy the new one right after. The new secret is in this answer only. An Idempotency-Key is ignored here.
Path parameters
- key_idstringRequiredThe API key's ID.
Returns
The API key object with its new secret, shown this once, and a message.
Errors
- No active API key with this ID on the X account.
- The key to roll has
writeand the calling key does not. - 403forbiddenAn AI app connected through OAuth asked, a team member's key whose role can only view the settings, or a member rolling a key they did not make.
curl -X POST \
https://gemlead.ai/api/v1/api_keys/Pz4vN8kRtB/roll \
-H "Authorization: Bearer $GEMLEAD_API_KEY"{
"id": "Pz4vN8kRtB",
"object": "api_key",
"name": "Zapier",
"prefix": "gl_live_Q7mx",
"scopes": ["read", "write"],
"created_at": "2026-11-06T09:02:44.000Z",
"last_used_at": "2026-11-06T10:41:09.000Z",
"current": false,
"secret": "gl_live_Q7mxB2kWp9RtL4vZc8NyH3dF",
"message": "Copy the secret now: it is shown this once and never again. The old secret stopped working."
}Revoke an API key
Revokes a key. It stops working at once, and the webhook endpoints it made are turned off with the reason creator_revoked. Revoking the calling key ends its own access too.
Path parameters
- key_idstringRequiredThe API key's ID.
Returns
An object with the key's id, revoked set to true, current when it was the calling key, and a message.
Errors
- No active API key with this ID on the X account.
- 403forbiddenA team member's key whose role can only view the settings. The owner and the members who edit the settings can.
curl -X DELETE https://gemlead.ai/api/v1/api_keys/kY7mQ2pLxW \
-H "Authorization: Bearer $GEMLEAD_API_KEY"{
"id": "kY7mQ2pLxW",
"object": "api_key",
"revoked": true,
"current": false,
"message": "Key revoked: it stopped working, and the webhook endpoints it made are turned off."
}