NAV
shell http

# Introduction

This documents an HTTP based API for basic control of PVP.

# Requests

## Scheme

Requests may be made over HTTP or HTTPS depending on your network settings in PVP.

## Prefix

All request paths are prefixed with `/api/0` in addition to the standard URL components for the scheme (https), host, and port.

For an end point with the path `/data/playlists`, the full request would be:

`GET https://localhost:8080/api/0/data/playlists`

The address "localhost" and port number "8080" is used for examples, your address will depend on your network settings and your port number is configured in PVP preferences.

## Authentication

> API Access Request:

    // HTTP
    GET /api/0/data/playlists HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    // HTTPS
    GET /api/0/data/playlists HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json
    Authorization: Bearer <your unique key here>

    // HTTPS
    curl -H "Authorization: Bearer <your unique key here>" -X GET https://localhost:8080/api/0/data/playlists -k

Access to the API is controlled via API keys. Keys can be managed in PVP preferences.

The API expects the API key to be passed with all requests via an Authorization header like the following:

`Authorization: Bearer <your unique key here>`

You must replace `<your unique key here>` with your personal API key.

## JSON

    POST /api/0/opacity/layer/0 HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    { "value": 0.5 }

    curl -d '{ "value": 0.5 }' -H "Content-Type: application/json" -X POST http://localhost:8080/api/0/opacity/layer/0 -k

Some POST requests can take JSON data as a parameter; these are noted by the sections in the documentation that contain a 'Request Body'. Our API conforms to the JSON 1.0 Specification

### HTTP

If JSON is needed for an HTTP request, the folowing should be included in the request:

`{ "<requestBodyKey>": <requestBodyValue> }`

- NOTE: The above is only an example. Some requests will have more keys/values, but these will be defined in the request body sections of the documentation.

A sample request to assign an opacity of 0.5 to layer 0 is shown on the right:

### CURL

If JSON is needed for a cURL request, the following should be included in the request:

`-d '{ "<requestBodyKey>":<requestBodyValue> }' -H "Content-Type: application/json"`

- NOTE: The correct "requestBodyKey" and "requestBodyValue" can be found in the Request Body section of each request that should/can include JSON.

A sample request to assign an opacity of 0.5 to layer 0 is shown on the right:

# Data

## Playlists

> Example Request:

    GET /api/0/data/playlists HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X GET http://localhost:8080/api/0/data/playlists -k

> JSON response:

    {
       "playlist":{
          "items":[

          ],
          "name":"Root",
          "children":[
             {
                "items":[
                   {
                      "name":"002_JB_HD-H264",
                      "uuid":"6CD29387-44B8-4D61-94D7-6BE69359D12E"
                   },
                   {
                      "name":"003_JB_HD-H264",
                      "uuid":"16441A40-3B08-4575-89F2-1A44C9656A14"
                   },
                   {
                      "name":"005_JB_HD-H264",
                      "uuid":"0244E1A9-04B1-43DE-82C8-7FCA1E36F2CA"
                   }
                ],
                "name":"Playlist 1",
                "children":[

                ],
                "uuid":"9EE5DFC3-7EE2-47F8-B932-765CEBBA8245"
             },
             {
                "items":[

                ],
                "name":"Group A",
                "children":[
                   {
                      "items":[
                         {
                            "name":"037_JB_HD-H264",
                            "uuid":"D3029DEB-39BB-49EE-9E25-E39525CDB020"
                         },
                         {
                            "name":"042_JB_HD-H264",
                            "uuid":"4A2EC5DC-22B9-40A3-856D-70878FA89AF8"
                         }
                      ],
                      "name":"Playlist 2",
                      "children":[

                      ],
                      "uuid":"2F9A1691-B659-4199-8655-AA46729D0C21"
                   }
                ],
                "uuid":"D62AFD1D-59B5-46FC-A33B-6F7E1AC7C5A0"
             },
             {
                "items":[

                ],
                "name":"Video Input",
                "children":[

                ],
                "uuid":"5F34B21B-76F7-4837-A337-92F13CF6F856"
             }
          ],
          "uuid":"C0E4E090-F969-4B60-9526-D44EBC5C52ED"
       }
    }

`/data/playlists`

### GET

Returns a JSON representation of playlists including a brief description of the cues in each playlist.

## Specific Playlist

> Request:

    GET /api/0/data/playlist/playlistName HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X GET http://localhost:8080/api/0/data/playlist/playlistName -k

> JSON response:

    {
       "playlist":{
          "items":[
             {
                "name":"002_JB_HD-H264",
                "uuid":"6CD29387-44B8-4D61-94D7-6BE69359D12E"
             },
             {
                "name":"003_JB_HD-H264",
                "uuid":"16441A40-3B08-4575-89F2-1A44C9656A14"
             },
             {
                "name":"005_JB_HD-H264",
                "uuid":"0244E1A9-04B1-43DE-82C8-7FCA1E36F2CA"
             }
          ],
          "name":"Playlist 1",
          "children":[

          ],
          "uuid":"9EE5DFC3-7EE2-47F8-B932-765CEBBA8245"
       }
    }

`/data/playlist/{id}`

### GET

Returns JSON representation of specified playlist

### Parameters

Parameter | Description
--- | ---
id | Can be a uuid (string), name (string), or index (integer) of the playlist.

### Notes

- Video Input playlist can be accessed by -1 (index) or by UUID
- Number only parameters are always interpreted as an index and never name.

## Specific Cue

> Request:

    GET /api/0/data/playlist/0/cue/0 HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X GET http://localhost:8080/api/0/data/playlist/0/cue/0 -k

> JSON response:

    {
      "playlistItem" : {
        "name" : "Abstract Cheer Gold Fast-HD 1080",
        "uuid" : "0CC37FC9-3784-4599-9088-B06C55ACB1D0"
      }
    }

