Skip to content

Create a category

Request

Security
BearerAuth
Bodyapplication/jsonrequired
idstring

Category id. Ignored on update. The {id} path parameter is authoritative.

Example:"cat_123456"
account_idstringrequired

Setmore account id that owns this category.

Example:"acc_123456"
descriptionstring, <= 1500 characters

Description of the category.

Example:"Standard haircut services"
titlestring, [ 1 .. 255 ] charactersrequired

Required. Must contain at least one non-whitespace character; an empty or blank title is rejected with parameter_not_found.

Example:"Haircuts"
service_idsArray of strings, <= 100 itemsrequired

Service id(s) belonging to this category.

Example:
[ "svc_123456" ]
color_codestring, <= 7 characters^#[0-9A-Fa-f]{6}$

Hex color code, e.g. #FF5733.

Example:"#FF5733"
image_urlstring, (uri)

URL of the image shown for the category. See RFC 3986 for URI syntax.

Example:"https://cdn.example.com/categories/haircuts.png"
visibilitystring

Visibility of the category (PUBLIC, PRIVATE or UNAVAILABLE). Defaults to PUBLIC when not provided.

Default:"PUBLIC"
Enum:"PUBLIC""PRIVATE""UNAVAILABLE"
Example:"PUBLIC"
curl -i -X POST \
  https://developer.setmore.com/api/v2/categories \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "id": "cat_123456",
    "account_id": "acc_123456",
    "description": "Standard haircut services",
    "title": "Haircuts",
    "service_ids": [
      "svc_123456"
    ],
    "color_code": "#FF5733",
    "image_url": "https://cdn.example.com/categories/haircuts.png",
    "visibility": "PUBLIC"
  }'

Responses

Category created.

Bodyapplication/json
dataobject(Category)

A category, as returned in API responses.

Response
{ "data": { "id": "cat_123456", "account_id": "acc_123456", "description": "Standard haircut services", "title": "Haircuts", "service_ids": [ … ], "color_code": "#FF5733", "image_url": "https://cdn.example.com/categories/haircuts.png", "visibility": "PUBLIC" } }