本文へスキップ
Won.dev
ドキュメントAPIリファレンス

タスク

最大100回の検索や500件のリード取得をバックグラウンドで実行し、呼び出しごとに課金。終わったら結果を読み取ります。

タスクは、同じエンドポイントへの多数の呼び出しをバックグラウンドで代わりに実行します。エージェントが1件ずつ送ったり、実行中ずっと接続を開いておいたりする必要はありません。

  • enrich.people.email.find、enrich.email.verify、signals.find は inputs を受け取ります。最大100件で、それぞれが1回の呼び出しのリクエストボディです。trade.leads.find は limit を最大500にできる1つの input を受け取り、タスクがリストを順にページ送りします。
  • 各呼び出しは単独の呼び出しとまったく同じように実行・課金されるので、タスクの費用はその呼び出しの費用の合計です。タスクの作成、取得、一覧、キャンセルは無料です。max_cost を超えるおそれのあるタスクは拒否され、dry_run: true なら最大費用がわかります。
  • タスクを作成すると、すぐに 202 Accepted が返り、Location ヘッダーにそのタスクのURLが入ります。status が running でなくなるまで、そこを GET /tasks/{id} で確認してください。
  • 残高やキーの予算が尽きたタスクは failed で止まり、それまでの結果は残ります。
  • タスクが終わると、task.completed があなたのWebhookと GET /events に届きます。顧客IDなど独自の metadata は、タスクとそのイベントにそのまま返ります。
  • 結果は終了後7日間保存されます。データ提供元が保存を認めていない場合は1日です。タスク自体は30日間一覧に残ります。
  • テストキーでは各呼び出しがサンドボックスで動き、課金されません。また、テストキーで作られたタスクしか見えません。
  • 同じことは、MCPサーバーの task_create ツールと task_get ツールでもできます。

タスクを作成

同じエンドポイントへの多数の呼び出しをバックグラウンドで実行します。inputs の項目ごとに1回ずつ、仕事用メールアドレスの検索(enrich.people.email.find)、メールアドレスの検証(enrich.email.verify)、企業シグナルの確認(signals.find)を最大100回、または limit を最大500にした1つの input から最大500件のリード(trade.leads.find)を取得します。各呼び出しは単独で呼び出したときとまったく同じように動き、返った結果に対してエンドポイントの価格で課金されます。同じ呼び出しの繰り返しと、30日以内に支払い済みの結果は無料です。タスクの作成自体は無料です。max_cost を超えるおそれのあるタスクは拒否され、dry_run: true なら最大費用だけを返します。残高やキーの予算が尽きると、タスクは failed で終わり、それまでの結果は残ります。進み具合は GET /tasks/{id} で確認するか、task.completed イベントを待ってください。結果は終了後7日間保存されます。Idempotency-Key ヘッダーをつければ、再試行で2つ目のタスクが作られることはありません。対象のエンドポイント:trade.leads.find、enrich.people.email.find、enrich.email.verify、signals.find。

POST
/tasks

認証

apiKey
headerAuthorizationBearer <APIキー>

Authorization: Bearer won_live_..., a key from the console.

ヘッダーパラメータ

Idempotency-Key?string

Any unique string. A retry with the same key and the same body returns the first response and is not charged again.

長さlength <= 255

リクエストボディ

application/json
  1. body
operation*string

What to run: trade.leads.find, enrich.people.email.find, enrich.email.verify, signals.find.

取りうる値"trade.leads.find""enrich.people.email.find""enrich.email.verify""signals.find"
inputs?array<>

For a batch: up to 100 parts, each the body of one call of the endpoint, such as {"email": "jane@example.com"}.

要素1 <= items <= 100
input?

For trade.leads.find: the body of one call, with limit up to 500 (default 100). The task goes down the ranked list until it has limit leads or the list ends.

max_cost?number

The most the whole task may cost, in US dollars. A task that could cost more is refused before anything runs.

範囲0 < value
dry_run?boolean

Only say the most the task can cost. Nothing is created or charged.

デフォルトfalse
metadata?

Your own keys and values, such as {"customer_id": "c_812"}: up to 20 keys of at most 40 characters, each value a string of at most 500. Returned as given, and in the events about it.

レスポンスボディ

Nothing was started: the answer to dry_run: true.

application/json
  1. response
data*

The task, and the most it can cost.

notice*|

A plain sentence when there is something to know about this answer. Null otherwise.

usage*

Nothing is charged here. The balance, for reference.

リクエストの例
curl -X POST 'https://api.won.dev/v1/tasks' \  -H 'Content-Type: application/json' \  -d '{  "operation": "enrich.people.email.find",  "inputs": [    {      "first_name": "Dana",      "last_name": "Reyes",      "domain": "harbor-chairs.com"    },    {      "linkedin_url": "https://www.linkedin.com/in/lee-okafor"    }  ],  "max_cost": 3,  "metadata": {    "customer_id": "c_812"  }}'
レスポンスの例
{  "data": {    "dry_run": true,    "max_cost": 0,    "task": {      "id": "string",      "operation": "string",      "status": "running",      "progress": {        "done": 0,        "total": 0,        "failed": 0      },      "cost": 0,      "max_cost": 0,      "error": {        "code": "string",        "message": "string"      },      "metadata": {        "property1": "string",        "property2": "string"      },      "created_at": "string",      "completed_at": "string",      "results_expire_at": "string"    }  },  "notice": "string",  "usage": {    "cost": 0,    "balance": 0,    "replayed": true  }}

タスクを取得

タスクの進み具合と費用、そして順番どおりの結果を返します。各結果は、そのエンドポイントを呼び出したときのレスポンスと同じで、HTTPステータスがつきます。結果は cursor でページ送りできます。status が running の間は、1分ほどおいてもう一度確認するか、task.completed イベントを待ってください。結果は終了から7日後に削除されます(results_expire_at)。無料です。

