6.7 KiB
Player API Reference
Overview
Player service base URL: http://localhost:8081
This document covers the player HTTP surface only. The admin dashboard exposes its own routes for screen commands and onboarding management.
Access note: most player endpoints are unauthenticated because they are meant to run inside a trusted deployment network. Anything that mutates state or writes files should be treated as internal-only unless you add your own auth layer in front of it.
When PULSE_SIGNAGE_SHARED_SECRET is set, the player pages sign same-origin API fetches with x-pulse-page-auth, and the web app signs server-to-player requests with x-pulse-request-timestamp plus x-pulse-request-signature. Page tokens auto-renew before expiry while the page stays active, and signed server requests are only accepted when their timestamp is fresh. If the secret is unset, those checks stay disabled for compatibility.
Endpoints
GET /
Returns the player onboarding landing page. Access: public within the trusted player deployment.
GET /onboard
Returns the onboarding form page. Access: public within the trusted player deployment.
GET /screen/{slug}
Returns the rendered player page for a screen. Access: public within the trusted player deployment.
GET /api/onboarding/status
Returns the persisted onboarding status for a device. Access: public within the trusted player deployment.
Query fields:
deviceIdrequired
GET /api/onboarding/screens
Returns the list of screens available for onboarding. Access: public within the trusted player deployment.
GET /api/onboarding/qr
Returns an SVG QR code that points to the onboarding form. Access: public within the trusted player deployment.
Query fields:
deviceIdrequired
POST /api/auth/page
Renews the current page-auth token before it expires.
Access: internal to the player page and onboarding page. The request must include a valid x-pulse-page-auth header.
Response fields:
tokenissuedAtexpiresAt
POST /api/onboarding
Binds a device to a screen and client name. Access: internal-only. Protect this endpoint if the player service is reachable outside your trusted network.
Accepted request fields:
deviceIdrequiredclientNamerequiredscreenSlugrequired
Response fields:
deviceIdclientNamescreenIdscreenSlugscreenNameplayerUrlqueued
GET /api/media/config
Returns the upload directory configured for the player service. Access: internal-only.
PUT /api/media/{filename}
Writes an uploaded file into the player upload directory. Access: internal-only and write-protected behind your deployment boundary.
DELETE /api/media/{filename}
Deletes a file from the player upload directory. Access: internal-only and write-protected behind your deployment boundary.
GET /api/rtmp/session
Creates or reuses an RTMP-to-HLS session for a source URL. Access: internal-only.
Query fields:
sourcerequireddisableAudiooptional
GET /api/rtmp/streams/{key}/index.m3u8
Returns the RTMP session HLS manifest. Access: internal-only.
GET /api/rtmp/streams/{key}/{fileName}
Returns an RTMP HLS segment or related stream file. Access: internal-only.
GET /api/screens/{slug}/playlist
Returns the current playlist payload for a screen. Access: public within the trusted player deployment.
Response fields:
screenplaylistslidesrssFeedsapiSourcesrevision
GET /api/screens/{slug}/connections
GET /api/screens/{slug}/clients
Returns the live player connection snapshot for a screen. Access: public within the trusted player deployment, but it exposes live connection state.
Response fields:
screenscreenSlugcountconnectionsdegraded
POST /api/screens/{slug}/commands
Sends a command to the player connections for a screen. Access: internal-only. The admin dashboard should remain the protected control surface for commands.
Accepted request fields:
commandrequiredconnectionIdoptionalclientIdoptionalblackoutoptional whencommand=blackout
Command-specific fields:
urlforredirectclientNameforsetclientnamedeviceIdforsetclientname
Supported commands:
refreshreloadredirectpauseblackoutpreviousnextleftrightsetclientname
If connectionId or clientId is provided, the command targets a single player connection. Otherwise it is broadcast to all connections for that screen.
Response fields:
screenscreenSlugcommandconnectionIdsentdegraded
Response Shapes
Onboarding Status Response
GET /api/onboarding/status returns an object with:
deviceIdonboardedclientNamescreenIdscreenSlugscreenNameplayerUrl
Onboarding Screens Response
GET /api/onboarding/screens returns an object with:
screens
QR Response
GET /api/onboarding/qr returns SVG markup.
Upload Config Response
GET /api/media/config returns an object with:
uploadDir
RTMP Session Response
GET /api/rtmp/session returns an object with:
keyplaylistUrldisableAudioready
Onboarding Write Response
POST /api/onboarding returns an object with:
deviceIdclientNamescreenIdscreenSlugscreenNameplayerUrlqueued
Playlist Response
GET /api/screens/{slug}/playlist returns an object with:
screenplaylistslidesrssFeedsapiSourcesrevision
Connections Response
GET /api/screens/{slug}/connections and GET /api/screens/{slug}/clients return an object with:
screenscreenSlugcountconnectionsdegraded
Command Response
POST /api/screens/{slug}/commands returns an object with:
screenscreenSlugcommandconnectionIdsentdegraded
Data Models
Screen
idnameslugplaylist_idcreated_atmodified_at
Playlist
idnamefade_between_slides
Slide
idtitlebodyduration_secondsschedule_modeschedule_start_datetimeschedule_end_datetimeschedule_start_timeschedule_end_timeschedule_days_jsonmedia_urlmedia_typekindtemplate_idtemplatecontent
Connection
idclientIdclientNamedeviceIdlabeluserAgentviewportpagecurrentSlidecurrentSlideIdcurrentSlideTitlepausedblackoutclientIpremoteAddressconnectedAtlastSeenAt
Notes
- The player API is the only surface documented here.
- Web UI/admin routes are intentionally omitted, except where the player service itself exposes onboarding and upload endpoints.