# Comet Backup

> Run your Comet Backup server: watch recent jobs and their logs, start or cancel backups on connected devices, and manage user accounts and install tokens.

App · 18 actions. Web page: https://docs.lodol.com/docs/integrations/comet-backup

## Actions

### Add user

Create a user account the backup app signs in with.

**Inputs**

- Username (`target_user`, text, required): The new account's username.
- Password (`target_password`, text, required): The new account's password.
- Keep a recovery code (`store_recovery_code`, true/false): On so you can reset the password later.
- Change password at first sign-in (`require_password_change`, true/false): On to make the user pick a new password.

**Outputs**

- `created` (true/false): True once created
- `username` (text): The user account

**Example output**

```json
{
  "created": true,
  "username": "acme-laptop"
}
```

### Cancel job

Ask a device to cancel a running job. The device must be connected.

**Inputs**

- User account (`target_user`, text, required): The user account. Pick one, or give its username.
- Job ID (`job_id`, text, required): The job's id (GUID), from a job list.

**Outputs**

- `cancelled` (true/false): True once the device accepted it
- `job_id` (text): The job

**Example output**

```json
{
  "cancelled": true,
  "job_id": "4a9dae5b-0000-1111-2222-333344445555"
}
```

### Create install token

Make a one-use token that installs the backup app silently, signed in as a user account (Windows and macOS).

**Inputs**

- User account (`target_user`, text, required): The user account. Pick one, or give its username.
- User's password (`target_password`, text, required): The user account's password.

**Outputs**

- `expires_at` (number): When it expires (Unix time)
- `server` (text): The server the app signs in to
- `token` (text): The token, for install.exe /TOKEN=
- `username` (text): The user account

**Example output**

```json
{
  "expires_at": 1764576000,
  "server": "https://backup.example.com/",
  "token": "abc123",
  "username": "acme-laptop"
}
```

### Delete user

Delete a user account and its job history. Data it backed up can no longer be decrypted.

**Inputs**

- User account (`target_user`, text, required): The user account. Pick one, or give its username.

**Outputs**

- `deleted` (true/false): True once deleted
- `username` (text): The user account

**Example output**

```json
{
  "deleted": true,
  "username": "acme-laptop"
}
```

### Get job

Get one job: the user, device, Protected Item and Storage Vault, when it ran, its status and how much it moved.

**Inputs**

- Job ID (`job_id`, text, required): The job's id (GUID), from a job list.

**Outputs**

- `job` (object): A job

**Example output**

```json
{
  "job": {
    "CancellationID": "",
    "Classification": 4001,
    "ClassificationName": "Backup",
    "DestinationGUID": "3f8c9e4a-0000-1111-2222-333344445555",
    "DeviceID": "dev-1",
    "EndTime": 1764490200,
    "GUID": "4a9dae5b-0000-1111-2222-333344445555",
    "SourceGUID": "2e7b8d3f-0000-1111-2222-333344445555",
    "StartTime": 1764489600,
    "Status": 5000,
    "StatusName": "Success",
    "TotalFiles": 1200,
    "TotalSize": 5368709120,
    "UploadSize": 10485760,
    "Username": "acme-laptop"
  }
}
```

### Get job log

Get a job's log entries, optionally only warnings or errors, or only those containing some text.

**Inputs**

- Job ID (`job_id`, text, required): The job's id (GUID), from a job list.
- At least (`min_severity`, text): The least severe entries to include. One of: `I` (Information and up), `W` (Warnings and errors), `E` (Errors only).
- Containing (`message_contains`, text): Only entries containing this exact text.

**Outputs**

- `count` (number): How many were returned
- `entries` (list): The log entries

**Example output**

```json
{
  "count": 1,
  "entries": [
    {
      "Message": "Backup started",
      "Severity": "I",
      "Time": 1764489600
    }
  ]
}
```

### Get server info

Get the Comet Server's version, roles, licence end and how many devices are configured.

**Inputs**: None.

**Outputs**

- `server` (object): The Comet Server

