# Automation

Automate transfers and fetch information about mounted tapes using Canister's API.

{% hint style="info" %}
A `Pro` license is required to use the Canister API. Mac support is coming soon.
{% endhint %}

## How it works

The Canister API responds to URLs beginning with `canister://`. These can be triggered from a browser, shell, or script. [Deployment calls](https://docs.hedge.video/canister/features/deployment) can be included in your automated workflows.

\
**Example script usage**

{% tabs %}
{% tab title="Windows" %}
Using Python:

```
import os
os.system("start canister://open")
```

{% endtab %}
{% endtabs %}

#### Add Archive <a href="#deactivate" id="deactivate"></a>

Archive a source to all mounted tapes:

```
canister://addarchive?sources="E:\Important footage"
```

| URL Parameter | Type   | Required? |
| ------------- | ------ | --------- |
| sources       | String | Mandatory |

A Collection of different sources, files, or folders can be combined using the `|` ("pipe") operator. Source paths must either be wrapped in quotes or URL encoded.

```
canister://addarchive?sources="E:\Important footage 1"|"F:\Important footage 2"
```

Optional parameters for choosing a destination tape and folder are available:

| URL Parameter     | Type   | Required? |
| ----------------- | ------ | --------- |
| destinationtape   | string | optional  |
| destinationfolder | string | optional  |

Putting it together:

{% code overflow="wrap" %}

```
canister://addarchive?sources="E:\Important footage 1"&destinationtape="Archive 01"&destinationfolder="260304"
```

{% endcode %}

#### Add Retrieve <a href="#deactivate" id="deactivate"></a>

Retrieve folders or files from tape:

{% code overflow="wrap" %}

```
canister://addretrieve?sources="260304\Important footage 1"&sourcetape="Archive 01"&destinationpath="E:\Retrieved Footage"
```

{% endcode %}

| URL Parameter   | Type   | Required? |
| --------------- | ------ | --------- |
| sources         | string | mandatory |
| sourcetape      | string | mandatory |
| destinationpath | string | mandatory |

#### Get Tapes <a href="#deactivate" id="deactivate"></a>

Generate a JSON list of mounted tapes using `gettapes`. Set an optional path for the dump using the `path` parameter:

```
canister://gettapes?path="c:\temp scripts"
```

| URL Parameter | Type   | Required? |
| ------------- | ------ | --------- |
| path          | String | optional  |

Sample output:

```
[
  {
    "name"               : "Archive 01",
    "serial"             : "19WT134678",
    "driveLetter"        : "Z",
    "status"             : "READY",
    "totalCapacityBytes" : 2408088338432,
    "freeBytes"          : 2408085192704
  }
]
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hedge.video/canister/features/automation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
