Referencia de la API

Acciones

Una acción es una herramienta del servidor MCP, por REST. Cada una tiene el nombre, la entrada y el resultado de su herramienta MCP, así que un script ejecuta lo mismo que un asistente de IA, con una clave API y sin cliente MCP.

La mayoría también es un endpoint propio en las otras páginas. Usa una acción para una herramienta que no tiene endpoint, o para llamar a todas las herramientas de la misma forma.

El objeto acción

Una herramienta del servidor MCP, tal como la ve tu clave.

Atributos

  • objectstring
    Siempre action.
  • namestring
    Su nombre, el mismo que el de la herramienta MCP, como search_leads.
  • titlestring
    Su título en pocas palabras.
  • descriptionstring
    Lo que hace y lo que devuelve, las palabras que lee un asistente de IA.
  • scopestring
    write cuando modifica datos. Una clave con read solo ejecuta las demás.
    readwrite
  • input_schemaobject
    El JSON Schema del cuerpo que recibe, sus campos y los obligatorios.
El objeto acción
{
  "object": "action",
  "name": "get_lead",
  "title": "Get lead",
  "description": "One lead by id: X profile, score and reason, hot, status, persona, campaign, conversation id, locked_to (the one X account of the owner allowed to contact this person, when a campaign or a conversation holds it), your metadata.",
  "scope": "read",
  "input_schema": {
    "type": "object",
    "properties": {
      "lead_id": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64,
        "description": "From search_leads."
      }
    },
    "required": ["lead_id"],
    "additionalProperties": false
  }
}

Listar acciones

GET/v1/actionsScope read

Devuelve todas las acciones que tu clave puede ejecutar, por nombre.

Devuelve

Una lista de objetos acción, todas en una sola página.

GET/v1/actions
curl https://gemlead.ai/api/v1/actions \
  -H "Authorization: Bearer $GEMLEAD_API_KEY"
Respuesta200
{
  "object": "list",
  "data": [
    {
      "object": "action",
      "name": "get_lead",
      "title": "Get lead",
      "description": "One lead by id: X profile, score and reason, hot, status, persona, campaign, conversation id, locked_to (the one X account of the owner allowed to contact this person, when a campaign or a conversation holds it), your metadata.",
      "scope": "read",
      "input_schema": {
        "type": "object",
        "properties": {
          "lead_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "From search_leads."
          }
        },
        "required": ["lead_id"],
        "additionalProperties": false
      }
    }
  ],
  "has_more": false
}

Obtener una acción

GET/v1/actions/:nameScope read

Devuelve una acción, con el esquema del cuerpo que recibe.

Parámetros de ruta

  • namestringObligatorio
    El nombre de la acción, como search_leads.

Devuelve

Un objeto acción.

Errores

GET/v1/actions/:name
curl https://gemlead.ai/api/v1/actions/get_lead \
  -H "Authorization: Bearer $GEMLEAD_API_KEY"
Respuesta200
{
  "object": "action",
  "name": "get_lead",
  "title": "Get lead",
  "description": "One lead by id: X profile, score and reason, hot, status, persona, campaign, conversation id, locked_to (the one X account of the owner allowed to contact this person, when a campaign or a conversation holds it), your metadata.",
  "scope": "read",
  "input_schema": {
    "type": "object",
    "properties": {
      "lead_id": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64,
        "description": "From search_leads."
      }
    },
    "required": ["lead_id"],
    "additionalProperties": false
  }
}

Ejecutar una acción

POST/v1/actions/:nameScope read

Ejecuta una acción como el servidor MCP ejecuta su herramienta. El cuerpo es su entrada, los campos que lista su input_schema, o vacío para una acción que no recibe nada. Una acción cuyo scope es write necesita una clave con write.

Parámetros de ruta

  • namestringObligatorio
    El nombre de la acción, como search_leads.

Devuelve

Un objeto resultado de acción. Los errores propios de la acción llegan tal cual, como resource_missing para un lead que no está en la cuenta.

Errores

POST/v1/actions/:name
curl -X POST https://gemlead.ai/api/v1/actions/get_lead \
  -H "Authorization: Bearer $GEMLEAD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "lead_id": "msgOtJ8dvT"
  }'
Respuesta200
{
  "object": "action_result",
  "action": "get_lead",
  "result": {
    "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": {},
    "contact": null
  }
}

El objeto resultado de acción

Lo que devolvió una acción cuando la ejecutaste.

Atributos

  • objectstring
    Siempre action_result.
  • actionstring
    El nombre de la acción.
  • resultany
    Su resultado, el mismo que el de la herramienta MCP, como un objeto lead para get_lead. null cuando no devuelve nada.
El objeto resultado de acción
{
  "object": "action_result",
  "action": "get_lead",
  "result": {
    "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": {},
    "contact": null
  }
}