API-Referenz

Aktionen

Eine Aktion ist ein Tool des MCP-Servers, über REST. Jede hat den Namen, die Eingabe und das Ergebnis ihres MCP-Tools, also führt ein Skript aus, was ein KI-Assistent ausführen würde, mit einem API-Schlüssel und ohne MCP-Client.

Die meisten sind auf den anderen Seiten auch ein eigener Endpoint. Nimm eine Aktion für ein Tool ohne Endpoint, oder um jedes Tool auf dieselbe Weise aufzurufen.

Das Aktion-Objekt

Ein Tool des MCP-Servers, so wie dein Schlüssel es sieht.

Attribute

  • objectstring
    Immer action.
  • namestring
    Ihr Name, derselbe wie der des MCP-Tools, etwa search_leads.
  • titlestring
    Ihr Titel in wenigen Worten.
  • descriptionstring
    Was sie tut und was sie zurückgibt, die Worte, die ein KI-Assistent liest.
  • scopestring
    write, wenn sie Daten ändert. Ein Schlüssel mit read führt nur die anderen aus.
    readwrite
  • input_schemaobject
    Das JSON Schema des Bodys, den sie annimmt, seine Felder und die Pflichtfelder.
Das Aktion-Objekt
{
  "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
  }
}

Aktionen auflisten

GET/v1/actionsScope read

Gibt jede Aktion, die dein Schlüssel ausführen kann, nach Namen zurück.

Rückgabe

Eine Liste von Aktion-Objekten, alle auf einer Seite.

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

Aktion abrufen

GET/v1/actions/:nameScope read

Gibt eine Aktion zurück, mit dem Schema des Bodys, den sie annimmt.

Pfadparameter

  • namestringErforderlich
    Der Name der Aktion, etwa search_leads.

Rückgabe

Ein Aktion-Objekt.

Fehler

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

Aktion ausführen

POST/v1/actions/:nameScope read

Führt eine Aktion aus, so wie der MCP-Server sein Tool ausführt. Der Body ist ihre Eingabe, die Felder, die ihr input_schema aufführt, oder leer für eine Aktion, die nichts annimmt. Eine Aktion mit dem Scope write braucht einen Schlüssel mit write.

Pfadparameter

  • namestringErforderlich
    Der Name der Aktion, etwa search_leads.

Rückgabe

Ein Aktionsergebnis-Objekt. Die eigenen Fehler der Aktion kommen unverändert, etwa resource_missing für einen Lead, der nicht im Konto ist.

Fehler

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

Das Aktionsergebnis-Objekt

Was eine Aktion zurückgegeben hat, als du sie ausgeführt hast.

Attribute

  • objectstring
    Immer action_result.
  • actionstring
    Der Name der Aktion.
  • resultany
    Ihr Ergebnis, dasselbe wie das des MCP-Tools, etwa ein Lead-Objekt für get_lead. null, wenn sie nichts zurückgibt.
Das Aktionsergebnis-Objekt
{
  "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
  }
}