Tasks (Legacy)

Run Task by Name (Legacy)

Changed on

Executes a task by its name, always using the latest version. This is a convenience endpoint for running tasks without needing to know the task ID.

If you are using the new Task Builder, see the non-deprecated Tasks endpoints in this API reference.

post/v1/task/run/{taskName}

Request

  • Base URL
    https://api.anchorbrowser.io
  • Auth
    API key in header anchor-api-key

Path parameters

taskNamestring required
Example:web-scraper

The name of the task to run

Request body

sessionIdstring uuid

Optional existing browser session ID to use for task execution

asyncboolean

Whether to run the task asynchronously

inputsobject

Environment variables for task execution (keys must start with ANCHOR_)

cleanupSessionsboolean

Whether to cleanup browser sessions after task execution. Defaults to true.

Example request

{
  "overrideBrowserConfiguration": {
    "tags": [
      "production",
      "scraping",
      "customer-123"
    ],
    "domain_allowlist": [
      "example.com",
      "example.org"
    ]
  }
}

Response

Task executed successfully

Changes