GET
/tasks/{id}

認証

apiKey
headerAuthorizationBearer <APIキー>

Authorization: Bearer won_live_..., a key from the console.

パスパラメータ

id*string

Task ID, such as task_7p1q8w3e5r4k2m9x.

長さlength <= 40

クエリパラメータ

limit?integer

How many to return, 1 to 100.

範囲1 <= value <= 100
デフォルト20
cursor?string

To get the next page, pass next_cursor of the previous response back unchanged, with the same parameters.

長さlength <= 200

レスポンスボディ

The result.

application/json
  1. response
data*

The task, and a page of its results.

has_more*boolean

Whether more results follow this page.

next_cursor*|

Pass it as cursor to get the next page of results. Null on the last page.

notice*|

A plain sentence when there is something to know about this answer. Null otherwise.

usage*

Nothing is charged here. The balance, for reference.

リクエストの例
curl -X GET 'https://api.won.dev/v1/tasks/task_7p1q8w3e5r4k2m9x?limit=1'
レスポンスの例
{  "data": {    "task": {      "id": "task_7p1q8w3e5r4k2m9x",      "operation": "enrich.people.email.find",      "status": "completed",      "progress": {        "done": 100,        "total": 100,        "failed": 2      },      "cost": 1.86,      "max_cost": 3,      "error": null,      "metadata": {        "customer_id": "c_812"      },      "created_at": "2026-11-20T13:40:00.000Z",      "completed_at": "2026-11-20T13:46:12.000Z",      "results_expire_at": "2026-11-27T13:46:12.000Z"    },    "results": [      {        "index": 0,        "status": 200,        "body": {          "data": {            "email": {              "address": "dana.reyes@harbor-chairs.com",              "status": "verified"            },            "person": null          },          "query": {            "first_name": "Dana",            "last_name": "Reyes",            "domain": "harbor-chairs.com"          },          "notice": null,          "usage": {            "unit": "person_email",            "records": 1,            "already_paid": 0,            "cost": 0.03,            "balance": 49.97,            "replayed": false          }        }      }    ]  },  "has_more": true,  "next_cursor": "cur_Zx81kQp4b2JtMW0uMXJ6ZzQ",  "notice": null,  "usage": {    "cost": 0,    "balance": 48.14,    "replayed": false  }}

タスクの一覧

タスクを新しい順に、ステータス、進み具合、費用とともに返します。結果は GET /tasks/{id} で取得します。無料です。

GET
/tasks

認証

apiKey
headerAuthorizationBearer <APIキー>

Authorization: Bearer won_live_..., a key from the console.

クエリパラメータ

limit?integer

How many to return, 1 to 100.

範囲1 <= value <= 100
デフォルト25
cursor?string

To get the next page, pass next_cursor of the previous response back unchanged, with the same parameters.

長さlength <= 200

レスポンスボディ

The result.

application/json
  1. response
data*array<>

The tasks, newest first.

has_more*boolean

Whether more follow this page.

next_cursor*|

Pass it as cursor to get the next page. Null on the last page.

notice*|

A plain sentence when there is something to know about this answer. Null otherwise.

usage*

Nothing is charged here. The balance, for reference.

リクエストの例
curl -X GET 'https://api.won.dev/v1/tasks?limit=1'
レスポンスの例
{  "data": [    {      "id": "task_7p1q8w3e5r4k2m9x",      "operation": "enrich.people.email.find",      "status": "completed",      "progress": {        "done": 100,        "total": 100,        "failed": 2      },      "cost": 1.86,      "max_cost": 3,      "error": null,      "metadata": {        "customer_id": "c_812"      },      "created_at": "2026-11-20T13:40:00.000Z",      "completed_at": "2026-11-20T13:46:12.000Z",      "results_expire_at": "2026-11-27T13:46:12.000Z"    }  ],  "has_more": false,  "next_cursor": null,  "notice": null,  "usage": {    "cost": 0,    "balance": 48.14,    "replayed": false  }}

タスクをキャンセル

実行中のタスクを止め、新しい呼び出しを始めないようにします。すでに始まっていた呼び出しは最後まで実行され、通常どおり課金されます。それまでの結果はすべて残ります。status: canceled の task.completed イベントが送られます。無料です。

POST
/tasks/{id}/cancel

認証

apiKey
headerAuthorizationBearer <APIキー>

Authorization: Bearer won_live_..., a key from the console.

パスパラメータ

id*string

Task ID, such as task_7p1q8w3e5r4k2m9x.

長さlength <= 40

ヘッダーパラメータ

Idempotency-Key?string

Any unique string. A retry with the same key and the same body returns the first response and is not charged again.

長さlength <= 255

レスポンスボディ

The result.

application/json
  1. response
data*

The task, canceled.

notice*|

A plain sentence when there is something to know about this answer. Null otherwise.

usage*

Nothing is charged here. The balance, for reference.

リクエストの例
curl -X POST 'https://api.won.dev/v1/tasks/task_7p1q8w3e5r4k2m9x/cancel'
レスポンスの例
{  "data": {    "id": "task_7p1q8w3e5r4k2m9x",    "operation": "enrich.people.email.find",    "status": "canceled",    "progress": {      "done": 35,      "total": 100,      "failed": 0    },    "cost": 0.84,    "max_cost": 3,    "error": null,    "metadata": {      "customer_id": "c_812"    },    "created_at": "2026-11-20T13:40:00.000Z",    "completed_at": "2026-11-20T13:46:12.000Z",    "results_expire_at": "2026-11-27T13:46:12.000Z"  },  "notice": null,  "usage": {    "cost": 0,    "balance": 48.14,    "replayed": false  }}

最終更新日