リードキャプチャAPI

リードキャプチャフォームの作成と管理、パブリケーションからの閲覧者情報の収集、リードデータのCSVエクスポートを行います。

On this page

リードキャプチャAPI

リードキャプチャAPIを使用すると、フリップブックパブリケーション内に表示されるフォームを作成し、閲覧者の情報を収集できます。フォームフィールド、トリガー条件、スタイルを設定できます。キャプチャされたリードは保存され、一覧表示、検索、CSVエクスポートが可能です。

ベースURL: https://api.zenflip.io/v1/leads

リードのキャプチャ(パブリック)

パブリケーションビューアーからリードを送信します。これはパブリックエンドポイントであり、認証は不要です。読者がリードキャプチャフォームに入力すると、埋め込みビューアーから呼び出されます。

` POST /leads/capture/:pubId `

レート制限:IPアドレスあたり毎分10件。

パスパラメータ

パラメータ

説明

pubId

string

パブリケーションUUID

リクエストボディ

フィールド

必須

説明

email

string

はい

リードのメールアドレス

name

string

いいえ

氏名

company

string

いいえ

会社名または組織名

phone

string

いいえ

電話番号

customFields

object

いいえ

カスタムフォームフィールドのキーバリューペア

sourcePage

integer

いいえ

フォームがトリガーされたページ番号

triggerType

string

いいえ

フォームの表示方法:pageexittimerscroll

リクエスト例

`bash curl -X POST "https://api.zenflip.io/v1/leads/capture/a1b2c3d4-e5f6-7890-abcd-ef1234567890" \ -H "Content-Type: application/json" \ -d '{ "email": "jane@example.com", "name": "Jane Doe", "company": "Acme Inc.", "phone": "+1-555-0100", "customFields": { "jobTitle": "Product Manager", "department": "Marketing" }, "sourcePage": 3, "triggerType": "page" }' `

レスポンス例

`json { "data": { "id": "d4e5f6a7-b8c9-0123-def0-234567890123", "email": "jane@example.com", "name": "Jane Doe", "company": "Acme Inc.", "phone": "+1-555-0100", "customFields": { "jobTitle": "Product Manager", "department": "Marketing" }, "sourcePage": 3, "triggerType": "page", "capturedAt": "2026-02-20T15:30:00.000Z" } } `

リード一覧

組織のすべてのキャプチャ済みリードのページネーション付き一覧を取得します。

` GET /leads `

クエリパラメータ

パラメータ

必須

説明

pubId

string

いいえ

パブリケーションIDでフィルタ

page

integer

いいえ

ページ番号(デフォルト:1)

limit

integer

いいえ

1ページあたりの項目数(デフォルト:20)

search

string

いいえ

メールまたは名前で検索

リクエスト例

`bash curl "https://api.zenflip.io/v1/leads?pubId=a1b2c3d4...&page=1&limit=20" \ -H "Authorization: Bearer YOUR_TOKEN" `

レスポンス例

`json { "data": [ { "id": "d4e5f6a7-b8c9-0123-def0-234567890123", "publicationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "email": "jane@example.com", "name": "Jane Doe", "company": "Acme Inc.", "phone": "+1-555-0100", "customFields": { "jobTitle": "Product Manager" }, "sourcePage": 3, "triggerType": "page", "capturedAt": "2026-02-20T15:30:00.000Z" } ], "meta": { "total": 142, "page": 1, "limit": 20, "totalPages": 8 } } `

リードのCSVエクスポート

組織(または特定のパブリケーション)のすべてのリードをCSVファイルとしてエクスポートします。

` GET /leads/export `

クエリパラメータ

パラメータ

必須

説明

pubId

string

いいえ

パブリケーションIDでフィルタ

リクエスト例

`bash curl "https://api.zenflip.io/v1/leads/export?pubId=a1b2c3d4..." \ -H "Authorization: Bearer YOUR_TOKEN" `

レスポンス例

`json { "data": "email,name,company,phone,source_page,trigger_type,captured_at\njane@example.com,Jane Doe,Acme Inc.,+1-555-0100,3,page,2026-02-20T15:30:00.000Z\n" } `

