Documentation

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.

Base URL:
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.

Quick Overview
REST
Standard HTTP Methods
JSON
Response Format
API Key
Authentication

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.

Getting Your API Key
  1. Log in to your Blog Api Service dashboard
  2. Create a new project or select an existing one
  3. Navigate to Project Settings
  4. Copy your API key from the API section

Example Request

request.sh
# Read: Fetch all posts
curl -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}'

Authorization & Roles

When you authenticate with an API key, you operate as the project owner with full access to all CRUD operations. The dashboard also supports team collaboration with role-based access:

Owner

Full access. Can delete the project, manage members, and perform all operations.

Admin

Can manage members, create/edit/delete all content, and manage settings.

Editor

Can create, edit, and manage posts, categories, authors, and custom model instances.

Viewer

Read-only access. Can view content but cannot create, update, or delete.

Posts

8 endpoints

Full CRUD operations for blog posts. Read endpoints return only published posts for public API requests. Authenticated members can filter by status.

GET/posts/project/{project-slug}/
Retrieve all published posts for a project. Results are paginated.

Path Parameters

NameTypeRequiredDescription
project-slugstringRequiredThe unique slug of your project

Query Parameters

NameTypeRequiredDescription
pagenumberOptionalPage number for pagination (default: 1)
per_pagenumberOptionalNumber of posts per page (default: 10, max: 100)
statusstringOptionalFilter by status: draft, published, unpublished, scheduled (authenticated only)

Example Response

response.json
{
"success": true,
"message": "Posts retrieved successfully",
"data": [
{
"id": 1,
"title": "Getting Started with Blog Api Service",
"slug": "getting-started-with-blog-api-service",
"content": "<p>Welcome to Blog Api Service...</p>",
"description": "Learn how to use Blog Api Service",
"image": "https://example.com/image.jpg",
"category": 1,
"category_details": {
"id": 1,
"name": "Tutorials",
"slug": "tutorials"
},
"author": 1,
"author_details": {
"id": 1,
"name": "John Doe",
"slug": "john-doe"
},
"status": "published",
"status_display": "Published",
"published_at": "2025-01-15T10:30:00Z",
"created_at": "2025-01-15T10:30:00Z",
"updated_at": "2025-01-15T10:30:00Z"
}
],
"meta": {
"pagination": {
"current_page": 1,
"per_page": 10,
"total_pages": 3,
"total_count": 25,
"has_next": true,
"has_previous": false,
"next_page": "/posts/project/my-blog/?page=2",
"previous_page": null
}
}
}
GET/posts/{slug}/
Retrieve a single post by its slug.

Path Parameters

NameTypeRequiredDescription
slugstringRequiredThe unique slug of the post

Example Response

response.json
{
"success": true,
"message": "Post retrieved successfully",
"data": {
"id": 1,
"title": "Getting Started with Blog Api Service",
"slug": "getting-started-with-blog-api-service",
"content": "<p>Welcome to Blog Api Service...</p>",
"description": "Learn how to use Blog Api Service",
"image": "https://example.com/image.jpg",
"project": 1,
"category": 1,
"category_details": {
"id": 1,
"name": "Tutorials",
"slug": "tutorials",
"project": 1,
"custom_fields": {},
"created_at": "2025-01-10T09:00:00Z"
},
"author": 1,
"author_details": {
"id": 1,
"name": "John Doe",
"slug": "john-doe",
"bio": "Senior developer and technical writer",
"profile_picture": "https://example.com/john.jpg",
"project": 1
},
"meta_title": "Getting Started | Blog Api Service",
"meta_description": "Learn how to use Blog Api Service",
"meta_keywords": "blog-api-service, tutorial, getting started",
"canonical_url": "https://myblog.com/getting-started",
"custom_fields": {},
"status": "published",
"status_display": "Published",
"published_at": "2025-01-15T10:30:00Z",
"scheduled_at": null,
"created_at": "2025-01-15T10:30:00Z",
"updated_at": "2025-01-15T10:30:00Z"
}
}
GET/posts/project/{project-slug}/category/{category-slug}/
Retrieve posts filtered by category.

