Skip to main content
POST
/
colors
Add a new color
curl --request POST \
  --url https://api.rechain.co/public/v1/colors \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form name=Red \
  --form companyId=123e4567-e89b-12d3-a456-426614174000 \
  --form 'pantone=PANTONE 186 C' \
  --form pantoneName=Red \
  --form 'hex=#FF0000' \
  --form yama=R-YM-001 \
  --form image='@example-file'
{
  "name": "Red",
  "companyId": "123e4567-e89b-12d3-a456-426614174000",
  "pantone": "PANTONE 186 C",
  "pantoneName": "Red",
  "image": "https://example.com/images/red.png",
  "hex": "#FF0000",
  "yama": "R-YM-001",
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "createdAt": "2023-08-23T18:25:43.511Z",
  "components": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "componentName": "Component Name",
      "componentId": "123e4567-e89b-12d3-a456-426614174000"
    }
  ],
  "variants": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "name": "Variant Name",
      "productId": "123e4567-e89b-12d3-a456-426614174000",
      "productName": "Product Name"
    }
  ],
  "colorValues": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "content": "Value Content",
      "colorId": "123e4567-e89b-12d3-a456-426614174000",
      "colorFieldId": "123e4567-e89b-12d3-a456-426614174000"
    }
  ],
  "resourceLabels": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "labelId": "123e4567-e89b-12d3-a456-426614174000",
      "name": "Label Name"
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

multipart/form-data

Create a new color

name
string
required
Example:

"Red"

companyId
string<uuid>
required
Example:

"123e4567-e89b-12d3-a456-426614174000"

pantone
string
Example:

"PANTONE 186 C"

pantoneName
string
Example:

"Red"

hex
string
Example:

"#FF0000"

yama
string
Example:

"R-YM-001"

image
file

The photo file to upload

Response

Successful operation

id
string<uuid>
Example:

"123e4567-e89b-12d3-a456-426614174000"

createdAt
string<date-time>
Example:

"2023-08-23T18:25:43.511Z"

components
object[]
variants
object[]
colorValues
object[]
resourceLabels
object[]
name
string
Example:

"Red"

companyId
string<uuid>
Example:

"123e4567-e89b-12d3-a456-426614174000"

pantone
string
Example:

"PANTONE 186 C"

pantoneName
string
Example:

"Red"

image
string<uri>
Example:

"https://example.com/images/red.png"

hex
string
Example:

"#FF0000"

yama
string
Example:

"R-YM-001"