`/data/playlist/{playlistID}/cue/{cueID}`

### GET

Returns JSON representation of the specified cue in the specified playlist

### Parameters

Parameter | Description
--- | ---
playlistID | Can be a uuid (string), name (string), or index (integer) of the playlist
cueID | Can be a uuid (string), name (string), or index (integer) of the cue

### Notes

- Number only parameters are always interpreted as an index and never name.

## Layers

> Request:

    GET /api/0/data/layers HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X GET http://localhost:8080/api/0/data/layers -k

> JSON response:

    {
      "data" : [
        {
          "layer" : {
            "isHidden" : false,
            "name" : "Layer 1",
            "isMuted" : false,
            "effectPresetUUID" : "null",
            "effects" : [

            ],
            "uuid" : "394B7D0F-050E-4590-98B9-B30A8823488D",
            "opacity" : 1,
            "targetSetUUID" : "AC04BC27-F3C2-429D-BC9B-446D04465EE9",
            "transitionDuration" : 0.5
          }
        },
        {
          "layer" : {
            "isHidden" : false,
            "name" : "Layer 2",
            "isMuted" : false,
            "effectPresetUUID" : "null",
            "effects" : [
              {
                "variables" : [
                  {
                    "type" : "Float",
                    "base" : {
                      "value" : -2.002185583114624,
                      "max_value" : 3.1415927410125732,
                      "min_value" : -3.1415927410125732,
                      "name" : "Hue"
                    }
                  },
                  {
                    "type" : "Float",
                    "base" : {
                      "value" : 1.328668475151062,
                      "max_value" : 2,
                      "min_value" : 0,
                      "name" : "Saturation"
                    }
                  },
                  {
                    "type" : "Float",
                    "base" : {
                      "value" : 0,
                      "max_value" : 1,
                      "min_value" : -1,
                      "name" : "Brightness"
                    }
                  },
                  {
                    "type" : "Float",
                    "base" : {
                      "value" : 0.84164398908615112,
                      "max_value" : 2,
                      "min_value" : 0,
                      "name" : "Contrast"
                    }
                  }
                ],
                "enabled" : true,
                "name" : "Adjust Color",
                "uuid" : "D4C199A9-64D7-4CCB-8C26-443E7A9C5C03"
              },
              {
                "variables" : [
                  {
                    "type" : "Float",
                    "base" : {
                      "value" : 0.30066463351249695,
                      "max_value" : 1,
                      "min_value" : 0,
                      "name" : "Blur Amount"
                    }
                  }
                ],
                "enabled" : true,
                "name" : "Blur",
                "uuid" : "D84CE4A3-D1C3-4F7C-AA75-4C645A3621F2"
              }
            ],
            "uuid" : "75969169-B4B3-45A1-8B4A-2A037CABDB97",
            "opacity" : 0.74831989247311825,
            "targetSetUUID" : "95DE9073-DF30-427A-A824-45120205EB29",
            "transitionDuration" : 0.5
          }
        },
        {
          "layer" : {
            "isHidden" : false,
            "name" : "Layer 3",
            "isMuted" : false,
            "effectPresetUUID" : "null",
            "effects" : [
              {
                "variables" : [
                  {
                    "type" : "Float",
                    "base" : {
                      "value" : 0.5,
                      "max_value" : 1,
                      "min_value" : 0.0099999997764825821,
                      "name" : "Blend Amount"
                    }
                  },
                  {
                    "type" : "Float",
                    "base" : {
                      "value" : 0.5,
                      "max_value" : 1,
                      "min_value" : 0.0099999997764825821,
                      "name" : "Speed"
                    }
                  }
                ],
                "enabled" : true,
                "name" : "Radial Blur",
                "uuid" : "6BC757C8-3F76-4E7E-885A-7A7C944465A5"
              }
            ],
            "uuid" : "364A8A26-1DEE-4991-ABE4-2CDE04BB6761",
            "opacity" : 1,
            "targetSetUUID" : "8B276680-12C8-4990-8F9F-9BFE6489E4C8",
            "transitionDuration" : 0.5
          }
        },
        {
          "layer" : {
            "isHidden" : false,
            "name" : "Layer 4",
            "isMuted" : false,
            "effectPresetUUID" : "null",
            "effects" : [

            ],
            "uuid" : "421841A9-3BA4-41DD-9211-5B07FEF76721",
            "opacity" : 1,
            "targetSetUUID" : "null",
            "transitionDuration" : 0.5
          }
        }
      ]
    }

`/data/layers`

### GET

Returns JSON representation of layers

## Specific Layer

> Request:

    GET /api/0/data/layer/0 HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X GET http://localhost:8080/api/0/data/layer/0 -k

> JSON response:

    {
      "layer" : {
        "isHidden" : false,
        "name" : "Layer 1",
        "isMuted" : false,
        "effectPresetUUID" : "null",
        "effects" : [

        ],
        "uuid" : "394B7D0F-050E-4590-98B9-B30A8823488D",
        "opacity" : 1,
        "targetSetUUID" : "AC04BC27-F3C2-429D-BC9B-446D04465EE9",
        "transitionDuration" : 0.5
      }
    }

`/data/layer/{id}`

### GET

Returns JSON representation of specified layer

### Parameters

Parameter | Description
--- | ---
id | Can be a uuid (string), name (string), or index (integer) of the layer

### Notes

- Number only parameters are always interpreted as an index and never name.

# Clear

## Workspace

> Request:

    POST /api/0/clear/workspace HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X POST http://localhost:8080/api/0/clear/workspace -k

`/clear/workspace`

### POST

Tells the client application to clear the workspace

## Layer

> Request:

    POST /api/0/clear/layer/0 HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X POST http://localhost:8080/api/0/clear/layer/0 -k

`/clear/layer/{id}`

### POST