**Example output**

```json
{
  "server": {
    "AuthenticationRole": true,
    "ConfiguredDevices": 42,
    "ConstellationRole": true,
    "LicenseValidUntil": 1798761600,
    "StorageRole": true,
    "Version": "26.8.3",
    "VersionCodename": "Voyager"
  }
}
```

### Get user

Get a user account with its devices, Protected Items, Storage Vaults and backup rules.

**Inputs**

- User account (`target_user`, text, required): The user account. Pick one, or give its username.

**Outputs**

- `backup_rules` (list): Its backup rules
- `devices` (list): Its devices
- `protected_items` (list): Its Protected Items
- `storage_vaults` (list): Its Storage Vaults
- `user` (object): The user account

**Example output**

```json
{
  "backup_rules": [
    {
      "id": "1d6a7c2e-0000-1111-2222-333344445555",
      "name": "Nightly",
      "protected_item_id": "2e7b8d3f-0000-1111-2222-333344445555",
      "storage_vault_id": "3f8c9e4a-0000-1111-2222-333344445555"
    }
  ],
  "devices": [
    {
      "id": "8876b0d8-8f26-4fab-9ac9-9274ae030cfc",
      "name": "Laptop"
    }
  ],
  "protected_items": [
    {
      "id": "8876b0d8-8f26-4fab-9ac9-9274ae030cfc",
      "name": "Documents"
    }
  ],
  "storage_vaults": [
    {
      "id": "8876b0d8-8f26-4fab-9ac9-9274ae030cfc",
      "name": "Cloud vault"
    }
  ],
  "user": {
    "account_name": "Acme laptop",
    "emails": [
      "it@acme.example.com"
    ],
    "is_suspended": false,
    "organization_id": "",
    "username": "acme-laptop"
  }
}
```

### List connected devices

List the devices connected to the server right now, with the connection id 'Run backup now' needs.

**Inputs**

- User account (`username_filter`, text): Only devices signed in as this account.

**Outputs**

- `count` (number): How many were returned
- `devices` (list): The devices

**Example output**

```json
{
  "count": 1,
  "devices": [
    {
      "ConnectionID": "5b0ebf6c-0000-1111-2222-333344445555",
      "ConnectionTime": 1764489000,
      "DeviceID": "dev-1",
      "IPAddress": "203.0.113.5",
      "ReportedPlatform": "windows/amd64",
      "ReportedVersion": "26.8.3",
      "Username": "acme-laptop"
    }
  ]
}
```

### List jobs by date

List every job that started or ended in a time range.

**Inputs**

- From (`start`, date and time, required): The start of the range.
- To (`end`, date and time): The end of the range. Defaults to now.

**Outputs**

- `count` (number): How many were returned
- `jobs` (list): The jobs

**Example output**

```json
{
  "count": 1,
  "jobs": [
    {
      "CancellationID": "",
      "Classification": 4001,
      "ClassificationName": "Backup",
      "DestinationGUID": "3f8c9e4a-0000-1111-2222-333344445555",
      "DeviceID": "dev-1",
      "EndTime": 1764490200,
      "GUID": "4a9dae5b-0000-1111-2222-333344445555",
      "SourceGUID": "2e7b8d3f-0000-1111-2222-333344445555",
      "StartTime": 1764489600,
      "Status": 5000,
      "StatusName": "Success",
      "TotalFiles": 1200,
      "TotalSize": 5368709120,
      "UploadSize": 10485760,
      "Username": "acme-laptop"
    }
  ]
}
```

### List organizations

List the organizations (tenants) on the server. Needs a top-level admin.

**Inputs**: None.

**Outputs**

- `count` (number): How many were returned
- `organizations` (list): The organizations

**Example output**

```json
{
  "count": 1,
  "organizations": [
    {
      "id": "6c1fc07d-0000-1111-2222-333344445555",
      "is_suspended": false,
      "name": "Reseller A"
    }
  ]
}
```

### List policies

List the policies user accounts can follow.

