Skip to content

attachments

attachments add

Add attachments to a Pega case (atomic batch POST)

Usage

bash
pega attachments add <caseId> [flags]

Source endpoint: POST /cases/{caseID}/attachmentsview command source

Arguments

ArgumentRequiredDescription
caseIdYesFull case handle

Flags

FlagTypeRequiredDefaultDescription
--formatoptionNojsonOutput format (json, compact, yaml, table)
--fieldsoptionNoComma-separated top-level fields to include in output
--dry-runbooleanNoPrint HTTP request details and exit without executing
--quietbooleanNoSuppress all stderr progress/warning output
--verbosebooleanNoEmit full HTTP request/response details to stderr
--no-cachebooleanNoBypass token file cache; perform fresh OAuth exchange
--profileoptionNodefaultNamed config profile
--attachmentsoptionYesJSON 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

ArgumentRequiredDescription
idYesAttachment ID

Flags

FlagTypeRequiredDefaultDescription
--formatoptionNojsonOutput format (json, compact, yaml, table)
--fieldsoptionNoComma-separated top-level fields to include in output
--dry-runbooleanNoPrint HTTP request details and exit without executing
--quietbooleanNoSuppress all stderr progress/warning output
--verbosebooleanNoEmit full HTTP request/response details to stderr
--no-cachebooleanNoBypass token file cache; perform fresh OAuth exchange
--profileoptionNodefaultNamed config profile

Examples

sh
pega attachments delete ATTACH-ID-1

attachments get

Get a Pega attachment by ID

Usage

bash
pega attachments get <id> [flags]

Source endpoint: GET /attachments/{attachmentID}view command source

Arguments

ArgumentRequiredDescription
idYesAttachment ID

Flags

FlagTypeRequiredDefaultDescription
--formatoptionNojsonOutput format (json, compact, yaml, table)
--fieldsoptionNoComma-separated top-level fields to include in output
--dry-runbooleanNoPrint HTTP request details and exit without executing
--quietbooleanNoSuppress all stderr progress/warning output
--verbosebooleanNoEmit full HTTP request/response details to stderr
--no-cachebooleanNoBypass token file cache; perform fresh OAuth exchange
--profileoptionNodefaultNamed config profile
-o, --outputoptionNoWrite attachment content to this file path

Examples

sh
pega attachments get ATTACH-1
sh
pega attachments get ATTACH-1 --output ./file.pdf

attachments list

List attachments on a Pega case

Usage

bash
pega attachments list <caseId> [flags]

Source endpoint: GET /cases/{caseID}/attachmentsview command source

Arguments

ArgumentRequiredDescription
caseIdYesFull case handle

Flags

FlagTypeRequiredDefaultDescription
--formatoptionNojsonOutput format (json, compact, yaml, table)
--fieldsoptionNoComma-separated top-level fields to include in output
--dry-runbooleanNoPrint HTTP request details and exit without executing
--quietbooleanNoSuppress all stderr progress/warning output
--verbosebooleanNoEmit full HTTP request/response details to stderr
--no-cachebooleanNoBypass token file cache; perform fresh OAuth exchange
--profileoptionNodefaultNamed config profile
--include-thumbnailsbooleanNoInclude thumbnail images in the response

Examples

sh
pega attachments list MYAPP-CASE-1
sh
pega attachments list MYAPP-CASE-1 --include-thumbnails

attachments patch

Update attachment metadata (name and/or category)

Usage

bash
pega attachments patch <id> [flags]

Source endpoint: PATCH /attachments/{attachmentID}view command source

Arguments

ArgumentRequiredDescription
idYesAttachment ID

Flags

FlagTypeRequiredDefaultDescription
--formatoptionNojsonOutput format (json, compact, yaml, table)
--fieldsoptionNoComma-separated top-level fields to include in output
--dry-runbooleanNoPrint HTTP request details and exit without executing
--quietbooleanNoSuppress all stderr progress/warning output
--verbosebooleanNoEmit full HTTP request/response details to stderr
--no-cachebooleanNoBypass token file cache; perform fresh OAuth exchange
--profileoptionNodefaultNamed config profile
--nameoptionNoNew attachment name
--categoryoptionNoNew attachment category

Examples

sh
pega attachments patch ATTACH-ID-1 --name "New Name"
sh
pega attachments patch ATTACH-ID-1 --category Correspondence
sh
pega attachments patch ATTACH-ID-1 --name "New Name" --category Correspondence

attachments upload

Upload a file as a Pega attachment (multipart POST)

Usage

bash
pega attachments upload [flags]

Source endpoint: POST /attachments/uploadview command source

Flags

FlagTypeRequiredDefaultDescription
--formatoptionNojsonOutput format (json, compact, yaml, table)
--fieldsoptionNoComma-separated top-level fields to include in output
--dry-runbooleanNoPrint HTTP request details and exit without executing
--quietbooleanNoSuppress all stderr progress/warning output
--verbosebooleanNoEmit full HTTP request/response details to stderr
--no-cachebooleanNoBypass token file cache; perform fresh OAuth exchange
--profileoptionNodefaultNamed config profile
-f, --fileoptionYesPath to the file to upload
--append-unique-idbooleanNoAppend a unique ID to the uploaded filename

Examples

sh
pega attachments upload --file ./report.pdf
sh
pega attachments upload --file ./report.pdf --append-unique-id