HTTP API reference#

This section provides documentation for the VISOR HTTP API service, including available endpoints, usage examples, and expected responses.

Use these endpoints to interact programmatically with VISOR.

POST /start#

Start Instance

Start the active visualizer instance with the given input file and metadata.

Example request:

POST /start HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "file_path": "string",
    "metadata": {
        "name": "string",
        "unit": "string",
        "state": {
            "parts": {},
            "serialized_dataset_path": "string",
            "source_file_path": "string",
            "source_metadata_path": "string"
        }
    },
    "timeout": 1
}
Status Codes:
  • 200 OK

    Successful Response

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {}
    

  • 422 Unprocessable Entity

    Validation Error

    Example response:

    HTTP/1.1 422 Unprocessable Entity
    Content-Type: application/json
    
    {
        "detail": [
            {
                "loc": [
                    "string",
                    1
                ],
                "msg": "string",
                "type": "string",
                "input": {},
                "ctx": {}
            }
        ]
    }
    

POST /update#

Update

Update the input file and metadata of the active visualizer instance, clearing any previous datasets.

Example request:

POST /update HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "file_path": "string",
    "metadata": {
        "name": "string",
        "unit": "string",
        "state": {
            "parts": {},
            "serialized_dataset_path": "string",
            "source_file_path": "string",
            "source_metadata_path": "string"
        }
    }
}
Status Codes:
  • 200 OK

    Successful Response

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {}
    

  • 422 Unprocessable Entity

    Validation Error

    Example response:

    HTTP/1.1 422 Unprocessable Entity
    Content-Type: application/json
    
    {
        "detail": [
            {
                "loc": [
                    "string",
                    1
                ],
                "msg": "string",
                "type": "string",
                "input": {},
                "ctx": {}
            }
        ]
    }
    

POST /stop#

Stop Instance

Stop visualizer server and delete Visor instance from cache

Status Codes:
  • 200 OK

    Successful Response

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {}
    

POST /initialize#

Connect Or Initialize Server

If an existing visualizer instance exists on the provided host and port, connect to that instance, making it the active instance. If no such instance exists, initialize a new visualizer instance on the provided host and port.

Example request:

POST /initialize HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "host": "string",
    "port": 1,
    "standalone": true,
    "dark_mode": true,
    "rendering_mode": "local"
}
Status Codes:
  • 200 OK

    Successful Response

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {}
    

  • 422 Unprocessable Entity

    Validation Error

    Example response:

    HTTP/1.1 422 Unprocessable Entity
    Content-Type: application/json
    
    {
        "detail": [
            {
                "loc": [
                    "string",
                    1
                ],
                "msg": "string",
                "type": "string",
                "input": {},
                "ctx": {}
            }
        ]
    }
    

GET /info#

Info

Get the information of the visualizer instance

Example request:

GET /info HTTP/1.1
Host: example.com
Status Codes:
  • 200 OK

    Successful Response

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "app_name": "string",
        "host": "string",
        "port": 1,
        "standalone": true,
        "datasets": [
            "string"
        ]
    }
    

GET /health#

Health Live

Get the health status of the FastAPI server

Example request:

GET /health HTTP/1.1
Host: example.com
Status Codes:
  • 200 OK

    Successful Response

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {}