Skip to Content
Won.dev

Tasks

Run up to 100 lookups or 500 leads in the background, billed per part, and read the results when they are done.

A task makes many calls of one endpoint for you in the background, so an agent does not have to send them one by one or keep a connection open while they run.

  • enrich.people.email.find, enrich.email.verify and signals.find take inputs: up to 100 parts, each the body of one call. trade.leads.find takes one input whose limit goes up to 500, and the task pages through the list for you.
  • Every part runs and is billed exactly like a call of its own, so a task costs what its calls cost. Creating, reading, listing and canceling a task is free. max_cost refuses a task that could cost more, and dry_run: true says the most it can cost.
  • A task that runs out of balance, or of its key's budget, stops as failed and keeps what it did.
  • When a task ends, task.completed goes to your webhooks and to GET /events. metadata of your own, such as a customer ID, comes back on the task and on that event.
  • Results are kept for 7 days after the end, 1 day when a source does not allow keeping them. The task itself is listed for 30 days.
  • A test key runs every part in the sandbox, is never charged, and only sees tasks made with a test key.
  • The same is the task_create and task_get tools of the MCP server.

Create a task

POST https://api.won.dev/v1/tasks

Runs many calls of one endpoint in the background: up to 100 work email lookups (enrich.people.email.find), address checks (enrich.email.verify) or company signal checks (signals.find), one per item of inputs, or up to 500 leads (trade.leads.find) from one input whose limit goes up to 500. Each part runs exactly like a call of its own: it is billed at the endpoint's price for what it returns, and repeats and results paid for in the last 30 days are free. Creating the task is free. max_cost refuses a task that could cost more, and dry_run: true says the most it can cost. A task that runs out of balance or of its key's budget stops as failed and keeps what it did. Follow it with GET /tasks/{id}, or wait for the task.completed event. Results are kept for 7 days after the end. With an Idempotency-Key header a retry never creates a second task. Endpoints: trade.leads.find, enrich.people.email.find, enrich.email.verify, signals.find.

Parameters

Parameters go in the JSON body.

ParameterTypeRequiredDescription
operationtrade.leads.find | enrich.people.email.find | enrich.email.verify | signals.findyesWhat to run: trade.leads.find, enrich.people.email.find, enrich.email.verify, signals.find.
inputsobject[]noFor a batch: up to 100 parts, each the body of one call of the endpoint, such as {"email": "jane@example.com"}.
inputobjectnoFor 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_costnumbernoThe most the whole task may cost, in US dollars. A task that could cost more is refused before anything runs.
dry_runbooleannoOnly say the most the task can cost. Nothing is created or charged. Default: false.
metadataobjectnoYour 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.

Response

FieldTypeDescription
dataobjectThe task, and the most it can cost.
data.dry_runbooleanTrue when nothing was created: the answer to dry_run: true.
data.max_costnumberThe most the task can cost, in US dollars.
data.taskobject | nullThe task. Null on a dry run.
data.task.idstringTask ID, such as task_7p1q8w3e5r4k2m9x.
data.task.operationstringThe endpoint it runs, such as enrich.email.verify.
data.task.statusrunning | completed | failed | canceledrunning, then completed, failed (it stopped early, and error says why) or canceled.
data.task.progressobjectHow far it got.
data.task.progress.doneintegerParts answered, or for leads the leads found.
data.task.progress.totalintegerParts of the batch, or the leads asked for.
data.task.progress.failedintegerParts answered with an error. They cost nothing.
data.task.costnumberWhat it cost so far, in US dollars.
data.task.max_costnumberThe most it can cost, in US dollars.
data.task.errorobject | nullWhy it stopped early: the error of the call that stopped it, such as insufficient_balance. Null otherwise.
data.task.error.codestring
data.task.error.messagestring
data.task.metadataobjectYour own keys and values, as you gave them. Empty when none were.
data.task.created_atstringWhen it was created, ISO 8601.
data.task.completed_atstring | nullWhen it ended. Null while it runs.
data.task.results_expire_atstring | nullWhen the results are deleted: 7 days after the end, 1 day when a source does not allow keeping them. Null while it runs.
noticestring | nullA plain sentence when there is something to know about this answer. Null otherwise.
usageobjectNothing is charged here. The balance, for reference.
usage.costnumberWhat this call cost, in US dollars.
usage.balancenumberThe balance left after this call, in US dollars.
usage.replayedbooleanTrue when this is a repeat of a request from the last 24 hours. Repeats are free.

Example

curl https://api.won.dev/v1/tasks \
  -H "Authorization: Bearer $WON_API_KEY" \
  -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": false,
    "max_cost": 0.06,
    "task": {
      "id": "task_7p1q8w3e5r4k2m9x",
      "operation": "enrich.people.email.find",
      "status": "running",
      "progress": {
        "done": 0,
        "total": 2,
        "failed": 0
      },
      "cost": 0,
      "max_cost": 0.06,
      "error": null,
      "metadata": {
        "customer_id": "c_812"
      },
      "created_at": "2026-11-20T13:40:00.000Z",
      "completed_at": null,
      "results_expire_at": null
    }
  },
  "notice": null,
  "usage": {
    "cost": 0,
    "balance": 48.14,
    "replayed": false
  }
}

Get a task

GET https://api.won.dev/v1/tasks/{id}

A task, how far it got and what it cost, with its results in order: each one the answer a call of the endpoint gives, with its HTTP status. Page through the results with cursor. While status is running, ask again in a minute, or wait for the task.completed event. Results are deleted 7 days after the end (results_expire_at). Free.

Parameters

id is part of the path. The others go in the query string.

ParameterTypeRequiredDescription
idstringyesTask ID, such as task_7p1q8w3e5r4k2m9x.
limitintegernoHow many to return, 1 to 100. Default: 20.
cursorstringnoTo get the next page, pass next_cursor of the previous response back unchanged, with the same parameters.

Response

FieldTypeDescription
dataobjectThe task, and a page of its results.
data.taskobject
data.task.idstringTask ID, such as task_7p1q8w3e5r4k2m9x.
data.task.operationstringThe endpoint it runs, such as enrich.email.verify.
data.task.statusrunning | completed | failed | canceledrunning, then completed, failed (it stopped early, and error says why) or canceled.
data.task.progressobjectHow far it got.
data.task.progress.doneintegerParts answered, or for leads the leads found.
data.task.progress.totalintegerParts of the batch, or the leads asked for.
data.task.progress.failedintegerParts answered with an error. They cost nothing.
data.task.costnumberWhat it cost so far, in US dollars.
data.task.max_costnumberThe most it can cost, in US dollars.
data.task.errorobject | nullWhy it stopped early: the error of the call that stopped it, such as insufficient_balance. Null otherwise.
data.task.error.codestring
data.task.error.messagestring
data.task.metadataobjectYour own keys and values, as you gave them. Empty when none were.
data.task.created_atstringWhen it was created, ISO 8601.
data.task.completed_atstring | nullWhen it ended. Null while it runs.
data.task.results_expire_atstring | nullWhen the results are deleted: 7 days after the end, 1 day when a source does not allow keeping them. Null while it runs.
data.resultsobject[]The results of this page, in order.
data.results[].indexintegerThe part of inputs it answers, or the page of leads, from 0.
data.results[].statusintegerThe HTTP status of the call: 200, or the status of its error.
data.results[].bodyobjectThe answer, exactly as a call of the endpoint returns it: its body or its error.
has_morebooleanWhether more results follow this page.
next_cursorstring | nullPass it as cursor to get the next page of results. Null on the last page.
noticestring | nullA plain sentence when there is something to know about this answer. Null otherwise.
usageobjectNothing is charged here. The balance, for reference.
usage.costnumberWhat this call cost, in US dollars.
usage.balancenumberThe balance left after this call, in US dollars.
usage.replayedbooleanTrue when this is a repeat of a request from the last 24 hours. Repeats are free.

Example

curl "https://api.won.dev/v1/tasks/task_7p1q8w3e5r4k2m9x?limit=1" \
  -H "Authorization: Bearer $WON_API_KEY"
{
  "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
  }
}

List tasks

GET https://api.won.dev/v1/tasks

Your tasks, newest first, with their status, progress and cost. Their results come with GET /tasks/{id}. Free.

Parameters

