attachments
attachments add
Add attachments to a Pega case (atomic batch POST)
Usage
bash
pega attachments add <caseId> [flags]Source endpoint: POST /cases/{caseID}/attachments — view command source
Arguments
| Argument | Required | Description |
|---|---|---|
caseId | Yes | Full case handle |
Flags
| Flag | Type | Required | Default | Description |
|---|---|---|---|---|
--format | option | No | json | Output format (json, compact, yaml, table) |
--fields | option | No | Comma-separated top-level fields to include in output | |
--dry-run | boolean | No | Print HTTP request details and exit without executing | |
--quiet | boolean | No | Suppress all stderr progress/warning output | |
--verbose | boolean | No | Emit full HTTP request/response details to stderr | |
--no-cache | boolean | No | Bypass token file cache; perform fresh OAuth exchange | |
--profile | option | No | default | Named config profile |
--attachments | option | Yes | JSON array of attachment objects (inline, @file, or -) |
Examples
sh
pega attachments add MYAPP-CASE-1 --attachments '[{"type":"File","category":"Correspondence","name":"doc.pdf","ID":"att-id-123"}]'attachments delete
Delete a Pega attachment by ID
Usage
bash
pega attachments delete <id> [flags]Source endpoint: DELETE /attachments/{attachmentID} — view command source
Arguments
| Argument | Required | Description |
|---|---|---|
id | Yes | Attachment ID |
Flags
| Flag | Type | Required | Default | Description |
|---|---|---|---|---|
--format | option | No | json | Output format (json, compact, yaml, table) |
--fields | option | No | Comma-separated top-level fields to include in output | |
--dry-run | boolean | No | Print HTTP request details and exit without executing | |
--quiet | boolean | No | Suppress all stderr progress/warning output | |
--verbose | boolean | No | Emit full HTTP request/response details to stderr | |
--no-cache | boolean | No | Bypass token file cache; perform fresh OAuth exchange | |
--profile | option | No | default | Named config profile |
Examples
sh
pega attachments delete ATTACH-ID-1attachments get
Get a Pega attachment by ID
Usage
bash
pega attachments get <id> [flags]Source endpoint: GET /attachments/{attachmentID} — view command source
Arguments
| Argument | Required | Description |
|---|---|---|
id | Yes | Attachment ID |
Flags
| Flag | Type | Required | Default | Description |
|---|---|---|---|---|
--format | option | No | json | Output format (json, compact, yaml, table) |
--fields | option | No | Comma-separated top-level fields to include in output | |
--dry-run | boolean | No | Print HTTP request details and exit without executing | |
--quiet | boolean | No | Suppress all stderr progress/warning output | |
--verbose | boolean | No | Emit full HTTP request/response details to stderr | |
--no-cache | boolean | No | Bypass token file cache; perform fresh OAuth exchange | |
--profile | option | No | default | Named config profile |
-o, --output | option | No | Write attachment content to this file path |
Examples
sh
pega attachments get ATTACH-1sh
pega attachments get ATTACH-1 --output ./file.pdfattachments list
List attachments on a Pega case
Usage
bash
pega attachments list <caseId> [flags]Source endpoint: GET /cases/{caseID}/attachments — view command source
Arguments
| Argument | Required | Description |
|---|---|---|
caseId | Yes | Full case handle |
Flags
| Flag | Type | Required | Default | Description |
|---|---|---|---|---|
--format | option | No | json | Output format (json, compact, yaml, table) |
--fields | option | No | Comma-separated top-level fields to include in output | |
--dry-run | boolean | No | Print HTTP request details and exit without executing | |
--quiet | boolean | No | Suppress all stderr progress/warning output | |
--verbose | boolean | No | Emit full HTTP request/response details to stderr | |
--no-cache | boolean | No | Bypass token file cache; perform fresh OAuth exchange | |
--profile | option | No | default | Named config profile |
--include-thumbnails | boolean | No | Include thumbnail images in the response |
Examples
sh
pega attachments list MYAPP-CASE-1sh
pega attachments list MYAPP-CASE-1 --include-thumbnailsattachments patch
Update attachment metadata (name and/or category)
Usage
bash
pega attachments patch <id> [flags]Source endpoint: PATCH /attachments/{attachmentID} — view command source
Arguments
| Argument | Required | Description |
|---|---|---|
id | Yes | Attachment ID |
Flags
| Flag | Type | Required | Default | Description |
|---|---|---|---|---|
--format | option | No | json | Output format (json, compact, yaml, table) |
--fields | option | No | Comma-separated top-level fields to include in output | |
--dry-run | boolean | No | Print HTTP request details and exit without executing | |
--quiet | boolean | No | Suppress all stderr progress/warning output | |
--verbose | boolean | No | Emit full HTTP request/response details to stderr | |
--no-cache | boolean | No | Bypass token file cache; perform fresh OAuth exchange | |
--profile | option | No | default | Named config profile |
--name | option | No | New attachment name | |
--category | option | No | New attachment category |
Examples
sh
pega attachments patch ATTACH-ID-1 --name "New Name"sh
pega attachments patch ATTACH-ID-1 --category Correspondencesh
pega attachments patch ATTACH-ID-1 --name "New Name" --category Correspondenceattachments upload
Upload a file as a Pega attachment (multipart POST)
Usage
bash
pega attachments upload [flags]Source endpoint: POST /attachments/upload — view command source
Flags
| Flag | Type | Required | Default | Description |
|---|---|---|---|---|
--format | option | No | json | Output format (json, compact, yaml, table) |
--fields | option | No | Comma-separated top-level fields to include in output | |
--dry-run | boolean | No | Print HTTP request details and exit without executing | |
--quiet | boolean | No | Suppress all stderr progress/warning output | |
--verbose | boolean | No | Emit full HTTP request/response details to stderr | |
--no-cache | boolean | No | Bypass token file cache; perform fresh OAuth exchange | |
--profile | option | No | default | Named config profile |
-f, --file | option | Yes | Path to the file to upload | |
--append-unique-id | boolean | No | Append a unique ID to the uploaded filename |
Examples
sh
pega attachments upload --file ./report.pdfsh
pega attachments upload --file ./report.pdf --append-unique-id