Skip to main content

Create Category

POST/api/v1/dashboard/content/categories

Overview

Creates a new blog category for the authenticated client. Categories support hierarchical nesting via parent_id, allowing trees like Tutorials > API Guides. A URL slug is auto-generated from the name if not provided.

Authentication

info

Bearer authentication required - Pass your credentials as Authorization: Bearer <client_id>:<api_key>:<api_secret>.

Headers

HeaderTypeRequiredDescription
AuthorizationstringYesBearer <client_id>:<api_key>:<api_secret>
Content-TypestringYesapplication/json

Request Body

ParameterTypeRequiredDescription
namestringYesCategory display name
slugstringNoURL-friendly slug (auto-generated from name if omitted)
descriptionstringNoCategory description
parent_idstring (UUID)NoParent category ID for nesting (omit for top-level)
sort_orderintegerNoSort position within parent level (default: 0)

Response

idstring (UUID)

Unique category identifier

namestring

Category display name

slugstring

URL-friendly slug

descriptionstring | null

Category description

parent_idstring (UUID) | null

Parent category ID, or null for top-level

sort_orderinteger

Sort position

Example Request

curl -X POST "https://spideriq.ai/api/v1/dashboard/content/categories" \
-H "Authorization: Bearer $CLIENT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "API Guides",
"description": "Step-by-step API integration guides",
"parent_id": "cat-001-uuid",
"sort_order": 1
}'

Example Response

{
"id": "cat-004-uuid",
"name": "API Guides",
"slug": "api-guides",
"description": "Step-by-step API integration guides",
"parent_id": "cat-001-uuid",
"sort_order": 1,
"children": []
}

Status Codes

Status CodeMeaningDescription
201CreatedCategory created successfully
400Bad RequestMissing required fields or invalid parent_id
401UnauthorizedInvalid or missing Bearer token
409ConflictA category with this slug already exists