Skip to content
JB edited this page Nov 11, 2026 · 11 revisions

API Documentation

NeXroll provides a REST API for programmatic control of prerolls, categories, schedules, sequences, and more.

Base URL

http://localhost:9393

Replace with your server's address if running remotely.

Authentication

NeXroll supports two authentication methods:

Session Authentication (Web UI)

Used by the web interface. After logging in via /auth/login, a session cookie is set and included in subsequent requests.

API Key Authentication (External Access)

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_here

Or as a query parameter:

GET /external/status?api_key=nx_your_api_key_here

Authorization: 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.

When Authentication is Disabled

If authentication is not enabled in Settings, all internal API endpoints are accessible without credentials. External API endpoints always require a valid API key.


External API Endpoints

These endpoints are designed for external integrations and require an API key.

System Status

GET /external/status

Returns system status, connection info, and version.

List Prerolls

GET /external/prerolls

Returns all registered prerolls.

List Schedules

GET /external/schedules

Returns all schedules.

Active Schedules

GET /external/active-schedules

Returns detailed info on currently active schedules.

Now Showing

GET /external/now-showing

Returns the current active category, preroll string, and active schedules.

List Categories

GET /external/categories

Returns all categories with preroll counts.

Coming Soon

GET /external/coming-soon?source=both&limit=10

Returns upcoming movies/TV from NeX-Up.

Parameter Description Default
source movies, shows, or both both
limit Max items to return 10

List Sequences

GET /external/sequences

Returns all saved sequences.

Sync Plex

POST /external/sync-plex

Triggers a Plex sync. Requires full access API key.

Create Category

POST /external/categories
Content-Type: application/json

{
  "name": "My Category",
  "description": "Optional description"
}

Requires full access API key.

Register Preroll

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.

Assign Preroll to Category

POST /external/prerolls/{preroll_id}/assign-category/{category_id}

Requires full access API key.

Create Schedule

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 Schedule

DELETE /external/schedules/{id}

Requires full access API key.

Toggle Schedule

PUT /external/schedules/{id}/toggle

Enable or disable a schedule. Requires full access API key.

Apply Category

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.


Categories

List Categories

GET /categories

Response:

[
  {
    "id": 1,
    "name": "Christmas",
    "description": "Holiday prerolls",
    "plex_mode": "shuffle",
    "preroll_count": 5
  }
]

Create Category

POST /categories
Content-Type: application/json

{
  "name": "Halloween",
  "description": "Spooky prerolls"
}

Update Category

PUT /categories/{id}
Content-Type: application/json

{
  "name": "Halloween 2025",
  "description": "Updated description"
}

Delete Category

DELETE /categories/{id}

Apply Category to Plex

POST /categories/{id}/apply-to-plex

Immediately 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 Category Prerolls

GET /categories/{id}/prerolls

Returns all prerolls assigned to a category.


Prerolls

List Prerolls

GET /prerolls

Response:

[
  {
    "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
  }
]

Upload Preroll

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.

Update Preroll

PUT /prerolls/{id}
Content-Type: application/json

{
  "display_name": "New Name",
  "category_id": 2,
  "tags": ["updated", "tags"]
}

Delete Preroll

DELETE /prerolls/{id}
DELETE /prerolls/{id}?delete_file=true

Removes 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

Preroll Trash

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.

List Trash

GET /prerolls/trash

Response:

{
  "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
}

Restore from Trash

POST /prerolls/trash/{entry_id}/restore

Puts the file back where it came from and re-indexes it in the library.

Permanently Delete One Entry

DELETE /prerolls/trash/{entry_id}

Empty the Trash

DELETE /prerolls/trash
DELETE /prerolls/trash?expired_only=true
Parameter Type Default Description
expired_only bool false Remove only entries past the retention window

Ignore List

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.

List Ignored Paths

GET /prerolls/ignored

Stop Ignoring One Path

DELETE /prerolls/ignored/{id}

The file is re-imported on the next library scan.

Clear the Ignore List

DELETE /prerolls/ignored

Check Duplicate

POST /prerolls/check-duplicate
Content-Type: multipart/form-data

file: [binary]

Returns whether a file with the same hash already exists.


Schedules

List Schedules

GET /schedules

Create Schedule

POST /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
}

Update Schedule

PUT /schedules/{id}
Content-Type: application/json

{
  "name": "Christmas 2025 Updated",
  "enabled": false
}

Delete Schedule

