Posts

Retrieves a list of posts with optional filtering and pagination. Returns lightweight post objects optimized for list views (excludes full content, only returns content_length for read time calculation).

get/api/v1/posts

Request

Query parameters

limitinteger

Number of posts to return

offsetinteger

Number of posts to skip (for pagination)

status'draft' | 'published' | 'archived' | 'deleted'

Filter by post status

category_idinteger

Filter by category ID

sub_category_idinteger

Filter by subcategory ID

searchstring

Search in title, content, and summary

sort_by'created_at' | 'updated_at' | 'view_count' | 'title'

Field to sort by

sort_order'ASC' | 'DESC'

Sort order

Response

Posts retrieved successfully

statusboolean
messagestring

Example response

{
  "status": true,
  "message": "Posts retrieved successfully",
  "data": [
    {
      "id": 1,
      "slug": "getting-started-with-go",
      "title": "Getting Started with Go",
      "summary": "Learn the basics of Go programming",
      "meta_description": "A comprehensive guide to getting started with Go",
      "keywords": "go,programming,tutorial",
      "category_id": 1,
      "sub_category_id": 2,
      "created_by": 1,
      "view_count": 100,
      "content_length": 1250
    }
  ],
  "meta": {
    "total": 100,
    "limit": 10
  }
}

Changes

    • breaking

      for the query request parameter limit, default value was changed from 10 to 20

    • breaking

      the response property // became nullable for the status

    • warning

      for the query request parameter limit, the max was set to 100.00

    • warning

      for the query request parameter limit, the min was set to 1.00

    • warning

      for the query request parameter offset, the min was set to 0.00

    • warning

      removed the optional property // from the response with the status

    • warning

      removed the optional property // from the response with the status

    • warning

      removed the optional property // from the response with the status

    • warning

      removed the optional property // from the response with the status

    • warning

      removed the optional property // from the response with the status

    • warning

      removed the optional property // from the response with the status

    • warning

      removed the optional property // from the response with the status

    • warning

      removed the optional property // from the response with the status

    • warning

      removed the optional property // from the response with the status

    • warning

      removed the optional property // from the response with the status

    • warning

      removed the optional property // from the response with the status

    • warning

      removed the optional property // from the response with the status

    • warning

      removed the optional property // from the response with the status

    • info

      added the new optional query request parameter search

    • info

      added the new optional query request parameter sort_by

    • info

      added the new optional query request parameter sort_order

    • info

      added the new enum value deleted to the query request parameter status

    • info

      added the optional property // to the response with the status

    • breaking

      for the query request parameter limit, default value was changed from 20 to 10

    • breaking

      removed the enum value deleted from the query request parameter status

    • warning

      deleted the query request parameter search

    • warning

      deleted the query request parameter sort_by

    • warning

      deleted the query request parameter sort_order

    • warning

      removed the optional property // from the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status