Create Category
curl --request POST \
--url https://qwoty.app/api/categories \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"api_name": "<string>",
"name": "<string>",
"description": "<string>",
"is_active": true,
"parent_category_id": "<string>"
}
'import requests
url = "https://qwoty.app/api/categories"
payload = {
"api_name": "<string>",
"name": "<string>",
"description": "<string>",
"is_active": True,
"parent_category_id": "<string>"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
api_name: '<string>',
name: '<string>',
description: '<string>',
is_active: true,
parent_category_id: '<string>'
})
};
fetch('https://qwoty.app/api/categories', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://qwoty.app/api/categories",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'api_name' => '<string>',
'name' => '<string>',
'description' => '<string>',
'is_active' => true,
'parent_category_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://qwoty.app/api/categories"
payload := strings.NewReader("{\n \"api_name\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"is_active\": true,\n \"parent_category_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://qwoty.app/api/categories")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"api_name\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"is_active\": true,\n \"parent_category_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://qwoty.app/api/categories")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"api_name\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"is_active\": true,\n \"parent_category_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440001",
"workspace_id": "660e8400-e29b-41d4-a716-446655440000",
"name": "Electronics",
"api_name": "electronics",
"description": "Electronic products and accessories",
"is_active": true,
"parent_category_id": null,
"created_at": "2026-01-15T10:00:00Z",
"updated_at": "2026-01-15T10:00:00Z"
}
}
Categories
Create Category
Create a new product category in your workspace
POST
/
api
/
categories
Create Category
curl --request POST \
--url https://qwoty.app/api/categories \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"api_name": "<string>",
"name": "<string>",
"description": "<string>",
"is_active": true,
"parent_category_id": "<string>"
}
'import requests
url = "https://qwoty.app/api/categories"
payload = {
"api_name": "<string>",
"name": "<string>",
"description": "<string>",
"is_active": True,
"parent_category_id": "<string>"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
api_name: '<string>',
name: '<string>',
description: '<string>',
is_active: true,
parent_category_id: '<string>'
})
};
fetch('https://qwoty.app/api/categories', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://qwoty.app/api/categories",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'api_name' => '<string>',
'name' => '<string>',
'description' => '<string>',
'is_active' => true,
'parent_category_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://qwoty.app/api/categories"
payload := strings.NewReader("{\n \"api_name\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"is_active\": true,\n \"parent_category_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://qwoty.app/api/categories")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"api_name\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"is_active\": true,\n \"parent_category_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://qwoty.app/api/categories")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"api_name\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"is_active\": true,\n \"parent_category_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440001",
"workspace_id": "660e8400-e29b-41d4-a716-446655440000",
"name": "Electronics",
"api_name": "electronics",
"description": "Electronic products and accessories",
"is_active": true,
"parent_category_id": null,
"created_at": "2026-01-15T10:00:00Z",
"updated_at": "2026-01-15T10:00:00Z"
}
}
Authorization
string
required
Bearer token for authentication. Format:
Bearer qwoty_your_tokenRequest Body
string
required
Unique API identifier (snake_case). Can only contain lowercase letters,
numbers and underscores. Cannot start or end with underscore.
string
required
Category name
string
Category description
boolean
default:"true"
Active status
string
UUID of parent category for hierarchical organization
Examples
curl -X POST https://qwoty.app/api/categories \
-H "Authorization: Bearer qwoty_your_token" \
-H "Content-Type: application/json" \
-d '{
"api_name": "electronics",
"name": "Electronics",
"description": "Electronic products and accessories",
"is_active": true
}'
curl -X POST https://qwoty.app/api/categories \
-H "Authorization: Bearer qwoty_your_token" \
-H "Content-Type: application/json" \
-d '{
"api_name": "smartphones",
"name": "Smartphones",
"description": "Mobile phones and accessories",
"is_active": true,
"parent_category_id": "550e8400-e29b-41d4-a716-446655440001"
}'
const response = await fetch('https://qwoty.app/api/categories', {
method: 'POST',
headers: {
Authorization: 'Bearer qwoty_your_token',
'Content-Type': 'application/json',
},
body: JSON.stringify({
api_name: 'electronics',
name: 'Electronics',
description: 'Electronic products and accessories',
is_active: true,
}),
})
const data = await response.json()
import requests
response = requests.post(
'https://qwoty.app/api/categories',
headers={
'Authorization': 'Bearer qwoty_your_token',
'Content-Type': 'application/json'
},
json={
'api_name': 'electronics',
'name': 'Electronics',
'description': 'Electronic products and accessories',
'is_active': True
}
)
data = response.json()
Response
boolean
Indicates whether the request was successful
object
Created category object
{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440001",
"workspace_id": "660e8400-e29b-41d4-a716-446655440000",
"name": "Electronics",
"api_name": "electronics",
"description": "Electronic products and accessories",
"is_active": true,
"parent_category_id": null,
"created_at": "2026-01-15T10:00:00Z",
"updated_at": "2026-01-15T10:00:00Z"
}
}
Error Responses
{
"success": false,
"error": "Validation error",
"details": [
"Field 'api_name' is required"
]
}
{
"success": false,
"error": "Validation error",
"details": [
"Field 'api_name' can only contain lowercase letters, numbers and underscores (cannot start or end with underscore)"
]
}
Was this page helpful?
⌘I

