Skip to main content
Version: 2

ScheduleClient

Client for managing a specific Schedule.

Schedules are used to automatically start Actors or tasks at specified times. This client provides methods to get, update, and delete schedules, as well as retrieve schedule logs.

Hierarchy

  • ResourceClient
    • ScheduleClient
const client = new ApifyClient({ token: 'my-token' });
const scheduleClient = client.schedule('my-schedule-id');

// Get schedule details
const schedule = await scheduleClient.get();

// Update schedule
await scheduleClient.update({
cronExpression: '0 12 * * *',
isEnabled: true
});

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

delete

  • delete(): Promise<void>

get

getLog

  • getLog(): Promise<undefined | string>

update

  • Updates the schedule with the specified fields.


    Parameters

    • newFields: Partial<Pick<Schedule, name | description | title | cronExpression | timezone | isEnabled | isExclusive | notifications> & { actions: DistributiveOptional<ScheduleAction, id>[] }>

      Fields to update.

    Returns Promise<Schedule>

    The updated schedule object.