Parameters go in the query string.

ParameterTypeRequiredDescription
limitintegernoHow many to return, 1 to 100. Default: 25.
cursorstringnoTo get the next page, pass next_cursor of the previous response back unchanged, with the same parameters.

Response

FieldTypeDescription
dataobject[]The tasks, newest first.
data[].idstringTask ID, such as task_7p1q8w3e5r4k2m9x.
data[].operationstringThe endpoint it runs, such as enrich.email.verify.
data[].statusrunning | completed | failed | canceledrunning, then completed, failed (it stopped early, and error says why) or canceled.
data[].progressobjectHow far it got.
data[].progress.doneintegerParts answered, or for leads the leads found.
data[].progress.totalintegerParts of the batch, or the leads asked for.
data[].progress.failedintegerParts answered with an error. They cost nothing.
data[].costnumberWhat it cost so far, in US dollars.
data[].max_costnumberThe most it can cost, in US dollars.
data[].errorobject | nullWhy it stopped early: the error of the call that stopped it, such as insufficient_balance. Null otherwise.
data[].error.codestring
data[].error.messagestring
data[].metadataobjectYour own keys and values, as you gave them. Empty when none were.
data[].created_atstringWhen it was created, ISO 8601.
data[].completed_atstring | nullWhen it ended. Null while it runs.
data[].results_expire_atstring | nullWhen the results are deleted: 7 days after the end, 1 day when a source does not allow keeping them. Null while it runs.
has_morebooleanWhether more follow this page.
next_cursorstring | nullPass it as cursor to get the next page. Null on the last page.
noticestring | nullA plain sentence when there is something to know about this answer. Null otherwise.
usageobjectNothing is charged here. The balance, for reference.
usage.costnumberWhat this call cost, in US dollars.
usage.balancenumberThe balance left after this call, in US dollars.
usage.replayedbooleanTrue when this is a repeat of a request from the last 24 hours. Repeats are free.

Example

curl "https://api.won.dev/v1/tasks?limit=1" \
  -H "Authorization: Bearer $WON_API_KEY"
{
  "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
  }
}

Cancel a task

POST https://api.won.dev/v1/tasks/{id}/cancel

Stops a running task: no further part starts. Parts that were already running finish and are charged as usual, and everything it did is kept. Sends task.completed with status: canceled. Free.

Parameters

id is part of the path.

ParameterTypeRequiredDescription
idstringyesTask ID, such as task_7p1q8w3e5r4k2m9x.

Response

FieldTypeDescription
dataobjectThe task, canceled.
data.idstringTask ID, such as task_7p1q8w3e5r4k2m9x.
data.operationstringThe endpoint it runs, such as enrich.email.verify.
data.statusrunning | completed | failed | canceledrunning, then completed, failed (it stopped early, and error says why) or canceled.
data.progressobjectHow far it got.
data.progress.doneintegerParts answered, or for leads the leads found.
data.progress.totalintegerParts of the batch, or the leads asked for.
data.progress.failedintegerParts answered with an error. They cost nothing.
data.costnumberWhat it cost so far, in US dollars.
data.max_costnumberThe most it can cost, in US dollars.
data.errorobject | nullWhy it stopped early: the error of the call that stopped it, such as insufficient_balance. Null otherwise.
data.error.codestring
data.error.messagestring
data.metadataobjectYour own keys and values, as you gave them. Empty when none were.
data.created_atstringWhen it was created, ISO 8601.
data.completed_atstring | nullWhen it ended. Null while it runs.
data.results_expire_atstring | nullWhen the results are deleted: 7 days after the end, 1 day when a source does not allow keeping them. Null while it runs.
noticestring | nullA plain sentence when there is something to know about this answer. Null otherwise.
usageobjectNothing is charged here. The balance, for reference.
usage.costnumberWhat this call cost, in US dollars.
usage.balancenumberThe balance left after this call, in US dollars.
usage.replayedbooleanTrue when this is a repeat of a request from the last 24 hours. Repeats are free.

Example

curl https://api.won.dev/v1/tasks/task_7p1q8w3e5r4k2m9x/cancel \
  -H "Authorization: Bearer $WON_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
{
  "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
  }
}

On this page