Create Category
POST
/api/v1/dashboard/content/categoriesOverview
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
| Header | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes | Bearer <client_id>:<api_key>:<api_secret> |
Content-Type | string | Yes | application/json |
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Category display name |
slug | string | No | URL-friendly slug (auto-generated from name if omitted) |
description | string | No | Category description |
parent_id | string (UUID) | No | Parent category ID for nesting (omit for top-level) |
sort_order | integer | No | Sort position within parent level (default: 0) |
Response
idstring (UUID)Unique category identifier
namestringCategory display name
slugstringURL-friendly slug
descriptionstring | nullCategory description
parent_idstring (UUID) | nullParent category ID, or null for top-level
sort_orderintegerSort position
Example Request
- cURL
- Python
- JavaScript
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
}'
import requests
resp = requests.post(
"https://spideriq.ai/api/v1/dashboard/content/categories",
headers={"Authorization": f"Bearer {CLIENT_TOKEN}"},
json={
"name": "API Guides",
"description": "Step-by-step API integration guides",
"parent_id": "cat-001-uuid",
"sort_order": 1,
},
)
category = resp.json()
print(f"Created category: {category['id']}")
print(f"Slug: {category['slug']}")
print(f"Parent: {category['parent_id']}")
const resp = await fetch(
"https://spideriq.ai/api/v1/dashboard/content/categories",
{
method: "POST",
headers: {
"Authorization": `Bearer ${CLIENT_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "API Guides",
description: "Step-by-step API integration guides",
parent_id: "cat-001-uuid",
sort_order: 1,
}),
}
);
const category = await resp.json();
console.log(`Created category: ${category.id}`);
console.log(`Slug: ${category.slug}`);
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 Code | Meaning | Description |
|---|---|---|
| 201 | Created | Category created successfully |
| 400 | Bad Request | Missing required fields or invalid parent_id |
| 401 | Unauthorized | Invalid or missing Bearer token |
| 409 | Conflict | A category with this slug already exists |