APIリファレンス
アクション
アクションはMCPサーバーのツールをRESTで使うものです。それぞれがMCPツールと同じ名前、入力、結果を持つので、スクリプトはAIアシスタントと同じことを、APIキーだけでMCPクライアントなしに実行できます。
ほとんどは、ほかのページに専用のエンドポイントもあります。エンドポイントのないツールを使うときや、すべてのツールを同じ方法で呼び出したいときにアクションを使ってください。
アクションオブジェクト
キーから見えるMCPサーバーのツール1つです。
属性
- objectstring常に
actionです。 - namestring名前です。MCPツールと同じで、たとえば
search_leadsです。 - titlestring短いタイトルです。
- descriptionstring何をして何を返すかの説明で、AIアシスタントが読む文章です。
- scopestringデータを変更するものは
writeです。readのキーはそれ以外だけを実行できます。readwrite - input_schemaobject受け取るボディのJSON Schemaで、フィールドと必須のものを示します。
アクションオブジェクト
{
"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
}
}GET/v1/ actions
curl https://gemlead.ai/api/v1/actions \
-H "Authorization: Bearer $GEMLEAD_API_KEY"レスポンス200
{
"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
}アクションを取得
GET/v1/ actions/ :name
readスコープ受け取るボディのスキーマとともに、アクションを1つ返します。
パスパラメーター
- namestring必須アクションの名前です。たとえば
search_leadsです。
戻り値
アクションオブジェクトです。
エラー
- キーで使える、この名前のアクションはありません。名前はアクションを一覧表示で確認できます。
GET/v1/ actions/ :name
curl https://gemlead.ai/api/v1/actions/get_lead \
-H "Authorization: Bearer $GEMLEAD_API_KEY"レスポンス200
{
"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
}
}アクションを実行
POST/v1/ actions/ :name
readスコープMCPサーバーがツールを実行するのと同じように、アクションを1つ実行します。ボディは入力で、input_schemaにあるフィールドを送ります。何も受け取らないアクションなら空です。スコープがwriteのアクションにはwrite付きのキーが必要です。
パスパラメーター
- namestring必須アクションの名前です。たとえば
search_leadsです。
戻り値
アクション結果オブジェクトです。アクション自身のエラーはそのまま返ります。たとえばアカウントにないリードならresource_missingです。
エラー
- キーで使える、この名前のアクションはありません。名前はアクションを一覧表示で確認できます。
- アクションのスコープは
writeですが、キーはreadです。 - アクションに必要なフィールドがありません。
paramがその名前を示します。 - ボディがアクションの
input_schemaと合いません。 - こちら側でアクションが失敗しました。リクエストを変える必要はありません。少し待ってからもう一度お試しください。
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"
}'レスポンス200
{
"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
}
}アクション結果オブジェクト
{
"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
}
}