Files Service

At a Glance

Learn how to upload files to the Altium 365 Files Service and use the returned file IDs in API mutations that accept file input. This article provides cURL and Python examples, explains the upload endpoint and authentication requirements, and covers important file ID handling rules. Keep reading to put these examples to work in your API requests.

- Upload files using a multipart/form-data POST request with your access token.
- Pass the returned file ID to a compatible API mutation.
- Understand the 24-hour availability window and why file IDs should not be parsed or constructed.
Go Deeper with AI:

The Files Service lets you upload files so they can be referenced in Altium 365 API requests. The typical use case is uploading a file (such as a component library export) and then passing the returned file ID to an API mutation that accepts file input.

Uploading a File

Send a multipart/form-data POST request to the files endpoint with your access token in the Authorization header. The response body is the file ID.

curl:

curl --location 'https://{workspace-domain}/api/files/File/Upload' \
  --header 'Authorization: Bearer {your-access-token}' \
  --form 'file=@"components.zip"'

Python:

import requests

token = "your-access-token"
file_path = "components.zip"

with open(file_path, "rb") as f:
    response = requests.post(
        "https://{workspace-domain}/api/files/File/Upload",
        files={"file": (file_path, f, "application/zip")},
        headers={"Authorization": f"Bearer {token}"}
    )

file_id = response.text
print(file_id)

Pass file_id to the relevant API mutation as the file reference. See the API schema for which mutations accept file IDs.

  • File IDs are temporary. An uploaded file is available for 24 hours from the last time it was accessed. After that, the file must be re-uploaded.

  • Treat the file ID as opaque. Its format may change — do not parse or construct it.

Endpoints

The upload path is /File/Upload appended to the files service base URL. See Altium 365 API Endpoints for the full list of Workspace and regional base URLs.

If you find an issue, select the text/image and pressCtrl + Enterto send us your feedback.
Contents
Contents