LogoLikeDo Docs
LogoLikeDo Docs
Homepage

Getting Started

Overview

User Guide

Short Links ServiceShare Link StatisticsPosts & Blog ManagementPost BacklinksPost Editor GuideCustom DomainsFile StorageEmail ServiceAI Chat AssistantAI ToolsCredits SystemDashboard AnalyticsReferral System

API Reference

Open API OverviewAPI KeyShort Link APIEmail APIPosts APIAI API
X (Twitter)

Posts API

Create and manage blog posts programmatically with RESTful API

Overview

The Posts API allows you to create, publish, and manage blog posts programmatically using API key authentication. You can create posts with rich content, AI-generated content, and manage visibility settings.

Playground

You can try the API endpoints in the Posts API Playground.

Authentication

All endpoints require API key authentication. Use your API key in one of two ways:

  1. Authorization Header (Recommended):

    Authorization: Bearer YOUR_API_KEY
  2. Query Parameter:

    ?key=YOUR_API_KEY

Rate Limits

Rate limits are configured based on your subscription tier:

  • Free Plan: 200 requests per hour
  • Pro Plan: 2000 requests per hour
  • Lifetime Plan: 2000 requests per hour

Endpoints

Create Post

POST /api/v1/posts

Create a new blog post with optional AI-powered content generation.

Request Body

ParameterTypeRequiredDescription
titlestringYesPost title (max 200 characters)
contentstringYesPost content (markdown supported)
summarystringNoShort summary of the post
coverImagestringNoCover image URL
tagsstring[]NoArray of tags
visiblebooleanNoVisibility (default: true)
publishedbooleanNoPublish status (default: true)
useAIbooleanNoUse AI to enhance content (default: false)
aiModelstringNoAI model for content generation
slugstringNoCustom URL slug

Example Request

curl -X POST "https://like.do/api/v1/posts" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Getting Started with LikeDo API",
    "content": "In this post, we will explore how to use the LikeDo API...",
    "summary": "Learn how to integrate LikeDo API into your application",
    "tags": ["tutorial", "api", "documentation"],
    "visible": true,
    "published": true
  }'

Success Response (201 Created)

{
  "success": true,
  "data": {
    "id": "post123",
    "title": "Getting Started with LikeDo API",
    "slug": "getting-started-with-likedo-api",
    "content": "In this post, we will explore how to use the LikeDo API...",
    "summary": "Learn how to integrate LikeDo API into your application",
    "coverImage": null,
    "tags": ["tutorial", "api", "documentation"],
    "visible": true,
    "published": true,
    "views": 0,
    "createdAt": "2026-01-04T12:00:00.000Z",
    "updatedAt": "2026-01-04T12:00:00.000Z",
    "postUrl": "https://like.do/blog/getting-started-with-likedo-api"
  }
}

List Posts

GET /api/v1/posts

Retrieve a paginated list of your blog posts with filtering and sorting options.

Query Parameters

ParameterTypeDefaultDescription
pagenumber1Page number (minimum: 1)
limitnumber10Items per page (1-100)
searchstring-Search in title, content, summary
sortBystringcreatedAtSort field: title, createdAt, views, updatedAt
sortOrderstringdescSort order: asc or desc
tagsstring-Filter by tag (comma-separated for multiple)
publishedboolean-Filter by published status
visibleboolean-Filter by visibility

Example Request

curl -X GET "https://like.do/api/v1/posts?page=1&limit=10&published=true" \
  -H "Authorization: Bearer YOUR_API_KEY"

Success Response (200 OK)

{
  "success": true,
  "data": {
    "items": [
      {
        "id": "post123",
        "title": "Getting Started with LikeDo API",
        "slug": "getting-started-with-likedo-api",
        "summary": "Learn how to integrate LikeDo API into your application",
        "coverImage": null,
        "tags": ["tutorial", "api", "documentation"],
        "views": 42,
        "published": true,
        "visible": true,
        "createdAt": "2026-01-04T12:00:00.000Z",
        "updatedAt": "2026-01-04T12:00:00.000Z"
      }
    ],
    "pagination": {
      "page": 1,
      "limit": 10,
      "total": 1,
      "totalPages": 1,
      "hasNext": false,
      "hasPrevious": false
    }
  }
}

Get Post by ID

GET /api/v1/posts/:id

Retrieve detailed information about a specific post by its ID.

Example Request

curl -X GET "https://like.do/api/v1/posts/post123" \
  -H "Authorization: Bearer YOUR_API_KEY"

Success Response (200 OK)

{
  "success": true,
  "data": {
    "id": "post123",
    "title": "Getting Started with LikeDo API",
    "slug": "getting-started-with-likedo-api",
    "content": "In this post, we will explore how to use the LikeDo API...",
    "summary": "Learn how to integrate LikeDo API into your application",
    "coverImage": null,
    "tags": ["tutorial", "api", "documentation"],
    "visible": true,
    "published": true,
    "views": 42,
    "createdAt": "2026-01-04T12:00:00.000Z",
    "updatedAt": "2026-01-04T12:00:00.000Z",
    "author": {
      "id": "user123",
      "name": "John Doe"
    }
  }
}