Tells the client application to clear a specified layer

### Parameters

Parameter | Description
--- | ---
id | Can be a uuid (string), name (string), or index (integer) of the layer we want to clear.

### Notes

- Number only parameters are always interpreted as an index and never name.

# Mute

## Workspace

> Request:

    POST /api/0/mute/workspace HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X POST http://localhost:8080/api/0/mute/workspace -k

`/mute/workspace`

### POST

Tells the client application to mute the workspace

## Layer

> Request:

    POST /api/0/mute/layer/0 HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X POST http://localhost:8080/api/0/mute/layer/0 -k

`/mute/layer/{id}`

### POST

Tells the client application to mute a specified layer

### Parameters

Parameter | Description
--- | ---
id | Can be a uuid (string), name (string), or index (integer) of the layer we want to mute

### Notes

- Number only parameters are always interpreted as an index and never name.

# Unmute

## Workspace

> Request:

    POST /api/0/unmute/workspace HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X POST http://localhost:8080/api/0/unmute/workspace -k

`/unmute/workspace`

### POST

Tells the client application to unmute the workspace

## Layer

> Request:

    POST /api/0/unmute/layer/0 HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X POST http://localhost:8080/api/0/unmute/layer/0 -k

`/unmute/layer/{id}`

### POST

Tells the client application to unmute a specified layer

### Parameters

Parameter | Description
--- | ---
id | Can be a uuid (string), name (string), or index (integer) of the layer we want to mute

### Notes

- Number only parameters are always interpreted as an index and never name.

# Hide

## Workspace

> Request:

    POST /api/0/hide/workspace HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X POST http://localhost:8080/api/0/hide/workspace -k

`/hide/workspace`

### POST

Tells the client application to hide the workspace

## Layer

> Request:

    POST /api/0/hide/layer/0 HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X POST http://localhost:8080/api/0/hide/layer/0 -k

`/hide/layer/{id}`

### POST

Tells the client application to hide a specified layer

### Parameters

Parameter | Description
--- | ---
id | Can be a uuid (string), name (string), or index (integer) of the layer we want to hide

### Notes

- Number only parameters are always interpreted as an index and never name.

# Unhide

## Workspace

> Request:

    POST /api/0/unhide/workspace HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X POST http://localhost:8080/api/0/unhide/workspace -k

`/unhide/workspace`

### POST

Tells the client application to unhide the workspace

## Layer

> Request:

    POST /api/0/unhide/layer/0 HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X POST http://localhost:8080/api/0/unhide/layer/0 -k

`/unhide/layer/{id}`

### POST

Tells the client application to unhide a specified layer

### Parameters

Parameter | Description
--- | ---
id | Can be a uuid (string), name (string), or index (integer) of the layer we want to unhide

### Notes

- Number only parameters are always interpreted as an index and never name.

# Select

## Layer

> Request:

    POST /api/0/select/layer/0 HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    POST /api/0/select/layer/0?target=true HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X POST http://localhost:8080/api/0/select/layer/0 -k

    curl -X POST http://localhost:8080/api/0/select/layer/0?target=true -k

`/select/layer/{id}`

### POST

Tells the client application to select a layer for the sidebar preview and layer options.

### Parameters

Parameter | Description
--- | ---
id | Can be a uuid (string), name (string), or index (integer) of the layer
target | Optional (Bool) value indicating whether the layer should be targeted (Can be true or 1, false or 0)

### Notes

- Number only parameters are always interpreted as an index and never name.

## Playlist

> Request:

    POST /api/0/select/playlist/0 HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X POST http://localhost:8080/api/0/select/playlist/0 -k

`/select/playlist/{id}`

### POST

Tells the client application to select a playlist.

### Parameters

Parameter | Description
--- | ---
id | Can be a uuid (string), name (string), or index (integer) of the playlist.

Note The index will correspond with the top level playlists only.

# Trigger

## Cue in Current Playlist

> Request:

    POST /api/0/trigger/cue/0 HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X POST http://localhost:8080/api/0/trigger/cue/0 -k

`/trigger/cue/{id}`

### POST

Triggers the specified cue in the current playlist

Will also trigger a videoInputAction if the currentPlaylist is the videoInputPlaylist

### Parameters

Parameter | Description
--- | ---
id | Can be a uuid (string), name (string), or index (integer) of the cue or videoInputAction

### Notes

- Number only parameters are always interpreted as an index and never name.

## First Cue in Playlist

> Request:

    POST /api/0/trigger/playlist/playlistName HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X POST http://localhost:8080/api/0/trigger/playlist/playlistName -k

`/trigger/playlist/{id}`

### POST

Triggers the first cue in the playlist

Will also trigger a videoInputAction if the currentPlaylist is the videoInputPlaylist

### Parameters

Parameter | Description
--- | ---
id | Can be a uuid (string), name (string), or index (integer) of the playlist

### Notes

- The 'Video Input' playlist can be accessed by index -1 or by UUID
- Number only parameters are always interpreted as an index and never name.

## Cue in Playlist

> Request:

    POST /api/0/trigger/playlist/playlistName HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X POST http://localhost:8080/api/0/trigger/playlist/playlistName/cue/0 -k

`/trigger/playlist/{playlistId}/cue/{cueId}`

### POST

Finds the playlist with the playlistID & then triggers the cue with the cueID

Will also trigger a videoInputAction if the found playlist is the videoInputPlaylist

### Parameters

Parameter | Description
--- | ---
playlistId | Can be a uuid (string), name (string), or index (integer) of the playlist we need to search through
cueID | Can be a uuid (string), name (string), or index (integer) of the cue or videoInputAction

### Notes

- The 'Video Input' playlist can be accessed by -1 (index) or by UUID

## Cue in Playlist Targeting Layer

