API reference

Schedule import API

Schedule import: sheets of schedule rows

HTTP reference. Generated from the backend contract. Browse endpoints below or download OpenAPI.

This group has 3 operations, generated from api/openapi.yaml. Filter by path, action, or authentication. Each endpoint lists its inputs; expand it for a request template and response codes. Templates need your own values and a schema-valid body.

Replace uppercase placeholders with your values. For a JSON request, save a body matching the schema in request.json. Cookie examples use a local cookie jar from an authenticated session.

Schedule import: sheets of schedule rows

GET/api/schedule/imports/template

Get Schedule Import Template

Answers a sheet with the columns a schedule import reads and three example rows (a screen code, a screen folder and a tag), as CSV or, with format=xlsx, an XLSX workbook.

Authentication
projectBearer OR dashboardSession
Request body
none
Operation ID
getScheduleImportTemplate

Parameters

NameSend inRequired?Description
ScreenRig-ProjectheaderoptionalDeprecated for one release. Must be consistent with the JWT projects grants; adds Deprecation and Warning headers. No token exchange.
formatqueryoptional
Request template and responses
shell · request template
curl --request GET --header 'Authorization: Bearer [SCREENRIG_TOKEN]' --cookie cookies.txt --cookie-jar cookies.txt 'https://api.screenrig.ai/api/schedule/imports/template'

Responses

