Skip to main content
The Posts API provides endpoints to list, retrieve, and navigate through blog posts in your Halo CMS.

List Posts

Retrieves a paginated list of published posts.
curl -X GET "http://localhost:8091/apis/api.content.halo.run/v1alpha1/posts?page=0&size=10" \
  -H "Accept: application/json"

Query Parameters

page
integer
default:"0"
Page number. Default is 0.
size
integer
default:"0"
Size number. Default is 0.
labelSelector
array
Label selector. e.g.: hidden!=true
fieldSelector
array
Field selector. e.g.: metadata.name==halo
sort
array
Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.

Response

Returns a ListedPostVoList object containing paginated post results.
items
array
Array of post objects.
metadata
Metadata
required
Post metadata including name, labels, and timestamps.
spec
PostSpec
Post specification.
title
string
required
Post title.
slug
string
required
Post slug for URL.
cover
string
Cover image URL.
allowComment
boolean
default:"true"
Whether comments are allowed.
pinned
boolean
default:"false"
Whether the post is pinned.
priority
integer
default:"0"
Post priority for ordering.
visible
string
default:"PUBLIC"
Visibility setting: PUBLIC, INTERNAL, or PRIVATE.
publishTime
string
Publication timestamp.
status
PostStatus
Post status information.
Permanent link to the post.
excerpt
string
Post excerpt.
commentsCount
integer
Number of comments.
stats
StatsVo
Post statistics.
visit
integer
Number of visits.
upvote
integer
Number of upvotes.
comment
integer
Number of comments.
categories
array
Array of category objects associated with the post.
tags
array
Array of tag objects associated with the post.
owner
ContributorVo
Post owner information.
contributors
array
Array of contributor objects.
page
integer
Current page number, starts from 1.
size
integer
Size of each page.
total
integer
Total number of posts.
totalPages
integer
Total number of pages.
first
boolean
Whether this is the first page.
last
boolean
Whether this is the last page.
hasNext
boolean
Whether there is a next page.
hasPrevious
boolean
Whether there is a previous page.

Get Post by Name

Retrieves a single post by its name.
curl -X GET "http://localhost:8091/apis/api.content.halo.run/v1alpha1/posts/{name}" \
  -H "Accept: application/json"

Path Parameters

name
string
required
Post name (unique identifier).

Response

Returns a PostVo object with complete post details including content.
metadata
Metadata
required
Post metadata.
spec
PostSpec
Post specification.
status
PostStatus
Post status.
content
ContentVo
Post content.
raw
string
Raw content (markdown/HTML).
content
string
Rendered content.
stats
StatsVo
Post statistics.
categories
array
Associated categories.
tags
array
Associated tags.
owner
ContributorVo
Post owner.
contributors
array
Post contributors.

Get Post Navigation

Retrieves the previous and next posts for navigation.
curl -X GET "http://localhost:8091/apis/api.content.halo.run/v1alpha1/posts/{name}/navigation" \
  -H "Accept: application/json"

Path Parameters

name
string
required
Post name (unique identifier).

Response

Returns a NavigationPostVo object.
previous
ListedPostVo
Previous post in the sequence.
next
ListedPostVo
Next post in the sequence.

Build docs developers (and LLMs) love