> Request:

    POST /api/0/trigger/layer/0/playlist/0/cue/0 HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X POST http://localhost:8080/api/0/trigger/layer/0/playlist/0/cue/0 -k

`/trigger/layer/{layerId}/playlist/{playlistId}/cue/{cueID}`

### POST

Triggers a cue or video input action to a specific layer. You can use the playlist end point to search for the cue within a specific playlist

### Parameters

Parameter | Description
--- | ---
layerId | Can be a uuid (string), name (string), or index (integer) of the layer we will target and fire the media on.
playlistId | Can be a uuid (string), name (string), or index (integer) of the playlist we need to search through.
cueID | Can be a uuid (string), name (string), or index (integer) of the cue or videoInputAction.

### Notes

- Number only parameters are always interpreted as an index and never name.

# Opacity

## Layer Opacity

> Request:

    GET /api/0/opacity/layer/0 HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X GET http://localhost:8080/api/0/opacity/layer/0 -k

`/opacity/layer/{id}`

### GET

Gets the opacity value for a specific layer.

### Parameters

Parameter | Description
--- | ---
id | Can be a uuid (string), name (string), or index (integer) of the layer we will target and change the opacity on

### Notes

- Number only parameters are always interpreted as an index and never name.

Response: {value}: The representation (double) of the opacity

The layer blending must be a standard blend mode to recieve a valid value. See Layer Blending for more detail.

> Request:

    POST /api/0/opacity/layer/0 HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X POST http://localhost:8080/api/0/opacity/layer/0 -k

> JSON Body:

    {
        "value" : 0.5
    }

### POST

Sets the opacity value for a specific layer.

### Parameters

Parameter | Description
--- | ---
id | Can be a uuid (string), name (string), or index (integer) of the layer we will target and change the opacity on

### Request Body JSON

Key | Description
--- | ---
value | The representation is a (double) for the layer opacity

### Notes

- Number only parameters are always interpreted as an index and never name.

The layer blending must be a standard blend mode or this request will set it to a standard "normal" blend mode and set the opacity accordingly

# Blend Mode

## Available Blend Modes

> Request:

    GET /api/0/blendMode HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X GET http://localhost:8080/api/0/blendMode -k

> JSON Response:

    {
      "data" : [
        {
          "blendMode" : {
            "name" : "Normal",
            "id" : 0
          }
        },
        {
          "blendMode" : {
            "name" : "Dissolve",
            "id" : 1
          }
        },
        {
          "blendMode" : {
            "name" : "Darken",
            "id" : 2
          }
        },
        {
          "blendMode" : {
            "name" : "Multiply",
            "id" : 3
          }
        }
      ]
    }

`/blendMode`

### GET

Gets all the blend modes available

## Layer Blend Mode

> Request:

    GET /api/0/blendMode/layer/0 HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X GET http://localhost:8080/api/0/blendMode/layer/0 -k

> JSON Response:

    {
      "blendMode" : {
        "name" : "Normal",
        "id" : 0
      }
    }

`/blendMode/layer/{id}`

### GET

Gets the blendMode of the specified layer.

### Parameters

Parameter | Description
--- | ---
id | Can be a uuid (string), name (string), or index (integer) of the layer we want to get the blendMode from

### Notes

- Number only parameters are always interpreted as an index and never name.

This is still a valid call, however see Layer Blending for a new version of handling blends.

> Request:

    POST /api/0/blendMode/layer/0 HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X POST http://localhost:8080/api/0/blendMode/layer/0 -k

> JSON Body:

    {
        "value" : "Color Burn"
    }

### POST

Sets the blendMode of the specified layer.

### Parameters

Parameter | Description
--- | ---
id | Can be a uuid (string), name (string), or index (integer) of the layer we will target and change the blendMode on

### Request Body JSON

Key | Description
--- | ---
value | The representation is a (string) for the name of the blend mode

### Notes

- Number only parameters are always interpreted as an index and never name.

This is still a valid call, however see Layer Blending for a new version of handling blends.

# Layer Blending

. `/blend/layer/{id}`

> Request:

    POST /api/0/blend/layer/0 HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X POST http://localhost:8080/api/0/blend/layer/0 -k

> JSON Body:

    {
        "layerBlend" : {
            "type" : "Luma Matte",
            "base" : {
                "isInverted" : true
            }
        }
    }

### GET

Gets the layer blending on the specified layer.

### Parameters

Parameter | Description
--- | ---
id | Can be a uuid (string), name (string), or index (integer) of the layer we want to get the layer blending from

### Notes

- Number only parameters are always interpreted as an index and never name.

### POST

Sets the layer blending on the layer

> JSON Body:

    {
        "type" : "Luma Matte",
        "base" : {
            "isInverted" : true
        }
    }

### Request Body JSON

Key | Description
--- | ---
type | A (string) value representing the type of the blend. Can be `Standard`, `Alpha Matte`, `Luma Matte`, or `White Matte`
base | A (JSON structure) representing the values for the blend. See Below

Base Standard Structure

Key | Description
--- | ---
name | A (string) value representing the name of the blend this is an optional value and not required
modeIndex | A (int) value representing the index of the blend mode
opacity | A (float) value representing the opacity of the blend

Alpha Matte Structure

Key | Description
--- | ---
isInverted | A (bool) value representing is the blending is inverted or not

Luma Matte Structure

Key | Description
--- | ---
isInverted | A (bool) value representing is the blending is inverted or not

White Matte Structure

No additional data. May be expanded in the future.

### Notes

- The base structure differs between types

# Layer Preset

## Available Layer Presets

> Request:

    GET /api/0/layerPreset HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X GET http://localhost:8080/api/0/layerPreset -k

> JSON Response:

    {
      "data" : [
       {
        "id": "example",
        "name": "exampleBlendModeName"
        }
      ]
    }

`/layerPreset`

### GET

Gets all the layer presets available