リードキャプチャフォーム

リードキャプチャフォームは、パブリケーション内で閲覧者に表示されるフォームのフィールド、トリガー条件、スタイルを定義します。

パブリケーションのフォーム一覧

` GET /leads/forms/:pubId `

リクエスト例

`bash curl "https://api.zenflip.io/v1/leads/forms/a1b2c3d4-e5f6-7890-abcd-ef1234567890" \ -H "Authorization: Bearer YOUR_TOKEN" `

レスポンス例

`json { "data": [ { "id": "e5f6a7b8-c9d0-1234-ef01-345678901234", "publicationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "title": "Download gated form", "description": "Enter your details to continue reading", "fields": [ { "name": "email", "type": "email", "label": "Email", "required": true }, { "name": "name", "type": "text", "label": "Full Name", "required": false }, { "name": "company", "type": "text", "label": "Company", "required": false } ], "trigger": { "type": "page", "page": 3 }, "styling": { "backgroundColor": "#ffffff", "buttonColor": "#3b82f6" }, "isActive": true, "createdAt": "2026-02-10T09:00:00.000Z", "updatedAt": "2026-02-10T09:00:00.000Z" } ] } `

リードキャプチャフォームの作成

` POST /leads/forms/:pubId `

必要なロール: editor以上。 必要なプラン機能: leadCapture

リクエストボディ

フィールド

必須

説明

title

string

はい

フォームタイトル(最大200文字)

description

string

いいえ

フォームの上に表示される説明

fields

array

はい

フィールド定義の配列(下記参照)

trigger

object

はい

トリガー設定(下記参照)

styling

object

いいえ

カスタムスタイルオプション

フィールド定義オブジェクト

プロパティ

説明

name

string

フィールド識別子(送信データのキーとして使用)

type

string

フィールドタイプ:emailtexttelselecttextarea

label

string

フィールドの表示ラベル

required

boolean

フィールドが必須かどうか

options

array

selectフィールドの選択肢(文字列の配列)

トリガー設定オブジェクト

プロパティ

説明

type

string

トリガータイプ:pageexittimerscroll

page

integer

ページ番号(pageトリガーの場合)

delay

integer

待機秒数(timerトリガーの場合)

percent

integer

スクロール率(scrollトリガーの場合)

リクエスト例

`bash curl -X POST "https://api.zenflip.io/v1/leads/forms/a1b2c3d4-e5f6-7890-abcd-ef1234567890" \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "title": "Get the full report", "description": "Enter your email to unlock all pages", "fields": [ { "name": "email", "type": "email", "label": "Work Email", "required": true }, { "name": "name", "type": "text", "label": "Full Name", "required": true }, { "name": "company", "type": "text", "label": "Company", "required": false } ], "trigger": { "type": "page", "page": 5 }, "styling": { "backgroundColor": "#ffffff", "buttonColor": "#4F46E5", "buttonText": "Unlock Report" } }' `

リードキャプチャフォームの更新

` PATCH /leads/forms/:formId `

必要なロール: editor以上。

すべてのフィールドは任意です。変更したいフィールドのみを含めてください。

フィールド

説明

title

string

フォームタイトル

description

string

フォームの説明

fields

array

更新されたフィールド定義

trigger

object

更新されたトリガー設定

styling

object

更新されたスタイルオプション

isActive

boolean

フォームの有効化または無効化

リードキャプチャフォームの削除

` DELETE /leads/forms/:formId `

必要なロール: editor以上。

`bash curl -X DELETE "https://api.zenflip.io/v1/leads/forms/e5f6a7b8-c9d0-1234-ef01-345678901234" \ -H "Authorization: Bearer YOUR_TOKEN" `

レスポンス

`json { "message": "Lead capture form deleted" } `

アクティブなフォームの取得(パブリック)

パブリケーションのアクティブなリードキャプチャフォームのみを取得します。これは、ビューアーがどのフォームを表示するかを判断するために使用するパブリックエンドポイントです。

` GET /leads/forms/public/:pubId `

認証不要。isActivetrueのフォームのみを返します。

← Previous
アナリティクスAPI
Next →
パブリケーションAPI