TwurpleAuthenticationGetting dataExamplesFAQMigration

Main classes

HelixScheduleApi

The Helix API methods that deal with schedules.

Overview

Can be accessed using client.schedule on an ApiClient instance.

Example

const api = new ApiClient({ authProvider });
const { data: schedule } = await api.helix.schedule.getSchedule('61369223');

Methods

createScheduleSegment(broadcaster, data)

async

Creates a new segment in a given broadcaster's schedule.

ParameterTypeRequiredDefaultDescription
broadcaster
UserIdResolvable

A user ID or a user or channel object.

This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name.

Aliased type: string | number | UserIdResolvableType

none

The broadcaster to create a new schedule segment for.

dataHelixCreateScheduleSegmentDatanonesee below
data.categoryIdstringnone

The ID of the category of the segment.

data.durationnumbernone

The planned duration of the segment, in minutes. Defaults to 240 (4 hours).

data.isRecurringbooleannone

Whether the segment is recurring every week.

data.startDatestringnone

The date when the segment starts. Must be in UTC.

data.timezonestringnone

The timezone the segment is created from.

This is used for managing DST shifts only. The startDate must always be given in UTC.

data.titlestringnone

The title of the segment.

deleteScheduleSegment(broadcaster, segmentId)

async

Deletes a segment in a given broadcaster's schedule.

ParameterTypeRequiredDefaultDescription
broadcaster
UserIdResolvable

A user ID or a user or channel object.

This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name.

Aliased type: string | number | UserIdResolvableType

none

The broadcaster to create a new schedule segment for.

segmentIdstringnone

The ID of the segment to update.

Return type: void

getSchedule(broadcaster, filter)

async

Gets the schedule for a given broadcaster.

ParameterTypeRequiredDefaultDescription
broadcaster
UserIdResolvable

A user ID or a user or channel object.

This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name.

Aliased type: string | number | UserIdResolvableType

none

The broadcaster to get the schedule of.

filterHelixPaginatedScheduleFilternonesee below
filter.afterstringnone

A cursor to get the following page of.

filter.limitnumbernone

The number of results per page.

filter.startDatestringnone

The earliest date to find schedule segments for.

filter.utcOffsetnumbernone

The offset from UTC you request for, to ensure everything goes to the correct day.

Return type: HelixPaginatedScheduleResult

getScheduleAsIcal(broadcaster)

async

Gets the schedule for a given broadcaster in iCal format.

ParameterTypeRequiredDefaultDescription
broadcaster
UserIdResolvable

A user ID or a user or channel object.

This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name.

Aliased type: string | number | UserIdResolvableType

none

The broadcaster to get the schedule for.

Return type: string

getScheduleSegmentById(broadcaster, id)

async

Gets a single schedule segment by ID.

ParameterTypeRequiredDefaultDescription
broadcaster
UserIdResolvable

A user ID or a user or channel object.

This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name.

Aliased type: string | number | UserIdResolvableType

none

The broadcaster to get a schedule segment of.

idstringnone

The ID of the schedule segment.

Return type: HelixScheduleSegment | null

getScheduleSegmentsByIds(broadcaster, ids)

async

Gets a set of schedule segments by IDs.

ParameterTypeRequiredDefaultDescription
broadcaster
UserIdResolvable

A user ID or a user or channel object.

This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name.

Aliased type: string | number | UserIdResolvableType

none

The broadcaster to get schedule segments of.

idsstring[]none

The IDs of the schedule segments.

Return type: HelixScheduleSegment[]

getScheduleSegmentsPaginated(broadcaster, filter)

Creates a paginator for schedule segments for a given broadcaster.

ParameterTypeRequiredDefaultDescription
broadcaster
UserIdResolvable

A user ID or a user or channel object.

This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name.

Aliased type: string | number | UserIdResolvableType

none

The broadcaster to get the schedule segments of.

filterHelixScheduleFilternonesee below
filter.startDatestringnone

The earliest date to find schedule segments for.

filter.utcOffsetnumbernone

The offset from UTC you request for, to ensure everything goes to the correct day.

updateScheduleSegment(broadcaster, segmentId, data)

async

Updates a segment in a given broadcaster's schedule.

ParameterTypeRequiredDefaultDescription
broadcaster
UserIdResolvable

A user ID or a user or channel object.

This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name.

Aliased type: string | number | UserIdResolvableType

none

The broadcaster to create a new schedule segment for.

segmentIdstringnone

The ID of the segment to update.

dataHelixUpdateScheduleSegmentDatanonesee below
data.categoryIdstringnone

The ID of the category of the segment.

data.durationnumbernone

The planned duration of the segment, in minutes. Defaults to 240 (4 hours).

data.isCanceledbooleannone

Whether the schedule broadcast is canceled.

data.startDatestringnone

The date when the segment starts. Must be in UTC.

data.timezonestringnone

The timezone the segment is created from.

This is used for managing DST shifts only. The startDate must always be given in UTC.

data.titlestringnone

The title of the segment.

updateScheduleSettings(broadcaster, settings)

async

Updates the schedule settings of a given broadcaster.

ParameterTypeRequiredDefaultDescription
broadcaster
UserIdResolvable

A user ID or a user or channel object.

This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name.

Aliased type: string | number | UserIdResolvableType

none

The broadcaster to update the schedule settings for.

settingsHelixScheduleSettingsUpdatenonesee below
settings.vacationHelixScheduleSettingsUpdateVacation | nullnone

Vacation mode settings.

Note that not setting this (or setting it to undefined) does not change the vacation settings, but setting it to null disables vacation mode.

Return type: void