ION stores file attachments such as procedure images, run artifacts, and inspection photos. You don’t upload a file by posting it through the GraphQL endpoint. Instead, you use a three-step flow: request a signed upload URL from ION, send the file directly to that URL, then register the attachment back to ION with the storage details. Large files upload directly to storage rather than through ION.
The two most common stumbling blocks are capturing the ETag from the upload response and choosing the right entityId.
How the flow works
- Send
requestFileUploadUrl to ION. ION returns uploadUrl, s3Key, and contentType.
- Send a PUT request with the file body and
Content-Type header to uploadUrl. Storage returns a 200 response with an ETag header.
- Send
createFileAttachment to ION with s3Key, s3Etag, entityId, and filename. ION returns the fileAttachment.
Prerequisites
- An authenticated GraphQL client. See Authentication.
- Permission to attach files to the entity you’re targeting.
- The entity ID of the object you’re attaching to. See Choose an entityId.
Step 1: Request a signed upload URL
Request a signed upload URL:
Variables:
Response:
The uploadUrl is single-use and time-bound, typically for a few minutes. If you wait too long, the PUT request in step 2 fails. If that happens, request a new URL.
The contentType in the response is the value you must send in the PUT request’s Content-Type header. ION derives it from the filename extension. If the extension doesn’t reveal your file’s type, request the URL with a more specific filename.
Step 2: Upload the file
Upload the file directly using the signed URL:
The -i flag returns the response headers, including the ETag value:
That ETag value, with the surrounding quotes stripped, is your s3Etag for step 3. ION uses it to verify that the file you uploaded matches the registration you’re about to create.
Capturing the ETag is the most common file-upload bug. Confirm your HTTP
library exposes response headers and isn’t using a wrapper that discards them.
Step 3: Register the attachment
Variables:
Response:
After this returns successfully, the file is visible in the ION UI on the entity you attached it to.
Set validateUpload to true. ION makes one extra HEAD request and gives you
immediate feedback when the registration doesn’t match the uploaded bytes.
Choose an entityId
The entityId is not the same as the parent object’s id. ION lets multiple object types share a relationship to file attachments, so you pass the parent’s entity ID rather than its own id. To attach a file to a run step, the most common case, first fetch the run step’s entity.id:
Use the returned entity.id, not runStep.id, as the entityId in step 3.
The same pattern applies to other targets. Parts, runs, procedures, procedure steps, and run step fields all expose an entity { id } you can fetch and use.
End-to-end example in Python
For the full Python integration template, see Build an API client.
Common errors
Verify the attachment
After step 3, you can confirm the attachment in two ways:
- In the ION UI, open the parent entity and check the attachments panel.
- Via the API, query the attachment back by ID:
The downloadUrl is a fresh signed download URL, time-bound the same way the upload URL was. Don’t cache it long-term.
Set a longer timeout for the upload PUT in step 2 than for your GraphQL
requests. For large files, the upload is the slowest part of the flow.