API Documentation
Everything you need to integrate Blog Api Service into your application. Fetch posts, categories, authors, and custom model data with simple REST API calls.
https://api.blogapiservice.com/api/v1/Introduction
The Blog Api Service API provides a simple and powerful way to manage your blog content programmatically. Use it to fetch, create, update, and delete posts, categories, authors, and custom model data with standard REST API calls.
Authentication
All API requests are authenticated using your project's API key. Include it in every request via the x-api-key header. The API key authenticates you as the project owner, granting full read and write access.
Required Header
Example Request
# Read: Fetch all postscurl -X GET "https://api.blogapiservice.com/api/v1//posts/project/my-blog/" \ -H "x-api-key: your-api-key" \ -H "Content-Type: application/json"# Write: Create a new post (same API key, no extra auth needed)curl -X POST "https://api.blogapiservice.com/api/v1//posts/" \ -H "x-api-key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"title": "My Post", "content": "<p>Hello!</p>", "project": 1}'Keep Your API Key Secret
Posts
8 endpointsFull CRUD operations for blog posts. Read endpoints return only published posts for public API requests. Authenticated members can filter by status.
Post Actions
3 endpointsSpecial action endpoints to manage the publish lifecycle of a post. All require API key authentication.
Categories
1 endpointEndpoint for fetching all categories in a project. Categories are managed via the dashboard.
Custom Models
5 endpointsCustom Models let you define your own content structures beyond posts, categories, and authors. Create any type of content — products, testimonials, portfolios, FAQs — and manage the data via the API.
Error Handling
ReferenceAll error responses follow a consistent format. The HTTP status code indicates the error category, and the response body provides details.
Error Response Format
// Validation error (400){ "success": false, "message": "Validation error", "errors": { "title": ["This field is required."], "project": ["This field is required."] }}// Authentication error (401){ "success": false, "message": "Authentication required for this action"}// Permission error (403){ "success": false, "message": "You don't have permission to modify data"}// Not found (404){ "success": false, "message": "Project not found or invalid API key"}// Plan limit exceeded (402){ "success": false, "message": "You have reached the maximum of 3 projects on your current plan. Please upgrade to create more projects."}Rate Limiting
ReferenceAPI calls are tracked per project and count toward your monthly plan limit. Only successful responses (2xx status codes) are counted.
Check Your Usage
GET /usage/ endpoint.Data Export
1 endpointExport all your project data as a JSON snapshot. Useful for backups or before cancelling a subscription.
MCP Server
AI IntegrationThe BlogAPIService MCP (Model Context Protocol) server lets AI assistants like Claude, Cursor, and Windsurf manage your blog content through natural language. Create posts, manage authors and categories, and work with custom models — all via your AI tool of choice.
What is MCP?
How It Works
BlogAPIService hosts a remote MCP server — no local installation required. Connect your AI tool using the server URL and your project API key as a Bearer token in the Authorization header.
https://api.blogapiservice.com/mcp/mcpAuthentication: Pass your project API key as a Bearer token in the Authorization header. The key is set once per session — every tool call authenticates automatically.
Configuration
Claude Desktop
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{ "mcpServers": { "blogapiservice": { "url": "https://api.blogapiservice.com/mcp/mcp", "headers": { "Authorization": "Bearer your-project-api-key" } } }}Claude Code
claude mcp add blogapiservice --transport http https://api.blogapiservice.com/mcp/mcp --header "Authorization: Bearer your-project-api-key"Or add to .mcp.json in your project root (shared with your team), or ~/.claude.json for user-scope (auto-trusted, no approval prompt):
{ "mcpServers": { "blogapiservice": { "type": "http", "url": "https://api.blogapiservice.com/mcp/mcp", "headers": { "Authorization": "Bearer your-project-api-key" } } }}Cursor
Add to .cursor/mcp.json in your project:
{ "mcpServers": { "blogapiservice": { "url": "https://api.blogapiservice.com/mcp/mcp", "headers": { "Authorization": "Bearer your-project-api-key" } } }}VS Code
Add to .vscode/mcp.json in your project:
{ "servers": { "blogapiservice": { "type": "http", "url": "https://api.blogapiservice.com/mcp/mcp", "headers": { "Authorization": "Bearer your-project-api-key" } } }}Available Tools
The MCP server exposes 21 tools organized by resource type:
Usage Examples
Once configured, interact with your blog through natural language in your AI assistant:
Requirements
Playground
InteractiveThe Playground is an interactive API tester built into the Blog Api Service dashboard. Use it to explore your endpoints, test queries, and preview JSON responses — all without writing any code.
How to Access
Response Types
TypeScriptTypeScript interfaces for all API responses. Use these to add type safety to your application.
Type Safety
ApiResponse
The wrapper type for all API responses
// Base API Responseinterface ApiResponse<T> { success: boolean; message: string; data: T; meta: { pagination: Pagination; };}Pagination
Pagination information included in list responses
// Paginationinterface Pagination { current_page: number; per_page: number; total_pages: number; total_count: number; has_next: boolean; has_previous: boolean; next_page: string | null; previous_page: string | null;}Post
The structure of a blog post
// Postinterface Post { id: number; title: string; slug: string; content: string; description: string; image: string | null; project: number; category: number; category_details: { id: number; name: string; slug: string; project: number; custom_fields: Record<string, unknown>; created_at: string; }; author: number; author_details: { id: number; name: string; slug: string; bio: string | null; profile_picture: string | null; project: number; }; meta_title: string; meta_description: string; meta_keywords: string; canonical_url: string; custom_fields: Record<string, unknown>; status: "draft" | "published" | "unpublished" | "scheduled"; status_display: string; published_at: string | null; scheduled_at: string | null; created_at: string; updated_at: string;}Category
The structure of a category
// Categoryinterface Category { id: number; name: string; slug: string; project: number; custom_fields: Record<string, unknown>; custom_fields_schema: unknown[]; created_at: string;}Author
The structure of an author
// Authorinterface Author { id: number; name: string; slug: string; project: number; bio: string | null; profile_picture: string | null; description: string | null; facebook_url: string | null; instagram_url: string | null; github_url: string | null; x_url: string | null; custom_fields: Record<string, unknown>; custom_fields_schema: unknown[]; created_at: string;}CustomModelInstance
The structure of a custom model instance
// Custom Model Instanceinterface CustomModelInstance { id: number; custom_model: number; model_name: string; model_slug: string; project: number; slug: string; data: Record<string, unknown>; relationships: Record<string, unknown>; relationships_expanded: Record<string, unknown>; created_at: string; updated_at: string;}ErrorResponse
The structure of an error response
// Error Responseinterface ErrorResponse { success: false; message: string; errors?: Record<string, string[]>;}Code Examples
Multiple LanguagesReady-to-use code examples in popular programming languages.
Fetching Posts (Read)
// Fetch posts from your projectconst response = await fetch( "https://api.blogapiservice.com/api/v1//posts/project/my-blog/", { headers: { "x-api-key": "your-api-key", "Content-Type": "application/json" } });const data = await response.json();// Access your postsdata.data.forEach(post => { console.log(post.title); console.log(post.slug);});Creating a Post (Write)
// Create a new post (API key authenticates as project owner)const response = await fetch( "https://api.blogapiservice.com/api/v1//posts/", { method: "POST", headers: { "x-api-key": "your-api-key", "Content-Type": "application/json" }, body: JSON.stringify({ title: "My New Post", content: "<p>Hello world!</p>", description: "A short summary", project: 1, category: 2, author: 1, status: "draft" }) });const data = await response.json();console.log(data.data.slug); // "my-new-post"Custom Model CRUD
// Create a custom model instanceconst response = await fetch( "https://api.blogapiservice.com/api/v1//custom/my-blog/products/", { method: "POST", headers: { "x-api-key": "your-api-key", "Content-Type": "application/json" }, body: JSON.stringify({ data: { name: "Premium Widget", price: 29.99, description: "A high-quality widget" } }) });const result = await response.json();console.log(result.data.slug); // "premium-widget"// Update the instanceconst updateRes = await fetch( "https://api.blogapiservice.com/api/v1//custom/my-blog/products/premium-widget/", { method: "PATCH", headers: { "x-api-key": "your-api-key", "Content-Type": "application/json" }, body: JSON.stringify({ data: { price: 24.99 } }) });// Delete the instanceawait fetch( "https://api.blogapiservice.com/api/v1//custom/my-blog/products/premium-widget/", { method: "DELETE", headers: { "x-api-key": "your-api-key" } });