curl --request POST \
--url https://east.sandbox.spade.com/users/{userId}/categories \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '{
"name": "Kitchen Remodel",
"parentId": "011-000-000-000"
}'
{
"id": "4d5419f1-bcde-40f5-9168-7f8989b9c55f",
"name": "Kitchen Remodel",
"icon": "https://static.v2.spadeapi.com/categories/ee4ee39fd5474d31ac42f9e606b9040a/light.png",
"fullCategoryHierarchy": [
{
"id": "011-000-000-000",
"name": "Retail",
"icon": "https://static.v2.spadeapi.com/categories/ee4ee39fd5474d31ac42f9e606b9040a/light.png"
},
{
"id": "4d5419f1-bcde-40f5-9168-7f8989b9c55f",
"name": "Kitchen Remodel",
"icon": "https://static.v2.spadeapi.com/categories/ee4ee39fd5474d31ac42f9e606b9040a/light.png"
}
]
}
Create a custom user-level category.
To learn more about user category personalization, please read the User Category Personalization Guide.
curl --request POST \
--url https://east.sandbox.spade.com/users/{userId}/categories \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '{
"name": "Kitchen Remodel",
"parentId": "011-000-000-000"
}'
{
"id": "4d5419f1-bcde-40f5-9168-7f8989b9c55f",
"name": "Kitchen Remodel",
"icon": "https://static.v2.spadeapi.com/categories/ee4ee39fd5474d31ac42f9e606b9040a/light.png",
"fullCategoryHierarchy": [
{
"id": "011-000-000-000",
"name": "Retail",
"icon": "https://static.v2.spadeapi.com/categories/ee4ee39fd5474d31ac42f9e606b9040a/light.png"
},
{
"id": "4d5419f1-bcde-40f5-9168-7f8989b9c55f",
"name": "Kitchen Remodel",
"icon": "https://static.v2.spadeapi.com/categories/ee4ee39fd5474d31ac42f9e606b9040a/light.png"
}
]
}
The userId
of the relevant user.
Schema for creating a custom category.
Successful operation
The newly created category.