Path Parameters

NameTypeRequiredDescription
project-slugstringRequiredThe unique slug of your project
category-slugstringRequiredThe unique slug of the category

Query Parameters

NameTypeRequiredDescription
pagenumberOptionalPage number for pagination (default: 1)

Example Response

response.json
{
"success": true,
"message": "Posts retrieved successfully",
"data": [
{
"id": 2,
"title": "Advanced Blog Api Service Features",
"slug": "advanced-blog-api-service-features",
"content": "<p>Discover advanced features...</p>",
"description": "Explore advanced features",
"image": null,
"category": 2,
"category_details": {
"id": 2,
"name": "News",
"slug": "news"
},
"author": 1,
"author_details": {
"id": 1,
"name": "John Doe",
"slug": "john-doe"
},
"status": "published",
"published_at": "2025-01-16T14:00:00Z",
"created_at": "2025-01-16T14:00:00Z",
"updated_at": "2025-01-16T14:00:00Z"
}
],
"meta": {
"pagination": {
"current_page": 1,
"per_page": 10,
"total_pages": 1,
"total_count": 5,
"has_next": false,
"has_previous": false,
"next_page": null,
"previous_page": null
}
}
}
GET/posts/project/{project-slug}/author/{author-slug}/
Retrieve posts filtered by author.

Path Parameters

NameTypeRequiredDescription
project-slugstringRequiredThe unique slug of your project
author-slugstringRequiredThe unique slug of the author

Query Parameters

NameTypeRequiredDescription
pagenumberOptionalPage number for pagination (default: 1)

Example Response

response.json
{
"success": true,
"message": "Posts retrieved successfully",
"data": [
{
"id": 3,
"title": "Post by Jane",
"slug": "post-by-jane",
"content": "<p>Content here...</p>",
"description": "A post by Jane Smith",
"author": 2,
"author_details": {
"id": 2,
"name": "Jane Smith",
"slug": "jane-smith"
},
"status": "published",
"published_at": "2025-02-01T09:00:00Z",
"created_at": "2025-02-01T09:00:00Z",
"updated_at": "2025-02-01T09:00:00Z"
}
],
"meta": {
"pagination": {
"current_page": 1,
"per_page": 10,
"total_pages": 1,
"total_count": 1,
"has_next": false,
"has_previous": false,
"next_page": null,
"previous_page": null
}
}
}
POST/posts/
Create a new blog post. Requires API key authentication.

Request Body

NameTypeRequiredDescription
titlestringRequiredThe title of the post
contentstringRequiredHTML content of the post
descriptionstringOptionalShort description / excerpt
projectnumberRequiredThe project ID this post belongs to
categorynumberOptionalCategory ID for the post
authornumberOptionalAuthor ID for the post
imagefileOptionalFeatured image (multipart/form-data upload)
statusstringOptionalPost status: "draft" (default), "published", "scheduled"
scheduled_atstring (ISO 8601)OptionalRequired if status is "scheduled". Must be a future date.
meta_titlestringOptionalSEO meta title
meta_descriptionstringOptionalSEO meta description
meta_keywordsstringOptionalSEO meta keywords (comma-separated)
canonical_urlstringOptionalCanonical URL for SEO
custom_fieldsobjectOptionalCustom field values (must match project custom field definitions)

Example Request

request.json
{
"title": "My First Blog Post",
"content": "<h2>Hello World</h2><p>This is my first post.</p>",
"description": "A brief introduction to my blog",
"project": 1,
"category": 2,
"author": 1,
"status": "draft",
"meta_title": "My First Blog Post | My Blog",
"meta_description": "A brief introduction to my blog",
"meta_keywords": "blog, introduction, first post",
"custom_fields": {
"reading_time": "5 min",
"featured": true
}
}
The slug is auto-generated from the title. If a slug already exists, a random suffix is appended.

Example Response

