> ## Documentation Index
> Fetch the complete documentation index at: https://spreecommerce.org/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# List all Post Categories

> Returns a list of Post Categories. This endpoint is only available in Spree 5.2 or later.



## OpenAPI

````yaml /api-reference/storefront.yaml get /api/v2/storefront/post_categories
openapi: 3.0.3
info:
  version: 2.0.0
  title: Storefront API
  description: >-
    Storefront API is a modern REST API based on the [JSON API
    spec](https://jsonapi.org/) which provides you with all the necessary
    endpoints to build amazing user interfaces either in JavaScript frameworks
    or native mobile libraries.


    Import to
    [Postman](https://raw.githubusercontent.com/spree/spree/main/docs/api-reference/storefront.yaml)
  contact:
    name: Vendo Connect Inc.
    url: https://spreecommerce.org
    email: hello@spreecommerce.org
  license:
    name: BSD-3-Clause
    url: https://github.com/spree/spree/blob/main/LICENSE.md
servers:
  - url: https://demo.spreecommerce.org
    description: demo
  - url: http://localhost:3000
    description: localhost
security: []
tags:
  - name: Account
  - name: Account / Address
  - name: Account / Credit Cards
  - name: Account / Orders
  - name: Cart
  - name: Cart / Line Items
  - name: Cart / Coupons
  - name: Cart / Other
  - name: Checkout
  - name: Checkout / State
  - name: Checkout / Shipments
  - name: Checkout / Payments
  - name: Checkout / Store Credit
  - name: Stripe
  - name: Adyen
  - name: Countries
  - name: Digital Downloads
  - name: Order Status
  - name: Products
  - name: Variants
  - name: Stores
  - name: Policies
  - name: Taxons
  - name: Vendors
  - name: Wishlists
  - name: Wishlists / Wished Items
paths:
  /api/v2/storefront/post_categories:
    get:
      tags:
        - Post Categories
      summary: List all Post Categories
      description: >-
        Returns a list of Post Categories. This endpoint is only available in
        Spree 5.2 or later.
      operationId: post-categories-list
      parameters:
        - $ref: '#/components/parameters/FilterByIds'
        - in: query
          name: filter[title]
          schema:
            type: string
          example: News
          description: Filter Post Categories by title
        - $ref: '#/components/parameters/PageParam'
        - $ref: '#/components/parameters/PerPageParam'
        - in: query
          name: sort
          schema:
            type: string
            enum:
              - id
              - '-id'
              - title
              - '-title'
              - created_at
              - '-created_at'
              - updated_at
              - '-updated_at'
          example: title
          description: >-
            Sort post categories by attribute. Prefix with "-" for descending
            order. Available options: id, title, created_at, updated_at
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/PostCategory'
                  meta:
                    $ref: '#/components/schemas/ListMeta'
                  links:
                    $ref: '#/components/schemas/ListLinks'
              examples:
                success:
                  value:
                    data:
                      - id: '1'
                        type: post_category
                        attributes:
                          title: Resources
                          slug: resources
                          created_at: '2025-08-11T20:58:24.354Z'
                          updated_at: '2025-08-11T20:58:24.354Z'
                          description: null
                        relationships: {}
                      - id: '2'
                        type: post_category
                        attributes:
                          title: Articles
                          slug: articles
                          created_at: '2025-08-11T20:58:24.365Z'
                          updated_at: '2025-08-11T20:58:24.365Z'
                          description: null
                        relationships: {}
                      - id: '3'
                        type: post_category
                        attributes:
                          title: News
                          slug: news
                          created_at: '2025-08-11T20:58:24.375Z'
                          updated_at: '2025-08-11T20:58:24.375Z'
                          description: null
                        relationships: {}
                    meta:
                      count: 3
                      total_count: 3
                      total_pages: 1
                    links:
                      self: http://localhost:3000/api/v2/storefront/post_categories
                      next: >-
                        http://localhost:3000/api/v2/storefront/post_categories?page=1
                      prev: >-
                        http://localhost:3000/api/v2/storefront/post_categories?page=1
                      last: >-
                        http://localhost:3000/api/v2/storefront/post_categories?page=1
                      first: >-
                        http://localhost:3000/api/v2/storefront/post_categories?page=1
components:
  parameters:
    FilterByIds:
      in: query
      name: filter[ids]
      schema:
        type: string
      example: 1,2,3
      description: Fetch only resources with corresponding IDs
    PageParam:
      name: page
      in: query
      description: Number of requested page when paginating collection
      schema:
        type: integer
      example: 1
    PerPageParam:
      name: per_page
      in: query
      description: Number of requested records per page when paginating collection
      schema:
        type: integer
      example: 25
  schemas:
    PostCategory:
      type: object
      title: Post Category
      description: >-
        Post Category represents a category for organizing blog posts or news
        articles.
      properties:
        id:
          type: string
          example: '1'
        type:
          type: string
          default: post_category
        attributes:
          type: object
          properties:
            title:
              type: string
              example: News
              description: Title of the post category
            slug:
              type: string
              example: news
              description: URL-friendly identifier for the post category
            created_at:
              $ref: '#/components/schemas/Timestamp'
            updated_at:
              $ref: '#/components/schemas/Timestamp'
            description:
              type: string
              example: null
              description: Description of the post category
              nullable: true
        relationships:
          type: object
          properties:
            posts:
              type: object
              properties:
                data:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: string
                        example: '1'
                      type:
                        type: string
                        example: post
          required:
            - title
            - slug
            - created_at
            - updated_at
      required:
        - id
        - type
        - attributes
    ListMeta:
      type: object
      x-internal: false
      title: Pagination Meta
      properties:
        count:
          type: number
          example: 7
          description: Number of items on the current listing
        total_count:
          type: number
          example: 145
          description: Number of all items matching the criteria
        total_pages:
          type: number
          example: 10
          description: Number of all pages containing items matching the criteria
    ListLinks:
      x-internal: false
      type: object
      title: Pagination Links
      properties:
        self:
          type: string
          description: URL to the current page of the listing
        next:
          type: string
          description: URL to the next page of the listing
        prev:
          type: string
          description: URL to the previous page of the listing
        last:
          type: string
          description: URL to the last page of the listing
        first:
          type: string
          description: URL to the first page of the listing
    Timestamp:
      type: string
      format: date-time
      example: '2020-02-16T07:14:54.617Z'
      x-internal: false
      title: Time Stamp
      x-examples:
        example-1: '2020-02-16T07:14:54.617Z'

````