Riferimento API

Azioni

Un'azione è uno strumento del server MCP, via REST. Ognuna ha il nome, l'input e il risultato del suo strumento MCP, quindi uno script esegue ciò che eseguirebbe un assistente IA, con una chiave API e senza client MCP.

La maggior parte è anche un endpoint a sé nelle altre pagine. Usa un'azione per uno strumento che non ha un endpoint, o per chiamare tutti gli strumenti allo stesso modo.

L'oggetto azione

Uno strumento del server MCP, come lo vede la tua chiave.

Attributi

  • objectstring
    Sempre action.
  • namestring
    Il suo nome, lo stesso dello strumento MCP, come search_leads.
  • titlestring
    Il suo titolo in poche parole.
  • descriptionstring
    Cosa fa e cosa restituisce, le parole che legge un assistente IA.
  • scopestring
    write quando modifica i dati. Una chiave con read esegue solo le altre.
    readwrite
  • input_schemaobject
    Il JSON Schema del body che accetta, i suoi campi e quelli obbligatori.
L'oggetto azione
{
  "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
  }
}

Elenca le azioni

GET/v1/actionsScope read

Restituisce tutte le azioni che la tua chiave può eseguire, per nome.

Restituisce

Un elenco di oggetti azione, tutte in una sola pagina.

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

Recupera un'azione

GET/v1/actions/:nameScope read

Restituisce un'azione, con lo schema del body che accetta.

Parametri di percorso

  • namestringObbligatorio
    Il nome dell'azione, come search_leads.

Restituisce

Un oggetto azione.

Errori

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

Esegui un'azione

POST/v1/actions/:nameScope read

Esegue un'azione come il server MCP esegue il suo strumento. Il body è il suo input, i campi che elenca il suo input_schema, oppure vuoto per un'azione che non accetta nulla. Un'azione con scope write richiede una chiave con write.

Parametri di percorso

  • namestringObbligatorio
    Il nome dell'azione, come search_leads.

Restituisce

Un oggetto risultato dell'azione. Gli errori propri dell'azione arrivano così come sono, come resource_missing per un lead che non è sull'account.

Errori

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

L'oggetto risultato dell'azione

Ciò che un'azione ha restituito quando l'hai eseguita.

Attributi

  • objectstring
    Sempre action_result.
  • actionstring
    Il nome dell'azione.
  • resultany
    Il suo risultato, lo stesso dello strumento MCP, come un oggetto lead per get_lead. null quando non restituisce nulla.
L'oggetto risultato dell'azione
{
  "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
  }
}