## Layer Preset

> Request:

    GET /api/0/layerPreset/layer/0 HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X GET http://localhost:8080/api/0/layerPreset/layer/0 -k

> JSON Response:

    {
      "data" : [
       {
        "id": "example",
        "name": "exampleBlendModeName"
        }
      ]
    }

`/layerPreset/layer/{id}`

### GET

Gets the layer preset for a specific layer

### Parameters

Parameter | Description
--- | ---
id | Can be a uuid (string), name (string), or index (integer) of the layer we want to get the layerPreset from

### Notes

- Number only parameters are always interpreted as an index and never name.

> Request:

    POST /api/0/layerPreset/layer/0 HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X POST http://localhost:8080/api/0/layerPreset/layer/0 -k

> JSON Body:

    {
        "value": "exampleLayerPresetName",
    }

### POST

Sets the layer preset for a specific layer

### Parameters

Parameter | Description
--- | ---
id | Can be a uuid (string), name (string), or index (integer) of the layer we want to set the layerPreset on

### Request Body JSON

Key | Description
--- | ---
value | The representation is a (string) for the name of the layer preset

### Notes

- Number only parameters are always interpreted as an index and never name.

# Target Set

## Available Target Sets

> Request:

    GET /api/0/targetSet HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X GET http://localhost:8080/api/0/targetSet -k

> JSON Response:

    {
      "data" : [
        {
          "targetSet" : {
            "name" : "Both",
            "uuid" : "95DE9073-DF30-427A-A824-45120205EB29"
          }
        },
        {
          "targetSet" : {
            "name" : "Right",
            "uuid" : "8B276680-12C8-4990-8F9F-9BFE6489E4C8"
          }
        },
        {
          "targetSet" : {
            "name" : "Left",
            "uuid" : "AC04BC27-F3C2-429D-BC9B-446D04465EE9"
          }
        }
      ]
    }

`/targetSet`

### GET

Gets all the target sets available

## Layer Target Set

> Request:

    GET /api/0/targetSet/layer/0 HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X GET http://localhost:8080/api/0/targetSet/layer/0 -k

> JSON Response:

    {
      "targetSet" : {
        "name" : "Left",
        "uuid" : "AC04BC27-F3C2-429D-BC9B-446D04465EE9"
      }
    }

`/targetSet/layer/{id}`

### GET

Gets the target set thats active on a specific layer which can be nil

### Parameters

Parameter | Description
--- | ---
id | Can be a uuid (string), name (string), or index (integer) of the layer we want to get the targetSet from

### Notes

- Number only parameters are always interpreted as an index and never name.

> Request:

    POST /api/0/targetSet/layer/0 HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X POST http://localhost:8080/api/0/targetSet/layer/0 -k

> JSON Body:

    {
        "value" : "Target Set 1"
    }

### POST

Sets the targetSet for a specific layer

### Parameters

Parameter | Description
--- | ---
id | Can be a uuid (string), name (string), or index (integer) of the layer we want to set the targetSet on

### Notes

- Number only parameters are always interpreted as an index and never name.

### Request Body JSON

Key | Description
--- | ---
value | The representation is a (string) for the name of the target set

### Notes

- To set the targetSet to nil, do not send a JSON body.

# Effects

## Available Effects

> Request:

    GET /api/0/effects HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X GET http://localhost:8080/api/0/effects -k

> JSON Response:

    {
      "data" : [
        {
          "effect" : {
            "variables" : [
              {
                "type" : "Float",
                "base" : {
                  "value" : 0,
                  "max_value" : 3.1415927410125732,
                  "min_value" : -3.1415927410125732,
                  "name" : "Hue"
                }
              },
              {
                "type" : "Float",
                "base" : {
                  "value" : 1,
                  "max_value" : 2,
                  "min_value" : 0,
                  "name" : "Contrast"
                }
              }
            ],
            "enabled" : false,
            "name" : "Adjust Color",
            "uuid" : "D4C199A9-64D7-4CCB-8C26-443E7A9C5C03"
          }
        }
      ]
    }

`/effects`

### GET

Gets all the available effects in the client application

## Workspace Effects

> Request:

    GET /api/0/effects/workspace HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X GET http://localhost:8080/api/0/effects/workspace -k

> JSON Response:

    {
      "data" : [
        {
          "effect" : {
            "variables" : [

            ],
            "enabled" : true,
            "name" : "Color Invert",
            "uuid" : "EDF55F11-1A1E-4BF3-9718-FA2D3731626D"
          }
        }
      ]
    }

`/effects/workspace`

### GET

Gets all the effects currently active on the workspace

> Request:

    POST /api/0/effects/workspace HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X POST http://localhost:8080/api/0/effects/workspace -k

> JSON Body:

    {
       "effect" : {
          "variables" : [
          {
             "type" : "Float",
             "base" : {
                "value" : 0.5,
                "max_value" : 1,
                "min_value" : 0,
                "name" : "Outline Amount"
             }
          },

          {
             "type" : "Float",
             "base" : {
                "value" : 0.5,
                "max_value" : 1,
                "min_value" : 0,
                "name" : "Color Level"
             }
          }
          ],

          "enabled" : true,
          "name" : "Edge Outline",
          "uuid" : "86BA6E3E-358F-4DA2-93C4-6A2C0EC831DA"
       }
    }

### POST

Sets all the effects on the workspace

### Request Body JSON

Key | Description
--- | ---
variables | Optional An (array of JSON Structures) of variables for the effect. See Below
enabled | Optional The (bool) indicating whether the effect is enabled
name | Optional The name (string) of the effect
uuid | Required The UUID (string) of the desired effect

Variables Array

Key | Description
--- | ---
type | A (string) value representing the type of the effect. Can be `Int`, `Float`, `Double`, `Direction`, or `Color`
base | A (JSON structure) representing the values for the variable. See Below

