# API Reference: Agent Update

## GET `/agent/version`

**Summary:** Get current agent version

**Description:** Returns the current agent-node version. Called by agent nodes at startup
and periodically to detect if they need to self-update.

#### Responses

| Status Code | Description |
|-------------|-------------|
| `200` | Successful Response |

#### Example Usage

```bash
curl -X 'GET' \
  'http://localhost:8000/api/v1/agent/version' \
  -H 'accept: application/json'
```

---

## GET `/agent/download`

**Summary:** Download agent node tarball

**Description:** Streams the current agent-node source as a gzipped tarball.
Only called when an agent detects it is behind the hub's version.

#### Responses

| Status Code | Description |
|-------------|-------------|
| `200` | Successful Response |

#### Example Usage

```bash
curl -X 'GET' \
  'http://localhost:8000/api/v1/agent/download' \
  -H 'accept: application/json'
```

---

## GET `/agent/installer`

**Summary:** Download bootstrap_installer.py

**Description:** Returns the bootstrap_installer.py script itself.
Used for initial one-liner provisioning on headless nodes.

#### Responses

| Status Code | Description |
|-------------|-------------|
| `200` | Successful Response |

#### Example Usage

```bash
curl -X 'GET' \
  'http://localhost:8000/api/v1/agent/installer' \
  -H 'accept: application/json'
```

---

## GET `/agent/binary/{arch}`

**Summary:** Download Standalone Binary

**Description:** Serves the All-in-One compiled binary for linux_amd64, linux_arm64, or darwin.

#### Parameters

| Name | In | Required | Type | Description |
|------|----|----------|------|-------------|
| `arch` | path | Yes | string |  |

#### Responses

| Status Code | Description |
|-------------|-------------|
| `200` | Successful Response |
| `422` | Validation Error |

#### Example Usage

```bash
curl -X 'GET' \
  'http://localhost:8000/api/v1/agent/binary/{arch}' \
  -H 'accept: application/json'
```

---