response.json
{
"success": true,
"message": "Post created successfully",
"data": {
"id": 10,
"title": "My First Blog Post",
"slug": "my-first-blog-post",
"content": "<h2>Hello World</h2><p>This is my first post.</p>",
"description": "A brief introduction to my blog",
"image": null,
"project": 1,
"category": 2,
"category_details": {
"id": 2,
"name": "Tutorials",
"slug": "tutorials"
},
"author": 1,
"author_details": {
"id": 1,
"name": "John Doe",
"slug": "john-doe"
},
"meta_title": "My First Blog Post | My Blog",
"meta_description": "A brief introduction to my blog",
"meta_keywords": "blog, introduction, first post",
"canonical_url": "",
"custom_fields": {
"reading_time": "5 min",
"featured": true
},
"status": "draft",
"status_display": "Draft",
"published_at": null,
"scheduled_at": null,
"created_at": "2025-03-20T10:00:00Z",
"updated_at": "2025-03-20T10:00:00Z"
}
}
PUT/posts/{slug}/
Fully update an existing post. Requires all writable fields. Requires API key authentication.

Path Parameters

NameTypeRequiredDescription
slugstringRequiredThe slug of the post to update

Request Body

NameTypeRequiredDescription
titlestringRequiredThe title of the post
contentstringRequiredHTML content of the post
projectnumberRequiredThe project ID
categorynumberOptionalCategory ID
authornumberOptionalAuthor ID
statusstringOptionalPost status: "draft", "published", "scheduled"

Example Request

request.json
{
"title": "Updated Blog Post Title",
"content": "<p>Updated content here.</p>",
"description": "Updated description",
"project": 1,
"category": 2,
"author": 1,
"status": "published"
}

Example Response

response.json
{
"success": true,
"message": "Post updated successfully",
"data": {
"id": 10,
"title": "Updated Blog Post Title",
"slug": "my-first-blog-post",
"content": "<p>Updated content here.</p>",
"description": "Updated description",
"status": "published",
"status_display": "Published",
"published_at": "2025-03-20T12:00:00Z",
"updated_at": "2025-03-20T12:00:00Z"
}
}
PATCH/posts/{slug}/
Partially update a post. Only send the fields you want to change. Requires API key authentication.

Path Parameters

NameTypeRequiredDescription
slugstringRequiredThe slug of the post to update

Request Body

NameTypeRequiredDescription
titlestringOptionalUpdated title
contentstringOptionalUpdated HTML content
descriptionstringOptionalUpdated description
statusstringOptionalChange status: "draft", "published", "scheduled"
categorynumberOptionalUpdated category ID
meta_titlestringOptionalUpdated SEO title
custom_fieldsobjectOptionalUpdated custom field values

Example Request

request.json
{
"title": "Updated Title Only",
"meta_description": "Better SEO description"
}

Example Response

response.json
{
"success": true,
"message": "Post updated successfully",
"data": {
"id": 10,
"title": "Updated Title Only",
"slug": "my-first-blog-post",
"meta_description": "Better SEO description",
"status": "draft",
"updated_at": "2025-03-20T13:00:00Z"
}
}
DELETE/posts/{slug}/
Permanently delete a post. Requires API key authentication.

Path Parameters

NameTypeRequiredDescription
slugstringRequiredThe slug of the post to delete
This action is irreversible. The post and its associated data will be permanently removed.

Example Response

response.json
{
"success": true,
"message": "Post deleted successfully"
}

Post Actions

3 endpoints

Special action endpoints to manage the publish lifecycle of a post. All require API key authentication.

POST/posts/{slug}/publish/
Publish a post immediately. Sets the status to 'published' and records the published_at timestamp.

Path Parameters

NameTypeRequiredDescription
slugstringRequiredThe slug of the post to publish

Example Response

response.json
{
"success": true,
"message": "Post published successfully",
"data": {
"id": 10,
"title": "My First Blog Post",
"slug": "my-first-blog-post",
"status": "published",
"status_display": "Published",
"published_at": "2025-03-20T14:00:00Z",
"updated_at": "2025-03-20T14:00:00Z"
}
}
POST/posts/{slug}/unpublish/
Unpublish a published post. Sets the status to 'unpublished'. The post will no longer appear in public API responses.

