Create a new category
POST
/categories
const url = 'http://localhost:8000/api/v1/categories';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"client_id":"245cb3df-df3a-428b-a908-e5f74b8d58a3:245cb3df-df3a-428b-a908-e5f74b8d58a4","type":"income","name":"example","description":"example","icon":"example","icon_type":"example","created_at":"2026-04-15T12:00:00Z"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:8000/api/v1/categories \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "client_id": "245cb3df-df3a-428b-a908-e5f74b8d58a3:245cb3df-df3a-428b-a908-e5f74b8d58a4", "type": "income", "name": "example", "description": "example", "icon": "example", "icon_type": "example", "created_at": "2026-04-15T12:00:00Z" }'Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ” Media type application/json
object
client_id
Unique identifier for your local client
string format: string
Example
245cb3df-df3a-428b-a908-e5f74b8d58a3:245cb3df-df3a-428b-a908-e5f74b8d58a4 type
required
Type of the category
string
name
required
Name of the category
string
description
The description of the category
string
icon
The icon of the category (file or icon string)
string
icon_type
The type of the icon (icon or emoji or image)
string
created_at
string format: date-time
Responses
Section titled “ Responses ”Category created successfully
Media type application/json
object
id
ID of the category
integer
name
Name of the category
string
description
Description of the category
string
type
Type of the category (income or expense)
string
icon
Category icon
object
id
ID of the icon
integer
path
Image of the icon
string
type
Type of icon( image or icon or emoji)
string
sync_state
Sync state
object
id
ID of the sync state
integer
syncable_id
ID of the syncable
integer
client_generated_id
ID from the client
integer
syncable_type
Syncable type
string
source
string
last_synced_at
Date last synced
string format: date-time
created_at
Date created
string format: date-time
deleted_at
Date deleted
string format: date-time
Example generated
{ "id": 1, "name": "example", "description": "example", "type": "example", "icon": { "id": 1, "path": "example", "type": "example" }, "sync_state": { "id": 1, "syncable_id": 1, "client_generated_id": 1, "syncable_type": "example", "source": "example", "last_synced_at": "2026-04-15T12:00:00Z", "created_at": "2026-04-15T12:00:00Z", "deleted_at": "2026-04-15T12:00:00Z" }}Invalid input
Internal server error