# Reference API: Šablony

Šablony: všechny operace API v1 s požadovaným scope, parametry, příklady v curl, JavaScriptu a Pythonu a odpověďmi. Ověřování, chyby, stránkování, limity a idempotence jsou v [přehledu reference API](/docs/api-reference); viz také [SDK](/docs/sdks) a [příkazový řádek](/docs/cli).

> Vyzkoušejte se svým klíčem: vytvořte v konzoli klíč API, v terminálu spusťte `export APIDLY_API_KEY=...` a vložte libovolný příklad curl níže. Hodnoty v příkladech jsou ilustrační. Na této stránce není žádné pole pro zadání klíče.

Popisy operací a polí pocházejí z definice API a jsou anglicky.

| Operace | Požadovaný scope | Shrnutí |
| --- | --- | --- |
| `GET /templates` | `read` | Veřejné šablony a šablony vaší organizace |
| `POST /templates` | `full` | Vytvořit šablonu organizace |
| `GET /templates/{id}` | `read` | Jedna šablona |
| `PATCH /templates/{id}` | `full` | Aktualizovat šablonu vaší organizace |
| `DELETE /templates/{id}` | `full` | Smazat šablonu, nebo ji skrýt, když na ni servery ještě odkazují |
| `POST /templates/{id}/share` | `full` | Vytvořit sdílený odkaz na šablonu vaší organizace |
| `DELETE /templates/{id}/share` | `full` | Zrušit sdílené odkazy šablony |
| `GET /templates/{id}/share` | `full` | Odkazy pro sdílení šablony |
| `POST /templates/{id}/duplicate` | `full` | Zkopírovat šablonu vaší organizace |
| `GET /templates/{id}/revisions` | `read` | Historie revizí šablony, nejnovější první |
| `POST /templates/{id}/revisions/{rev}/restore` | `full` | Obnovit starší revizi jako novou |
| `GET /templates/{id}/export` | `full` | Exportovat šablonu do přenosného souboru |
| `POST /templates/import` | `full` | Vytvořit šablonu z exportovaného souboru |
| `POST /template-shares/{token}/import` | `full` | Zkopírovat sdílenou šablonu do vaší organizace |
| `POST /template-shares/{token}/report` | `servers` | Nahlásit sdílenou šablonu našim pracovníkům (nejvýše 10 za hodinu na organizaci) |

### GET /templates

Veřejné šablony a šablony vaší organizace

