Categories

Use this endpoint to manipulate and obtain details on Salesbox’s Categories.

Base Endpoint

https://segmentai.salesbox.com.br/api/categories

Get Category

GET /api/categories/{id}

Get an individual Category by ID.

HTTP Request

GET /api/categories/ID

Response

Expected Response Code: 200

{
    "category": {
        "id": 1,
        "title": "Marketing Materials",
        "alias": "marketing-materials",
        "description": "Marketing related documents and assets",
        "color": "#4CAF50",
        "bundle": "asset",
        "createdAt": "2024-01-15T10:00:00+00:00",
        "modifiedAt": "2024-01-15T10:00:00+00:00",
        "createdBy": 1,
        "createdByUser": "John Smith",
        "modifiedBy": 1,
        "modifiedByUser": "John Smith"
    }
}

Category Properties

Name

Type

Description

id

int

ID of the Category

title

string

Name of the Category

alias

string

URL-friendly version of the name

description

string/null

Description of the Category

color

string/null

Color code for the Category

bundle

string

Type of items in the category (asset, campaign, etc)

createdAt

datetime

Category creation date/time

modifiedAt

datetime/null

Category last modified date/time

createdBy

int

ID of the User that created the Category

createdByUser

string

Name of the User that created the Category

modifiedBy

int

ID of the User that last modified the Category

modifiedByUser

string

Name of the User that last modified the Category

List Categories

GET /api/categories

Get a list of categories.

Query Parameters

Name

Type

Description

search

string

Text to search categories by

page

int

Which page to display

limit

int

How many records to return

orderBy

string

Column to sort by

orderByDir

string

Sort direction: asc or desc

bundle

string

Filter by bundle type

Create Category

POST /api/categories/new

Create a new category.

Request Body

Name

Type

Description

title

string

Category name

description

string

Category description

bundle

string

Bundle type (asset, campaign, etc)

color

string

Color code for the category

alias

string

URL-friendly version of the name (optional)

Edit Category

PATCH /api/categories/{id}/edit

Edit an existing category.

Request Body

Same fields as Create Category.

Delete Category

DELETE /api/categories/{id}/delete

Delete an existing category.