Base Structure

Key | Description
--- | ---
value | In the case of type: float, a (double) value representing the desired value of the variable
max_value | In the case of type: float, a (double) value representing the max value of the variable
min_value | In the case of type: float, a (double) value representing the min value of the variable
name | A (string) value representing the name of the variable

## Layer Effects

> Request:

    GET /api/0/effects/layer/0 HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X GET http://localhost:8080/api/0/effects/layer/0 -k

> JSON Response:

    {
      "data" : [
        {
          "effect" : {
            "variables" : [

            ],
            "enabled" : true,
            "name" : "Color Invert",
            "uuid" : "EDF55F11-1A1E-4BF3-9718-FA2D3731626D"
          }
        }
      ]
    }

`/effects/layer/{id}`

### GET

Gets all the effects currently active on a specific layer

### Parameters

Parameter | Description
--- | ---
id | Can be a uuid (string), name (string), or index (integer) of the layer we want to get effects from

### Notes

- Number only parameters are always interpreted as an index and never name.

> Request:

    POST /api/0/effects/layer/0 HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X POST http://localhost:8080/api/0/effects/layer/0 -k

> JSON Body:

    {      "effect" : {
            "variables" : [
              {
                "type" : "Float",
                "base" : {
                  "value" : 0.5,
                  "max_value" : 1,
                  "min_value" : 0,
                  "name" : "Outline Amount"
                }
              },
              {
                "type" : "Float",
                "base" : {
                  "value" : 0.5,
                  "max_value" : 1,
                  "min_value" : 0,
                  "name" : "Color Level"
                }
              }
            ],
            "enabled" : true,
            "name" : "Edge Outline",
            "uuid" : "86BA6E3E-358F-4DA2-93C4-6A2C0EC831DA"
          }
    }

### POST

Sets all the effects on a specific layer

### Parameters

Parameter | Description
--- | ---
id | Can be a uuid (string), name (string), or index (integer) of the layer we want to set effects on

### Notes

- Number only parameters are always interpreted as an index and never name.

### Request Body JSON

Key | Description
--- | ---
variables | Optional An (array of JSON Structures) of variables for the effect. See Below
enabled | Optional The (bool) indicating whether the effect is enabled
name | Optional The name (string) of the effect
uuid | Required The UUID (string) of the desired effect

Variables Array

Key | Description
--- | ---
type | A (string) value representing the type of the effect. Can be `Int`, `Float`, `Double`, `Direction`, or `Color`
base | A (JSON structure) representing the values for the variable. See Below

Base Structure

Key | Description
--- | ---
value | In the case of type: float, a (double) value representing the desired value of the variable
max_value | In the case of type: float, a (double) value representing the max value of the variable
min_value | In the case of type: float, a (double) value representing the min value of the variable
name | A (string) value representing the name of the variable

# Effects Preset

## Available Effects Presets

> Request:

    GET /api/0/effectsPreset HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X GET http://localhost:8080/api/0/effectsPreset -k

> JSON Response:

    {
      "data" : [
        {
          "effectPreset" : {
            "name" : "ColorInvert",
            "effects" : [
              {
                "variables" : [

                ],
                "enabled" : true,
                "name" : "Color Invert",
                "uuid" : "EDF55F11-1A1E-4BF3-9718-FA2D3731626D"
              }
            ],
            "uuid" : "3B076957-6D48-45A7-803F-6D1E06B02F54"
          }
        }
      ]
    }

`/effectsPreset`

### GET

Gets all the available effectPresets in the client application

## Workspace Effects Presets

> Request:

    GET /api/0/effectsPreset/workspace HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X GET http://localhost:8080/api/0/effectsPreset/workspace -k

> JSON Response:

    {
      "effectPreset" : {
        "name" : "ColorInvert",
        "effects" : [
          {
            "variables" : [

            ],
            "enabled" : true,
            "name" : "Color Invert",
            "uuid" : "EDF55F11-1A1E-4BF3-9718-FA2D3731626D"
          }
        ],
        "uuid" : "3B076957-6D48-45A7-803F-6D1E06B02F54"
      }
    }

`/effectsPreset/workspace`

### GET

Gets the effectPreset currently selected on the workspace, this can be Null

### Response JSON

Key | Description
--- | ---
uuid | The representation is a (string) for the effectPreset uuid
name | The name of the effectPreset represented as (string)
effects | Array of JSON values containing the effects within this preset or `null` if nothing is selected

> Request:

    POST /api/0/effectsPreset/workspace HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X POST http://localhost:8080/api/0/effectsPreset/workspace -k

> JSON Body:

    {
        "value" : null
    }

### POST

Sets the effectPreset on a the workspace, you can set the value to be Null

### Request Body JSON

Key | Description
--- | ---
value | The representation is a (string) for the effectPreset uuid or `null` if nothing is selected

## Layer Effects Preset

> Request:

    GET /api/0/effectsPreset/layer/0 HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X GET http://localhost:8080/api/0/effectsPreset/layer/0 -k

> JSON Response:

    {
      "effectPreset" : {
        "name" : "ColorInvert",
        "effects" : [
          {
            "variables" : [

            ],
            "enabled" : true,
            "name" : "Color Invert",
            "uuid" : "EDF55F11-1A1E-4BF3-9718-FA2D3731626D"
          }
        ],
        "uuid" : "3B076957-6D48-45A7-803F-6D1E06B02F54"
      }
    }

`/effectsPreset/layer/{id}`

### GET

Gets the effectPreset currently selected on a specific layer, this can be Null

### Parameters

Parameter | Description
--- | ---
id | Can be a uuid (string), name (string), or index (integer) of the layer we want to get the preset from

### Notes

- Number only parameters are always interpreted as an index and never name.

### Response JSON

