APIリファレンス

エクスポート

エクスポートは、フィルターに一致するすべてのリードを1つのファイルにまとめます。ページ送りでは大きすぎる取得に使います。作成したら、statusがreadyになるまで取得を繰り返し、urlからダウンロードします。エクスポートは1アカウントあたり1時間に10回まで作成できます。

typeをconversationsにすると、ファイルにはリードの代わりにアカウントのすべてのDMの会話が入り、それぞれにリードと最初からのすべてのメッセージが含まれます。AIアシスタントや自分のコードでDMをまとめて分析し、どの書き出しに返信が来るか、どの返答でリードの反論を乗り越えられるかを確かめるためのものです。GemleadはすべてのDMの独自コピーを編集や削除も含めてXと同期しているため、ファイルはXを呼び出さずにこのコピーから作成され、1 500件の会話が1分以内に用意できます。

エクスポートオブジェクト

バックグラウンドで作成されるリードまたは会話のファイル。ページネーションでは時間がかかりすぎる大量の取得に使います。

属性

  • idstring
    エクスポートの一意の識別子。
  • objectstring
    常にexportです。
  • typestring
    ファイルの中身。リード、またはメッセージ付きの会話です。
    leadsconversations
  • statusstring
    ファイルの作成中はprocessing、その後はreadyまたはfailedです。リンクが無効になるとexpiredになります。
    processingreadyfailedexpired
  • formatstring
    ファイルの形式。リードはcsvまたはjsonl、会話はjsonlまたはmarkdownです。
    csvjsonlmarkdown
  • filtersobject
    エクスポートの作成時に指定したフィルター。リードを一覧表示または会話を一覧表示と同じです。
  • row_countinteger
    ファイルに含まれるリードまたは会話の数。ファイルの作成中に増えていきます。最大でリード100 000件、または会話20 000件です。
  • total_countintegerまたはnull
    フィルターなしの会話のエクスポートで、ファイルに入る会話の数。作成の開始時に数えます。それ以外はnullです。
  • urlstringまたはnull
    準備ができたファイルのダウンロード先。24時間、expires_atまで有効です。
  • expires_atstringまたはnull
    urlが使えなくなる日時。ISO 8601形式です。
  • created_atstring
    エクスポートが作成された日時。ISO 8601形式です。
エクスポートオブジェクト
{
  "id": "e4TnW8yHqA",
  "object": "export",
  "type": "leads",
  "status": "ready",
  "format": "csv",
  "filters": {
    "hot": true,
    "persona": "lvWBPnytpS"
  },
  "row_count": 2134,
  "total_count": null,
  "url": "https://parsefiles.back4app.com/7Hn2kQ9xWm4LpR8tV3bZc6YdF1sJ0aUe/5f1c9e2b7a4d8c3e6f0b9a2d1c4e7f8a_gemlead-leads-e4TnW8yHqA.csv",
  "expires_at": "2026-11-07T07:45:12.904Z",
  "created_at": "2026-11-06T07:45:12.904Z"
}

エクスポートを作成

POST/v1/exportsreadスコープMCPcreate_export

リードまたは会話のファイルの作成を開始します。すぐにprocessingのエクスポートが返ります。

ボディパラメーター

  • typestring
    エクスポートする対象。デフォルトはleadsです。
    leadsconversations
  • formatstring
    ファイルの形式。リードはcsvまたはjsonlで、デフォルトはcsvです。会話はjsonlまたはmarkdownで、デフォルトはjsonlです。
    csvjsonlmarkdown
  • filtersobject
    エクスポートするリード。リードを一覧表示と同じフィルターで指定します。会話の場合は、会話を一覧表示と同じくpersonaとunreadのみです。

戻り値

ステータスがprocessingのエクスポートオブジェクト。HTTPステータスは202です。

エラー

  • 必須パラメーターがありません。paramにその名前が入ります。
  • APIが受け付けない値のパラメーターがあります。paramにその名前が入ります。
  • このアカウントで、過去1時間に10回を超えるエクスポートがありました。
POST/v1/exports
curl -X POST https://gemlead.ai/api/v1/exports \
  -H "Authorization: Bearer $GEMLEAD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "format": "csv",
    "filters": {
      "hot": true,
      "persona": "lvWBPnytpS"
    }
  }'
レスポンス202
{
  "id": "e4TnW8yHqA",
  "object": "export",
  "type": "leads",
  "status": "processing",
  "format": "csv",
  "filters": {
    "hot": true,
    "persona": "lvWBPnytpS"
  },
  "row_count": 0,
  "total_count": null,
  "url": null,
  "expires_at": null,
  "created_at": "2026-11-06T07:45:12.904Z"
}

エクスポートを一覧表示

GET/v1/exportsreadスコープMCPlist_exports

エクスポートを新しい順に返します。

クエリパラメーター

  • limitinteger
    返すオブジェクトの数。1から100まで指定でき、デフォルトは25です。
  • cursorstring
    次のページを取得するための、前のページのnext_cursor。ページネーションを参照してください。

戻り値

エクスポートオブジェクトのリスト。

GET/v1/exports
curl https://gemlead.ai/api/v1/exports \
  -H "Authorization: Bearer $GEMLEAD_API_KEY"
レスポンス200
{
  "object": "list",
  "data": [
    {
      "id": "e4TnW8yHqA",
      "object": "export",
      "type": "leads",
      "status": "ready",
      "format": "csv",
      "filters": {
        "hot": true,
        "persona": "lvWBPnytpS"
      },
      "row_count": 2134,
      "total_count": null,
      "url": "https://parsefiles.back4app.com/7Hn2kQ9xWm4LpR8tV3bZc6YdF1sJ0aUe/5f1c9e2b7a4d8c3e6f0b9a2d1c4e7f8a_gemlead-leads-e4TnW8yHqA.csv",
      "expires_at": "2026-11-07T07:45:12.904Z",
      "created_at": "2026-11-06T07:45:12.904Z"
    }
  ],
  "has_more": false,
  "next_cursor": null
}

エクスポートを取得

GET/v1/exports/:idreadスコープMCPget_export

エクスポートを返します。statusがreadyになるまで数秒ごとに取得し、その後urlからダウンロードします。

パスパラメーター

  • idstring必須
    エクスポートのID。

戻り値

エクスポートオブジェクト。

エラー

  • キーのアカウントに、このIDのエクスポートはありません。
GET/v1/exports/:id
curl https://gemlead.ai/api/v1/exports/e4TnW8yHqA \
  -H "Authorization: Bearer $GEMLEAD_API_KEY"
レスポンス200
{
  "id": "e4TnW8yHqA",
  "object": "export",
  "type": "leads",
  "status": "ready",
  "format": "csv",
  "filters": {
    "hot": true,
    "persona": "lvWBPnytpS"
  },
  "row_count": 2134,
  "total_count": null,
  "url": "https://parsefiles.back4app.com/7Hn2kQ9xWm4LpR8tV3bZc6YdF1sJ0aUe/5f1c9e2b7a4d8c3e6f0b9a2d1c4e7f8a_gemlead-leads-e4TnW8yHqA.csv",
  "expires_at": "2026-11-07T07:45:12.904Z",
  "created_at": "2026-11-06T07:45:12.904Z"
}

ファイル内の会話

会話のjsonlファイルの各行。最新の会話から順に並びます。スレッド全体、リード、historyを含む会話オブジェクトです。markdownファイルにも同じ内容が、会話ごとに1つのトランスクリプトとして入ります。

属性

  • idstring
    会話の一意の識別子。
  • objectstring
    常にconversationです。
  • lead_idstring
    会話の相手のリード。
  • profileobject
    リードオブジェクトと同じ形式の、リードのXプロフィール。
  • personaobjectまたはnull
    リードのペルソナ。
  • columnobjectまたはnull
    会話ボードで会話が置かれている列。
  • unreadboolean
    リードの最後のメッセージが未読の場合はtrue。
  • messages_countinteger
    messages内のメッセージ数。
  • first_message_atstringまたはnull
    最初のメッセージが送信された日時。ISO 8601形式です。
  • last_message_atstringまたはnull
    最後のメッセージが送信された日時。ISO 8601形式です。
  • last_messageobjectまたはnull
    最後のメッセージ。
  • leadobjectまたはnull
    スコア、ステータス、ペルソナ、キャンペーンを含むリードオブジェクト。
  • historystring
    messagesがスレッド全体の場合はcomplete。長いスレッドについてGemleadが最新のメッセージしか保持しておらず、残りをまだXから一度読み込んでいない間はrecentです。
    completerecent
  • messagesobjectsの配列
    スレッドのすべてのメッセージ。古い順で、方向、テキスト、日時、メディア、リアクションを含みます。メディアのリンクは24時間有効です。
ファイル内の会話
{
  "id": "msgOtJ8dvT",
  "object": "conversation",
  "lead_id": "msgOtJ8dvT",
  "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"
  },
  "unread": false,
  "last_message_at": "2026-11-06T08:12:44.000Z",
  "messages_count": 1,
  "last_message": {
    "id": "1985321409876543210",
    "object": "message",
    "direction": "inbound",
    "text": "Yes, I want to charge for my Discord. How does it work?",
    "created_at": "2026-11-06T08:12:44.000Z",
    "media": [],
    "reactions": [],
    "encrypted": false,
    "reply_to_message_id": null
  },
  "persona": {
    "id": "lvWBPnytpS",
    "name": "Tipsters"
  },
  "column": {
    "id": "q7m2xk4p",
    "name": "Interested"
  },
  "first_message_at": "2026-11-06T08:12:44.000Z",
  "lead": {
    "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": {}
  },
  "history": "complete",
  "messages": [
    {
      "id": "1985321409876543210",
      "object": "message",
      "direction": "inbound",
      "text": "Yes, I want to charge for my Discord. How does it work?",
      "created_at": "2026-11-06T08:12:44.000Z",
      "media": [],
      "reactions": [],
      "encrypted": false,
      "reply_to_message_id": null
    }
  ]
}