> For the complete documentation index, see [llms.txt](https://documentation.siteglide.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.siteglide.com/developer-tools/site-api/categories.md).

# Categories

## GET /categories

> Retrieve an overview list of all categories from your website

```json
{"openapi":"3.1.0","info":{"title":"Siteglide Site API","version":"2.0.0"},"servers":[{"url":"{siteUrl}/api/site/v2","variables":{"siteUrl":{"default":"https://www.my-site.com"}}}],"security":[{"apiKey":[],"siteID":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"x-api-key","description":"Your Siteglide API key"},"siteID":{"type":"apiKey","in":"header","name":"x-site-id","description":"The ID of the Siteglide site you are working with (not an API key — just the numeric site ID)"}}},"paths":{"/categories":{"get":{"tags":["Categories"],"summary":"Retrieve an overview list of all categories from your website","parameters":[{"name":"per_page","in":"query","description":"Number of items to retrieve, maximum of 500","schema":{"type":"integer"}},{"name":"sort_type","in":"query","description":"Field by which to sort the results","schema":{"type":"string"}},{"name":"sort_order","in":"query","description":"Order of results","schema":{"type":"string","enum":["asc","desc"],"default":"desc"}},{"name":"page","in":"query","description":"Page to retrieve number, to be used with per_page","schema":{"type":"integer"}}],"responses":{"200":{"description":"OK"},"401":{"description":"Unauthorized - Credentials Incorrect"},"403":{"description":"Forbidden - You cannot access this site"},"422":{"description":"Unprocessable Entity - Required data missing or data invalid"}}}}}}
```

## GET /categories/{id}

> Retrieve all data about an individual category

```json
{"openapi":"3.1.0","info":{"title":"Siteglide Site API","version":"2.0.0"},"servers":[{"url":"{siteUrl}/api/site/v2","variables":{"siteUrl":{"default":"https://www.my-site.com"}}}],"security":[{"apiKey":[],"siteID":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"x-api-key","description":"Your Siteglide API key"},"siteID":{"type":"apiKey","in":"header","name":"x-site-id","description":"The ID of the Siteglide site you are working with (not an API key — just the numeric site ID)"}}},"paths":{"/categories/{id}":{"get":{"tags":["Categories"],"summary":"Retrieve all data about an individual category","parameters":[{"name":"id","in":"path","required":true,"description":"The ID of the category","schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"401":{"description":"Unauthorized - Credentials Incorrect"},"403":{"description":"Forbidden - You cannot access this site"},"404":{"description":"Not Found - Case does not exist"},"422":{"description":"Unprocessable Entity - Required data missing or data invalid"}}}}}}
```

## PUT /categories/{id}

> Update a category

```json
{"openapi":"3.1.0","info":{"title":"Siteglide Site API","version":"2.0.0"},"servers":[{"url":"{siteUrl}/api/site/v2","variables":{"siteUrl":{"default":"https://www.my-site.com"}}}],"security":[{"apiKey":[],"siteID":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"x-api-key","description":"Your Siteglide API key"},"siteID":{"type":"apiKey","in":"header","name":"x-site-id","description":"The ID of the Siteglide site you are working with (not an API key — just the numeric site ID)"}}},"paths":{"/categories/{id}":{"put":{"tags":["Categories"],"summary":"Update a category","parameters":[{"name":"id","in":"path","required":true,"description":"The Category ID","schema":{"type":"string"}}],"requestBody":{"required":true,"description":"Your category custom fields as a JSON object","content":{"application/json":{"schema":{"type":"object","required":["name","enabled"],"properties":{"name":{"type":"string"},"slug":{"type":"string"},"enabled":{"type":"string"},"weighting":{"type":"string"},"meta_title":{"type":"string"},"meta_desc":{"type":"string"},"og_title":{"type":"string"},"og_desc":{"type":"string"},"og_image":{"type":"string"},"og_type":{"type":"string"},"twitter_type":{"type":"string"},"image_alt":{"type":"string"},"parent":{"type":"string"}}}}}},"responses":{"200":{"description":"OK"},"401":{"description":"Unauthorized - Credentials Incorrect"},"403":{"description":"Forbidden - You cannot access this site"},"422":{"description":"Unprocessable Entity - Required data missing or data invalid"}}}}}}
```

## POST /categories/create

> Create a category

```json
{"openapi":"3.1.0","info":{"title":"Siteglide Site API","version":"2.0.0"},"servers":[{"url":"{siteUrl}/api/site/v2","variables":{"siteUrl":{"default":"https://www.my-site.com"}}}],"security":[{"apiKey":[],"siteID":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"x-api-key","description":"Your Siteglide API key"},"siteID":{"type":"apiKey","in":"header","name":"x-site-id","description":"The ID of the Siteglide site you are working with (not an API key — just the numeric site ID)"}}},"paths":{"/categories/create":{"post":{"tags":["Categories"],"summary":"Create a category","requestBody":{"required":true,"description":"Your categories custom fields as a JSON object","content":{"application/json":{"schema":{"type":"object","required":["name","enabled"],"properties":{"name":{"type":"string"},"slug":{"type":"string"},"enabled":{"type":"string"},"weighting":{"type":"string"},"meta_title":{"type":"string"},"meta_desc":{"type":"string"},"og_title":{"type":"string"},"og_desc":{"type":"string"},"og_image":{"type":"string"},"og_type":{"type":"string"},"twitter_type":{"type":"string"},"image_alt":{"type":"string"},"parent":{"type":"string"}}}}}},"responses":{"200":{"description":"OK"},"401":{"description":"Unauthorized - Credentials Incorrect"},"403":{"description":"Forbidden - You cannot access this site"},"404":{"description":"Not Found - Case does not exist"},"422":{"description":"Unprocessable Entity - Required data missing or data invalid"}}}}}}
```
