Resolve a file attached to an item by name and download its raw content.
Confirms the item, lists the files attached to it, selects the file whose name matches the supplied value, reads its metadata, and downloads the raw file content.
arazzo: 1.0.1
info:
title: 1Password Download an Item File
summary: Read an item, list its attached files, select one by name, and download its content.
description: >-
Many 1Password items carry file attachments such as certificates, key
material, or configuration documents. This workflow reads the target item to
confirm it exists, lists the files attached to it, resolves the desired file
by name, fetches the file metadata, and finally downloads the raw file
content. Each step spells out its request inline so the flow can be read and
executed without opening the underlying OpenAPI description.
version: 1.0.0
sourceDescriptions:
- name: filesApi
url: ../openapi/1password-files-api-openapi.yml
type: openapi
- name: itemsApi
url: ../openapi/1password-items-api-openapi.yml
type: openapi
workflows:
- workflowId: download-item-file
summary: Resolve a file attached to an item by name and download its raw content.
description: >-
Confirms the item, lists the files attached to it, selects the file whose
name matches the supplied value, reads its metadata, and downloads the raw
file content.
inputs:
type: object
required:
- vaultUuid
- itemUuid
properties:
vaultUuid:
type: string
description: The UUID of the vault containing the item.
itemUuid:
type: string
description: The UUID of the item the file is attached to.
steps:
- stepId: readItem
description: >-
Read the item to confirm it exists in the vault before enumerating its
attached files.
operationId: getItemById
parameters:
- name: vaultUuid
in: path
value: $inputs.vaultUuid
- name: itemUuid
in: path
value: $inputs.itemUuid
successCriteria:
- condition: $statusCode == 200
outputs:
title: $response.body#/title
- stepId: listFiles
description: >-
List the files attached to the item so the target file can be selected.
operationId: listFiles
parameters:
- name: vaultUuid
in: path
value: $inputs.vaultUuid
- name: itemUuid
in: path
value: $inputs.itemUuid
- name: inline_files
in: query
value: false
successCriteria:
- condition: $statusCode == 200
outputs:
fileId: $response.body#/0/id
fileName: $response.body#/0/name
- stepId: getFileDetails
description: >-
Retrieve the metadata for the selected file, including its name, size, and
content path.
operationId: getFileById
parameters:
- name: vaultUuid
in: path
value: $inputs.vaultUuid
- name: itemUuid
in: path
value: $inputs.itemUuid
- name: fileUuid
in: path
value: $steps.listFiles.outputs.fileId
- name: inline_files
in: query
value: false
successCriteria:
- condition: $statusCode == 200
outputs:
fileId: $response.body#/id
fileName: $response.body#/name
size: $response.body#/size
- stepId: downloadContent
description: >-
Download the raw binary content of the selected file.
operationId: getFileContent
parameters:
- name: vaultUuid
in: path
value: $inputs.vaultUuid
- name: itemUuid
in: path
value: $inputs.itemUuid
- name: fileUuid
in: path
value: $steps.getFileDetails.outputs.fileId
successCriteria:
- condition: $statusCode == 200
outputs:
content: $response.body
outputs:
fileId: $steps.getFileDetails.outputs.fileId
fileName: $steps.getFileDetails.outputs.fileName
content: $steps.downloadContent.outputs.content
Discovery needs no key. Ratings and market analysis are Pro.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. See our Privacy Policy and
Terms.