Complete guide to ZenBlog's public API endpoints for programmatic access to your blog content.
Most endpoints require API key authentication. Include your API key in the request headers:
Authorization: Bearer your-api-key-here
You can generate API keys from your dashboard.
/api/v1/blogs
Get all blogs for the authenticated user.
{
"blogs": [
{
"id": "string",
"name": "string",
"description": "string",
"subdomain": "string",
"customDomain": "string",
"isActive": boolean,
"createdAt": "timestamp",
"updatedAt": "timestamp"
}
],
"total": number
}
/api/v1/blogs/{blogId}/posts
Get all posts for a specific blog.
blogId
(path): The ID of the blogpage
(query, optional): Page number (default: 1)limit
(query, optional): Number of posts per page (default: 10, max: 100)published
(query, optional): Filter by publication status ("true" or "false"){
"posts": [
{
"id": "string",
"title": "string",
"slug": "string",
"excerpt": "string",
"status": "published|draft",
"publishedAt": "timestamp",
"createdAt": "timestamp",
"updatedAt": "timestamp",
"tags": ["string"]
}
],
"pagination": {
"page": number,
"limit": number,
"total": number,
"totalPages": number,
"hasNext": boolean,
"hasPrev": boolean
}
}
/api/v1/posts/{postId}
Get a specific post by ID.
postId
(path): The ID of the post{
"post": {
"id": "string",
"title": "string",
"slug": "string",
"content": "string",
"excerpt": "string",
"status": "published|draft",
"publishedAt": "timestamp",
"createdAt": "timestamp",
"updatedAt": "timestamp",
"tags": ["string"],
"blogId": "string",
"blog": {
"id": "string",
"name": "string",
"subdomain": "string",
"customDomain": "string"
}
}
}
/api/public/blogs/{subdomain}
Get public blog information by subdomain.
subdomain
(path): The subdomain of the blog/api/public/blogs/{subdomain}/posts
Get all published posts for a blog.
subdomain
(path): The subdomain of the blog/api/public/blogs/{subdomain}/posts/{slug}
Get a specific published post by slug.
subdomain
(path): The subdomain of the blogslug
(path): The slug of the postAll endpoints may return error responses in the following format:
{
"error": "Error message description"
}
400
- Bad Request401
- Unauthorized (invalid or missing API key)404
- Not Found500
- Internal Server Errorcurl -H "Authorization: Bearer your-api-key" \
https://yourdomain.com/api/v1/blogs
curl https://yourdomain.com/api/public/blogs/myblog/posts
curl -H "Authorization: Bearer your-api-key" \
"https://yourdomain.com/api/v1/blogs/blog-id/posts?page=2&limit=5&published=true"
API requests are subject to rate limiting. If you exceed the rate limit, you will receive a 429 Too Many Requests
response.