When to use this. Colours are reusable library entities for your organisation: you create
them once, optionally organise them into colour groups, and then reference them as colourways
on styles. Use these endpoints to build, maintain and retire that library.
The workflow
A colour is an organisation-level record in the colour library. The usual path is to (optionally) set up colour groups for organisation, create the colours, then reference them from styles further along the product lifecycle, and update or retire them as the palette changes.1
Group (optional)
POST /api/color-groups to create groups (e.g. “Blues”, “Core”) you’ll file colours under.2
Create colours
POST /api/colors with the colour details, attaching colorGroupIds to file them.3
Find colours
GET /api/colors with filters (name, reference, state, group) to look colours up later,
or GET /api/colors/{id} to read one colour by its id.4
Reference on products
Styles assign library colours as colourways, and
GET /api/styles/{styleId}/items/{styleItemId}/colors shows the master colour behind each
colour card on a style item. An item’s own colour cards come from
GET /api/items/{itemId}/colors.5
Update or retire colours
PATCH /api/colors/{id} changes only the fields you send; PUT /api/colors/{id} replaces
the colour in full, and PUT /api/colors replaces many colours in one all-or-nothing
request. Set state to inactive to retire a colour, or DELETE /api/colors/{id} to
soft-delete one that no style colour or item colour card still uses.Walkthrough
Create a colour and file it under a colour group. The body is an array: one or many colours are created in a single all-or-nothing transaction.id: styles
reference colours by it.
Field reference
The fields that matter most when creating or updating a colour:Updating a colour: PUT vs PATCH
PUT is a full replace: send every field you want to keep, because an omitted optional field or
collection is cleared. PATCH takes an RFC 6902 JSON Patch document
(Content-Type: application/json-patch+json) and changes only the paths you send.
An unknown colour group or language id is rejected with an error pointing at its position
(
colorGroupIds[i], languageIds[k]; items[n].… in a bulk PUT). A PATCH path that is not
on the update body (e.g. /organizationId) returns 422, and a failed test operation returns 409.
In a bulk PUT, sending state: "deleted" on an item soft-deletes that colour.
Roles & permissions
Managing the colour library requires admin-levelcolors permission on a designer
(brand) account: typically CompanyAdmin. Supplier accounts collaborate on styles
but do not manage a brand’s colour library: reading a colour by id with
GET /api/colors/{id} is open to any designer user, and a supplier caller receives 403.
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.
Cases specific to reading, updating and deleting a colour by id:
- 403
authorization_error.color_access_denied:GET,PUTorPATCHon a colour that belongs to another organisation. - 404
resource_error.color_not_found: the id exists in no organisation.DELETEalso returns 404 for a colour in another organisation. - 409
resource_conflict_error(detailcolor_deleted_conflict):DELETEon a colour still used by a style colour or an item colour card. Set it toinactiveinstead, or remove those references first.
What to call next
Colour groups
Organise colours into groups for filtering and reuse.
Style colours
Assign library colours to a style as its colourways.
Item colours
Read an item’s own colour cards:
GET /api/items/{itemId}/colors.Style-item colours
Colours on a style’s items:
GET /api/styles/{styleId}/items/{styleItemId}/colors.Authentication
How to get and send your
X-Auth-Token API key.