> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# REST API

Websocketserver includes a REST API that allows an external application (ADR) to stop the
server, reserve a session and view the core status of the services layer.  If the incoming GET pathname
starts with /v1/, then the GET request is interpreted as being a REST API call.  The current
API is implemented using REST GET operations on the websocketserver HTML server port
(--http\_port).  Note that --http\_directory must be specified for the HTML server to be enabled.
The API namespace is currently defined as:

* `/v1/stop` - shutdown the server
* `/v1/status` - return the status of the current services as a JSON formatted string
* `/v1/status_view` - return the status of the current services as an HTML table (human readable)
* `/v1/reserve/{servicename}?option1=value1&option2=value2` - reserve a service with the specified options
* `/v1/release/{token}` - release a reserved or active token

## Security token

The websocketserver REST API can be protected using a shared secret that must be
included in all REST GET operations.  When the websocketserver is started, the
security token can be supplied via the 'WEBSOCKETSERVER\_SECURITY\_TOKEN' environmental
variable or via the --security\_token command line option.  If the token is specified,
then the query field 'security\_token' must be supplied.  For example, if the server
is launched with "--security\_token HELLO" then the REST URI for the status operation
would look like:  "/v1/status?security\_token=HELLO".  Without the token, a 401
error will result.
