AI Knowledge & Logic

Public files

Publish uploaded or generated files with public URLs, without passing file contents through the agent.

Host a wiring diagram, PDF guide or other file for use in articles, workflows and actions. Publication returns a durable publicUrl that works without an Octocom login and does not expire. Anyone with that URL can read the file, so publish content intended for public sharing.

The file bytes move directly between storage and the client or server. They do not go into model tool arguments. Publication does not index knowledge, edit articles/workflows or publish portal pages.

From an MCP client

  1. Call create_public_file_upload_url with organizationId, businessId, filename and contentType.
  2. Upload the original local file directly to the returned presignedUrl, using HTTP PUT and the returned headers. The create-only URL lasts 15 minutes.
  3. Call finalize_public_file_upload with the same organization/business and returned fileId. It validates the bytes and returns publicUrl.

For a client with shell access, the transfer is a normal file upload:

curl --fail --request PUT \
  --header 'x-ms-blob-type: BlockBlob' \
  --upload-file ./wiring.png \
  "$UPLOAD_URL"

Use the exact returned upload URL. Only metadata and IDs pass through MCP; there is no base64 payload. Files can be at most 25 MiB. Until finalization succeeds, there is no public download URL. Repeating finalization after success returns the existing public export.

From Copilot

For a file already uploaded to the current Copilot session, call publish_file(file_id, businessId). This native tool resolves the session file, transfers its original bytes on the server, validates them and returns the public URL. It uses the same scoped upload/finalization tools internally.

PDFs and Word documents have readable Markdown extracts, and Excel uploads have readable CSV sheets. Publication uses the original PDF, Word document or workbook. It does not publish the extracted text under the original filename. Uploaded originals carry a server-signed source reference. Older uploads without that reference need to be uploaded again before publication.

For a new file generated in Copilot Python, register it first:

file_id = octocom_save("/mnt/data/report.pdf")
print(file_id)

Then call publish_file with that returned ID. The file is resolved from the live registry, so this works within the same turn. Copilot publication supports originals up to its 20 MiB read limit. Only files in that session's registry with verified original references can be published.

Programmatic uploads from Python

The temporary upload URL is also useful from Copilot Python or any external program with HTTP access. After reserving the upload, send bytes directly:

import requests

with open("/mnt/data/report.pdf", "rb") as file:
    response = requests.put(upload_url, data=file, headers=upload_headers, timeout=60)
response.raise_for_status()

Then finalize using the returned file ID. When the file is already registered with octocom_save, the native publish_file route avoids these extra steps.

Use the public URL

Insert the exact returned URL in article Markdown as an image or document link:

![Example router wiring](<returned publicUrl>)
[Download the setup guide](<returned publicUrl>)

In a workflow, specify when to show the matching image/link and what the customer should do with it. An action can return the URL or use an image in show_card. See Chat UI from actions.

Images: PNG, JPEG, GIF and WebP. Documents: PDF, DOCX, XLSX, XLS, PPTX, TXT, CSV and Markdown. Raster images display inline; documents download as attachments. Actual content is validated before publication. HTML, SVG and scripts, active PDFs and Office files with macros/embedded files are not supported. This is format validation, not a general antivirus scan.

Both upload/finalization and native publication require write access and a business in the current organization. Read-only Copilot/MCP and subagents cannot publish. Finalization cannot disclose unrelated private attachments; it only accepts reservations from this public-upload flow. A validated private original remains private, and publication creates a separate public copy.

New uploads create new URLs. Replacing a file requires updating its references; removing a link does not revoke copies already cached or downloaded.

For knowledge retrieval, use upload_document or the document upload tools. For portal-page assets, use upload_portal_asset, which stays private until a published page references it. See Knowledge base and Portal assets.

On this page