POST
/
api-category
/
v1
/
category
/
bulk
/
upsert
Create or update multiple categories or collections
curl --request POST \
  --url https://live.copilot.fabric.inc/api-category/v1/category/bulk/upsert \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'x-site-context: <x-site-context>' \
  --data '[
  {
    "name": "Sofa",
    "parentNodeName": "PRIMARY->Furniture",
    "order": 2
  }
]'
{
  "success": [
    {
      "id": "611686da50fb7e0c5df78c2e",
      "name": "Sofa",
      "parentId": "63ea48368da1ae00089b7052",
      "nodeId": 12,
      "message": "Categories upserted successfully"
    }
  ],
  "failed": [
    {
      "name": "testNodeChild",
      "parentNodeName": "PRIMARY->testNode",
      "message": "Parent node 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.

Example:

"{\"date\": \"2023-01-01T00:00:00.000Z\", \"channel\": 12, \"account\": \"1234abcd5678efgh9ijklmno\",\"stage\":\"production\"}"

Body

application/json · object[]
name
string
required

Category name to upsert

Example:

"Sofa"

parentNodeName
string
required

Parent Category breadcrumb starting from PRIMARY which is the name of root node

Example:

"PRIMARY->Furniture"

order
number

Order in which category will be displayed in Product Catalog in Copilot.

Example:

2

Response

OK

success
object[]
failed
object[]