Skip to main content

Taxonomy

Taxonomy endpoints manage tags and categories for organizing content. Categories support hierarchical nesting (parent/child). Both can be assigned to content items.

Endpoints

Tags

MethodPathPermissionDescription
GET/sites/{site_id}/tags?page&per_pageReadList tags for a site (paginated)
GET/tags/{id}ReadGet tag by ID
GET/tags/by-slug/{slug}ReadGet tag by slug
GET/content/{content_id}/tagsReadGet tags assigned to content
POST/tagsAuthorCreate a tag
PUT/tags/{id}AuthorUpdate a tag
DELETE/tags/{id}AuthorSoft delete a tag

Categories

MethodPathPermissionDescription
GET/sites/{site_id}/categories?page&per_pageReadList root categories (paginated)
GET/sites/{site_id}/categories/blog-countsReadGet categories with blog post counts
GET/categories/{id}ReadGet category by ID
GET/categories/{parent_id}/childrenReadGet child categories
GET/content/{content_id}/categoriesReadGet categories assigned to content
POST/categoriesAuthorCreate a category
PUT/categories/{id}AuthorUpdate a category
DELETE/categories/{id}AuthorSoft delete a category
POST/content/{content_id}/categoriesReadAssign a category to content
DELETE/content/{content_id}/categories/{category_id}ReadRemove a category from content

List Tags

curl -H "X-API-Key: oy_live_abc123..." \
"https://your-domain.com/api/v1/sites/{site_id}/tags?page=1&per_page=25"

Categories with Blog Counts

Returns categories with the number of published blog posts in each, useful for sidebar widgets:

curl -H "X-API-Key: oy_live_abc123..." \
https://your-domain.com/api/v1/sites/{site_id}/categories/blog-counts

Response 200 OK

[
{
"id": "cat-uuid",
"name": "Rust",
"slug": "rust",
"blog_count": 5
}
]

Assign a Category to Content

curl -X POST \
-H "X-API-Key: oy_live_abc123..." \
-H "Content-Type: application/json" \
-d '{
"category_id": "cat-uuid",
"is_primary": true
}' \
https://your-domain.com/api/v1/content/{content_id}/categories

Response 204 No Content