For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Help CenterAPI KeysStatusSign In
GuidesAPI ReferenceChangelog
GuidesAPI ReferenceChangelog
  • Introduction
    • Getting started
  • Email API
  • Transactional SMS
  • Transactional WhatsApp
  • Marketing Campaigns
  • Contact Management
  • Events
    • GETGet events
    • POSTCreate an event
    • POSTCreate events in batch
  • Object Management
  • Accounts and Settings
  • Sales CRM
  • Conversations
  • Ecommerce
      • GETReturn all your categories
      • POSTCreate/Update a category
      • GETGet a category details
      • POSTCreate categories in batch
  • Loyalty
LogoLogo
Help CenterAPI KeysStatusSign In
EcommerceCategories

Create/Update a category

POST
https://api.brevo.com/v3/categories
POST
/v3/categories
1import { BrevoClient } from "@getbrevo/brevo";
2
3async function main() {
4 const client = new BrevoClient({
5 apiKey: "YOUR_API_KEY_HERE",
6 });
7 await client.ecommerce.createUpdateCategory({
8 id: "CAT123",
9 });
10}
11main();
1{
2 "id": "21"
3}
Create a new ecommerce category or update an existing one, identified by the mandatory `id` field. When `updateEnabled` is set to `false` (the default), the endpoint performs an insert and returns `201`; if the category ID already exists, a `400` error is returned. When `updateEnabled` is `true`, the endpoint performs an upsert, returning `201` for a new category or `204` when an existing category is updated. The `name` field is mandatory for creation but optional for updates.
Was this page helpful?
Previous

Get a category details

Next
Built with

Create a new ecommerce category or update an existing one, identified by the mandatory id field. When updateEnabled is set to false (the default), the endpoint performs an insert and returns 201; if the category ID already exists, a 400 error is returned. When updateEnabled is true, the endpoint performs an upsert, returning 201 for a new category or 204 when an existing category is updated. The name field is mandatory for creation but optional for updates.

Authentication

api-keystring

The API key should be passed in the request headers as api-key for authentication.

Request

Values to create/update a category

idstringRequired
Unique Category ID as saved in the shop
deletedAtstringOptional

UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of the category deleted from the shop’s database

isDeletedbooleanOptional
category deleted from the shop's database
namestringOptional

Mandatory in case of creation. Name of the Category, as displayed in the shop

updateEnabledbooleanOptionalDefaults to false

Facilitate to update the existing category in the same request (updateEnabled = true)

urlstringOptional
URL to the category

Response

Category created
idstring
ID of the category when a new category is created

Errors

400
Bad Request Error