API
Besides the graphical controls embedded into the Norsk Studio UI, components expose an OpenAPI-defined HTTP interface for easy integration into the rest of your workflow.
The API is automatically generated from the same schemas that define each component, so you can always expect the API surface to match the configuration and state of the component.
You can explore the API interactively using the built-in Swagger UI. How you access it depends on whether a workflow is running:
-
When no workflow is running, the API Docs button is available in the Studio UI. It provides the complete set of API endpoints for all Norsk Studio components.
-
During runtime, the Live Docs button appears. It provides a focused view of the API, showing only the endpoints for the components currently in your running workflow. For example, if your workflow consists of an SRT input, a source switcher, and a CMAF output, the live docs will display the API documentation for just those three components.
Each component type has its own set of endpoints. For example:
-
processor.onscreenGraphic
lets you query the active graphic, change graphic positions, upload a new graphic, delete a graphic, etc. -
input.srt-listener
lets you enable, disable, or disconnect incoming SRT streams, and also provides metrics, alerts, and configuration endpoints.
In addition, components share common endpoints for querying metrics and configuration.
Example: onscreenGraphic
The processor.onscreenGraphic
component exposes endpoints that allow you to manage graphics in your workflow programmatically.
For example:
-
Query the active graphic You can use a
GET /active
request to retrieve the currently active graphic and its metadata. -
Upload a new graphic A
POST /graphics
request allows you to upload a new image or video asset that can later be activated as an overlay. -
Switch or reposition a graphic With a
PUT /active
request, you can change which graphic is shown, or update its position, size, and opacity. -
Delete a graphic A
DELETE /graphics/id
request removes a previously uploaded graphic from the component’s library.
Here’s a sample curl for changing the position of the active graphic:
# Get the currently active graphic
curl -s studio_url/live/api/onscreengraphic_component_id/active-graphic
# Set a new active graphic, positioned top-right
curl -X 'POST' \
'studio_url/live/api/onscreengraphic_component_id/active-graphic' \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{
"graphic": "Norsk.png",
"position": {
"type": "named",
"position": "topright"
}
}'
In the Swagger UI, all you need to do is input your graphic filename and position, and click execute:
