# Referencia de la API: Plantillas

Plantillas: todas las operaciones de la API v1 con su scope, parámetros, ejemplos en curl, JavaScript y Python, y respuestas. La autenticación, los errores, la paginación, los límites y la idempotencia están en la [vista general de la referencia de la API](/docs/api-reference); consulta también los [SDK](/docs/sdks) y la [línea de comandos](/docs/cli).

> Pruébalo con tu clave: crea una clave de API en la consola, ejecuta `export APIDLY_API_KEY=...` en tu terminal y pega cualquier ejemplo de curl de abajo. Los valores de ejemplo son ilustrativos. En esta página no hay ningún campo para introducir una clave.

Las descripciones de las operaciones y de los campos vienen de la definición de la API y están en inglés.

| Operación | Scope necesario | Resumen |
| --- | --- | --- |
| `GET /templates` | `read` | Plantillas públicas y las de tu organización |
| `POST /templates` | `full` | Crear una plantilla de la organización |
| `GET /templates/{id}` | `read` | Una plantilla |
| `PATCH /templates/{id}` | `full` | Actualizar una plantilla de tu organización |
| `DELETE /templates/{id}` | `full` | Eliminar una plantilla, u ocultarla cuando aún hay servidores que la usan |
| `POST /templates/{id}/share` | `full` | Crear un enlace para compartir una plantilla de tu organización |
| `DELETE /templates/{id}/share` | `full` | Revocar los enlaces para compartir de una plantilla |
| `GET /templates/{id}/share` | `full` | Enlaces para compartir una plantilla |
| `POST /templates/{id}/duplicate` | `full` | Copiar una plantilla de tu organización |
| `GET /templates/{id}/revisions` | `read` | Historial de revisiones de una plantilla, de la más reciente a la más antigua |
| `POST /templates/{id}/revisions/{rev}/restore` | `full` | Restaurar una revisión anterior como una nueva |
| `GET /templates/{id}/export` | `full` | Exportar una plantilla como archivo portátil |
| `POST /templates/import` | `full` | Crear una plantilla a partir de un archivo exportado |
| `POST /template-shares/{token}/import` | `full` | Copiar una plantilla compartida en tu organización |
| `POST /template-shares/{token}/report` | `servers` | Denunciar una plantilla compartida a nuestro equipo (como máximo 10 por hora por organización) |

### GET /templates

Plantillas públicas y las de tu organización

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.

**Scope necesario:** `read`

**Parámetros**

| Nombre | En | Tipo | Obligatorio | Descripción |
| --- | --- | --- | --- | --- |
| `limit` | query | integer | no |  |
| `cursor` | query | string | no |  |
| `q` | query | string | no |  |
| `category` | query | `base` \| `llm` \| `image` \| `notebook` \| `training` \| `custom` | no |  |
| `source` | query | `builtin` \| `own` | no |  |
| `vramGb` | query | integer | no |  |

**Solicitud de ejemplo (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()
```

**Herramienta de línea de comandos:** `apidly templates`, `apidly export`, `apidly plan`, `apidly apply` ([Referencia de la CLI](/docs/cli))

**Respuesta de ejemplo** (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"
}
```

Estados de error: `401`, `403`, `429`.

### POST /templates

Crear una plantilla de la organización

**Scope necesario:** `full` · **Rol del creador:** `admin` · **Se puede repetir con:** `Idempotency-Key`

**Cuerpo de la solicitud**

| Nombre | Tipo | Obligatorio | Descripción |
| --- | --- | --- | --- |
| `name` | string | sí |  |
| `summary` | string | no |  |
| `description` | string | no |  |
| `image` | string | sí |  |
| `tag` | string | no |  |
| `launchMode` | `ssh` \| `jupyter` \| `app` | sí |  |
| `env` | object | no |  |
| `secretEnv` | object | no |  |
| `ports` | array de object | no |  |
| `startScript` | string | no | Shell script run on the server after each start (up to 64 KB). Replaces the deprecated `onStart`. |
| `onStart` | string | no | Deprecated name of `startScript`, read until 2027-05-31. Send `startScript`. |
| `args` | string | no |  |
| `appPort` | integer o null | no |  |
| `defaultDiskGb` | integer | no |  |
| `minVramGb` | integer | no |  |
| `constraints` | object | no |  |
| `recommendedVramGb` | integer o null | no |  |
| `inference` | object o null | no |  |
| `registryId` | string o null | no |  |
| `latestCudaTag` | boolean | no |  |
| `inheritSecretsFrom` | string | no |  |

**Solicitud de ejemplo (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",
})
```

**Herramienta de línea de comandos:** `apidly templates` ([Referencia de la CLI](/docs/cli))

**Respuesta de ejemplo** (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"
  }
}
```

