Skip to content

Create asset category (admin)

POST
/api/asset-categories
curl --request POST \
--url http://localhost:3000/api/asset-categories \
--header 'Content-Type: application/json' \
--cookie session=<session> \
--data '{ "name": "example", "slug": "example", "icon": "package", "description": "example" }'
Media type application/json
object
name
required
string
slug

Auto-generated from name when omitted

string
icon
string
default: package
description
string

Category created

Media type application/json
object
data
object
id
required
string format: uuid
name
required
string
slug
string
nullable
icon
string
default: package
description
string
nullable
fields
Array<object>
object
id
required
string format: uuid
categoryId
required
string format: uuid
fieldKey
required
string
label
required
string
fieldType
required
string
default: text
options
Array<string>
nullable
required
boolean
placeholder
string
nullable
helpText
string
nullable
sortOrder
integer
createdAt
required
string format: date-time
updatedAt
required
string format: date-time
Example
{
"data": {
"icon": "package",
"fields": [
{
"fieldType": "text"
}
]
}
}

Name is required

Media type application/json
object
error
required
string
Example
{
"error": "Not found"
}

Not authenticated

Media type application/json
object
error
required
string
Example
{
"error": "Not found"
}

Admin access required

Media type application/json
object
error
required
string
Example
{
"error": "Not found"
}