Skip to main content
Version: Next

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.

@example
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
});
@see

Hierarchy

  • ResourceClient
    • ScheduleClient

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.

    @see

    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.