Update Post

PUT /api/v1/posts/:id

Update an existing blog post. Only the post owner can update the post.

Request Body

ParameterTypeRequiredDescription
titlestringNoUpdated post title
contentstringNoUpdated post content
summarystringNoUpdated summary
coverImagestringNoUpdated cover image URL
tagsstring[]NoUpdated tags
visiblebooleanNoUpdated visibility
publishedbooleanNoUpdated publish status

Example Request

curl -X PUT "https://like.do/api/v1/posts/post123" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Getting Started with LikeDo API (Updated)",
    "published": true
  }'

Success Response (200 OK)

{
  "success": true,
  "data": {
    "id": "post123",
    "title": "Getting Started with LikeDo API (Updated)",
    "slug": "getting-started-with-likedo-api",
    "content": "In this post, we will explore how to use the LikeDo API...",
    "summary": "Learn how to integrate LikeDo API into your application",
    "published": true,
    "updatedAt": "2026-01-04T12:30:00.000Z"
  }
}

Delete Post

DELETE /api/v1/posts/:id

Delete a blog post. Only the post owner can delete the post.

Example Request

curl -X DELETE "https://like.do/api/v1/posts/post123" \
  -H "Authorization: Bearer YOUR_API_KEY"

Success Response (200 OK)

{
  "success": true,
  "message": "Post deleted successfully"
}

Error Responses

All error responses follow a consistent format:

{
  "success": false,
  "error": "Error message describing what went wrong"
}

Common Error Codes

Status CodeDescription
400Bad Request - Invalid request data or missing required fields
401Unauthorized - Missing or invalid API key
403Forbidden - API key valid but you don't own this resource
404Not Found - Post not found
409Conflict - Post slug already exists
429Too Many Requests - Rate limit exceeded
500Internal Server Error - Something went wrong on our end

AI-Powered Content Generation

When creating a post with useAI: true, the API will use AI to enhance your content:

  • Title Enhancement: Generate engaging titles
  • Summary Generation: Auto-generate post summaries
  • Content Enhancement: Improve readability and structure
  • SEO Optimization: Add SEO-friendly metadata

Example with AI:

curl -X POST "https://like.do/api/v1/posts" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "API Integration Guide",
    "content": "Basic content about API integration...",
    "useAI": true,
    "aiModel": "gpt-4"
  }'

Best Practices

  1. Use Meaningful Slugs: Create custom slugs that are SEO-friendly and descriptive
  2. Optimize Images: Use optimized images for cover photos to improve page load speed
  3. Tag Consistently: Use consistent tagging for better content organization
  4. Draft First: Create posts as drafts (published: false) before publishing
  5. Batch Operations: Space out post creation requests to avoid rate limits
  6. Cache Responses: Cache post data when appropriate to reduce API calls

Code Examples

JavaScript (Node.js)

const fetch = require('node-fetch');

async function createPost(apiKey, postData) {
  const response = await fetch('https://like.do/api/v1/posts', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${apiKey}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify(postData),
  });

  const result = await response.json();

  if (!response.ok) {
    throw new Error(result.error || 'Failed to create post');
  }

  return result.data;
}

// Usage
const post = await createPost(process.env.API_KEY, {
  title: 'My Blog Post',
  content: 'Post content here...',
  tags: ['tutorial', 'api'],
  published: true,
});

console.log('Post created:', post.postUrl);

Python

import requests
import os

def create_post(api_key, post_data):
    response = requests.post(
        'https://like.do/api/v1/posts',
        headers={
            'Authorization': f'Bearer {api_key}',
            'Content-Type': 'application/json',
        },
        json=post_data
    )

    result = response.json()

    if not response.ok:
        raise Exception(result.get('error', 'Failed to create post'))

    return result['data']

# Usage
post = create_post(os.getenv('API_KEY'), {
    'title': 'My Blog Post',
    'content': 'Post content here...',
    'tags': ['tutorial', 'api'],
    'published': True,
})

print('Post created:', post['postUrl'])

Support

Need help with the Posts API?

  • Interactive Playground: Try it now
  • API Overview: View all APIs
  • Contact Support: Reach out to our team for technical assistance

Table of Contents

Overview
Playground
Authentication
Rate Limits
Endpoints
Create Post
Request Body
Example Request
Success Response (201 Created)
List Posts
Query Parameters
Example Request
Success Response (200 OK)
Get Post by ID
Example Request
Success Response (200 OK)
Update Post
Request Body
Example Request
Success Response (200 OK)
Delete Post
Example Request
Success Response (200 OK)
Error Responses
Common Error Codes
AI-Powered Content Generation
Best Practices
Code Examples
JavaScript (Node.js)
Python
Support