Path Parameters

NameTypeRequiredDescription
slugstringRequiredThe slug of the post to unpublish

Example Response

response.json
{
"success": true,
"message": "Post unpublished successfully",
"data": {
"id": 10,
"title": "My First Blog Post",
"slug": "my-first-blog-post",
"status": "unpublished",
"status_display": "Unpublished",
"updated_at": "2025-03-20T15:00:00Z"
}
}
POST/posts/{slug}/schedule/
Schedule a post for future publication. The post will be automatically published at the specified time.

Path Parameters

NameTypeRequiredDescription
slugstringRequiredThe slug of the post to schedule

Request Body

NameTypeRequiredDescription
scheduled_atstring (ISO 8601)RequiredFuture date/time when the post should be published (e.g., 2026-02-01T10:00:00Z)

Example Request

request.json
{
"scheduled_at": "2026-02-01T10:00:00Z"
}
The scheduled_at time must be in the future. Use ISO 8601 format.

Example Response

response.json
{
"success": true,
"message": "Post scheduled for 2026-02-01T10:00:00+00:00",
"data": {
"id": 10,
"title": "My First Blog Post",
"slug": "my-first-blog-post",
"status": "scheduled",
"status_display": "Scheduled",
"scheduled_at": "2026-02-01T10:00:00Z",
"updated_at": "2025-03-20T15:30:00Z"
}
}

Categories

1 endpoint

Endpoint for fetching all categories in a project. Categories are managed via the dashboard.

GET/project-data/{project-slug}/categories/
Retrieve all categories for a project.

Path Parameters

NameTypeRequiredDescription
project-slugstringRequiredThe unique slug of your project

Query Parameters

NameTypeRequiredDescription
pagenumberOptionalPage number for pagination (default: 1)
per_pagenumberOptionalItems per page (default: 10, max: 100)

Example Response

response.json
{
"success": true,
"message": "Categories retrieved successfully",
"data": [
{
"id": 1,
"name": "Tutorials",
"slug": "tutorials",
"project": 1,
"custom_fields": {},
"custom_fields_schema": [],
"created_at": "2025-01-10T09:00:00Z"
},
{
"id": 2,
"name": "News",
"slug": "news",
"project": 1,
"custom_fields": {},
"custom_fields_schema": [],
"created_at": "2025-01-10T09:05:00Z"
}
],
"meta": {
"pagination": {
"current_page": 1,
"per_page": 10,
"total_pages": 1,
"total_count": 2,
"has_next": false,
"has_previous": false,
"next_page": null,
"previous_page": null
}
}
}

Authors

1 endpoint

Endpoint for fetching all authors in a project. Authors are managed via the dashboard.

GET/project-data/{project-slug}/authors/
Retrieve all authors for a project.

Path Parameters

NameTypeRequiredDescription
project-slugstringRequiredThe unique slug of your project

Query Parameters

NameTypeRequiredDescription
pagenumberOptionalPage number for pagination (default: 1)
per_pagenumberOptionalItems per page (default: 10, max: 100)

Example Response

response.json
{
"success": true,
"message": "Authors retrieved successfully",
"data": [
{
"id": 1,
"name": "John Doe",
"slug": "john-doe",
"project": 1,
"bio": "Senior developer and technical writer",
"description": null,
"profile_picture": "https://example.com/john.jpg",
"facebook_url": null,
"instagram_url": null,
"github_url": "https://github.com/johndoe",
"x_url": "https://x.com/johndoe",
"custom_fields": {},
"custom_fields_schema": [],
"created_at": "2025-01-10T08:00:00Z"
}
],
"meta": {
"pagination": {
"current_page": 1,
"per_page": 10,
"total_pages": 1,
"total_count": 1,
"has_next": false,
"has_previous": false,
"next_page": null,
"previous_page": null
}
}
}

