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-hereYou can generate API keys from your dashboard.
https://api.zenblog.ai/v1/blogsGet 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
}https://api.zenblog.ai/v1/blogs/{blogId}/postsGet 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
}
}https://api.zenblog.ai/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"
}
}
}https://api.zenblog.ai/public/blogs/{subdomain}Get public blog information by subdomain.
subdomain (path): The subdomain of the bloghttps://api.zenblog.ai/public/blogs/{subdomain}/postsGet all published posts for a blog.
subdomain (path): The subdomain of the bloghttps://api.zenblog.ai/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://api.zenblog.ai/v1/blogscurl https://api.zenblog.ai/public/blogs/myblog/postscurl -H "Authorization: Bearer your-api-key" \
"https://api.zenblog.ai/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.