**Inputs**: None.

**Outputs**

- `count` (number): How many were returned
- `policies` (list): The policies

**Example output**

```json
{
  "count": 1,
  "policies": [
    {
      "id": "8876b0d8-8f26-4fab-9ac9-9274ae030cfc",
      "name": "Standard"
    }
  ]
}
```

### List recent jobs

List jobs from the last day and every job still running, with their status.

**Inputs**: None.

**Outputs**

- `count` (number): How many were returned
- `jobs` (list): The jobs

**Example output**

```json
{
  "count": 1,
  "jobs": [
    {
      "CancellationID": "",
      "Classification": 4001,
      "ClassificationName": "Backup",
      "DestinationGUID": "3f8c9e4a-0000-1111-2222-333344445555",
      "DeviceID": "dev-1",
      "EndTime": 1764490200,
      "GUID": "4a9dae5b-0000-1111-2222-333344445555",
      "SourceGUID": "2e7b8d3f-0000-1111-2222-333344445555",
      "StartTime": 1764489600,
      "Status": 5000,
      "StatusName": "Success",
      "TotalFiles": 1200,
      "TotalSize": 5368709120,
      "UploadSize": 10485760,
      "Username": "acme-laptop"
    }
  ]
}
```

### List user groups

List the user groups.

**Inputs**: None.

**Outputs**

- `count` (number): How many were returned
- `user_groups` (list): The user groups

**Example output**

```json
{
  "count": 1,
  "user_groups": [
    {
      "id": "8876b0d8-8f26-4fab-9ac9-9274ae030cfc",
      "name": "Acme"
    }
  ]
}
```

### List user jobs

List every job of one user account.

**Inputs**

- User account (`target_user`, text, required): The user account. Pick one, or give its username.

**Outputs**

- `count` (number): How many were returned
- `jobs` (list): The jobs

**Example output**

```json
{
  "count": 1,
  "jobs": [
    {
      "CancellationID": "",
      "Classification": 4001,
      "ClassificationName": "Backup",
      "DestinationGUID": "3f8c9e4a-0000-1111-2222-333344445555",
      "DeviceID": "dev-1",
      "EndTime": 1764490200,
      "GUID": "4a9dae5b-0000-1111-2222-333344445555",
      "SourceGUID": "2e7b8d3f-0000-1111-2222-333344445555",
      "StartTime": 1764489600,
      "Status": 5000,
      "StatusName": "Success",
      "TotalFiles": 1200,
      "TotalSize": 5368709120,
      "UploadSize": 10485760,
      "Username": "acme-laptop"
    }
  ]
}
```

### List users

List every user account's username.

**Inputs**: None.

**Outputs**

- `count` (number): How many were returned
- `usernames` (list): The usernames

**Example output**

```json
{
  "count": 1,
  "usernames": [
    "acme-laptop"
  ]
}
```

### Reset user password

Set a new password for a user account. The account needs a recovery code, or its old password.

**Inputs**

- User account (`target_user`, text, required): The user account. Pick one, or give its username.
- New password (`new_password`, text, required): The new password.
- Old password (`old_password`, text): The current password, if the account has no recovery code.

**Outputs**

- `reset` (true/false): True once reset
- `username` (text): The user account

**Example output**

```json
{
  "reset": true,
  "username": "acme-laptop"
}
```

### Run backup now

Tell a connected device to run one of its backup rules now.

**Inputs**

- Device connection ID (`device_connection_id`, text, required): The device's live connection id, from 'List connected devices'.
- Backup rule ID (`backup_rule_id`, text, required): The backup rule's id, from 'Get user'.

**Outputs**

- `device_connection_id` (text): The device's live connection id
- `job_id` (text): The new job's id, when the server gives it
- `started` (true/false): True once the device accepted it

**Example output**

```json
{
  "device_connection_id": "5b0ebf6c-0000-1111-2222-333344445555",
  "job_id": "4a9dae5b-0000-1111-2222-333344445555",
  "started": true
}
```