DELETE /schedules/{id}

Get Active Schedules

GET /scheduler/active-schedule-ids

Returns {"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.


Sequences

List Sequences

GET /sequences

Create Sequence

POST /sequences
Content-Type: application/json

{
  "name": "My Sequence",
  "description": "Description here",
  "blocks": [
    {"type": "random", "category_id": 1, "count": 2}
  ]
}

Update Sequence

PUT /sequences/{id}
Content-Type: application/json

{
  "name": "Updated Name",
  "blocks": [...]
}

Delete Sequence

DELETE /sequences/{id}

Export Sequence

POST /sequences/{id}/export?export_mode=with_community_ids

Export modes: pattern_only, with_community_ids, with_preroll_data, full_bundle

Import Sequence

POST /sequences/import
Content-Type: multipart/form-data

file: [.nexseq or .zip file]
auto_download: true

Settings

Get a Setting

GET /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.

Update a Setting

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.

Connect to Plex

POST /plex/connect
Content-Type: application/json

{
  "url": "http://192.168.1.100:32400",
  "token": "your-token"
}

Connect to Jellyfin

POST /jellyfin/connect
Content-Type: application/json

{
  "url": "http://192.168.1.100:8096",
  "api_key": "your-api-key"
}

Filler Settings

GET /settings/filler
PUT /settings/filler?enabled=true&filler_type=preroll&preroll_id=12

PUT 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.

Playback Guard

GET /settings/playback-guard              # {"minutes": 20, "max_minutes": 120}
PUT /settings/playback-guard?minutes=10   # 0 turns the guard off

How 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.


Path Mappings

Get Path Mappings

GET /settings/path-mappings

Update Path Mappings

PUT /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.

Test a Path

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.

Find the Folders on Plex

POST /settings/path-mappings/detect

What 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.

Set Mappings Up Automatically

POST /settings/path-mappings/auto-setup

Runs 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.

Browse Plex Folders

GET /plex/browse?path=/media

Lists 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.


Authentication Endpoints

Auth Status

GET /auth/status

Returns whether authentication is enabled and session info.

Login

POST /auth/login
Content-Type: application/json

{
  "username": "admin",
  "password": "your-password",
  "remember_me": false
}

Logout

POST /auth/logout

Register First User

POST /auth/register
Content-Type: application/json

{
  "username": "admin",
  "password": "your-password",
  "role": "admin"
}

User Management

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 password

Auth Settings

GET /auth/settings                     # Get auth settings
PUT /auth/settings                     # Update auth settings

Audit Logs

GET /auth/audit-logs                   # View authentication events
DELETE /auth/audit-logs                # Clear audit logs

API Keys

Manage API Keys

GET /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 key

Logging Endpoints

View Logs

GET /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.

Log Statistics

GET /logs/stats

Returns total, counts by_level and by_category (every category present), last_24h by level, routine_reads (logged page loads) and the oldest/newest timestamps.

Export Logs

GET /logs/export?format=json

Formats: json, csv. Takes the same filters as GET /logs.

Log File

GET /logs/file?level=ERROR&search=plex&limit=300

Entries 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=true

Downloads app.log (or app.log.1) with secrets and IP addresses redacted.

Clear Logs

DELETE /logs?older_than_days=7
DELETE /logs?routine_reads=true
DELETE /logs?clear_all=true

routine_reads=true deletes only logged requests for reads that worked. Without any filter, entries older than the retention period are deleted.

Log Settings

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
}

NeX-Up Endpoints

Settings

GET /nexup/settings                    # Get NeX-Up settings
PUT /nexup/settings                    # Update NeX-Up settings

trailer_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.

Radarr

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 server

With 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.

Sonarr

POST /nexup/sonarr/connect             # Connect to Sonarr
DELETE /nexup/sonarr/disconnect         # Disconnect Sonarr
GET /nexup/sonarr/upcoming             # Get upcoming shows

Dynamic Preroll Generation

POST /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 settings

Coming Soon list exclusions

GET /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.

Sync Progress

GET /nexup/sync-progress               # Get current sync/download progress

Health & Status

Health Check

GET /health

Response:

{
  "status": "healthy",
  "version": "1.11.0"
}

Version

GET /system/version

System Health Summary

GET /system/health/summary
GET /system/health/summary?conflicts=2

Composite 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.

Install Update (Windows installer builds)

GET /update/install
POST /update/install

GET 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.


Error Responses

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

Clone this wiki locally