Skip to main content
Version: Next

TaskClient

Client for managing a specific Actor task.

Tasks are pre-configured Actor runs with saved input and options. This client provides methods to start, call, update, and delete tasks, as well as manage their runs and webhooks.

@example
const client = new ApifyClient({ token: 'my-token' });
const taskClient = client.task('my-task-id');

// Start a task
const run = await taskClient.start();

// Call a task and wait for it to finish
const finishedRun = await taskClient.call();
@see

Hierarchy

  • ResourceClient
    • TaskClient

Index

Properties

inheritedapifyClient

apifyClient: ApifyClient

inheritedbaseUrl

baseUrl: string

inheritedhttpClient

httpClient: HttpClient

optionalinheritedid

id?: string

optionalinheritedparams

params?: Record<string, unknown>

inheritedpublicBaseUrl

publicBaseUrl: string

inheritedresourcePath

resourcePath: string

optionalinheritedsafeId

safeId?: string

inheritedurl

url: string

Methods

call

delete

  • delete(): Promise<void>

get

  • get(): Promise<undefined | Task>

getInput

lastRun

runs

start

  • start(input, options): Promise<ActorRun>

update

  • update(newFields): Promise<Task>

updateInput

webhooks