# API reference: Templates

Every operation of the public API v1 in the Templates area, with the key scope it needs, its parameters, a request in curl, JavaScript and Python, and a response. Start with the [API reference overview](/docs/api-reference) for authentication, errors, pagination, rate limits and idempotency; the clients are described in [SDKs](/docs/sdks) and the [command-line tool](/docs/cli).

> Try it with your key: create an API key in the console, run `export APIDLY_API_KEY=...` in your terminal, then paste any curl example below. Example values are illustrative. There is no place to enter a key on this page.

| Operation | Required scope | Summary |
| --- | --- | --- |
| `GET /templates` | `read` | Public templates and your organization's own |
| `POST /templates` | `full` | Create an organization template |
| `GET /templates/{id}` | `read` | One template |
| `PATCH /templates/{id}` | `full` | Update one of your organization's templates |
| `DELETE /templates/{id}` | `full` | Delete a template, or hide it when servers still reference it |
| `POST /templates/{id}/share` | `full` | Create a share link for one of your organization's templates |
| `DELETE /templates/{id}/share` | `full` | Revoke share links of a template |
| `GET /templates/{id}/share` | `full` | Share links of a template |
| `POST /templates/{id}/duplicate` | `full` | Copy one of your organization's templates |
| `GET /templates/{id}/revisions` | `read` | Revision history of a template, newest first |
| `POST /templates/{id}/revisions/{rev}/restore` | `full` | Restore an older revision as a new one |
| `GET /templates/{id}/export` | `full` | Export a template as a portable file |
| `POST /templates/import` | `full` | Create a template from an exported file |
| `POST /template-shares/{token}/import` | `full` | Copy a shared template into your organization |
| `POST /template-shares/{token}/report` | `servers` | Report a shared template to our staff (at most 10 an hour per organization) |

### GET /templates

Public templates and your organization's own

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.

**Required scope:** `read`

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `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 |  |

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

**Command-line tool:** `apidly templates`, `apidly export`, `apidly plan`, `apidly apply` ([CLI reference](/docs/cli))

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

Error statuses: `401`, `403`, `429`.

### POST /templates

Create an organization template

**Required scope:** `full` · **Creator role:** `admin` · **Retry-safe with:** `Idempotency-Key`

**Request body**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | yes |  |
| `summary` | string | no |  |
| `description` | string | no |  |
| `image` | string | yes |  |
| `tag` | string | no |  |
| `launchMode` | `ssh` \| `jupyter` \| `app` | yes |  |
| `env` | object | no |  |
| `secretEnv` | object | no |  |
| `ports` | array of 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 or null | no |  |
| `defaultDiskGb` | integer | no |  |
| `minVramGb` | integer | no |  |
| `constraints` | object | no |  |
| `recommendedVramGb` | integer or null | no |  |
| `inference` | object or null | no |  |
| `registryId` | string or null | no |  |
| `latestCudaTag` | boolean | no |  |
| `inheritSecretsFrom` | string | no |  |

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

**Command-line tool:** `apidly templates` ([CLI reference](/docs/cli))

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

Error statuses: `400`, `401`, `403`, `409`, `429`.

### GET /templates/{id}

One template

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

**Required scope:** `read`

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes |  |

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

**Command-line tool:** `apidly templates` ([CLI reference](/docs/cli))

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

Error statuses: `401`, `403`, `404`, `429`.

### PATCH /templates/{id}

Update one of your organization's templates

**Required scope:** `full` · **Creator role:** `admin`

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes |  |

**Request body**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `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 of 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 or null | no |  |
| `defaultDiskGb` | integer | no |  |
| `minVramGb` | integer | no |  |
| `constraints` | object | no |  |
| `recommendedVramGb` | integer or null | no |  |
| `inference` | object or null | no |  |
| `registryId` | string or null | no |  |
| `latestCudaTag` | boolean | no |  |

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

**Command-line tool:** `apidly templates` ([CLI reference](/docs/cli))

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

Error statuses: `400`, `401`, `403`, `404`, `429`.

### DELETE /templates/{id}

Delete a template, or hide it when servers still reference it

**Required scope:** `full` · **Creator role:** `admin`

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes |  |

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

**Command-line tool:** `apidly templates` ([CLI reference](/docs/cli))

**Example response** (200)

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

Error statuses: `401`, `403`, `404`, `429`.

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

Create a share link for one of your organization's templates

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.

**Required scope:** `full` · **Permission:** `templates.manage`

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes |  |

**Request body**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `displayName` | string or null | no |  |
| `includeStartScript` | boolean | no |  |
| `expiresInDays` | integer or null | no |  |

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

**Command-line tool:** `apidly templates` ([CLI reference](/docs/cli))

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

Error statuses: `400`, `401`, `403`, `404`, `409`, `429`.

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

Revoke share links of a template

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

**Required scope:** `full` · **Permission:** `templates.manage`

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes |  |

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

**Command-line tool:** `apidly templates` ([CLI reference](/docs/cli))

**Example response** (200)

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

Error statuses: `401`, `403`, `404`, `429`.

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

Share links of a template

**Required scope:** `full` · **Permission:** `templates.manage`

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes |  |

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

**Command-line tool:** `apidly templates` ([CLI reference](/docs/cli))

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

Error statuses: `401`, `403`, `404`, `429`.

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

Copy one of your organization's templates

**Required scope:** `full` · **Permission:** `templates.manage`

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes |  |

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

**Command-line tool:** `apidly templates` ([CLI reference](/docs/cli))

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

Error statuses: `401`, `403`, `404`, `409`, `429`.

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

Revision history of a template, newest first

Secret values are never included.

**Required scope:** `read`

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes |  |

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

**Command-line tool:** `apidly templates` ([CLI reference](/docs/cli))

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

Error statuses: `401`, `403`, `404`, `429`.

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

Restore an older revision as a new one

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

**Required scope:** `full` · **Permission:** `templates.manage`

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes |  |
| `rev` | path | string | yes |  |

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

**Command-line tool:** `apidly templates` ([CLI reference](/docs/cli))

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

Error statuses: `401`, `403`, `404`, `429`.

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

Export a template as a portable file

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

**Required scope:** `full` · **Permission:** `templates.manage`

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes |  |

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

**Command-line tool:** `apidly templates` ([CLI reference](/docs/cli))

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

Error statuses: `401`, `403`, `404`, `409`, `429`.

### POST /templates/import

Create a template from an exported file

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

**Required scope:** `full` · **Permission:** `templates.manage` · **Retry-safe with:** `Idempotency-Key`

**Request body**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `json` | string | yes |  |

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

**Command-line tool:** `apidly templates` ([CLI reference](/docs/cli))

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

Error statuses: `400`, `401`, `403`, `409`, `429`.

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

Copy a shared template into your organization

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

**Required scope:** `full` · **Permission:** `templates.manage` · **Retry-safe with:** `Idempotency-Key`

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `token` | path | string | yes |  |

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

**Command-line tool:** `apidly templates` ([CLI reference](/docs/cli))

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

Error statuses: `401`, `403`, `404`, `409`, `429`.

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

Report a shared template to our staff (at most 10 an hour per organization)

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.

**Required scope:** `servers` · **Retry-safe with:** `Idempotency-Key`

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `token` | path | string | yes |  |

**Request body**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `details` | string | no |  |
| `reason` | `malware` \| `illegal` \| `secrets` \| `other` | yes |  |

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

**Command-line tool:** `apidly templates` ([CLI reference](/docs/cli))

**Example response** (201)

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

Error statuses: `400`, `401`, `403`, `404`, `429`.
