Skip to main content
Version: Next

ScheduleCollectionClient

Client for managing the collection of Schedules in your account.

Schedules are used to automatically start Actors or tasks at specified times. This client provides methods to list and create schedules.

@example
const client = new ApifyClient({ token: 'my-token' });
const schedulesClient = client.schedules();

// List all schedules
const { items } = await schedulesClient.list();

// Create a new schedule
const newSchedule = await schedulesClient.create({
actorId: 'my-actor-id',
cronExpression: '0 9 * * *',
isEnabled: true
});
@see

Hierarchy

  • ResourceCollectionClient
    • ScheduleCollectionClient

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

create

list

  • list(options): PaginatedIterator<Schedule>
  • Lists all schedules.

    Awaiting the return value (as you would with a Promise) will result in a single API call. The amount of fetched items in a single API call is limited.

    const paginatedList = await client.list(options);

    Asynchronous iteration is also supported. This will fetch additional pages if needed until all items are retrieved.

    for await (const singleItem of client.list(options)) {...}
    @see

    Parameters

    Returns PaginatedIterator<Schedule>

    A paginated iterator of schedules.