Skip to main content

Create Category

Adds a category under a parent. The new category gets the next sequential int_id, and its path is the parent's path with that int_id appended (1.4 → 1.4.117).

is_leaf is a declaration, not a derived state: a leaf holds tokenized assets instead of sub-categories, so creating a category under a leaf parent is refused (turn the parent's is_leaf off first with Update Category).

The request is multipart/form-data so an image can travel with it. If you already host the image, send its URL as image_url instead. When both are sent, the uploaded file wins. The file is stored after the category is created, so a failed upload can leave a category without an image; retry the image with an update.

Required permission: category:create

Request​

POST /v2/admin/categories

Headers​

NameDescription
AuthorizationRequired. Bearer <access_token>
Content-TypeRequired. multipart/form-data (set by your HTTP client together with the boundary)

Body​

FieldTypeRequiredDescription
parent_idstringYesId of the parent category. It must exist and must not be a leaf
name_enstringYesEnglish name
name_trstringYesTurkish name
is_leafbooleanNotrue if the category will hold tokenized assets instead of sub-categories. Default false
show_on_dashboardbooleanNoShow the category on the dashboard. Default false
image_urlstringNoURL of an image you already host
imagefileNoImage file, smaller than 2 MB. Requires image storage to be configured on the server

Example​

curl --request POST \
--url '{{baseUrl}}/v2/admin/categories' \
--header 'Authorization: Bearer <access_token>' \
--form 'parent_id=667e9251ca818a2138ed4888' \
--form 'name_en=Venture Capital Funds' \
--form 'name_tr=Girişim Sermayesi Fonları' \
--form 'is_leaf=true' \
--form 'show_on_dashboard=false' \
--form 'image=@./venture-capital.png'

Response​

201 Created with the new category.

{
"id": "6911a3c2e4b0f51d2c8a7e41",
"parent_id": "667e9251ca818a2138ed4888",
"name": {
"en": "Venture Capital Funds",
"tr": "Girişim Sermayesi Fonları"
},
"path": "1.4.117",
"int_id": 117,
"image_svg": null,
"image_url": "https://s3.tokenizationtr.com/categories/image/6911a3c2e4b0f51d2c8a7e41.png",
"is_leaf": true,
"show_on_dashboard": false,
"created_at": "2026-11-09T10:15:42.318Z"
}

Response Fields​

The category, in the shape described on Get Category.

Errors​

StatusCodeDescription
40010015Validation failed (parent_id, name_en or name_tr missing) — see details. Also returned when the image is 2 MB or larger, or when image upload is not configured on the server
40010016parent_id is not a valid 24-character hex id
40010002Parent category not found (domain 4)
40010003Parent category is a leaf and cannot hold sub-categories (domain 4)

See Errors for the error format and common codes.