POST
/
api-category
/
v1
/
category
/
attribute
/
bulk
curl --request POST \
  --url https://live.copilot.fabric.inc/api-category/v1/category/attribute/bulk \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'x-site-context: <x-site-context>' \
  --data '[
  {
    "action": "UPDATE",
    "id": "61ba11691a29d52cb2842541",
    "name": "weight",
    "description": "Item weight, in KG",
    "type": "INTEGER",
    "textSubType": "HTML",
    "serialStart": 1000,
    "optionsType": "DATETIME",
    "format": "YYYY-MM-DD",
    "formula": "`${item.weightValue} ${item.weightUnit}`",
    "validation": {
      "required": true,
      "inheritable": true,
      "inverse": true,
      "unique": true,
      "exact": "<string>",
      "attributeTypes": [
        "Serial",
        "Integer"
      ],
      "contains": "<string>",
      "range": {
        "min": "<string>",
        "max": "<string>"
      },
      "formula": "value < 10 || value > 20",
      "oneOf": [
        "<string>"
      ]
    }
  }
]'
{
  "attributes": {
    "success": [
      {
        "id": "622932439c73c975335cb654",
        "name": "name",
        "message": "Attribute created successfully"
      }
    ],
    "failed": [
      {
        "name": "ITEM_ATTRIBUTE_VALUE_IS_INVALID",
        "errors": [
          [
            "Attribute value is invalid",
            "Attribute value not found"
          ]
        ]
      }
    ]
  }
}

Authorizations

Authorization
string
header
required

S2S access token (JWT) from fabric Identity service (during Login)

Headers

x-site-context
string
required

The x-site-context header is a JSON object that contains information about the source you wish to pull from. The mandatory account is the 24 character identifier found in Copilot. The channel (Sales channel ID), stage (environment name), and date attributes can be used to further narrow the scope of your data source.

Body

application/json · object[]
action
enum<string>
required

Action type. <br /> Note: <br /> 1) Attribute ID is required only for UPDATE and DELETE actions (not for CREATE). <br /> 2) CREATE action replaces any existing category attribute with the same name.

Available options:
CREATE,
UPDATE,
DELETE
name
string
required

Attribute name

type
enum<string>
required

Supported attribute types for the attribute

Available options:
TEXT,
BOOLEAN,
SERIAL,
DECIMAL,
INTEGER,
DATETIME,
OPTIONS
id
string

A 24-character system-generated attribute ID

description
string

Accurate description of the attribute and what it represents

textSubType
enum<string>

Conditionally required for TEXT attribute type

Available options:
SMALL_TEXT,
TEXT_AREA,
HTML
serialStart
number

Conditionally required to indicate the starting value of SERIAL attribute type. When enabled, the subsequent attribute values increment by 1.

optionsType
enum<string>

Conditionally required to indicate the selectable values for OPTIONS attribute type

Available options:
TEXT,
BOOLEAN,
DECIMAL,
INTEGER,
DATETIME
format
string

Attribute format. Currently used only for DATETIME attribute type.

formula
string

JavaScript expression to dynamically compute the attribute value. The data type returned by this expression must match the attribute's data type. <br /> Note: When this is provided, validation is ignored.

validation
object

Response

200
application/json
OK
attributes
object