List all categories

GET https://api.zenoti.com/v1/centers/{center_id}/categories

This API helps you to retrieve the list of categories that are active in a center. You must specify the unique identifier of the location (center) in the API request as center_id.

Before you begin

Permission: Manage API Keys (on the Administrator security object) — Required to access Zenoti APIs.

Endpoint

GET /v1/centers/{center_id}/categories

Base URL: https://api.zenoti.com

Request

Headers

Header Required Description
Authorization Yes bearer {{access_token}}

Path parameters

Parameter Type Required Description
center_id string Yes Mandatory Unique 32-character identifier of the center.

Query parameters

Parameter Type Required Default Description
page integer (int32) No 1 Optional Number of the results page. Default value is 1.
size integer (int32) No 10 Optional Number of records to be displayed on a page. Default value is 10.
show_in_catalog boolean No — Optional Indicates whether the category is displayed in the catalog. Default value is false.
type enum (1.2.3.4.5.6) No 1 Optional Indicates the type of categories: Services - 1, Products - 2, Memberships - 3, Packages - 4. Default value is Services.
include_sub_categories boolean No — Optional Indicates whether sub-categories are to included in the API response. Default value is false.

Response

Success (200 OK)

{
  "categories": [
    {
      "...": "..."
    }
  ],
  "page_Info": {
    "total": 2,
    "page": 1,
    "size": 10
  }
}

Response fields

Field Type Description
categories object[]
categories[].id string
categories[].name string
categories[].description string
page_Info object
page_Info.total integer
page_Info.page integer
page_Info.size integer

Example

curl --request GET \
  --url 'https://api.zenoti.com/v1/centers/{center_id}/categories' \
  --header 'Authorization: bearer {{access_token}}'
const response = await fetch('https://api.zenoti.com/v1/centers/{center_id}/categories', {
  method: 'GET',
  headers: {
    'Authorization': 'bearer {{access_token}}'
  },
});
const data = await response.json();
import requests

response = requests.get(
    'https://api.zenoti.com/v1/centers/{center_id}/categories',
    headers={
        'Authorization': 'bearer {{access_token}}',
    },
)
data = response.json()
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "bearer {{access_token}}");
var response = await client.GetAsync(
    "https://api.zenoti.com/v1/centers/{center_id}/categories");
var data = await response.Content.ReadAsStringAsync();
require 'net/http'
require 'json'

uri = URI('https://api.zenoti.com/v1/centers/{center_id}/categories')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
request['Authorization'] = 'bearer {{access_token}}'
response = http.request(request)
data = JSON.parse(response.body)

Error codes

Status Description
400 400
401 Unauthorized -- invalid or expired access token
429 Too many requests -- rate limit exceeded