Skip to main content
Version: 3.4.x

Admin API

Moth provides admin APIs for server management and control tasks. They are used to change configuration and perform monitoring.

Admin API overview

Moth admin APIs are intended for administrators and support configuration lookup, update, deletion, state control, and monitoring. They are available over HTTP and WebSocket.

Protocol

  • http | https: use HTTP/HTTPS when calling the API over HTTP
  • ws | wss: use WebSocket or secure WebSocket when calling the API over WebSocket

API types

Moth admin APIs are divided into two groups.

APIFunctionSupported version
/managerManagement operations such as lookup, update, delete, and run control
/monitorMedia-client or simple monitoring functions

Pathnames

The admin API pathnames are as follows.

API typeFunctionSupported version
/manager/http/cmdUsed when calling over HTTP
/manager/ws/cmdUsed when calling over WebSocket

Options

Configure the following options when calling the admin API.

OptionDescriptionUsage
opSpecifies the command to execute.
op=[show | set | run | add | delete | update | load | save | ping ]
objSpecifies the command target.
obj=[session | channel | group | config]
idSpecifies the target ID, typically in <xid> format.
stateSpecifies the state to apply to the target.
state=[idle | using]
optSpecifies a detailed option for the target.
[source | track | key | record | trans]
valueSpecifies an additional value.
value=[ <number> | on | off]
formatSpecifies the output format.
format=[text | json]

Authorization

Moth provides two authorization methods.

  • channel usage authorization
  • server administration authorization

To authorize channel usage, set a Stream key when using the API. To use server administration functions, authorization is checked against the key configured in the Moth server.

Examples are shown below.

  • channel usage authorization

    /manager/http/cmd?format=json&obj=channel&op=set&key=<string>
  • server administration authorization

    /manager/http/cmd?format=json&obj=channel&op=show&key=<string>

Summary

Use the Moth service API and admin API together to implement media services and manage the server. The service API handles data transfer, while the admin API handles configuration and operations.