Custom Models

5 endpoints

Custom 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.

How It Works
  1. Create a Custom Model — Go to your dashboard and create a new model (e.g. "Photos"). This defines the content type and generates a slug like photos.
  2. Add Custom Fields — Define the fields for your model (e.g. title, image_url, description, location). These become the data shape for every instance.
  3. Create Instances — Fill in the form to add entries to your model, or use the POST endpoint below.
  4. Full CRUD via API — List, get, create, update, and delete instances using the endpoints below.
GET/custom/{project-slug}/{model-slug}/
Retrieve all instances for a custom model. Supports pagination and filtering.

Path Parameters

NameTypeRequiredDescription
project-slugstringRequiredThe unique slug of your project
model-slugstringRequiredThe slug of your custom model (e.g. photos, products, testimonials)

Query Parameters

NameTypeRequiredDescription
pagenumberOptionalPage number for pagination (default: 1)
per_pagenumberOptionalNumber of instances per page (default: 10, max: 100)
filter[field_name]stringOptionalFilter by any data field value (e.g. ?filter[location]=Malibu)

Example Response

response.json
{
"success": true,
"message": "Photos retrieved successfully",
"data": [
{
"id": 1,
"slug": "sunset-at-the-beach",
"model_name": "Photos",
"data": {
"title": "Sunset at the Beach",
"image_url": "https://example.com/sunset.jpg",
"description": "A beautiful sunset captured at Malibu",
"location": "Malibu, CA"
},
"relationships": {},
"relationships_expanded": {},
"created_at": "2025-03-05T12:00:00Z",
"updated_at": "2025-03-05T12:00:00Z"
}
],
"meta": {
"model": {
"name": "Photo",
"slug": "photos",
"plural_name": "Photos"
},
"pagination": {
"current_page": 1,
"per_page": 10,
"total_pages": 2,
"total_count": 12,
"has_next": true,
"has_previous": false,
"next_page": 2,
"previous_page": null
}
}
}
GET/custom/{project-slug}/{model-slug}/{instance-slug}/
Retrieve a single custom model instance by its slug.

Path Parameters

NameTypeRequiredDescription
project-slugstringRequiredThe unique slug of your project
model-slugstringRequiredThe slug of your custom model
instance-slugstringRequiredThe slug of the instance

Example Response

response.json
{
"success": true,
"message": "Instance retrieved successfully",
"data": {
"id": 1,
"custom_model": 1,
"model_name": "Photo",
"model_slug": "photos",
"project": 1,
"slug": "sunset-at-the-beach",
"data": {
"title": "Sunset at the Beach",
"image_url": "https://example.com/sunset.jpg",
"description": "A beautiful sunset captured at Malibu",
"location": "Malibu, CA"
},
"relationships": {},
"relationships_expanded": {},
"created_at": "2025-03-05T12:00:00Z",
"updated_at": "2025-03-05T12:00:00Z",
"created_by": 1
}
}
POST/custom/{project-slug}/{model-slug}/
Create a new custom model instance. Requires API key authentication. Field values are validated against the model's field definitions.

Path Parameters

NameTypeRequiredDescription
project-slugstringRequiredThe unique slug of your project
model-slugstringRequiredThe slug of your custom model

Request Body

NameTypeRequiredDescription
dataobjectRequiredKey-value pairs matching the custom model's field definitions
relationshipsobjectOptionalRelationship field values (references to other model instances by UUID)

Example Request

request.json
{
"data": {
"title": "Mountain Sunrise",
"image_url": "https://example.com/sunrise.jpg",
"description": "Early morning in the Rockies",
"location": "Colorado, USA"
},
"relationships": {}
}
The slug is auto-generated from the first text field or the instance data. Field values are validated against the model's field definitions (type, required, etc.).

Example Response

