# Make a base template the one new VMs start from.

> https://koi.dog/docs/api/cloud/activate-template/

`POST /api/v1/cloud/templates/{name}/activate` · Scope: `config`

Experimental: this route may change inside v1. When an API key calls it, the timeline records who did what and the outcome. No query parameters, and no body.

## Path parameters.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | `string` | yes | The base template's name. |

## Headers.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `Idempotency-Key` | `string` | no | Makes a retry safe: the same key with the same request returns the first answer and does nothing else. |

## Response.

200 OK: a JSON object. The example has placeholder values.

## Request.

```sh
curl -X POST "https://app.koi.dog/api/v1/cloud/templates/$NAME/activate" \
    -H "Authorization: Bearer $KOIDOG_API_KEY" \
    -H "Idempotency-Key: $(uuidgen)"
```

```js
const res = await fetch(`https://app.koi.dog/api/v1/cloud/templates/${process.env.NAME}/activate`, {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.KOIDOG_API_KEY}`,
    "Idempotency-Key": crypto.randomUUID(),
  },
});
console.log(await res.json());
```

```python
import os
import uuid

import requests

r = requests.post(
    f"https://app.koi.dog/api/v1/cloud/templates/{os.environ['NAME']}/activate",
    headers={
        "Authorization": f"Bearer {os.environ['KOIDOG_API_KEY']}",
        "Idempotency-Key": str(uuid.uuid4()),
    },
)
r.raise_for_status()
print(r.json())
```

## Response example.

```json
{
  "provider": "boat",
  "connected": false,
  "status": "string",
  "limits": {
    "activeSandboxes": { … },
    "starts": { … },
    "walletUsd": 0,
    "nextStartUsd": 0,
    "readAt": "string",
    "error": "string"
  },
  "budget": {
    "capUsd": 0,
    "spentUsd": 0,
    "reservedUsd": 0,
    "burnUsdPerHour": 0,
    "basis": "string"
  },
  "vms": [],
  "templates": [],
  "activeBase": "string",
  "region": "string"
}
```
