Posts

List 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

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

Changed in 2 of the 7 revisions of this API.42018

  • f04a452a2baf2165See the full diff
    • for the query request parameter limit, default value was changed from 10 to 20

      request-parameter-default-value-changed

    • the response property data/items/sub_category_id became nullable for the status 200

      response-property-became-nullable

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

      request-parameter-max-set

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

      request-parameter-min-set

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

      request-parameter-min-set

    • removed the optional property data/items/archived_at from the response with the 200 status

      response-optional-property-removed

    • removed the optional property data/items/content from the response with the 200 status

      response-optional-property-removed

    • removed the optional property data/items/deleted_at from the response with the 200 status

      response-optional-property-removed

    • removed the optional property data/items/is_public from the response with the 200 status

      response-optional-property-removed

    • removed the optional property data/items/meta_title from the response with the 200 status

      response-optional-property-removed

    • removed the optional property data/items/og_image from the response with the 200 status

      response-optional-property-removed

    • removed the optional property data/items/published_at from the response with the 200 status

      response-optional-property-removed

    • removed the optional property data/items/status from the response with the 200 status

      response-optional-property-removed

    • removed the optional property data/items/thumbnail from the response with the 200 status

      response-optional-property-removed

    • removed the optional property data/items/updated_at from the response with the 200 status

      response-optional-property-removed

    • removed the optional property data/items/updated_by from the response with the 200 status

      response-optional-property-removed

    • removed the optional property data/items/uuid from the response with the 200 status

      response-optional-property-removed

    • removed the optional property data/items/version from the response with the 200 status

      response-optional-property-removed

    • added the new optional query request parameter search

      new-optional-request-parameter

    • added the new optional query request parameter sort_by

      new-optional-request-parameter

    • added the new optional query request parameter sort_order

      new-optional-request-parameter

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

      request-parameter-enum-value-added

    • added the optional property data/items/content_length to the response with the 200 status

      response-optional-property-added

  • 3d17f189af692413See the full diff
    • for the query request parameter limit, default value was changed from 20 to 10

      request-parameter-default-value-changed

    • removed the enum value deleted from the query request parameter status

      request-parameter-enum-value-removed

    • deleted the query request parameter search

      request-parameter-removed

    • deleted the query request parameter sort_by

      request-parameter-removed

    • deleted the query request parameter sort_order

      request-parameter-removed

    • removed the optional property data/items/content_length from the response with the 200 status

      response-optional-property-removed

    • added the optional property data/items/archived_at to the response with the 200 status

      response-optional-property-added

    • added the optional property data/items/content to the response with the 200 status

      response-optional-property-added

    • added the optional property data/items/deleted_at to the response with the 200 status

      response-optional-property-added

    • added the optional property data/items/is_public to the response with the 200 status

      response-optional-property-added

    • added the optional property data/items/meta_title to the response with the 200 status

      response-optional-property-added

    • added the optional property data/items/og_image to the response with the 200 status

      response-optional-property-added

    • added the optional property data/items/published_at to the response with the 200 status

      response-optional-property-added

    • added the optional property data/items/status to the response with the 200 status

      response-optional-property-added

    • added the optional property data/items/thumbnail to the response with the 200 status

      response-optional-property-added

    • added the optional property data/items/updated_at to the response with the 200 status

      response-optional-property-added

    • added the optional property data/items/updated_by to the response with the 200 status

      response-optional-property-added

    • added the optional property data/items/uuid to the response with the 200 status

      response-optional-property-added

    • added the optional property data/items/version to the response with the 200 status

      response-optional-property-added

    This revision also has 1 change that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog