> For the complete documentation index, see [llms.txt](https://docs.rumi.systems/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rumi.systems/rumi-management/guides/agent/using-the-rest-api.md).

# Using the REST API

This guide covers interacting with the Rumi Agent through its REST API.

## Overview

The Agent exposes a REST API at `http://<host>:<port>/rumi-agent` (default port: 7778). The API provides endpoints for system management, script execution, application command-and-control, and monitoring.

## System Discovery

### List Systems

```
GET /rumi-agent/v2/systems
```

Returns all systems known to the embedded Controller, including their containers, scripts, and configuration.

Query parameters:

* `excludeInternal` (boolean) — Exclude internal systems from the response.

### List System Names

```
GET /rumi-agent/v2/systems/names
```

Returns only the names of available systems (lightweight alternative to the full system listing).

## Script Execution

### List Scripts

```
GET /rumi-agent/system/scripts?systemName=<systemName>
```

Returns the scripts available for the specified system, including parameter metadata.

### Execute a Script

```
POST /rumi-agent/invoke/script
```

Request body: `InvokeSystemScriptRequest` containing the system name, script name, and parameter values.

The response includes a UUID for tracking the execution.

### Cancel Execution

```
POST /rumi-agent/invoke/cancel?uuid=<executionUUID>
```

Cancels a running script execution.

## Application Command and Control

### List Commands

```
GET /rumi-agent/app/commands
```

Returns the application commands available across all deployed systems.

### Invoke a Command

```
POST /rumi-agent/app/command/invoke
```

Request body: `InvokeAppCommandRequest` specifying the command, target application, and parameters.

## XAR Deployment

### Deploy a XAR

```
POST /rumi-agent/xars/unpack
```

Uploads and unpacks a XAR file, creating a new system.

## System Management

### Archive a System

```
POST /rumi-agent/v2/systems/archive
```

Archives a system, moving it to the `.archived/` directory.

### Restore a System

```
POST /rumi-agent/v2/systems/restore
```

Restores a previously archived system.

### Delete a System

```
POST /rumi-agent/v2/systems/delete
```

Permanently removes a system.

## Configuration

### Get Configuration

```
GET /rumi-agent/v2/config
```

Returns the current Agent configuration.

### Update Configuration

```
POST /rumi-agent/v2/config
```

Updates the Agent configuration.

## Health and Information

### Health Check

```
GET /rumi-agent/ping
```

Returns a simple health check response.

### Agent Information

```
GET /rumi-agent/info
```

Returns Agent version, status, and runtime information.

### Data Sources

```
GET /rumi-agent/datasources
```

Returns the available data sources (InfluxDB connection details).

See the [REST API Reference](/rumi-management/reference/agent/rest-api.md) for the complete endpoint specification.
