Repository navigation
API
NeXroll provides a REST API for programmatic control of prerolls, categories, schedules, sequences, and more.
http://localhost:9393
Replace with your server's address if running remotely.
NeXroll supports two authentication methods:
Used by the web interface. After logging in via /auth/login, a session cookie is set and included in subsequent requests.
For programmatic access, use API keys with the /external/* endpoints. Send the
key in the X-Api-Key header:
X-Api-Key: nx_your_api_key_hereOr as a query parameter:
GET /external/status?api_key=nx_your_api_key_hereAuthorization: Bearer is not accepted and returns 401.
Browser pages on other sites (a dashboard widget, for example) can call the
/external/* endpoints, with a key. Every other endpoint answers only
NeXroll's own pages: a browser on another site gets no CORS access, and
changes it sends are refused with 403. Scripts and servers are not affected.
API keys are generated in Settings → API Keys. Keys can be scoped as read-only or full access and can have expiration dates.
With login on, a key also works on the internal endpoints: a read-only key for reading (GET), a full access key for anything that changes something. Before 2.3.0 a read-only key could also make changes. A backup fetched with any key leaves out the Plex token and the Jellyfin, Emby, Radarr, Sonarr and TMDB keys; restoring such a backup keeps the keys the install already has.
If authentication is not enabled in Settings, all internal API endpoints are accessible without credentials. External API endpoints always require a valid API key.
These endpoints are designed for external integrations and require an API key.
GET /external/statusReturns system status, connection info, and version.
GET /external/prerollsReturns all registered prerolls.
GET /external/schedulesReturns all schedules.
GET /external/active-schedulesReturns detailed info on currently active schedules.
GET /external/now-showingReturns the current active category, preroll string, and active schedules.
GET /external/categoriesReturns all categories with preroll counts.
GET /external/coming-soon?source=both&limit=10Returns upcoming movies/TV from NeX-Up.
| Parameter | Description | Default |
|---|---|---|
source |
movies, shows, or both
|
both |
limit |
Max items to return | 10 |
GET /external/sequencesReturns all saved sequences.
POST /external/sync-plexTriggers a Plex sync. Requires full access API key.
POST /external/categories
Content-Type: application/json
{
"name": "My Category",
"description": "Optional description"
}Requires full access API key.
POST /external/prerolls/register
Content-Type: application/json
{
"file_path": "/path/to/video.mp4",
"display_name": "My Preroll",
"category_id": 1
}Registers an existing video file as a preroll. Requires full access API key.
POST /external/prerolls/{preroll_id}/assign-category/{category_id}Requires full access API key.
POST /external/schedules
Content-Type: application/json
{
"name": "My Schedule",
"category_id": 1,
"start_date": "2025-12-01",
"end_date": "2025-12-25",
"exclusive": true,
"enabled": true
}Requires full access API key.
DELETE /external/schedules/{id}Requires full access API key.
PUT /external/schedules/{id}/toggleEnable or disable a schedule. Requires full access API key.
POST /external/apply-category/{category_id}Immediately applies a category to Plex. Requires full access API key.
Only the category's enabled prerolls are sent, through your path mappings. While Plex is playing the prerolls of a movie that just started, the call answers 409 with detail.code "playback" and changes nothing, because changing the list then makes Plex skip the next preroll. Retry once the movie has started, or add ?force=true to apply anyway.
GET /categoriesResponse:
[
{
"id": 1,
"name": "Christmas",
"description": "Holiday prerolls",
"plex_mode": "shuffle",
"preroll_count": 5
}
]POST /categories
Content-Type: application/json
{
"name": "Halloween",
"description": "Spooky prerolls"
}PUT /categories/{id}
Content-Type: application/json
{
"name": "Halloween 2025",
"description": "Updated description"
}DELETE /categories/{id}POST /categories/{id}/apply-to-plexImmediately applies the category's enabled prerolls to Plex. Answers 409 (detail.code "playback") while Plex is playing the prerolls of a movie that just started; ?force=true applies anyway. POST /sequences/{id}/apply behaves the same way.
GET /categories/{id}/prerollsReturns all prerolls assigned to a category.
GET /prerollsResponse:
[
{
"id": 1,
"filename": "christmas_intro.mp4",
"display_name": "Christmas Intro",
"full_path": "/prerolls/christmas_intro.mp4",
"category_id": 1,
"tags": ["holiday", "winter"],
"duration": 15.5,
"file_size": 25000000
}
]POST /prerolls/upload
Content-Type: multipart/form-data
file: [binary]
category_id: 1
tags: "holiday,winter"
description: "My preroll"Limits: Maximum file size 500MB. Allowed extensions: .mp4, .mkv, .avi, .mov, .wmv, .flv, .webm, .m4v, .ts, .mpg, .mpeg.
PUT /prerolls/{id}
Content-Type: application/json
{
"display_name": "New Name",
"category_id": 2,
"tags": ["updated", "tags"]
}DELETE /prerolls/{id}
DELETE /prerolls/{id}?delete_file=trueRemoves the preroll from the library. The video file is kept on disk unless
you pass delete_file=true, and even then it is moved to a recoverable trash
rather than erased. Files reached through a path mapping (externally mapped
media) are never deleted from disk, even with delete_file=true.
A preroll removed while its file stays on disk is added to the ignore list, so the next library scan does not simply re-import it.
| Parameter | Type | Default | Description |
|---|---|---|---|
delete_file |
bool | false |
Move the video file to the trash as well |
Files deleted with delete_file=true are moved to a .nexroll-trash folder
inside your preroll library and kept for 30 days. Set the
NEXROLL_TRASH_RETENTION_DAYS environment variable to change the window, or
0 to keep trashed files indefinitely. Expired entries are cleared during the
regular library scan.
These endpoints back the Library > Trash page in the UI. Use them directly for scripting or bulk recovery.
GET /prerolls/trashResponse:
{
"entries": [
{
"id": "3f7c1e28c9f04c5f9b1c2d3e4f5a6b70",
"filename": "christmas_intro.mp4",
"original_path": "/prerolls/Holiday/christmas_intro.mp4",
"deleted_at": "2026-08-18T14:22:05",
"size_bytes": 25000000
}
],
"count": 1,
"bytes": 25000000,
"retention_days": 30
}POST /prerolls/trash/{entry_id}/restorePuts the file back where it came from and re-indexes it in the library.
DELETE /prerolls/trash/{entry_id}DELETE /prerolls/trash
DELETE /prerolls/trash?expired_only=true| Parameter | Type | Default | Description |
|---|---|---|---|
expired_only |
bool | false |
Remove only entries past the retention window |
Prerolls removed from the library while their file stays on disk are recorded here so a later scan does not undo the removal. Deliberately re-importing a file clears its entry automatically.
GET /prerolls/ignoredDELETE /prerolls/ignored/{id}The file is re-imported on the next library scan.
DELETE /prerolls/ignoredPOST /prerolls/check-duplicate
Content-Type: multipart/form-data
file: [binary]Returns whether a file with the same hash already exists.
GET /schedulesPOST /schedules
Content-Type: application/json
{
"name": "Christmas 2025",
"category_id": 1,
"start_date": "2025-12-01",
"end_date": "2025-12-25",
"exclusive": true,
"enabled": true
}PUT /schedules/{id}
Content-Type: application/json
{
"name": "Christmas 2025 Updated",
"enabled": false
}DELETE /schedules/{id}GET /scheduler/active-schedule-idsReturns {"active_schedule_ids": [...]} for the schedules active right now.
For the full records rather than the ids, use the External API's
GET /external/active-schedules.
GET /sequencesPOST /sequences
Content-Type: application/json
{
"name": "My Sequence",
"description": "Description here",
"blocks": [
{"type": "random", "category_id": 1, "count": 2}
]
}PUT /sequences/{id}
Content-Type: application/json
{
"name": "Updated Name",
"blocks": [...]
}DELETE /sequences/{id}POST /sequences/{id}/export?export_mode=with_community_idsExport modes: pattern_only, with_community_ids, with_preroll_data, full_bundle
POST /sequences/import
Content-Type: multipart/form-data
file: [.nexseq or .zip file]
auto_download: trueGET /settings/{key}Returns the value stored under that key, or 404 if the key is not set. There is no endpoint that returns every setting at once.
PUT /settings/{key}
Content-Type: application/json
"http://192.168.1.100:32400"The body is the value itself -- a string, object or array. Plex connection
details are set through POST /plex/connect rather than here.
POST /plex/connect
Content-Type: application/json
{
"url": "http://192.168.1.100:32400",
"token": "your-token"
}POST /jellyfin/connect
Content-Type: application/json
{
"url": "http://192.168.1.100:8096",
"api_key": "your-api-key"
}GET /settings/filler
PUT /settings/filler?enabled=true&filler_type=preroll&preroll_id=12PUT takes query parameters, any subset of: enabled, filler_type, category_id, sequence_id, preroll_id, coming_soon_layout (grid or list) and dynamic_filename. Filler types: category, sequence, preroll (one preroll from the library), coming_soon, dynamic. An unknown type or an id that doesn't exist returns {"error": "..."}.
Saving runs a scheduler check, which starts filler only if nothing else holds the preroll field (an active schedule, a stored fallback, a manual apply, Coexistence Mode or Clear Prerolls When Inactive). The response's applied is true when the saved filler is now what plays.
GET /settings/playback-guard # {"minutes": 20, "max_minutes": 120}
PUT /settings/playback-guard?minutes=10 # 0 turns the guard offHow long a newly started Plex movie holds back a preroll change (see Playback Guard). GET /scheduler/status reports a waiting change as waiting_for_playback, with since, seconds, context and window_minutes.
GET /settings/path-mappingsPUT /settings/path-mappings
Content-Type: application/json
{
"mappings": [
{
"local": "/prerolls",
"plex": "/media/prerolls"
}
]
}Replaces every mapping. Add ?merge=true to keep the existing ones and replace only those with the same local folder.
POST /settings/path-mappings/test
Content-Type: application/json
{"paths": ["/prerolls/Christmas/intro.mp4"], "check_plex": true}Shows how each path is translated and which mapping matched; with check_plex, also whether Plex can open the result.
POST /settings/path-mappings/detectWhat Find it for me runs: looks for NeXroll's folders (prerolls, NeX-Up storage outside it, Library Trailers movie folders) among the folders the Plex server can see. Returns folders (one result each, with found) and suggestions (the mappings needed). Nothing is saved. Send {"local_folder": "..."} to check one folder.
POST /settings/path-mappings/auto-setupRuns the same search and saves every mapping it confirmed; a mapping for the same NeXroll folder is replaced and the others are kept. Returns the detect report plus saved (the mappings written), not_found (folders it could not find) and working (every folder is reachable). NeXroll calls it after Plex is connected and from the dashboard's Fix it for me.
GET /plex/browse?path=/mediaLists a folder as the Plex server sees it (the Browse Plex picker). Without path, lists the top-level folders. Needs the Plex server owner's account.
GET /auth/statusReturns whether authentication is enabled and session info.
POST /auth/login
Content-Type: application/json
{
"username": "admin",
"password": "your-password",
"remember_me": false
}POST /auth/logoutPOST /auth/register
Content-Type: application/json
{
"username": "admin",
"password": "your-password",
"role": "admin"
}GET /auth/users # List all users
POST /auth/users # Create user
DELETE /auth/users/{user_id} # Delete user
PUT /auth/users/{user_id}/toggle # Enable/disable user
POST /auth/change-password # Change passwordGET /auth/settings # Get auth settings
PUT /auth/settings # Update auth settingsGET /auth/audit-logs # View authentication events
DELETE /auth/audit-logs # Clear audit logsGET /api/keys # List all API keys
POST /api/keys # Create new API key
PUT /api/keys/{key_id} # Update API key
DELETE /api/keys/{key_id} # Revoke API key
GET /api/keys/validate # Validate an API keyGET /logs?level=ERROR&category=scheduler&search=failed&limit=100| Parameter | Description |
|---|---|
level |
Filter by log level: DEBUG, INFO, WARNING, ERROR, CRITICAL |
category |
Filter by category: system, scheduler, api, user, plex, jellyfin, emby, plugin, nexup |
search |
Search messages, sources, request IDs and details |
start_date, end_date
|
ISO date/time range |
include_reads |
false hides logged requests for reads that worked (default true) |
limit |
Max results to return (up to 1000) |
The response's total is how many entries match, before limit.
GET /logs/statsReturns total, counts by_level and by_category (every category present), last_24h by level, routine_reads (logged page loads) and the oldest/newest timestamps.
GET /logs/export?format=jsonFormats: json, csv. Takes the same filters as GET /logs.
GET /logs/file?level=ERROR&search=plex&limit=300Entries from app.log, newest first. Lines that continue an entry (an error trace, the rest of a multi-line message) come back as its detail. Also returns matched, total_entries, by_level, the file's path, size and modified time, and backup (size and modified time of app.log.1, or null).
GET /logs/file/download
GET /logs/file/download?backup=trueDownloads app.log (or app.log.1) with secrets and IP addresses redacted.
DELETE /logs?older_than_days=7
DELETE /logs?routine_reads=true
DELETE /logs?clear_all=trueroutine_reads=true deletes only logged requests for reads that worked. Without any filter, entries older than the retention period are deleted.
GET /logs/settings
PUT /logs/settings
Content-Type: application/json
{
"log_level": "INFO",
"log_retention_days": 30,
"log_to_database": true,
"log_request_logging": true,
"log_scheduler_logging": true,
"log_api_logging": true
}GET /nexup/settings # Get NeX-Up settings
PUT /nexup/settings # Update NeX-Up settingstrailer_language takes a TMDB language code (en, fr-FR, fr-CA, de-DE, es-ES, es-MX, ...); GET lists the choices as trailer_languages. trailer_language_fallback is english or skip. A sync reports movies skipped for having no trailer in the language as skipped_no_language. max_storage_gb must be more than 0 (a 400 otherwise; 0 used to be saved and read as 5 GB). download_delay takes 0 to 60 seconds; 0 means no wait.
POST /nexup/radarr/connect # Connect to Radarr
DELETE /nexup/radarr/disconnect # Disconnect Radarr
GET /nexup/radarr/upcoming # Get upcoming movies (every Radarr)
GET /nexup/radarr/servers # More Radarr servers (no API keys)
POST /nexup/radarr/servers # Add one: {"url", "api_key", "name"?}
POST /nexup/radarr/servers/{id}/test # Test a saved server
DELETE /nexup/radarr/servers/{id} # Stop reading a serverWith more than one Radarr, radarr_id / radarr_movie_id is a NeXroll movie key: the main Radarr's movies keep their Radarr id, and another server's movie is server id x 1000000000 + its Radarr id. Upcoming movies carry radarr_server (the server's name), and GET /nexup/radarr/upcoming lists unreachable servers in failed_servers. The Sonarr side works the same way: /nexup/sonarr/servers takes the same requests, sonarr_id / sonarr_series_id are show keys built the same way, upcoming shows carry sonarr_server, and GET /nexup/sonarr/upcoming returns failed_servers.
POST /nexup/sonarr/connect # Connect to Sonarr
DELETE /nexup/sonarr/disconnect # Disconnect Sonarr
GET /nexup/sonarr/upcoming # Get upcoming showsPOST /nexup/preroll/generate # Generate dynamic intro
POST /nexup/preroll/generate-coming-soon-list # Generate Coming Soon List video
POST /nexup/preroll/generate-from-preview # Generate from preview settingsGET /nexup/coming-soon-list/exclusions # Titles left off Coming Soon lists
PUT /nexup/coming-soon-list/exclusions # Exclude a title or put it back
Content-Type: application/json
{"kind": "movie", "tmdb_id": 1368337, "title": "The Odyssey", "excluded": true}Exclusions are kept per title, whether or not NeX-Up has a trailer for it: movies by tmdb_id, shows by tvdb_id ("kind": "show"; every season), and by title when there is no id. excluded is required. GET /nexup/radarr/upcoming and GET /nexup/sonarr/upcoming report each title's excluded_from_list. The older PUT /nexup/trailers/{id}/exclude and PUT /nexup/trailers/tv/{id}/exclude still toggle the title of that trailer.
GET /nexup/sync-progress # Get current sync/download progressGET /healthResponse:
{
"status": "healthy",
"version": "1.11.0"
}GET /system/versionGET /system/health/summary
GET /system/health/summary?conflicts=2Composite health score behind the dashboard's System health tile. Scores the
install out of 100 across the scheduler, media server, preroll library, storage,
schedule conflicts, and community index age. With login on, a plugin_keys
check (warn, 5 points) names Jellyfin/Emby plugins that asked
/plugin/intros for prerolls without an API key in the last week; it is left
out otherwise. GET /jellyfin/status and GET /emby/status list those plugins
in keyless_plugins (server_name, address, plugin_version, last_seen,
requests); a plugin leaves the list when it connects with a key.
A check that could not be measured is reported as unknown and costs no points,
so a fresh install does not open on an alarming score. Any check in error
holds status at degraded regardless of the number.
Schedule-conflict detection lives in the frontend, so the count is passed in via
conflicts. Omit it and that check is reported as unknown rather than guessed.
| Parameter | Type | Default | Description |
|---|---|---|---|
conflicts |
int | (none) | Number of detected schedule conflicts |
Response:
{
"score": 90,
"status": "attention",
"note": "Your preroll library is empty",
"attention_count": 1,
"checks": [
{
"key": "scheduler",
"label": "Scheduler",
"status": "ok",
"detail": "",
"value": "Running",
"weight": 30
}
]
}status is one of healthy, attention, or degraded. Each check's status
is one of ok, warn, error, or unknown.
GET /update/install
POST /update/installGET says whether Install Update works on this install and how the last
update went:
{
"supported": true,
"reason": null,
"message": null,
"current_version": "2.3.0",
"status": {
"state": "done",
"message": "Updated NeXroll from 2.2.9 to 2.3.0",
"request_id": "9f2c41d0...",
"from_version": "2.2.9",
"to_version": "2.3.0",
"started_at": "2026-11-05T12:00:01.1234567Z",
"updated_at": "2026-11-05T12:01:40.7654321Z"
}
}reason is docker, not_installer (a source install) or updater_missing
(installed before Install Update existed; install the next version by hand
once). status.state is checking, downloading, installing or
restarting while an update runs, then done, failed or up_to_date.
POST with {"version": "2.3.1"} backs up the database, then starts the
NeXroll Updater task, which stops NeXroll, installs that release from GitHub
and starts NeXroll again. The version must be newer than the one running.
With Require Login on, only an admin (or a request made on the NeXroll
machine itself) may start an update. Responses: 200 with request_id,
400 for a missing or not-newer version, 409 when updates can't be
installed here or one is already running, 500 when the backup or the task
could not start. Poll GET /update/install until current_version is the new
version or status.state is failed.
Automatic updates are part of the update settings:
GET /update/settings
PUT /update/settings{
"check_interval": "daily",
"include_prerelease": false,
"auto_install": false,
"auto_hour": 4,
"auto_delay_days": 3
}auto_hour is 0-23 on the schedules' clock and auto_delay_days 0-30 (values
outside are brought into range). Changing an auto_* field follows the same
admin rule as POST /update/install.
All endpoints return errors in this format:
{
"detail": "Error message here"
}Common HTTP status codes:
| Code | Description |
|---|---|
200 |
Success |
201 |
Created |
400 |
Bad Request (invalid input) |
401 |
Unauthorized (missing or invalid credentials) |
403 |
Forbidden (insufficient permissions) |
404 |
Not Found |
413 |
Payload Too Large (file exceeds upload limit) |
500 |
Server Error |