Key | Description
--- | ---
uuid | The representation is a (string) for the effectPreset uuid
name | The name of the effectPreset represented as (string)
effects | Array of JSON values containing the effects within this preset or `null` if nothing is selected

> Request:

    POST /api/0/effectsPreset/layer/0 HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X POST http://localhost:8080/api/0/effectsPreset/layer/0 -k

> JSON Body:

    {
        "value" : "NameOfEffectsPreset"
    }

### POST

Sets an effectPreset on a specific layer, you can set the value to be Null

### Parameters

Parameter | Description
--- | ---
id | Can be a uuid (string), name (string), or null if we don't want to set an effect Preset

### Request Body JSON

Key | Description
--- | ---
value | The (string) value for the name of the effects preset

# Transitions

## Available Transitions

> Request:

    GET /api/0/transition HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X GET http://localhost:8080/api/0/transition -k

> JSON Response:

    {
      "data" : [
        {
          "transition" : {
            "variables" : [
              {
                "type" : "Color",
                "base" : {
                  "name" : "Burn Color",
                  "color" : "#6C6C6C"
                }
              }
            ],
            "enabled" : false,
            "name" : "Color Burn",
            "uuid" : "2B855B65-6ABC-4F65-8198-A19A5EF97821"
          }
        },
        {
          "transition" : {
            "variables" : [

            ],
            "enabled" : false,
            "name" : "Color Push",
            "uuid" : "E958E7B0-E5C2-4C10-9B22-D1FE4FEA1E49"
          }
        }
      ]
    }

`/transition`

### GET

Gets all the available transitions in the client application

### Response JSON

Key | Description
--- | ---
transitions | (Array) of JSON values containing the transitions

## Workspace Transition

> Request:

    GET /api/0/transition/workspace HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X GET http://localhost:8080/api/0/transition/workspace -k

> JSON Response:

    {
      "transition" : {
        "variables" : [

        ],
        "enabled" : false,
        "name" : "Default (Dissolve)",
        "uuid" : "EC52A828-AD85-4602-B70C-1DEE7C904DB6"
      }
    }

`/transition/workspace`

### GET

Gets the transition currently selected on the workspace

### Response JSON

Key | Description
--- | ---
uuid | The representation is a (string) for the transition uuid
name | The name of the transition represented as (string)
enabled | (Bool) value representing whether the transition is enabled

> Request:

    POST /api/0/transition/workspace HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X POST http://localhost:8080/api/0/transition/workspace -k

> JSON Body:

        {
          "transition" : {
            "variables" : [
              {
                "type" : "Color",
                "base" : {
                  "name" : "Burn Color",
                  "color" : "#6C6C6C"
                }
              }
            ],
            "enabled" : false,
            "name" : "Color Burn",
            "uuid" : "2B855B65-6ABC-4F65-8198-A19A5EF97821"
          }
        }

### POST

Sets the transition on a the workspace.

### Request Body JSON

Key | Description
--- | ---
value | The representation is a (string) for the transition uuid
name | The name of the transition represented as (string)

## Layer Transition

> Request:

    GET /api/0/transition/layer/0 HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X GET http://localhost:8080/api/0/transition/layer/0 -k

> JSON Response:

    {
      "transition" : {
        "variables" : [

        ],
        "enabled" : false,
        "name" : "Cross Hatch",
        "uuid" : "5584E51F-5C92-47B5-9B65-3C2540C1F20C"
      }
    }

`/transition/layer/{id}`

### GET

Gets the transition currently selected on a layer, this can be Null

### Parameters

Parameter | Description
--- | ---
id | Can be a uuid (string), name (string), or index (integer) of the layer we want to get the transition from

### Notes

- Number only parameters are always interpreted as an index and never name.

Paramaters: None

### Response JSON

Key | Description
--- | ---
uuid | The representation is a (string) for the transition uuid
name | The name of the transition represented as (string) or `null` if nothing is selected
enabled | (Bool) value representing whether the transition is enabled

> Request:

    POST /api/0/transition/layer/0 HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X POST http://localhost:8080/api/0/transition/layer/0 -k

> JSON Body:

    {
    "transition" : {
        "variables" : [
        {
            "type" : "Color",
            "base" : {
                "name" : "Burn Color",
                "color" : "#6C6C6C"
            }
        }
        ],
        "enabled" : false,
        "name" : "Color Burn",
        "uuid" : "2B855B65-6ABC-4F65-8198-A19A5EF97821"
        }
    }

### POST

Sets the transition on a layer, you can set the value to be Null if you want to set it to use the master transition

### Parameters

Parameter | Description
--- | ---
id | Can be a uuid (string), name (string), or index (integer) of the layer we want to set the transition on

### Notes

- Number only parameters are always interpreted as an index and never name.

### Request Body JSON

Key | Description
--- | ---
value | The representation is a (string) for the transition uuid
name | The name of the transition represented as (string) or `null` if nothing is selected

# Transition Duration

## Workspace Transition Duration

> Request:

    GET /api/0/transitionDuration/workspace HTTP/1.1
    Host: localhost: 8080
    Content-Type: application/json

    curl -X GET http://localhost:8080/api/0/transitionDuration/workspace -k

> JSON Response:

    {
      "transitionDuration" : {
        "value" : 0.5
      }
    }

`/transitionDuration/workspace`

### GET

Gets the transition duration for the workspace

### Response JSON

Key | Description
--- | ---
value | The representation is a (double) and can be between 0.0 & 5.0

> Request:

    POST /api/0/transitionDuration/workspace HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X POST http://localhost:8080/api/0/transitionDuration/workspace -k

> JSON Body:

    {
        "value" : 1.5
    }

### POST

Sets the transition duration on the workspace.

### Request Body JSON

Key | Description
--- | ---
value | The representation should be a (double) and can be between 0.0 & 5.0

