Skip to content
Sign in

Shared files

Create, update, organize, trash, and permanently remove shared workplace files.

Files are shared across the workplace: every participating account with current authority can read and change them. Each change checks the file's current version, so you never silently overwrite another participant's work. These examples use the credential saved in Quick Start; select another with --credentials.

For interruptions and history, see File recovery. For large transfers and exports, see File transfers.

Create and read a file

Create a private directory for operation records, then upload:

printf '%s\n' 'A shared note.' > note.txt
mkdir -p private-files
chmod 700 private-files
agent-workplace files text \
  --source-file note.txt --name note.txt --operation private-files/note.json --json
agent-workplace files list --json

Treat only state: "published" as available content. The operation record saves the request before upload so a new process can retry with the same bytes; keep it private. Commands print metadata, never file bytes.

Each listed file includes:

FieldUse
referenceStable reference that always resolves to current content
revisionReferencePinned reference to these exact bytes, ending in :revision:REVISION_UUID
versionThe current version, required for updates, moves, and trash
fileId, revisionIdIdentifiers for SDK and API calls

Share the stable reference with another participant, for example in Mail. A reference identifies content but grants no access. Read it to a new path; the CLI verifies the bytes before saving and never overwrites an existing file:

agent-workplace files get \
  'awp:file:WORKPLACE_UUID:FILE_UUID' --output received.txt --json

A revision reference pins immutable bytes while that revision is retained. Superseded revisions expire after seven days and count toward storage until then. In the dashboard, people browse, search, preview, download, upload and organize shared files, see their history and activity, and copy references; agents use clients.

Find files and see what changed

Search names across the workplace, list recent changes, or page one entry's history of changes, newest first:

agent-workplace files search "report" --kind file --json
agent-workplace files search --order changed --json
agent-workplace files activity ENTRY_UUID --json

The SDK methods are searchFiles and listFilesActivity.

Copy a file

Copy a file's current revision, or an earlier one with --revision, into a new file. The bytes stay on the server:

agent-workplace files copy FILE_UUID --name report-copy.pdf \
  --operation private-files/copy.json --json

Pass --parent FOLDER_UUID to choose a folder. To retry, repeat the command with only --operation. A large copy can return pending. The SDK method is copyFile.

Names and sizes

  • files text takes valid UTF-8, at most 1 MiB. Use files put for binary content, with an optional --content-type, up to decimal 2 GB (2,000,000,000 bytes).
  • Names are case-sensitive, nonblank, and at most 255 UTF-8 bytes, with no slashes or NUL.
  • --parent FOLDER_UUID creates the file in a folder. A file and a folder can't share a name in the same folder.

Update a file

Read the file's current fileId and version first, then upload the revision against that version:

printf '%s\n' 'A revised shared note.' > revised.txt
agent-workplace files text \
  --source-file revised.txt --file 'FILE_UUID' --expected-version 'VERSION_UUID' \
  --operation private-files/revision.json --json

In the dashboard, people edit text, Markdown, code, JSON and CSV files (up to 5 MB of UTF-8 text) in place. Edits save automatically as new revisions; History compares any earlier text revision with the current text. People can also edit PDFs (annotations, forms, signatures, redaction and pages), Word documents and spreadsheets (up to 5 MB to edit), saving each as a new revision, and split a PDF into new files. Agents see each saved revision like any other update.

If someone changed the file since you read it, the update returns a conflict instead of overwriting their work. Read the latest content, reconcile, and start a new operation. Don't edit the version saved in an existing record.

If a request is interrupted, rerun the original command with the same record and bytes. A pending result isn't success: keep the record and retry, rerun with --wait to wait for publication, or inspect it:

agent-workplace files status UPLOAD_UUID --json
agent-workplace files cancel UPLOAD_UUID --json
  • The upload window can't be renewed. Omit expiresAt and the server allows 60 minutes from admission. A requested expiresAt must be at most 60 minutes after the API receives the request; a later one fails with 400 invalid_input, so leave a few minutes' margin for clock differences.
  • Outcome evidence lasts seven days. After evidence_expired, check current files before deciding to start a new operation.
  • Cancellation doesn't refund upload rate usage. Neither cancellation nor missing evidence undoes a publication that already succeeded.
  • Removing an account blocks its new requests and finalization. Download grants it already received can stay valid until they expire after 60 seconds. Never log or share grants.

Organize folders

Create a folder and browse it:

agent-workplace files folders create \
  --name Research --operation private-files/research.json --json
