# API-referentie: Templates

Templates: elke bewerking van API v1 met scope, parameters, voorbeelden in curl, JavaScript en Python, en antwoorden. Authenticatie, fouten, paginering, limieten en idempotentie staan in het [overzicht van de API-referentie](/docs/api-reference); zie ook [SDK's](/docs/sdks) en de [opdrachtregel](/docs/cli).

> Probeer het met je sleutel: maak een API-sleutel in de console, voer `export APIDLY_API_KEY=...` uit in je terminal en plak daarna een curl-voorbeeld hieronder. De voorbeeldwaarden zijn illustratief. Op deze pagina kun je geen sleutel invoeren.

De beschrijvingen van bewerkingen en velden komen uit de API-definitie en zijn in het Engels.

| Bewerking | Vereiste scope | Samenvatting |
| --- | --- | --- |
| `GET /templates` | `read` | Openbare templates en die van je eigen organisatie |
| `POST /templates` | `full` | Een template voor je organisatie aanmaken |
| `GET /templates/{id}` | `read` | Eén template |
| `PATCH /templates/{id}` | `full` | Een template van je organisatie bijwerken |
| `DELETE /templates/{id}` | `full` | Een template verwijderen, of verbergen als servers er nog naar verwijzen |
| `POST /templates/{id}/share` | `full` | Een deellink maken voor een template van je organisatie |
| `DELETE /templates/{id}/share` | `full` | Deellinks van een template intrekken |
| `GET /templates/{id}/share` | `full` | Deellinks van een template |
| `POST /templates/{id}/duplicate` | `full` | Een template van je organisatie kopiëren |
| `GET /templates/{id}/revisions` | `read` | Revisiegeschiedenis van een template, nieuwste eerst |
| `POST /templates/{id}/revisions/{rev}/restore` | `full` | Een oudere revisie herstellen als nieuwe |
| `GET /templates/{id}/export` | `full` | Een template als draagbaar bestand exporteren |
| `POST /templates/import` | `full` | Een template maken uit een geëxporteerd bestand |
| `POST /template-shares/{token}/import` | `full` | Een gedeelde template naar je organisatie kopiëren |
| `POST /template-shares/{token}/report` | `servers` | Een gedeeld template melden bij onze medewerkers (maximaal 10 per uur per organisatie) |

### GET /templates

Openbare templates en die van je eigen organisatie

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.

**Vereiste scope:** `read`

**Parameters**

| Naam | In | Type | Verplicht | Beschrijving |
| --- | --- | --- | --- | --- |
| `limit` | query | integer | nee |  |
| `cursor` | query | string | nee |  |
| `q` | query | string | nee |  |
| `category` | query | `base` \| `llm` \| `image` \| `notebook` \| `training` \| `custom` | nee |  |
| `source` | query | `builtin` \| `own` | nee |  |
| `vramGb` | query | integer | nee |  |

**Voorbeeldverzoek (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()
```

**Opdrachtregelprogramma:** `apidly templates`, `apidly export`, `apidly plan`, `apidly apply` ([CLI-referentie](/docs/cli))

**Voorbeeldantwoord** (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"
}
```

Foutstatussen: `401`, `403`, `429`.

### POST /templates

Een template voor je organisatie aanmaken

**Vereiste scope:** `full` · **Rol van de maker:** `admin` · **Veilig te herhalen met:** `Idempotency-Key`

**Verzoekbody**

| Naam | Type | Verplicht | Beschrijving |
| --- | --- | --- | --- |
| `name` | string | ja |  |
| `summary` | string | nee |  |
| `description` | string | nee |  |
| `image` | string | ja |  |
| `tag` | string | nee |  |
| `launchMode` | `ssh` \| `jupyter` \| `app` | ja |  |
| `env` | object | nee |  |
| `secretEnv` | object | nee |  |
| `ports` | array van object | nee |  |
| `startScript` | string | nee | Shell script run on the server after each start (up to 64 KB). Replaces the deprecated `onStart`. |
| `onStart` | string | nee | Deprecated name of `startScript`, read until 2027-05-31. Send `startScript`. |
| `args` | string | nee |  |
| `appPort` | integer of null | nee |  |
| `defaultDiskGb` | integer | nee |  |
| `minVramGb` | integer | nee |  |
| `constraints` | object | nee |  |
| `recommendedVramGb` | integer of null | nee |  |
| `inference` | object of null | nee |  |
| `registryId` | string of null | nee |  |
| `latestCudaTag` | boolean | nee |  |
| `inheritSecretsFrom` | string | nee |  |

**Voorbeeldverzoek (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",
})
```

**Opdrachtregelprogramma:** `apidly templates` ([CLI-referentie](/docs/cli))

**Voorbeeldantwoord** (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"
  }
}
```

Foutstatussen: `400`, `401`, `403`, `409`, `429`.

### GET /templates/{id}

Eén template

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

**Vereiste scope:** `read`

**Parameters**

| Naam | In | Type | Verplicht | Beschrijving |
| --- | --- | --- | --- | --- |
| `id` | path | string | ja |  |

**Voorbeeldverzoek (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")
```

**Opdrachtregelprogramma:** `apidly templates` ([CLI-referentie](/docs/cli))

**Voorbeeldantwoord** (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"
  }
}
```

Foutstatussen: `401`, `403`, `404`, `429`.

### PATCH /templates/{id}

Een template van je organisatie bijwerken

**Vereiste scope:** `full` · **Rol van de maker:** `admin`

**Parameters**

| Naam | In | Type | Verplicht | Beschrijving |
| --- | --- | --- | --- | --- |
| `id` | path | string | ja |  |

**Verzoekbody**

| Naam | Type | Verplicht | Beschrijving |
| --- | --- | --- | --- |
| `name` | string | nee |  |
| `summary` | string | nee |  |
| `description` | string | nee |  |
| `image` | string | nee |  |
| `tag` | string | nee |  |
| `launchMode` | `ssh` \| `jupyter` \| `app` | nee |  |
| `env` | object | nee |  |
| `secretEnv` | object | nee |  |
| `ports` | array van object | nee |  |
| `startScript` | string | nee | Shell script run on the server after each start (up to 64 KB). Replaces the deprecated `onStart`. |
| `onStart` | string | nee | Deprecated name of `startScript`, read until 2027-05-31. Send `startScript`. |
| `args` | string | nee |  |
| `appPort` | integer of null | nee |  |
| `defaultDiskGb` | integer | nee |  |
| `minVramGb` | integer | nee |  |
| `constraints` | object | nee |  |
| `recommendedVramGb` | integer of null | nee |  |
| `inference` | object of null | nee |  |
| `registryId` | string of null | nee |  |
| `latestCudaTag` | boolean | nee |  |

**Voorbeeldverzoek (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",
})
```

**Opdrachtregelprogramma:** `apidly templates` ([CLI-referentie](/docs/cli))

**Voorbeeldantwoord** (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"
  }
}
```

Foutstatussen: `400`, `401`, `403`, `404`, `429`.

### DELETE /templates/{id}

Een template verwijderen, of verbergen als servers er nog naar verwijzen

**Vereiste scope:** `full` · **Rol van de maker:** `admin`

**Parameters**

| Naam | In | Type | Verplicht | Beschrijving |
| --- | --- | --- | --- | --- |
| `id` | path | string | ja |  |

**Voorbeeldverzoek (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")
```

**Opdrachtregelprogramma:** `apidly templates` ([CLI-referentie](/docs/cli))

**Voorbeeldantwoord** (200)

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

Foutstatussen: `401`, `403`, `404`, `429`.

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

Een deellink maken voor een template van je organisatie

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.

**Vereiste scope:** `full` · **Machtiging:** `templates.manage`

**Parameters**

| Naam | In | Type | Verplicht | Beschrijving |
| --- | --- | --- | --- | --- |
| `id` | path | string | ja |  |

**Verzoekbody**

| Naam | Type | Verplicht | Beschrijving |
| --- | --- | --- | --- |
| `displayName` | string of null | nee |  |
| `includeStartScript` | boolean | nee |  |
| `expiresInDays` | integer of null | nee |  |

**Voorbeeldverzoek (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")
```

**Opdrachtregelprogramma:** `apidly templates` ([CLI-referentie](/docs/cli))

**Voorbeeldantwoord** (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"
  }
}
```

Foutstatussen: `400`, `401`, `403`, `404`, `409`, `429`.

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

Deellinks van een template intrekken

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

**Vereiste scope:** `full` · **Machtiging:** `templates.manage`

**Parameters**

| Naam | In | Type | Verplicht | Beschrijving |
| --- | --- | --- | --- | --- |
| `id` | path | string | ja |  |

**Voorbeeldverzoek (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")
```

**Opdrachtregelprogramma:** `apidly templates` ([CLI-referentie](/docs/cli))

**Voorbeeldantwoord** (200)

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

Foutstatussen: `401`, `403`, `404`, `429`.

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

Deellinks van een template

**Vereiste scope:** `full` · **Machtiging:** `templates.manage`

**Parameters**

| Naam | In | Type | Verplicht | Beschrijving |
| --- | --- | --- | --- | --- |
| `id` | path | string | ja |  |

**Voorbeeldverzoek (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")
```

**Opdrachtregelprogramma:** `apidly templates` ([CLI-referentie](/docs/cli))

**Voorbeeldantwoord** (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"
    }
  ]
}
```

Foutstatussen: `401`, `403`, `404`, `429`.

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

Een template van je organisatie kopiëren

**Vereiste scope:** `full` · **Machtiging:** `templates.manage`

**Parameters**

| Naam | In | Type | Verplicht | Beschrijving |
| --- | --- | --- | --- | --- |
| `id` | path | string | ja |  |

**Voorbeeldverzoek (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")
```

**Opdrachtregelprogramma:** `apidly templates` ([CLI-referentie](/docs/cli))

**Voorbeeldantwoord** (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"
  }
}
```

Foutstatussen: `401`, `403`, `404`, `409`, `429`.

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

Revisiegeschiedenis van een template, nieuwste eerst

Secret values are never included.

**Vereiste scope:** `read`

**Parameters**

| Naam | In | Type | Verplicht | Beschrijving |
| --- | --- | --- | --- | --- |
| `id` | path | string | ja |  |

**Voorbeeldverzoek (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")
```

**Opdrachtregelprogramma:** `apidly templates` ([CLI-referentie](/docs/cli))

**Voorbeeldantwoord** (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
      }
    }
  ]
}
```

Foutstatussen: `401`, `403`, `404`, `429`.

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

Een oudere revisie herstellen als nieuwe

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

**Vereiste scope:** `full` · **Machtiging:** `templates.manage`

**Parameters**

| Naam | In | Type | Verplicht | Beschrijving |
| --- | --- | --- | --- | --- |
| `id` | path | string | ja |  |
| `rev` | path | string | ja |  |

**Voorbeeldverzoek (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")
```

**Opdrachtregelprogramma:** `apidly templates` ([CLI-referentie](/docs/cli))

**Voorbeeldantwoord** (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
}
```

Foutstatussen: `401`, `403`, `404`, `429`.

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

Een template als draagbaar bestand exporteren

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}`).

**Vereiste scope:** `full` · **Machtiging:** `templates.manage`

**Parameters**

| Naam | In | Type | Verplicht | Beschrijving |
| --- | --- | --- | --- | --- |
| `id` | path | string | ja |  |

**Voorbeeldverzoek (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")
```

**Opdrachtregelprogramma:** `apidly templates` ([CLI-referentie](/docs/cli))

**Voorbeeldantwoord** (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
  }
}
```

Foutstatussen: `401`, `403`, `404`, `409`, `429`.

### POST /templates/import

Een template maken uit een geëxporteerd bestand

`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.

**Vereiste scope:** `full` · **Machtiging:** `templates.manage` · **Veilig te herhalen met:** `Idempotency-Key`

**Verzoekbody**

| Naam | Type | Verplicht | Beschrijving |
| --- | --- | --- | --- |
| `json` | string | ja |  |

**Voorbeeldverzoek (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")
```

**Opdrachtregelprogramma:** `apidly templates` ([CLI-referentie](/docs/cli))

**Voorbeeldantwoord** (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"
  }
}
```

Foutstatussen: `400`, `401`, `403`, `409`, `429`.

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

Een gedeelde template naar je organisatie kopiëren

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

**Vereiste scope:** `full` · **Machtiging:** `templates.manage` · **Veilig te herhalen met:** `Idempotency-Key`

**Parameters**

| Naam | In | Type | Verplicht | Beschrijving |
| --- | --- | --- | --- | --- |
| `token` | path | string | ja |  |

**Voorbeeldverzoek (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")
```

**Opdrachtregelprogramma:** `apidly templates` ([CLI-referentie](/docs/cli))

**Voorbeeldantwoord** (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"
  }
}
```

Foutstatussen: `401`, `403`, `404`, `409`, `429`.

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

Een gedeeld template melden bij onze medewerkers (maximaal 10 per uur per organisatie)

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.

**Vereiste scope:** `servers` · **Veilig te herhalen met:** `Idempotency-Key`

**Parameters**

| Naam | In | Type | Verplicht | Beschrijving |
| --- | --- | --- | --- | --- |
| `token` | path | string | ja |  |

**Verzoekbody**

| Naam | Type | Verplicht | Beschrijving |
| --- | --- | --- | --- |
| `details` | string | nee |  |
| `reason` | `malware` \| `illegal` \| `secrets` \| `other` | ja |  |

**Voorbeeldverzoek (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")
```

**Opdrachtregelprogramma:** `apidly templates` ([CLI-referentie](/docs/cli))

**Voorbeeldantwoord** (201)

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

Foutstatussen: `400`, `401`, `403`, `404`, `429`.