## Layer Transition Duration

> Request:

    GET /api/0/transitionDuration/layer/0 HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X GET http://localhost:8080/api/0/transitionDuration/layer/0 -k

> JSON Response:

    {
      "transitionDuration" : {
        "value" : 0.5
      }
    }

`/transitionDuration/layer/{id}`

### GET

Gets the transition duration for a layer

### Parameters

Parameter | Description
--- | ---
id | Can be a uuid (string), name (string), or index (integer) of the layer we want to get the transition duration from

### Notes

- Number only parameters are always interpreted as an index and never name.

### Response JSON

Key | Description
--- | ---
value | The representation is a (double) and can be between 0.0 & 5.0

> Request:

    POST /api/0/transitionDuration/layer/0 HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X POST http://localhost:8080/api/0/transitionDuration/layer/0 -k

> JSON Body:

    {
        "value" : 1.5
    }

### POST

Sets the transition duration on a layer.

### Parameters

Parameter | Description
--- | ---
id | Can be a uuid (string), name (string), or index (integer) of the layer we want to set the transition duration on

### Notes

- Number only parameters are always interpreted as an index and never name.

### Request Body JSON

Key | Description
--- | ---
value | The representation should be a (double) and can be between 0.0 & 5.0

# Transport State

## Workspace Transport State

> Request:

    GET /api/0/transportState/workspace HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X GET http://localhost:8080/api/0/transportState/workspace -k

> JSON Response:

    {
      "data" : [
        {
          "transportState" : {
            "timeElapsed" : 0,
            "playbackRate" : 0,
            "playingItem" : {
              "name" : "Cue One",
              "uuid" : "CFCAC8BA-98AB-4DE9-9D95-FAB3D0B9FC84"
            },
            "playingMedia" : {
              "name" : "MediaName.jpg",
              "uuid" : "7358B6A7-85A4-4038-8ED3-88A72AC106E0"
            },
            "layer" : {
              "isHidden" : false,
              "name" : "Layer 1",
              "isMuted" : false,
              "effectPresetUUID" : "3B076957-6D48-45A7-803F-6D1E06B02F54",
              "effects" : [
                {
                  "variables" : [

                  ],
                  "enabled" : true,
                  "name" : "Color Invert",
                  "uuid" : "EDF55F11-1A1E-4BF3-9718-FA2D3731626D"
                }
              ],
              "transition" : {
                "variables" : [
                  {
                    "type" : "Color",
                    "base" : {
                      "name" : "Burn Color",
                      "color" : "#585858"
                    }
                  }
                ],
                "enabled" : false,
                "name" : "Color Burn",
                "uuid" : "2B855B65-6ABC-4F65-8198-A19A5EF97821"
              },
              "uuid" : "394B7D0F-050E-4590-98B9-B30A8823488D",
              "opacity" : 0.5,
              "targetSetUUID" : "95DE9073-DF30-427A-A824-45120205EB29",
              "transitionDuration" : 1.5
            },
            "isScrubbing" : false,
            "timeRemaining" : 0,
            "isPlaying" : false
          }
        }
      ]
    }

`/transportState/workspace`

### GET

Gets the transport state for the workspace

### Response JSON

Key | Description
--- | ---
data | An (Array) containing information on the transport state of the workspace

## Layer Transport State

> Request:

    GET /api/0/transportState/layer/0 HTTP/1.1
    Host: localhost:8080
    Content-Type: application/json

    curl -X GET http://localhost:8080/api/0/transportState/layer/0 -k

> JSON Response:

    {
      "transportState" : {
        "timeElapsed" : 0,
        "playbackRate" : 0,
        "playingItem" : {
          "name" : "Cue One",
          "uuid" : "CFCAC8BA-98AB-4DE9-9D95-FAB3D0B9FC84"
        },
        "layer" : {
          "isHidden" : false,
          "name" : "Layer 1",
          "isMuted" : false,
          "effectPresetUUID" : "3B076957-6D48-45A7-803F-6D1E06B02F54",
          "effects" : [
            {
              "variables" : [

              ],
              "enabled" : true,
              "name" : "Color Invert",
              "uuid" : "EDF55F11-1A1E-4BF3-9718-FA2D3731626D"
            }
          ],
          "transition" : {
            "variables" : [
              {
                "type" : "Color",
                "base" : {
                  "name" : "Burn Color",
                  "color" : "#585858"
                }
              }
            ],
            "enabled" : false,
            "name" : "Color Burn",
            "uuid" : "2B855B65-6ABC-4F65-8198-A19A5EF97821"
          },
          "uuid" : "394B7D0F-050E-4590-98B9-B30A8823488D",
          "opacity" : 0.5,
          "targetSetUUID" : "95DE9073-DF30-427A-A824-45120205EB29",
          "transitionDuration" : 1.5
        },
        "isScrubbing" : false,
        "timeRemaining" : 0,
        "isPlaying" : false
      }
    }

`/transportState/layer/{id}`

### GET

Gets the transport state for a layer

### Parameters

Parameter | Description
--- | ---
id | Can be a uuid (string), name (string), or index (integer) of the layer we want to get the transport state on

### Notes

- Number only parameters are always interpreted as an index and never name.

### Response JSON

Key | Description
--- | ---
data | An (Array) containing information on the transport state of the layer

# Errors

The API uses the following error codes:

Error Code | Meaning
--- | ---
400 | Bad Request -- Your request was invalid.
401 | Unauthorized -- Authorization failed.
403 | Forbidden -- The endpoint requested is hidden for administrators only.
404 | Not Found -- The specified endpoint could not be found.
405 | Method Not Allowed -- You tried to access an endpoint with an invalid method.
500 | Internal Server Error -- We had a problem with our server. Try again later.
503 | Service Unavailable -- We're temporarily offline for maintenance. Please try again later.

shell http