When to use this. Style files are the documents attached to a single style — tech packs,
artwork, and reference files — filed into that style’s folders. Use these endpoints to attach
an already-uploaded file to a style, organise and rename it, link it to a colourway, and read
the files back either folder-by-folder or as a flat, filterable list.
The workflow
A style file wraps a file resource (the uploaded bytes) and places it in one of the style’s folders. The usual path is to upload the resource, attach it to the style, keep it tidy with bulk updates, then read the files back.1
Upload the resource
Upload the file bytes via the file upload endpoint to get a
fileResourceId (a GUID). A
style file must reference a resource that already exists — a create with an empty resource is
rejected.2
Attach to a style
POST /api/styles/{styleId}/files with the fileResourceId and the folderId of the
folder to file it under. The body is an array, so you can attach several files in one
all-or-nothing transaction. Names must be unique among active files in the same folder.3
Organise & update
PUT /api/styles/{styleId}/files (or the cross-style PUT /api/style-files) to rename,
re-position, link a colourway, or deactivate files. These are bulk updates: send the id
plus only the fields you want to change — a null field is left unchanged.4
Retrieve
GET /api/styles/{styleId}/files returns the style’s folders with their files embedded;
GET /api/style-files returns a flat, filterable, paginated list across the organization.Walkthrough
Attach two files to a style’s folder, then bulk-update them. The request body is an array — one or many files are created (or updated) in a single all-or-nothing transaction.folderId,
folderType, position, state, and — for colourway-specific files — its colorwayId and
colorwayName.
Field reference
The fields that matter most when creating or updating a style file:Roles & permissions
Reading and managing style files requires thestyles permission — style files are part of
the style, not a separate library. Designer (brand) accounts (CompanyAdmin / CompanyUser)
and the supplier accounts collaborating on the style act through that permission. Every request
is scoped to the caller’s organization: a style or file that belongs to another organization
returns 403, and one that exists in no organization returns 404.
When things go wrong
Errors use the standard envelope (status: "error", a code, and error.details[]). See
Errors & responses for the full list of codes and how to resolve them.
What to call next
Styles
Create and manage the styles that files are attached to.
Upload files to a style
Attach uploaded resources to a style:
POST /api/styles/{styleId}/files.List a style's folders
Read a style’s folders with files embedded:
GET /api/styles/{styleId}/files.Authentication
How to get and send your
X-Auth-Token API key.