Skip to content

API Reference ​

Sortie exposes a REST API for managing applications, sessions, templates, and users. The full OpenAPI specification is available at openapi.yaml in the repository root.

Authentication ​

All API requests (except /api/auth/* and /api/config) require a valid JWT token.

Include the token in the Authorization header:

http
Authorization: Bearer <token>

Login ​

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

{"username": "admin", "password": "changeme"}

Returns access and refresh tokens.

Refresh Token ​

http
POST /api/auth/refresh
Content-Type: application/json

{"refresh_token": "<refresh_token>"}

Applications ​

MethodEndpointDescription
GET/api/appsList visible applications (filtered by user's access)
POST/api/appsCreate application (admin or category admin)
GET/api/apps/:idGet application by ID
PUT/api/apps/:idUpdate application
DELETE/api/apps/:idDelete application

Application Visibility ​

Each application has a visibility field that controls who can see it:

ValueWho can see
publicAll authenticated users
approvedCategory admins and approved users for the app's category
admin_onlyCategory admins for the app's category only

System administrators (admin role) can always see all applications regardless of visibility.

See the Access Control guide for details on how visibility interacts with category-scoped access grants.

Categories ​

MethodEndpointDescription
GET/api/categoriesList categories
POST/api/categoriesCreate category (admin only)
GET/api/categories/:idGet category by ID
PUT/api/categories/:idUpdate category (admin or category admin)
DELETE/api/categories/:idDelete category (admin only)

Category Admin Management ​

MethodEndpointDescription
GET/api/categories/:id/adminsList category admins
POST/api/categories/:id/adminsAdd category admin ({"user_id": "..."})
DELETE/api/categories/:id/admins/:userIdRemove category admin

Approved User Management ​

MethodEndpointDescription
GET/api/categories/:id/approved-usersList approved users
POST/api/categories/:id/approved-usersAdd approved user ({"user_id": "..."})
DELETE/api/categories/:id/approved-users/:userIdRemove approved user

Sessions ​

MethodEndpointDescription
GET/api/sessionsList sessions
POST/api/sessionsCreate session
GET/api/sessions/:idGet session by ID
DELETE/api/sessions/:idTerminate session
GET/api/sessions/sharedList sessions shared with the current user
POST/api/sessions/:id/sharesCreate a share (by username or link)
GET/api/sessions/:id/sharesList shares for a session (owner only)
DELETE/api/sessions/:id/shares/:shareIdRevoke a share (owner only)
POST/api/sessions/shares/joinJoin a session via share token

Session Sharing ​

Session owners can share running container sessions with other users. See the Session Sharing guide for details.

Shared sessions returned from /api/sessions/shared include extra fields: is_shared, owner_username, share_permission, and share_id.

Recordings ​

These endpoints require SORTIE_VIDEO_RECORDING_ENABLED=true.

MethodEndpointDescription
POST/api/sessions/:id/recording/startStart recording a session
POST/api/sessions/:id/recording/stopStop recording a session
POST/api/sessions/:id/recording/uploadUpload recorded video (multipart form)
GET/api/recordingsList current user's recordings
GET/api/admin/recordingsList all recordings (admin only)
GET/api/recordings/:id/downloadDownload a recording file
DELETE/api/recordings/:idDelete a recording

The upload endpoint accepts a multipart/form-data request with fields recording_id, duration (optional), and file (the .webm video).

Users can download and delete their own recordings. Administrators can access any user's recordings via the admin endpoint and can download or delete any recording.

Templates ​

MethodEndpointDescription
GET/api/templatesList all templates
GET/api/templates/:idGet template by ID

Admin Endpoints ​

These endpoints require the admin role.

MethodEndpointDescription
GET/api/admin/usersList users
GET/api/admin/sessionsList all sessions (admin view)
GET/PUT/api/admin/settingsManage settings
GET/api/admin/templatesManage templates
GET/api/admin/diagnosticsDownload diagnostics bundle
GET/api/admin/healthDetailed health check

WebSocket Endpoints ​

PathProtocolDescription
/ws/sessions/:idVNC (binary WebSocket)Linux desktop streaming
/ws/guac/sessions/:idGuacamole (text WebSocket)Windows desktop streaming

WebSocket connections require JWT authentication via query parameter (?token=<jwt>), cookie, or Authorization header.

Observability ​

MethodEndpointDescription
GET/healthzLiveness check
GET/readyzReadiness check
GET/api/loadCurrent load status
GET/debug/varsexpvar metrics