Skip to content

List blog categories

GET
/stores/{storeRef}/blog/categories
curl --request GET \
--url 'https://apibase.ecomweb.app/api/v1/stores/example/blog/categories?sort_order=asc&filters=%5B%7B%22field%22%3A%22post_count%22%2C%22operator%22%3A%22lte%22%2C%22values%22%3A%5B%220%22%5D%7D%5D' \
--header 'x-api-key: <x-api-key>'

Returns the store’s blog categories with the number of posts in each, ordered by sort_order by default. Search by name or slug, sort, or pass filters for list-view filters. Paginated with limit (default 20) and offset.

Required scopes: read:blog

storeRef
required
string

The store’s ref, as returned by GET /stores.

search
string

Free-text search over name and slug.

sort_by
string

Field to sort by: name, slug, sort_order, created_at, updated_at or post_count. Defaults to sort_order.

sort_order
string
Allowed values: asc desc

Sort direction.

limit
number
>= 1

Maximum number of items to return, at least 1. Defaults to 20 on the store list.

offset
number

Number of items to skip. Defaults to 0.

include_post_counts
boolean

Include each item’s post_count. The store list always includes it.

filters
string

Example

[{"field":"post_count","operator":"lte","values":["0"]}]

Admin list-view filters, a JSON array of {field, operator, values}. At most 10 clauses, at most 50 values each.

Media typeapplication/json
object
data
required
Array<object>
object
description

Description, or null.

string
nullable
color

Hex colour such as #ff6600, or null.

string
nullable
sort_order

Manual position in the category list; lower comes first.

number
nullable
id
required

Category ID.

number
name
required

Display name.

string
slug
required

URL slug, unique within the store.

string
post_count

Number of posts in the category. Present when post counts are included; always present on the paginated list.

number
created_at

When the category was created, as an ISO 8601 timestamp.

string
nullable
updated_at

When the category was last updated, as an ISO 8601 timestamp.

string
nullable
meta
required
object
total
required

Total number of items matching the request.

number
limit
required

Maximum number of items in this page.

number
offset
required

Number of items skipped before this page.

number
page
required

Current page number, starting at 1.

number
totalPages
required

Total number of pages.

number
hasNext
required

Whether a next page exists.

boolean
hasPrev
required

Whether a previous page exists.

boolean

Example generated

{
"data": [
{
"description": "example",
"color": "example",
"sort_order": 1,
"id": 1,
"name": "example",
"slug": "example",
"post_count": 1,
"created_at": "example",
"updated_at": "example"
}
],
"meta": {
"total": 1,
"limit": 1,
"offset": 1,
"page": 1,
"totalPages": 1,
"hasNext": true,
"hasPrev": true
}
}

The request is malformed or failed validation.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The key is missing, invalid, revoked or expired.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The key may not do this: a missing scope, a readonly key, a publishable key on a Store API route, or a disallowed origin.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}