Estados de error: `400`, `401`, `403`, `409`, `429`.

### GET /templates/{id}

Una plantilla

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

**Scope necesario:** `read`

**Parámetros**

| Nombre | En | Tipo | Obligatorio | Descripción |
| --- | --- | --- | --- | --- |
| `id` | path | string | sí |  |

**Solicitud de ejemplo (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")
```

**Herramienta de línea de comandos:** `apidly templates` ([Referencia de la CLI](/docs/cli))

**Respuesta de ejemplo** (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"
  }
}
```

Estados de error: `401`, `403`, `404`, `429`.

### PATCH /templates/{id}

Actualizar una plantilla de tu organización

**Scope necesario:** `full` · **Rol del creador:** `admin`

**Parámetros**

| Nombre | En | Tipo | Obligatorio | Descripción |
| --- | --- | --- | --- | --- |
| `id` | path | string | sí |  |

**Cuerpo de la solicitud**

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

**Solicitud de ejemplo (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",
})
```

**Herramienta de línea de comandos:** `apidly templates` ([Referencia de la CLI](/docs/cli))

**Respuesta de ejemplo** (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"
  }
}
```

Estados de error: `400`, `401`, `403`, `404`, `429`.

### DELETE /templates/{id}

Eliminar una plantilla, u ocultarla cuando aún hay servidores que la usan

**Scope necesario:** `full` · **Rol del creador:** `admin`

**Parámetros**

| Nombre | En | Tipo | Obligatorio | Descripción |
| --- | --- | --- | --- | --- |
| `id` | path | string | sí |  |

**Solicitud de ejemplo (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")
```

**Herramienta de línea de comandos:** `apidly templates` ([Referencia de la CLI](/docs/cli))

**Respuesta de ejemplo** (200)

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

Estados de error: `401`, `403`, `404`, `429`.

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

Crear un enlace para compartir una plantilla de tu organización

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.

**Scope necesario:** `full` · **Permiso:** `templates.manage`

**Parámetros**

| Nombre | En | Tipo | Obligatorio | Descripción |
| --- | --- | --- | --- | --- |
| `id` | path | string | sí |  |

**Cuerpo de la solicitud**

| Nombre | Tipo | Obligatorio | Descripción |
| --- | --- | --- | --- |
| `displayName` | string o null | no |  |
| `includeStartScript` | boolean | no |  |
| `expiresInDays` | integer o null | no |  |

**Solicitud de ejemplo (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")
```

**Herramienta de línea de comandos:** `apidly templates` ([Referencia de la CLI](/docs/cli))

**Respuesta de ejemplo** (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"
  }
}
```

Estados de error: `400`, `401`, `403`, `404`, `409`, `429`.

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

Revocar los enlaces para compartir de una plantilla

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

**Scope necesario:** `full` · **Permiso:** `templates.manage`

**Parámetros**

| Nombre | En | Tipo | Obligatorio | Descripción |
| --- | --- | --- | --- | --- |
| `id` | path | string | sí |  |

**Solicitud de ejemplo (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")
```

**Herramienta de línea de comandos:** `apidly templates` ([Referencia de la CLI](/docs/cli))

**Respuesta de ejemplo** (200)

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

Estados de error: `401`, `403`, `404`, `429`.

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

Enlaces para compartir una plantilla

**Scope necesario:** `full` · **Permiso:** `templates.manage`

**Parámetros**

| Nombre | En | Tipo | Obligatorio | Descripción |
| --- | --- | --- | --- | --- |
| `id` | path | string | sí |  |

**Solicitud de ejemplo (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")
```

**Herramienta de línea de comandos:** `apidly templates` ([Referencia de la CLI](/docs/cli))

**Respuesta de ejemplo** (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"
    }
  ]
}
```

Estados de error: `401`, `403`, `404`, `429`.

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

Copiar una plantilla de tu organización

**Scope necesario:** `full` · **Permiso:** `templates.manage`

**Parámetros**

| Nombre | En | Tipo | Obligatorio | Descripción |
| --- | --- | --- | --- | --- |
| `id` | path | string | sí |  |

**Solicitud de ejemplo (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")
```

**Herramienta de línea de comandos:** `apidly templates` ([Referencia de la CLI](/docs/cli))

**Respuesta de ejemplo** (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"
  }
}
```

Estados de error: `401`, `403`, `404`, `409`, `429`.

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

Historial de revisiones de una plantilla, de la más reciente a la más antigua

Secret values are never included.

**Scope necesario:** `read`

**Parámetros**

| Nombre | En | Tipo | Obligatorio | Descripción |
| --- | --- | --- | --- | --- |
| `id` | path | string | sí |  |

**Solicitud de ejemplo (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")
```

**Herramienta de línea de comandos:** `apidly templates` ([Referencia de la CLI](/docs/cli))

**Respuesta de ejemplo** (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
      }
    }
  ]
}
```

Estados de error: `401`, `403`, `404`, `429`.

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

Restaurar una revisión anterior como una nueva

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

**Scope necesario:** `full` · **Permiso:** `templates.manage`

**Parámetros**

| Nombre | En | Tipo | Obligatorio | Descripción |
| --- | --- | --- | --- | --- |
| `id` | path | string | sí |  |
| `rev` | path | string | sí |  |

**Solicitud de ejemplo (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")
```

**Herramienta de línea de comandos:** `apidly templates` ([Referencia de la CLI](/docs/cli))

**Respuesta de ejemplo** (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
}
```

Estados de error: `401`, `403`, `404`, `429`.

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

Exportar una plantilla como archivo portátil

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

**Scope necesario:** `full` · **Permiso:** `templates.manage`

**Parámetros**

| Nombre | En | Tipo | Obligatorio | Descripción |
| --- | --- | --- | --- | --- |
| `id` | path | string | sí |  |

**Solicitud de ejemplo (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")
```

**Herramienta de línea de comandos:** `apidly templates` ([Referencia de la CLI](/docs/cli))

**Respuesta de ejemplo** (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
  }
}
```

Estados de error: `401`, `403`, `404`, `409`, `429`.

### POST /templates/import

Crear una plantilla a partir de un archivo exportado

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

**Scope necesario:** `full` · **Permiso:** `templates.manage` · **Se puede repetir con:** `Idempotency-Key`

**Cuerpo de la solicitud**

| Nombre | Tipo | Obligatorio | Descripción |
| --- | --- | --- | --- |
| `json` | string | sí |  |

**Solicitud de ejemplo (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")
```

**Herramienta de línea de comandos:** `apidly templates` ([Referencia de la CLI](/docs/cli))

**Respuesta de ejemplo** (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"
  }
}
```

Estados de error: `400`, `401`, `403`, `409`, `429`.

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

Copiar una plantilla compartida en tu organización

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

**Scope necesario:** `full` · **Permiso:** `templates.manage` · **Se puede repetir con:** `Idempotency-Key`

**Parámetros**

| Nombre | En | Tipo | Obligatorio | Descripción |
| --- | --- | --- | --- | --- |
| `token` | path | string | sí |  |

**Solicitud de ejemplo (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")
```

**Herramienta de línea de comandos:** `apidly templates` ([Referencia de la CLI](/docs/cli))

**Respuesta de ejemplo** (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"
  }
}
```

Estados de error: `401`, `403`, `404`, `409`, `429`.

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

Denunciar una plantilla compartida a nuestro equipo (como máximo 10 por hora por organización)

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.

**Scope necesario:** `servers` · **Se puede repetir con:** `Idempotency-Key`

**Parámetros**

| Nombre | En | Tipo | Obligatorio | Descripción |
| --- | --- | --- | --- | --- |
| `token` | path | string | sí |  |

**Cuerpo de la solicitud**

| Nombre | Tipo | Obligatorio | Descripción |
| --- | --- | --- | --- |
| `details` | string | no |  |
| `reason` | `malware` \| `illegal` \| `secrets` \| `other` | sí |  |

**Solicitud de ejemplo (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")
```

**Herramienta de línea de comandos:** `apidly templates` ([Referencia de la CLI](/docs/cli))

**Respuesta de ejemplo** (201)

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

Estados de error: `400`, `401`, `403`, `404`, `429`.