Optional filters: `q` (up to 60 characters, case-insensitive, found in the name, slug, summary, image or category), `category`, `source` (`builtin` for the public catalogue, `own` for your organization's templates) and `vramGb` (only templates whose `minVramGb` is at most this, so they run on a GPU with that much memory). Repeat the same filters on every page so the `cursor` stays valid.

**Požadovaný scope:** `read`

**Parametry**

| Název | V | Typ | Povinné | Popis |
| --- | --- | --- | --- | --- |
| `limit` | query | integer | ne |  |
| `cursor` | query | string | ne |  |
| `q` | query | string | ne |  |
| `category` | query | `base` \| `llm` \| `image` \| `notebook` \| `training` \| `custom` | ne |  |
| `source` | query | `builtin` \| `own` | ne |  |
| `vramGb` | query | integer | ne |  |

**Příklad požadavku (curl)**

```bash
curl "https://apidly.com/api/v1/templates?limit=20" \
  -H "Authorization: Bearer $APIDLY_API_KEY"
```

**JavaScript (SDK)**

```js
await apidly.templates.list({ limit: 20 });
```

**Python (SDK)**

```python
client.templates.list()
```

**Nástroj příkazového řádku:** `apidly templates`, `apidly export`, `apidly plan`, `apidly apply` ([Reference CLI](/docs/cli))

**Příklad odpovědi** (200)

```json
{
  "templates": [
    {
      "id": "example",
      "slug": "example",
      "name": "example",
      "summary": "example",
      "category": "example",
      "image": "docker.io/library/ubuntu",
      "tag": "example",
      "launchMode": "ssh",
      "env": {
        "key": "example"
      },
      "ports": [
        {
          "port": null,
          "protocol": null,
          "label": null
        }
      ],
      "startScript": "example",
      "onStart": "example",
      "args": "example",
      "description": "example",
      "secretEnvKeys": [
        "example"
      ],
      "registryId": "id_example",
      "appPort": 1,
      "defaultDiskGb": 1,
      "minVramGb": 1,
      "recommendedVramGb": 1,
      "constraints": {
        "key": null
      },
      "latestCudaTag": false,
      "inference": {
        "api": "http",
        "healthPath": "example",
        "port": 1
      },
      "custom": false,
      "firstBootMinutes": 1,
      "revision": 1,
      "sort": 1,
      "createdAt": "2026-11-21T10:00:00.000Z"
    }
  ],
  "nextCursor": "example"
}
```

Chybové stavy: `401`, `403`, `429`.

### POST /templates

Vytvořit šablonu organizace

**Požadovaný scope:** `full` · **Role tvůrce:** `admin` · **Bezpečně opakovat s:** `Idempotency-Key`

**Tělo požadavku**

| Název | Typ | Povinné | Popis |
| --- | --- | --- | --- |
| `name` | string | ano |  |
| `summary` | string | ne |  |
| `description` | string | ne |  |
| `image` | string | ano |  |
| `tag` | string | ne |  |
| `launchMode` | `ssh` \| `jupyter` \| `app` | ano |  |
| `env` | object | ne |  |
| `secretEnv` | object | ne |  |
| `ports` | pole object | ne |  |
| `startScript` | string | ne | Shell script run on the server after each start (up to 64 KB). Replaces the deprecated `onStart`. |
| `onStart` | string | ne | Deprecated name of `startScript`, read until 2027-05-31. Send `startScript`. |
| `args` | string | ne |  |
| `appPort` | integer nebo null | ne |  |
| `defaultDiskGb` | integer | ne |  |
| `minVramGb` | integer | ne |  |
| `constraints` | object | ne |  |
| `recommendedVramGb` | integer nebo null | ne |  |
| `inference` | object nebo null | ne |  |
| `registryId` | string nebo null | ne |  |
| `latestCudaTag` | boolean | ne |  |
| `inheritSecretsFrom` | string | ne |  |

**Příklad požadavku (curl)**

```bash
curl -X POST "https://apidly.com/api/v1/templates" \
  -H "Authorization: Bearer $APIDLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"name":"example","image":"docker.io/library/ubuntu","launchMode":"ssh"}'
```

**JavaScript (SDK)**

```js
await apidly.templates.create({
  name: "example",
  image: "docker.io/library/ubuntu",
  launchMode: "ssh"
});
```

**Python (SDK)**

```python
client.templates.create(body={
    "name": "example",
    "image": "docker.io/library/ubuntu",
    "launchMode": "ssh",
})
```

**Nástroj příkazového řádku:** `apidly templates` ([Reference CLI](/docs/cli))

**Příklad odpovědi** (201)

```json
{
  "template": {
    "id": "example",
    "slug": "example",
    "name": "example",
    "summary": "example",
    "category": "example",
    "image": "docker.io/library/ubuntu",
    "tag": "example",
    "launchMode": "ssh",
    "env": {
      "key": "example"
    },
    "ports": [
      {
        "port": 1,
        "protocol": "tcp",
        "label": "example"
      }
    ],
    "startScript": "example",
    "onStart": "example",
    "args": "example",
    "description": "example",
    "secretEnvKeys": [
      "example"
    ],
    "registryId": "id_example",
    "appPort": 1,
    "defaultDiskGb": 1,
    "minVramGb": 1,
    "recommendedVramGb": 1,
    "constraints": {
      "key": null
    },
    "latestCudaTag": false,
    "inference": {
      "api": "http",
      "healthPath": "example",
      "port": 1
    },
    "custom": false,
    "firstBootMinutes": 1,
    "revision": 1,
    "sort": 1,
    "createdAt": "2026-11-21T10:00:00.000Z"
  }
}
```

Chybové stavy: `400`, `401`, `403`, `409`, `429`.

### GET /templates/{id}

Jedna šablona

`id` is a template id or the slug the catalogue lists (`pytorch`). Built-in templates are shown read-only (`custom: false`).

**Požadovaný scope:** `read`

**Parametry**

| Název | V | Typ | Povinné | Popis |
| --- | --- | --- | --- | --- |
| `id` | path | string | ano |  |

**Příklad požadavku (curl)**

```bash
curl "https://apidly.com/api/v1/templates/tpl_example" \
  -H "Authorization: Bearer $APIDLY_API_KEY"
```

**JavaScript (SDK)**

```js
await apidly.templates.get("tpl_example");
```

**Python (SDK)**

```python
client.templates.get("tpl_example")
```

**Nástroj příkazového řádku:** `apidly templates` ([Reference CLI](/docs/cli))

**Příklad odpovědi** (200)

```json
{
  "template": {
    "id": "example",
    "slug": "example",
    "name": "example",
    "summary": "example",
    "category": "example",
    "image": "docker.io/library/ubuntu",
    "tag": "example",
    "launchMode": "ssh",
    "env": {
      "key": "example"
    },
    "ports": [
      {
        "port": 1,
        "protocol": "tcp",
        "label": "example"
      }
    ],
    "startScript": "example",
    "onStart": "example",
    "args": "example",
    "description": "example",
    "secretEnvKeys": [
      "example"
    ],
    "registryId": "id_example",
    "appPort": 1,
    "defaultDiskGb": 1,
    "minVramGb": 1,
    "recommendedVramGb": 1,
    "constraints": {
      "key": null
    },
    "latestCudaTag": false,
    "inference": {
      "api": "http",
      "healthPath": "example",
      "port": 1
    },
    "custom": false,
    "firstBootMinutes": 1,
    "revision": 1,
    "sort": 1,
    "createdAt": "2026-11-21T10:00:00.000Z"
  }
}
```

Chybové stavy: `401`, `403`, `404`, `429`.

### PATCH /templates/{id}

Aktualizovat šablonu vaší organizace

**Požadovaný scope:** `full` · **Role tvůrce:** `admin`

**Parametry**

| Název | V | Typ | Povinné | Popis |
| --- | --- | --- | --- | --- |
| `id` | path | string | ano |  |

**Tělo požadavku**

| Název | Typ | Povinné | Popis |
| --- | --- | --- | --- |
| `name` | string | ne |  |
| `summary` | string | ne |  |
| `description` | string | ne |  |
| `image` | string | ne |  |
| `tag` | string | ne |  |
| `launchMode` | `ssh` \| `jupyter` \| `app` | ne |  |
| `env` | object | ne |  |
| `secretEnv` | object | ne |  |
| `ports` | pole object | ne |  |
| `startScript` | string | ne | Shell script run on the server after each start (up to 64 KB). Replaces the deprecated `onStart`. |
| `onStart` | string | ne | Deprecated name of `startScript`, read until 2027-05-31. Send `startScript`. |
| `args` | string | ne |  |
| `appPort` | integer nebo null | ne |  |
| `defaultDiskGb` | integer | ne |  |
| `minVramGb` | integer | ne |  |
| `constraints` | object | ne |  |
| `recommendedVramGb` | integer nebo null | ne |  |
| `inference` | object nebo null | ne |  |
| `registryId` | string nebo null | ne |  |
| `latestCudaTag` | boolean | ne |  |

**Příklad požadavku (curl)**

```bash
curl -X PATCH "https://apidly.com/api/v1/templates/tpl_example" \
  -H "Authorization: Bearer $APIDLY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"example","summary":"example","description":"example"}'
```

**JavaScript (SDK)**

```js
await apidly.templates.update("tpl_example", {
  name: "example",
  summary: "example",
  description: "example"
});
```

**Python (SDK)**

```python
client.templates.update("tpl_example", body={
    "name": "example",
    "summary": "example",
    "description": "example",
})
```

**Nástroj příkazového řádku:** `apidly templates` ([Reference CLI](/docs/cli))

**Příklad odpovědi** (200)

```json
{
  "template": {
    "id": "example",
    "slug": "example",
    "name": "example",
    "summary": "example",
    "category": "example",
    "image": "docker.io/library/ubuntu",
    "tag": "example",
    "launchMode": "ssh",
    "env": {
      "key": "example"
    },
    "ports": [
      {
        "port": 1,
        "protocol": "tcp",
        "label": "example"
      }
    ],
    "startScript": "example",
    "onStart": "example",
    "args": "example",
    "description": "example",
    "secretEnvKeys": [
      "example"
    ],
    "registryId": "id_example",
    "appPort": 1,
    "defaultDiskGb": 1,
    "minVramGb": 1,
    "recommendedVramGb": 1,
    "constraints": {
      "key": null
    },
    "latestCudaTag": false,
    "inference": {
      "api": "http",
      "healthPath": "example",
      "port": 1
    },
    "custom": false,
    "firstBootMinutes": 1,
    "revision": 1,
    "sort": 1,
    "createdAt": "2026-11-21T10:00:00.000Z"
  }
}
```

Chybové stavy: `400`, `401`, `403`, `404`, `429`.

### DELETE /templates/{id}

Smazat šablonu, nebo ji skrýt, když na ni servery ještě odkazují

**Požadovaný scope:** `full` · **Role tvůrce:** `admin`

**Parametry**

| Název | V | Typ | Povinné | Popis |
| --- | --- | --- | --- | --- |
| `id` | path | string | ano |  |

**Příklad požadavku (curl)**

```bash
curl -X DELETE "https://apidly.com/api/v1/templates/tpl_example" \
  -H "Authorization: Bearer $APIDLY_API_KEY"
```

**JavaScript (SDK)**

```js
await apidly.templates.delete("tpl_example");
```

**Python (SDK)**

```python
client.templates.delete("tpl_example")
```

**Nástroj příkazového řádku:** `apidly templates` ([Reference CLI](/docs/cli))

**Příklad odpovědi** (200)

```json
{
  "deleted": false,
  "hidden": false
}
```

Chybové stavy: `401`, `403`, `404`, `429`.

### POST /templates/{id}/share

Vytvořit sdílený odkaz na šablonu vaší organizace

Anyone with the link sees the template's name, description, image, ports, minimum GPU memory and the NAMES of its plain environment variables, and can copy it into their own organization. Secret values, registry logins and (unless `includeStartScript` is true) the start script are never shared.

**Požadovaný scope:** `full` · **Oprávnění:** `templates.manage`

**Parametry**

| Název | V | Typ | Povinné | Popis |
| --- | --- | --- | --- | --- |
| `id` | path | string | ano |  |

**Tělo požadavku**

| Název | Typ | Povinné | Popis |
| --- | --- | --- | --- |
| `displayName` | string nebo null | ne |  |
| `includeStartScript` | boolean | ne |  |
| `expiresInDays` | integer nebo null | ne |  |

**Příklad požadavku (curl)**

```bash
curl -X POST "https://apidly.com/api/v1/templates/tpl_example/share" \
  -H "Authorization: Bearer $APIDLY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"displayName":"example","includeStartScript":false,"expiresInDays":null}'
```

**JavaScript (SDK)**

```js
await apidly.templates.share("tpl_example");
```

**Python (SDK)**

```python
client.templates.share("tpl_example")
```

**Nástroj příkazového řádku:** `apidly templates` ([Reference CLI](/docs/cli))

**Příklad odpovědi** (201)

```json
{
  "share": {
    "id": "example",
    "templateId": "id_example",
    "token": "example",
    "displayName": "example",
    "includeStartScript": false,
    "expiresAt": "2026-11-21T10:00:00.000Z",
    "status": "active",
    "viewCount": 1,
    "importCount": 1,
    "createdAt": "2026-11-21T10:00:00.000Z"
  }
}
```

Chybové stavy: `400`, `401`, `403`, `404`, `409`, `429`.

### DELETE /templates/{id}/share

Zrušit sdílené odkazy šablony

Revokes one link with `?shareId=`, or every active link of the template when omitted.

**Požadovaný scope:** `full` · **Oprávnění:** `templates.manage`

**Parametry**

| Název | V | Typ | Povinné | Popis |
| --- | --- | --- | --- | --- |
| `id` | path | string | ano |  |

**Příklad požadavku (curl)**

```bash
curl -X DELETE "https://apidly.com/api/v1/templates/tpl_example/share" \
  -H "Authorization: Bearer $APIDLY_API_KEY"
```

**JavaScript (SDK)**

```js
await apidly.templates.unshare("tpl_example");
```

**Python (SDK)**

```python
client.templates.unshare("tpl_example")
```

**Nástroj příkazového řádku:** `apidly templates` ([Reference CLI](/docs/cli))

**Příklad odpovědi** (200)

```json
{
  "revoked": 1
}
```

Chybové stavy: `401`, `403`, `404`, `429`.

### GET /templates/{id}/share

Odkazy pro sdílení šablony

**Požadovaný scope:** `full` · **Oprávnění:** `templates.manage`

**Parametry**

| Název | V | Typ | Povinné | Popis |
| --- | --- | --- | --- | --- |
| `id` | path | string | ano |  |

**Příklad požadavku (curl)**

```bash
curl "https://apidly.com/api/v1/templates/tpl_example/share" \
  -H "Authorization: Bearer $APIDLY_API_KEY"
```

**JavaScript (SDK)**

```js
await apidly.templates.listShares("tpl_example");
```

**Python (SDK)**

```python
client.templates.list_shares("tpl_example")
```

**Nástroj příkazového řádku:** `apidly templates` ([Reference CLI](/docs/cli))

**Příklad odpovědi** (200)

```json
{
  "shares": [
    {
      "id": "example",
      "templateId": "id_example",
      "token": "example",
      "displayName": "example",
      "includeStartScript": false,
      "expiresAt": "2026-11-21T10:00:00.000Z",
      "status": "active",
      "viewCount": 1,
      "importCount": 1,
      "createdAt": "2026-11-21T10:00:00.000Z"
    }
  ]
}
```

Chybové stavy: `401`, `403`, `404`, `429`.

### POST /templates/{id}/duplicate

Zkopírovat šablonu vaší organizace

**Požadovaný scope:** `full` · **Oprávnění:** `templates.manage`

**Parametry**

| Název | V | Typ | Povinné | Popis |
| --- | --- | --- | --- | --- |
| `id` | path | string | ano |  |

**Příklad požadavku (curl)**

```bash
curl -X POST "https://apidly.com/api/v1/templates/tpl_example/duplicate" \
  -H "Authorization: Bearer $APIDLY_API_KEY"
```

**JavaScript (SDK)**

```js
await apidly.templates.duplicate("tpl_example");
```

**Python (SDK)**

```python
client.templates.duplicate("tpl_example")
```

**Nástroj příkazového řádku:** `apidly templates` ([Reference CLI](/docs/cli))

**Příklad odpovědi** (201)

```json
{
  "template": {
    "id": "example",
    "slug": "example",
    "name": "example",
    "summary": "example",
    "category": "example",
    "image": "docker.io/library/ubuntu",
    "tag": "example",
    "launchMode": "ssh",
    "env": {
      "key": "example"
    },
    "ports": [
      {
        "port": 1,
        "protocol": "tcp",
        "label": "example"
      }
    ],
    "startScript": "example",
    "onStart": "example",
    "args": "example",
    "description": "example",
    "secretEnvKeys": [
      "example"
    ],
    "registryId": "id_example",
    "appPort": 1,
    "defaultDiskGb": 1,
    "minVramGb": 1,
    "recommendedVramGb": 1,
    "constraints": {
      "key": null
    },
    "latestCudaTag": false,
    "inference": {
      "api": "http",
      "healthPath": "example",
      "port": 1
    },
    "custom": false,
    "firstBootMinutes": 1,
    "revision": 1,
    "sort": 1,
    "createdAt": "2026-11-21T10:00:00.000Z"
  }
}
```

Chybové stavy: `401`, `403`, `404`, `409`, `429`.

### GET /templates/{id}/revisions

Historie revizí šablony, nejnovější první

Secret values are never included.

**Požadovaný scope:** `read`

**Parametry**

| Název | V | Typ | Povinné | Popis |
| --- | --- | --- | --- | --- |
| `id` | path | string | ano |  |

**Příklad požadavku (curl)**

```bash
curl "https://apidly.com/api/v1/templates/tpl_example/revisions" \
  -H "Authorization: Bearer $APIDLY_API_KEY"
```

**JavaScript (SDK)**

```js
await apidly.templates.listRevisions("tpl_example");
```

**Python (SDK)**

```python
client.templates.list_revisions("tpl_example")
```

**Nástroj příkazového řádku:** `apidly templates` ([Reference CLI](/docs/cli))

**Příklad odpovědi** (200)

```json
{
  "revisions": [
    {
      "rev": 1,
      "kind": "example",
      "restoredFrom": 1,
      "createdAt": "2026-11-21T10:00:00.000Z",
      "createdByName": "example",
      "current": false,
      "servers": 1,
      "snapshot": {
        "key": null
      }
    }
  ]
}
```

Chybové stavy: `401`, `403`, `404`, `429`.

### POST /templates/{id}/revisions/{rev}/restore

Obnovit starší revizi jako novou

History is never rewritten: the restored copy becomes the newest revision.

**Požadovaný scope:** `full` · **Oprávnění:** `templates.manage`

**Parametry**

| Název | V | Typ | Povinné | Popis |
| --- | --- | --- | --- | --- |
| `id` | path | string | ano |  |
| `rev` | path | string | ano |  |

**Příklad požadavku (curl)**

```bash
curl -X POST "https://apidly.com/api/v1/templates/tpl_example/revisions/1/restore" \
  -H "Authorization: Bearer $APIDLY_API_KEY"
```

**JavaScript (SDK)**

```js
await apidly.templates.restoreRevision("tpl_example", "1");
```

**Python (SDK)**

```python
client.templates.restore_revision("tpl_example", "1")
```

**Nástroj příkazového řádku:** `apidly templates` ([Reference CLI](/docs/cli))

**Příklad odpovědi** (200)

```json
{
  "template": {
    "id": "example",
    "slug": "example",
    "name": "example",
    "summary": "example",
    "category": "example",
    "image": "docker.io/library/ubuntu",
    "tag": "example",
    "launchMode": "ssh",
    "env": {
      "key": "example"
    },
    "ports": [
      {
        "port": 1,
        "protocol": "tcp",
        "label": "example"
      }
    ],
    "startScript": "example",
    "onStart": "example",
    "args": "example",
    "description": "example",
    "secretEnvKeys": [
      "example"
    ],
    "registryId": "id_example",
    "appPort": 1,
    "defaultDiskGb": 1,
    "minVramGb": 1,
    "recommendedVramGb": 1,
    "constraints": {
      "key": null
    },
    "latestCudaTag": false,
    "inference": {
      "api": "http",
      "healthPath": "example",
      "port": 1
    },
    "custom": false,
    "firstBootMinutes": 1,
    "revision": 1,
    "sort": 1,
    "createdAt": "2026-11-21T10:00:00.000Z"
  },
  "revision": 1
}
```

Chybové stavy: `401`, `403`, `404`, `429`.

### GET /templates/{id}/export

Exportovat šablonu do přenosného souboru

The file the console downloads. Secret variables appear as names in `secretEnvNames`, never with values; the registry login is never included. Send its text to `POST /templates/import` to copy it into an organization. Only your organization's own templates can be exported: a built-in template answers 409 `invalid_state` (read it with `GET /templates/{id}`).

**Požadovaný scope:** `full` · **Oprávnění:** `templates.manage`

**Parametry**

| Název | V | Typ | Povinné | Popis |
| --- | --- | --- | --- | --- |
| `id` | path | string | ano |  |

**Příklad požadavku (curl)**

```bash
curl "https://apidly.com/api/v1/templates/tpl_example/export" \
  -H "Authorization: Bearer $APIDLY_API_KEY"
```

**JavaScript (SDK)**

```js
await apidly.templates.export("tpl_example");
```

**Python (SDK)**

```python
client.templates.export("tpl_example")
```

**Nástroj příkazového řádku:** `apidly templates` ([Reference CLI](/docs/cli))

**Příklad odpovědi** (200)

```json
{
  "format": "apidly-template",
  "version": 1,
  "template": {
    "name": "example",
    "summary": "example",
    "description": "example",
    "image": "docker.io/library/ubuntu",
    "tag": "example",
    "launchMode": "ssh",
    "env": {
      "key": "example"
    },
    "secretEnvNames": [
      "example"
    ],
    "ports": [
      {
        "port": 1,
        "protocol": "tcp",
        "label": "example"
      }
    ],
    "appPort": 1,
    "inference": {
      "key": null
    },
    "startScript": "example",
    "onStart": "example",
    "args": "example",
    "defaultDiskGb": 1,
    "minVramGb": 1
  }
}
```

Chybové stavy: `401`, `403`, `404`, `409`, `429`.

### POST /templates/import

Vytvořit šablonu z exportovaného souboru

`json` is the text of a file from `GET /templates/{id}/export` (or the console's Export). Secret variables arrive blank and the registry unset. 400 `invalid_file` when it is not such a file.

**Požadovaný scope:** `full` · **Oprávnění:** `templates.manage` · **Bezpečně opakovat s:** `Idempotency-Key`

**Tělo požadavku**

| Název | Typ | Povinné | Popis |
| --- | --- | --- | --- |
| `json` | string | ano |  |

**Příklad požadavku (curl)**

```bash
curl -X POST "https://apidly.com/api/v1/templates/import" \
  -H "Authorization: Bearer $APIDLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"json":"example"}'
```

**JavaScript (SDK)**

```js
await apidly.templates.import("example");
```

**Python (SDK)**

```python
client.templates.import_file(file="example")
```

**Nástroj příkazového řádku:** `apidly templates` ([Reference CLI](/docs/cli))

**Příklad odpovědi** (201)

```json
{
  "template": {
    "id": "example",
    "slug": "example",
    "name": "example",
    "summary": "example",
    "category": "example",
    "image": "docker.io/library/ubuntu",
    "tag": "example",
    "launchMode": "ssh",
    "env": {
      "key": "example"
    },
    "ports": [
      {
        "port": 1,
        "protocol": "tcp",
        "label": "example"
      }
    ],
    "startScript": "example",
    "onStart": "example",
    "args": "example",
    "description": "example",
    "secretEnvKeys": [
      "example"
    ],
    "registryId": "id_example",
    "appPort": 1,
    "defaultDiskGb": 1,
    "minVramGb": 1,
    "recommendedVramGb": 1,
    "constraints": {
      "key": null
    },
    "latestCudaTag": false,
    "inference": {
      "api": "http",
      "healthPath": "example",
      "port": 1
    },
    "custom": false,
    "firstBootMinutes": 1,
    "revision": 1,
    "sort": 1,
    "createdAt": "2026-11-21T10:00:00.000Z"
  }
}
```

Chybové stavy: `400`, `401`, `403`, `409`, `429`.

### POST /template-shares/{token}/import

Zkopírovat sdílenou šablonu do vaší organizace

`token` is the 32-character token of a share link (`/t/{token}`). 404 when the link is revoked, expired or unknown.

**Požadovaný scope:** `full` · **Oprávnění:** `templates.manage` · **Bezpečně opakovat s:** `Idempotency-Key`

**Parametry**

| Název | V | Typ | Povinné | Popis |
| --- | --- | --- | --- | --- |
| `token` | path | string | ano |  |

**Příklad požadavku (curl)**

```bash
curl -X POST "https://apidly.com/api/v1/template-shares/templateshare_example/import" \
  -H "Authorization: Bearer $APIDLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

**JavaScript (SDK)**

```js
await apidly.templates.importShared("templateshare_example");
```

**Python (SDK)**

```python
client.templates.import_shared("templateshare_example")
```

**Nástroj příkazového řádku:** `apidly templates` ([Reference CLI](/docs/cli))

**Příklad odpovědi** (201)

```json
{
  "template": {
    "id": "example",
    "slug": "example",
    "name": "example",
    "summary": "example",
    "category": "example",
    "image": "docker.io/library/ubuntu",
    "tag": "example",
    "launchMode": "ssh",
    "env": {
      "key": "example"
    },
    "ports": [
      {
        "port": 1,
        "protocol": "tcp",
        "label": "example"
      }
    ],
    "startScript": "example",
    "onStart": "example",
    "args": "example",
    "description": "example",
    "secretEnvKeys": [
      "example"
    ],
    "registryId": "id_example",
    "appPort": 1,
    "defaultDiskGb": 1,
    "minVramGb": 1,
    "recommendedVramGb": 1,
    "constraints": {
      "key": null
    },
    "latestCudaTag": false,
    "inference": {
      "api": "http",
      "healthPath": "example",
      "port": 1
    },
    "custom": false,
    "firstBootMinutes": 1,
    "revision": 1,
    "sort": 1,
    "createdAt": "2026-11-21T10:00:00.000Z"
  }
}
```

Chybové stavy: `401`, `403`, `404`, `409`, `429`.

### POST /template-shares/{token}/report

Nahlásit sdílenou šablonu našim pracovníkům (nejvýše 10 za hodinu na organizaci)

Opens a support ticket for staff with the reason (`malware`, `illegal`, `secrets`, `other`) and your details. Five reports an hour per key and ten an hour per organization, across all its keys.

**Požadovaný scope:** `servers` · **Bezpečně opakovat s:** `Idempotency-Key`

**Parametry**

| Název | V | Typ | Povinné | Popis |
| --- | --- | --- | --- | --- |
| `token` | path | string | ano |  |

**Tělo požadavku**

| Název | Typ | Povinné | Popis |
| --- | --- | --- | --- |
| `details` | string | ne |  |
| `reason` | `malware` \| `illegal` \| `secrets` \| `other` | ano |  |

**Příklad požadavku (curl)**

```bash
curl -X POST "https://apidly.com/api/v1/template-shares/templateshare_example/report" \
  -H "Authorization: Bearer $APIDLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"reason":"malware"}'
```

**JavaScript (SDK)**

```js
await apidly.templates.reportShared("templateshare_example", {
  reason: "malware"
});
```

**Python (SDK)**

```python
client.templates.report_shared("templateshare_example", reason="malware")
```

**Nástroj příkazového řádku:** `apidly templates` ([Reference CLI](/docs/cli))

**Příklad odpovědi** (201)

```json
{
  "ticketId": "id_example"
}
```

Chybové stavy: `400`, `401`, `403`, `404`, `429`.
