# uip or attachments

> Syntax and options for `uip or attachments`, which manages job-level file attachments in Orchestrator.

`uip or attachments` manages job attachments — files attached to jobs as input or output (screenshots, reports, data files). Attachments are tenant-scoped, so `download` needs no folder context, except for an attachment stored in a folder on a tenant with pre-signed URLs turned off. For upload, use `jobs start --attachment` or `--attachment-id`.

## Synopsis

```
uip or attachments <verb> [options]
```

## Verbs

| Verb | Purpose |
|---|---|
| `list` | List attachments for a specific job. |
| `download` | Download a single attachment by ID. |

## uip or attachments list

List attachments for a job. Returns attachment ID, name, category (`Input` or `Output`), and creation timestamp. The verb resolves the job's folder context internally and calls the (unbatched) `JobAttachments/GetByJobKey` endpoint directly.

### Options

| Short | Long | Value | Default | Description |
|---|---|---|---|---|
| — | `--job-key` | GUID | **required** | Job key whose attachments to list. |
| — | `--all-fields` | flag | off | Return the full API payload instead of the curated summary. |

### Examples

```bash
uip or attachments list --job-key b2c3d4e5-0000-0000-0000-000000000001

uip or attachments list --job-key b2c3d4e5-0000-0000-0000-000000000001 \
    --output-filter "[?Category=='Output'].AttachmentId"

uip or attachments list --job-key b2c3d4e5-0000-0000-0000-000000000001 --output table
```

### Data shape (--output json)

```json
{
  "Code": "AttachmentList",
  "Data": [
    {
      "AttachmentId": "a1b2c3d4-0000-0000-0000-000000000001",
      "Name": "screenshot.png",
      "Category": "Output",
      "Created": "2025-04-15T10:32:00Z"
    }
  ]
}
```

## uip or attachments download

Download a job attachment to local disk. The CLI asks Orchestrator where the file of the attachment is stored, downloads it from there, and writes it to disk.

On a tenant with pre-signed URLs turned off, Orchestrator serves the file itself. For an attachment stored in a folder on such a tenant, pass `--folder-path` or `--folder-key`.

### Arguments

| Name | Required | Purpose |
|---|---|---|
| `<attachment-id>` | yes | Attachment ID (GUID). Find it with `attachments list` or from `jobs get` output. |

### Options

| Short | Long | Value | Default | Description |
|---|---|---|---|---|
| `-d` | `--destination` | path | `attachment-<id>` in the current directory | Output file path. |
| — | `--folder-path` | path | — | Folder of an attachment stored in a folder (for example, `Shared`). Needed only on tenants with pre-signed URLs turned off. |
| — | `--folder-key` | GUID | — | Folder key of an attachment stored in a folder. Needed only on tenants with pre-signed URLs turned off. |

### Examples

```bash
uip or attachments download a1b2c3d4-0000-0000-0000-000000000001 \
    --destination ./report.pdf

uip or attachments download a1b2c3d4-0000-0000-0000-000000000001 \
    -d /tmp/screenshot.png

uip or attachments download a1b2c3d4-0000-0000-0000-000000000001 \
    --destination ./report.pdf --output-filter 'Size'

# Attachment stored in a folder, on a tenant with pre-signed URLs turned off
uip or attachments download a1b2c3d4-0000-0000-0000-000000000001 \
    --folder-path "Shared" --destination ./report.pdf
```

:::note
`-o, --output <path>` still works as a deprecated alias for `--destination` and prints a deprecation warning. `--destination` is the preferred form, because `--output` is also the name of the global output-format option. Passing both `--output <path>` and `--destination` fails with a validation error.
:::

### Data shape (--output json)

```json
{
  "Code": "AttachmentDownloaded",
  "Data": {
    "AttachmentId": "a1b2c3d4-0000-0000-0000-000000000001",
    "FileName": "./report.pdf",
    "Size": 204812
  }
}
```

## Exit codes

See [Exit codes](./exit-codes.md). No verb-specific overrides.

## Related commands

- [`uip or jobs`](./uip-or-jobs.md) — `jobs start --attachment` / `--attachment-id` to attach files when launching a job; `jobs get` surfaces attachment references in its output.

## See also

- [Global options](./global-options.md).