response.json
{
"success": true,
"message": "Photo created successfully",
"data": {
"id": 2,
"custom_model": 1,
"model_name": "Photo",
"model_slug": "photos",
"project": 1,
"slug": "mountain-sunrise",
"data": {
"title": "Mountain Sunrise",
"image_url": "https://example.com/sunrise.jpg",
"description": "Early morning in the Rockies",
"location": "Colorado, USA"
},
"relationships": {},
"relationships_expanded": {},
"created_at": "2025-03-20T10:00:00Z",
"updated_at": "2025-03-20T10:00:00Z",
"created_by": 1
}
}
PATCH/custom/{project-slug}/{model-slug}/{instance-slug}/
Partially update a custom model instance. Only send the fields you want to change. Requires API key authentication.

Path Parameters

NameTypeRequiredDescription
project-slugstringRequiredThe unique slug of your project
model-slugstringRequiredThe slug of your custom model
instance-slugstringRequiredThe slug of the instance to update

Request Body

NameTypeRequiredDescription
dataobjectOptionalUpdated key-value pairs for data fields
relationshipsobjectOptionalUpdated relationship field values

Example Request

request.json
{
"data": {
"location": "Rocky Mountains, CO"
}
}

Example Response

response.json
{
"success": true,
"message": "Photo updated successfully",
"data": {
"id": 2,
"custom_model": 1,
"model_name": "Photo",
"model_slug": "photos",
"project": 1,
"slug": "mountain-sunrise",
"data": {
"title": "Mountain Sunrise",
"image_url": "https://example.com/sunrise.jpg",
"description": "Early morning in the Rockies",
"location": "Rocky Mountains, CO"
},
"relationships": {},
"relationships_expanded": {},
"created_at": "2025-03-20T10:00:00Z",
"updated_at": "2025-03-20T11:00:00Z",
"created_by": 1
}
}
DELETE/custom/{project-slug}/{model-slug}/{instance-slug}/
Delete a custom model instance. Requires API key authentication.

Path Parameters

NameTypeRequiredDescription
project-slugstringRequiredThe unique slug of your project
model-slugstringRequiredThe slug of your custom model
instance-slugstringRequiredThe slug of the instance to delete
This action is irreversible. The instance will be permanently removed.

Example Response

response.json
{
"success": true,
"message": "Photo deleted successfully",
"data": {
"deleted": "mountain-sunrise"
}
}

Error Handling

Reference

All error responses follow a consistent format. The HTTP status code indicates the error category, and the response body provides details.

400 Bad Request

Invalid request body or missing required fields

401 Unauthorized

Missing or invalid authentication credentials

402 Payment Required

Plan limit reached (upgrade required)

403 Forbidden

Insufficient permissions for this action

404 Not Found

Resource not found or API key doesn't match

429 Too Many Requests

API rate limit exceeded for your plan

Error Response Format

errors.json
// 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

Reference

API calls are tracked per project and count toward your monthly plan limit. Only successful responses (2xx status codes) are counted.

How It Works
  • 1.Each successful API call increments your daily usage counter
  • 2.At 80% of your monthly limit, you'll receive a warning email
  • 3.At 100%, API calls are blocked until the next billing cycle
  • 4.Upgrade your plan to increase or remove the limit

Data Export

1 endpoint

Export all your project data as a JSON snapshot. Useful for backups or before cancelling a subscription.

GET/subscriptions/export_data/
Export all user data including projects, posts, authors, categories, and media files as a JSON snapshot. Requires authentication.
This endpoint requires JWT authentication (login to the dashboard). The export includes metadata for all your projects.

Example Response

