Skip to content

Create a category

POST
/categories/add
curl --request POST \
--url https://acme.mykreezalid.com/api/v1/categories/add \
--header 'Authorization: Basic <credentials>' \
--header 'Content-Type: application/json' \
--data '{ "title": "Shoes", "parent_id": 4242, "description": "example", "slug": "shoes", "external_id": "example" }'

Creates a listing category. title is required. The response always has the HTTP status 200: read success to know whether the category was created. On failure, message is either a sentence or an object listing the invalid fields.

Media typeapplication/json
object
title
required
string

Example

Shoes
parent_id

Parent category, to create a sub-category

integer
nullable

Example

4242
description
string
slug
string

Example

shoes
external_id

Your own reference for the category

string

Result of the creation

Media typeapplication/json
object
id

Identifier of the new category, null on failure

integer
nullable
success
boolean
message

Category created, or the reason of the failure

Example

{
"id": 4242,
"success": true,
"message": "Category created"
}

Missing or wrong API credentials