API Reference
Categories API
Get categories for a workspace
URL
https://contioreach.com/api/public/categoriesMethod
GETQuery Parameters
| Parameter | Type | Description |
|---|---|---|
idOptional | string | Filter categories by ID |
slugOptional | string | Filter categories by slug |
Authentication
API requests require authentication using an API key in one of two ways:
x-api-key header
Include your API key in the x-api-key header
headers: {
'x-api-key': 'YOUR_API_KEY'
}authorization header
Include your API key in the authorization header with format: Bearer YOUR_API_KEY
headers: {
'authorization': 'Bearer YOUR_API_KEY'
}Response
200Success
{
categories: [
{
id: string,
name: string,
slug: string,
description: string
}
]
}401Unauthorized
{
error: string // Authentication error message
}500Server Error
{
error: "Failed to fetch categories"
}Usage Examples
Fetch all categories
async function fetchCategories() {
const response = await fetch('https://contioreach.com/api/public/categories', {
headers: {
'x-api-key': 'YOUR_API_KEY'
}
});
return await response.json();
}Fetch category by slug
async function fetchCategoryBySlug(slug) {
const response = await fetch('https://contioreach.com/api/public/categories?slug=' + slug, {
headers: {
'x-api-key': 'YOUR_API_KEY'
}
});
return await response.json();
}