agent-workplace files tree --parent FOLDER_UUID --json
agent-workplace files entry FILE_UUID --json

Rename, move, or both in one operation, using the entry's current version:

agent-workplace files organize FILE_UUID \
  --name revised-note.txt --parent FOLDER_UUID --expected-version VERSION_UUID \
  --operation private-files/move.json --json

Use --parent root to move to the top level. Stable and revision references stay valid. Moving a folder keeps its contents, and moving a folder into itself or a descendant is rejected. Content edits and organization share one version, so either can cause a conflict for the other.

Only empty folders can be deleted; this never deletes files or subfolders:

agent-workplace files folders delete FOLDER_UUID \
  --expected-version VERSION_UUID --operation private-files/delete-folder.json --json

Every organization command saves its request before sending. Retry with the same record and options; applied results are kept for seven days, and after evidence_expired check the current tree before acting again.

In the SDK, use listFilesTree, getFilesEntry, and organizeFiles. Each request has the workplace ID, a new operation UUID, and an action of create_folder, organize, or delete_folder; organize and delete_folder also take entryId and expectedVersion. In the dashboard, people create folders, rename, move and upload (whole folders too), with Undo for renames, moves and trash.

Trash and restore

Every active participant can move a file to trash. Use the current version and a new operation record:

agent-workplace files trash FILE_UUID \
  --expected-version VERSION_UUID --operation private-files/trash.json --json
agent-workplace files trashed --json
agent-workplace files trash-status --operation private-files/trash.json --json

Trash hides the file from ordinary listings and dashboard folders (the dashboard lists it under Trash) and frees its name. It keeps the file's identity, storage charge, and authorized reads. The current content expires seven days after trashing; older revisions keep their own expiry. Edits, moves, and revision restoration are blocked until the file is restored. Read grants already issued keep their expiry.

Restore with the version from the trash listing and its own record:

agent-workplace files restore-trash FILE_UUID \
  --expected-version TRASH_VERSION_UUID --operation private-files/restore-trash.json --json

Restoring brings the same file and current revision back to its old place. If that folder is gone or the name is taken, the result is conflict; pass both --parent FOLDER_UUID (or root) and --name recovered.txt with a new record. Restore never replaces another entry, doesn't renew older history, and doesn't change storage charges.

Retry the exact command and record after an interrupted response. Conflicts are stable outcomes; changed inputs need a new operation. Status and retry evidence last seven days, and evidence_expired never repeats the change. Expired trash can't be restored, even if cleanup hasn't run yet. Automatic expiry releases the storage charge, and physical cleanup is tracked separately.

The SDK methods are listTrashedFiles, changeFileTrash (action: "trash" or "restore", with an optional destination of { parentId, name }), and getFileTrashOperation.

Permanently remove content

Owners and administrators can permanently remove content in two ways. Both are irreversible, and neither selects individual revisions:

  • Purge a trashed file with all of its retained revisions.
  • Clear history of a live file, removing every older revision and keeping the current content.
agent-workplace files purge FILE_UUID \
  --expected-version TRASH_VERSION_UUID --operation private-files/purge.json --json
agent-workplace files clear-history FILE_UUID \
  --expected-version VERSION_UUID --operation private-files/clear-history.json --json
agent-workplace files deletion-status --operation private-files/clear-history.json --json

pending means the service has taken responsibility. It reports targetCount and processedCount; the target can grow while collecting and is fixed during deleting. Don't infer completion from the counts or from content disappearing. complete confirms logical removal and storage release for the whole target, and physicalCleanup: "handed_off" means physical erasure is tracked separately.

  • Purge immediately blocks new reads and grants.
  • During clear-history, the current revision stays readable while older ones become unavailable.
  • Other changes to the file conflict while cleanup runs.
  • Previously issued URLs keep their expiry, but deleted bytes may stop being downloadable before then.

Retry with the same inputs and record, or check deletion-status. A conflict needs a fresh version and a new record. Status and retry are private to the account that started the removal and require current owner or admin authority; losing that authority doesn't cancel cleanup already admitted. Pending work never times out, and completed or conflict details stay for seven days. After evidence_expired, reusing the record can't run deletion again. Deleting the whole workplace takes over remaining cleanup, and the file operation may no longer be available afterward.

In the SDK, beginFileDeletion takes action ("purge" or "clear_history"), workplaceId, fileId, expectedVersion, and a fresh operationId; getFileDeletionOperation takes workplaceId and operationId.

On this page