StatusMeaningBody and headers
200The template sheet.string (text/csv), string (application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
default

Stable RFC 9457 problem response. A 421 server_draining carries Retry-After of 1 second, a 500 not_ready or dependency_unavailable carries 5, and a 500 manifest_degraded carries 60, unless the handler set a more specific value.

Problem (application/problem+json)
POST/api/schedule/imports/preview

Preview Schedule Import

Reads a sheet of schedule rows against the project and answers what committing it would do, writing nothing.

Each row names a target (a screen by id, by the value of a screen field such as a room code, or by name; folder:NAME; tag:NAME; several separated by ; or |), content (a media file name, or playlist:NAME or a playlist id), a start and an end (a date alone as the end closes that day), and optionally timezone, days (Mon-Fri), a daily window (daily_start, daily_end), priority 0 to 100, a name and display numbers.

Times are read on each screen's own clock; a timezone column converts them from another zone.

Every row is checked and reports its errors by column: unknown or ambiguous screen, folder or tag, missing or ambiguous file, a file that cannot fill a screen, invalid or reversed times, an end in the past, no timing at all, a screen without a time zone or a default playlist, two rows holding at once on a screen at the same priority, and more levels than a screen holds (32), or more campaigns than its organization holds across its projects (100; each shared level is one).

Rows that agree on content, times, priority and name become one level: one screen is an entry of that screen's own schedule; several screens, a folder or a tag are one shared level (a campaign), which outranks a screen's own levels.

The answer lists the levels with what a commit does to each (create, update, unchanged), the levels an earlier run of the same import made that the sheet no longer has (removals), the stacks of the screens as they would be (calendar), and a fingerprint to send to the commit. The sheet is JSON rows, CSV or XLSX, at most 5,000 rows.

Not available to a caller limited to screens (outside_screen_scope). Schedule import is part of the Enterprise plan; a project whose plan lacks it is refused with feature_not_in_plan (402). The template is open on every plan.

Authentication
projectBearer OR dashboardSession
Request body
ScheduleImportRequest
Operation ID
previewScheduleImport

Parameters

NameSend inRequired?Description
ScreenRig-ProjectheaderoptionalDeprecated for one release. Must be consistent with the JWT projects grants; adds Deprecation and Warning headers. No token exchange.
namequeryoptionalThe import's name; importing again under the same name updates the levels it made (default import). Sent with a file body.
timezonequeryoptionalThe IANA zone the times are written in when a row has no timezone. Without one, times are read on each screen's own clock.
sourcequeryoptionalThe file name, recorded with the import.
code_fieldqueryoptionalRead a screen code only from this screen field (for example code or room_id); otherwise a code matches any field.

Request body fields

FieldDescription
name (optional, string)Identifies the import; the same name updates the levels it made (default import). minLength: 1 maxLength: 80
source (optional, string)The file the rows came from. maxLength: 200
timezone (optional, string)The IANA zone the times are written in when a row has no timezone.
code_field (optional, string)Read a screen code only from this screen field.
fingerprint (optional, string)The preview's fingerprint; required by the commit.
rows (required, array)
Request template and responses
shell · request template
curl --request POST --header 'Authorization: Bearer [SCREENRIG_TOKEN]' --cookie cookies.txt --cookie-jar cookies.txt --header 'Content-Type: application/json' --data '@request.json' 'https://api.screenrig.ai/api/schedule/imports/preview'

Responses

StatusMeaningBody and headers
200The preview. valid is false while any row has an error.ScheduleImportPreview (application/json)
402feature_not_in_plan — Schedule import is part of the Enterprise plan; the problem names the feature, the plan the account is on and required_plan.Problem (application/problem+json)
403

outside_screen_scope - the caller is limited to screens and the screen, screen folder, selector or audience the request names or reaches is outside them (docs/screen-scope.md). An id outside the scope and an id that does not exist get the same answer; errors[0].screen_scope carries the caller's scope, and the write is refused whole, never narrowed.

Problem (application/problem+json)
default

Stable RFC 9457 problem response. A 421 server_draining carries Retry-After of 1 second, a 500 not_ready or dependency_unavailable carries 5, and a 500 manifest_degraded carries 60, unless the handler set a more specific value.

Problem (application/problem+json)
POST/api/schedule/imports

Commit Schedule Import

Commits a previewed import: the same sheet and the fingerprint its preview answered. Every level is created, updated or removed, the screens' schedules and the shared levels written in one transaction, and the import event schedule.imported appended: all rows apply or none does.

The one-file playlists the sheet's files need are made first (they change nothing on any screen). A sheet whose rows have errors is refused (schedule_import_invalid); a project that changed since the preview, or rows that read differently, is refused (schedule_import_stale), and the client previews again.

Importing the same sheet again under the same name changes nothing; a changed row updates its level and a removed row removes its level. Needs a person who can approve in the dashboard and a credential with write access for an agent.

A commit that would update or delete a reserved campaign answers reserved_item (403) and writes nothing, unless a person who can approve commits it.

A commit that reaches a protected screen is refused whole with protected_target, also when the import has no levels but removes import entries of a protected screen or deletes an import campaign whose audience reaches one.

In a project with protected screen folders a commit whose preview fails on a service, not on the sheet, answers dependency_unavailable and writes nothing: send the same request again after a short wait. A sheet, campaign or screen validation error answers as the commit would (invalid_request and the other problems above).

Not available to a caller limited to screens. Schedule import is part of the Enterprise plan; a project whose plan lacks it is refused with feature_not_in_plan (402). The template is open on every plan.

Authentication
projectBearer OR dashboardSession
Request body
ScheduleImportRequest
Operation ID
commitScheduleImport

Parameters

NameSend inRequired?Description
ScreenRig-ProjectheaderoptionalDeprecated for one release. Must be consistent with the JWT projects grants; adds Deprecation and Warning headers. No token exchange.
Idempotency-KeyheaderoptionalOmit for a fresh operation. Supply and reuse a key to deduplicate retries; the CLI manages keys automatically.
fingerprintqueryoptionalThe preview's fingerprint, for a CSV or XLSX body; a JSON body carries it as a member.
namequeryoptionalThe import's name; importing again under the same name updates the levels it made (default import). Sent with a file body.
timezonequeryoptionalThe IANA zone the times are written in when a row has no timezone. Without one, times are read on each screen's own clock.
sourcequeryoptionalThe file name, recorded with the import.
code_fieldqueryoptionalRead a screen code only from this screen field (for example code or room_id); otherwise a code matches any field.

Request body fields

FieldDescription
name (optional, string)Identifies the import; the same name updates the levels it made (default import). minLength: 1 maxLength: 80
source (optional, string)The file the rows came from. maxLength: 200
timezone (optional, string)The IANA zone the times are written in when a row has no timezone.
code_field (optional, string)Read a screen code only from this screen field.
fingerprint (optional, string)The preview's fingerprint; required by the commit.
rows (required, array)
Request template and responses
shell · request template
curl --request POST --header 'Authorization: Bearer [SCREENRIG_TOKEN]' --cookie cookies.txt --cookie-jar cookies.txt --header 'Content-Type: application/json' --data '@request.json' 'https://api.screenrig.ai/api/schedule/imports'

Responses

StatusMeaningBody and headers
200What the commit applied.ScheduleImportCommitted (application/json)
402feature_not_in_plan — Schedule import is part of the Enterprise plan; the problem names the feature, the plan the account is on and required_plan.Problem (application/problem+json)
403

outside_screen_scope or approver_required as on ScreenScopePlays, or reserved_item - a reserved campaign is changed, paused, deleted or un-reserved only by a person who can approve reviews, never by an agent or a service client (docs/screen-scope.md).

Problem (application/problem+json)
409

protected_target - the change reaches a screen in a protected screen folder and has no review form (docs/screen-scope.md). Clear the folder's protection through a review, make the change, and protect the folder again.

Problem (application/problem+json)
500dependency_unavailable - the check for protected screen folders could not run; send the same request again after a short wait.Problem (application/problem+json)
default

Stable RFC 9457 problem response. A 421 server_draining carries Retry-After of 1 second, a 500 not_ready or dependency_unavailable carries 5, and a 500 manifest_degraded carries 60, unless the handler set a more specific value.

Problem (application/problem+json)