API-referentie

Acties

Een actie is een tool van de MCP-server, via REST. Elke actie heeft de naam, de invoer en het resultaat van haar MCP-tool, dus een script voert uit wat een AI-assistent zou uitvoeren, met een API-sleutel en zonder MCP-client.

De meeste zijn op de andere pagina's ook een eigen endpoint. Gebruik een actie voor een tool zonder endpoint, of om elke tool op dezelfde manier aan te roepen.

Het actie-object

Een tool van de MCP-server, zoals je sleutel die ziet.

Attributen

  • objectstring
    Altijd action.
  • namestring
    Haar naam, dezelfde als die van de MCP-tool, zoals search_leads.
  • titlestring
    Haar titel in een paar woorden.
  • descriptionstring
    Wat ze doet en wat ze teruggeeft, de woorden die een AI-assistent leest.
  • scopestring
    write als ze gegevens wijzigt. Een sleutel met read voert alleen de andere uit.
    readwrite
  • input_schemaobject
    Het JSON Schema van de body die ze aanneemt, de velden ervan en welke verplicht zijn.
Het actie-object
{
  "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
  }
}

Acties opvragen

GET/v1/actionsScope read

Geeft elke actie die je sleutel kan uitvoeren terug, op naam.

Resultaat

Een lijst met actie-objecten, allemaal op één pagina.

GET/v1/actions
curl https://gemlead.ai/api/v1/actions \
  -H "Authorization: Bearer $GEMLEAD_API_KEY"
Response200
{
  "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
}

Een actie ophalen

GET/v1/actions/:nameScope read

Geeft één actie terug, met het schema van de body die ze aanneemt.

Padparameters

  • namestringVerplicht
    De naam van de actie, zoals search_leads.

Resultaat

Een actie-object.

Fouten

GET/v1/actions/:name
curl https://gemlead.ai/api/v1/actions/get_lead \
  -H "Authorization: Bearer $GEMLEAD_API_KEY"
Response200
{
  "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
  }
}

Een actie uitvoeren

POST/v1/actions/:nameScope read

Voert één actie uit zoals de MCP-server zijn tool uitvoert. De body is haar invoer, de velden die haar input_schema noemt, of leeg voor een actie die niets aanneemt. Een actie met scope write heeft een sleutel met write nodig.

Padparameters

  • namestringVerplicht
    De naam van de actie, zoals search_leads.

Resultaat

Een actieresultaat-object. De eigen fouten van de actie komen zoals ze zijn, zoals resource_missing voor een lead die niet op het account staat.

Fouten

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"
  }'
Response200
{
  "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
  }
}

Het actieresultaat-object

Wat een actie teruggaf toen je haar uitvoerde.

Attributen

  • objectstring
    Altijd action_result.
  • actionstring
    De naam van de actie.
  • resultany
    Haar resultaat, hetzelfde als dat van de MCP-tool, zoals een lead-object voor get_lead. null als ze niets teruggeeft.
Het actieresultaat-object
{
  "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
  }
}