response.json
{
"success": true,
"message": "Data export generated successfully",
"data": {
"exported_at": "2026-03-21T10:00:00Z",
"user": {
"email": "you@example.com",
"date_joined": "2025-01-01T00:00:00Z"
},
"projects": [
{
"id": 1,
"title": "My Blog",
"slug": "my-blog",
"description": "My personal blog",
"created_at": "2025-01-01T00:00:00Z",
"is_locked": false,
"posts": [
{
"id": 1,
"title": "First Post",
"slug": "first-post",
"status": "published",
"published_at": "2025-01-15T10:00:00Z",
"created_at": "2025-01-15T09:00:00Z"
}
],
"authors": [
{
"id": 1,
"name": "John Doe",
"slug": "john-doe",
"created_at": "2025-01-01T00:00:00Z"
}
],
"categories": [
{
"id": 1,
"name": "Tutorials",
"slug": "tutorials",
"created_at": "2025-01-01T00:00:00Z"
}
],
"media_files": [
{
"id": "a1b2c3d4-...",
"original_filename": "hero.jpg",
"file_size": 245000,
"mime_type": "image/jpeg",
"file_type": "image",
"created_at": "2025-01-15T09:30:00Z"
}
]
}
]
}
}

MCP Server

AI Integration

The 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.

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.

MCP Server URL
https://api.blogapiservice.com/mcp/mcp

Authentication: 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):

claude_desktop_config.json
{
"mcpServers": {
"blogapiservice": {
"url": "https://api.blogapiservice.com/mcp/mcp",
"headers": {
"Authorization": "Bearer your-project-api-key"
}
}
}
}

Claude Code

terminal
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):

.mcp.json
{
"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:

.cursor/mcp.json
{
"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:

.vscode/mcp.json
{
"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:

Posts (8 tools)
  • list_posts — List posts with filters
  • get_post — Get post by slug
  • create_post — Create with image support
  • update_post — Partial updates
  • delete_post — Delete a post
  • publish_post — Publish immediately
  • unpublish_post — Revert to draft
  • schedule_post — Schedule for later
Authors (4 tools)
  • list_authors — List all authors
  • create_author — Create with profile pic
  • update_author — Update author details
  • delete_author — Remove an author
Categories (4 tools)
  • list_categories — List all categories
  • create_category — Create a category
  • update_category — Rename a category
  • delete_category — Delete a category
Custom Models (5 tools)
  • list_custom_instances — List instances
  • get_custom_instance — Get by slug
  • create_custom_instance — Create instance
  • update_custom_instance — Update instance
  • delete_custom_instance — Delete instance

Usage Examples

Once configured, interact with your blog through natural language in your AI assistant:

  • >“List all published posts in my project”
  • >“Create a new blog post about Nepal trekking with the image at ~/photos/trek.jpg”
  • >“Update the post 'my-first-post' to change the title”
  • >“Schedule the post 'upcoming-trek' for April 1st 2026 at 10am UTC”
  • >“Create a new category called 'Travel Guides'”

Playground

Interactive

The 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.

Test Endpoints

Select any API endpoint from a dropdown and fire real requests against your project data.

JSON Response

View syntax-highlighted, formatted JSON responses directly in the dashboard.

Live Data

Responses use your real project data so you can verify content before shipping.

Response Types

TypeScript

TypeScript interfaces for all API responses. Use these to add type safety to your application.

ApiResponse

The wrapper type for all API responses

apiresponse.ts
// Base API Response
interface ApiResponse<T> {
success: boolean;
message: string;
data: T;
meta: {
pagination: Pagination;
};
}

Pagination

Pagination information included in list responses

pagination.ts
// Pagination
interface 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

post.ts
// Post
interface 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

category.ts
// Category
interface 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

author.ts
// Author
interface 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

custommodelinstance.ts
// Custom Model Instance
interface 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

errorresponse.ts
// Error Response
interface ErrorResponse {
success: false;
message: string;
errors?: Record<string, string[]>;
}

Code Examples

Multiple Languages

Ready-to-use code examples in popular programming languages.

Fetching Posts (Read)

example.js
// Fetch posts from your project
const 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 posts
data.data.forEach(post => {
console.log(post.title);
console.log(post.slug);
});

Creating a Post (Write)

example.js
// 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

example.js
// Create a custom model instance
const 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 instance
const 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 instance
await fetch(
"https://api.blogapiservice.com/api/v1//custom/my-blog/products/premium-widget/",
{
method: "DELETE",
headers: {
"x-api-key": "your-api-key"
}
}
);