# Create a screen link

> A link to the VM's screen. Who has the link watches, and can take over the screen, until it expires.

`POST /v1/tenants/{tenant}/vms/{name}/screen-links`

```bash curl
curl -X POST "https://api.shako.dev/v1/tenants/acme/vms/web1/screen-links" \
  -H "Authorization: Bearer $SHAKO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"expires":900}'
```

```python Python
import os

import requests

response = requests.post(
    "https://api.shako.dev/v1/tenants/acme/vms/web1/screen-links",
    headers={"Authorization": f"Bearer {os.environ['SHAKO_API_KEY']}"},
    json={
        "expires": 900,
    },
)
response.raise_for_status()
print(response.json())
```

```javascript JavaScript
const response = await fetch("https://api.shako.dev/v1/tenants/acme/vms/web1/screen-links", {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.SHAKO_API_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({
    "expires": 900
  }),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.json());
```

```json 201 (excerpt)
{
  "name": "web1",
  "url": "https://workspace.shako.dev/live/Zk3...",
  "expires": 1793492100
}
```

Authenticate with `Authorization: Bearer <API key>` on `https://api.shako.dev`. Role: contributor or owner.

## Path parameters

**tenant** `string` *required*

The tenant's name, from GET /v1/tenants.

**name** `string` *required*

The VM's name.

## Request body

**expires** `integer, 60 to 3600` (default: 3600)

How long the link works, in seconds: 60 to 3600.

## Response

201 with [the screen link object](https://shako.dev/api/objects/screen-link.md).

## Behavior

Put the url in your own page, for example in an <iframe>.

The errors: https://shako.dev/api/errors.md. All the endpoints of Screen links: https://shako.dev/api/screen-links.md.
