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

# List news posts (public)

> News posts, newest first. The key API returns every visibility and adds `visibility`, `status` and `author`.

This is the public, keyless version. It only returns what an anonymous visitor can see on your site, is cached for 60 seconds (edits in the admin area show up at once) and allows 60 requests per minute per IP.

**Authentication:** none, no API key needed.

**Rate limit:** 60 requests per minute per IP.



## OpenAPI

````yaml /docs/modules-api.yaml get /public/modules/news/posts
openapi: 3.1.0
info:
  title: Spartan Module API
  version: '2026.11'
  description: >-
    Endpoints added by modules. Key endpoints live under
    `/api/application/modules/<module>/` and need an API key with the module
    permission. Content modules (Blog, News, Knowledge Base, Status) also offer
    keyless read only endpoints under `/api/public/modules/<module>/` that only
    return what an anonymous visitor can see.
servers:
  - url: https://{domain}/api
    description: Your Spartan installation
    variables:
      domain:
        default: billing.example.com
        description: Domain of your Spartan installation, without https://
security:
  - bearerAuth: []
tags:
  - name: Blog
  - name: Blog (public)
  - name: News
  - name: News (public)
  - name: Knowledge Base
  - name: Knowledge Base (public)
  - name: Status
  - name: Status (public)
  - name: Forms
  - name: Affiliates
  - name: Deprecated endpoints
paths:
  /public/modules/news/posts:
    get:
      tags:
        - News (public)
      summary: List news posts (public)
      description: >-
        News posts, newest first. The key API returns every visibility and adds
        `visibility`, `status` and `author`.


        This is the public, keyless version. It only returns what an anonymous
        visitor can see on your site, is cached for 60 seconds (edits in the
        admin area show up at once) and allows 60 requests per minute per IP.


        **Authentication:** none, no API key needed.


        **Rate limit:** 60 requests per minute per IP.
      operationId: listNewsPostsPublic
      parameters:
        - name: search
          in: query
          required: false
          schema:
            type: string
            maxLength: 255
          description: Matches title, description or content.
        - name: include_content
          in: query
          required: false
          schema:
            type: boolean
            default: false
          description: Include the Markdown `content` of every item.
        - name: per_page
          in: query
          required: false
          schema:
            type: integer
            default: 25
            minimum: 1
            maximum: 100
          description: Items per page.
        - name: page
          in: query
          required: false
          schema:
            type: integer
            default: 1
            minimum: 1
          description: Page number.
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/NewsPost'
                  meta:
                    $ref: '#/components/schemas/ListMeta'
                required:
                  - data
                  - meta
              example:
                data:
                  - id: 4
                    title: Our new control panel is live
                    slug: new-control-panel
                    url: https://billing.example.com/news/new-control-panel
                    description: >-
                      Short interruptions on Saturday night while we upgrade the
                      network.
                    icon: null
                    layout: authenticated
                    og_image: https://billing.example.com/storage/news/frankfurt.png
                    meta_title: null
                    meta_description: null
                    reactions_enabled: true
                    reaction_counts: {}
                    published_at: '2026-04-03T09:08:43Z'
                    created_at: '2026-04-03T09:08:43Z'
                    updated_at: '2026-04-03T09:08:43Z'
                  - id: 3
                    title: Scheduled maintenance this weekend
                    slug: scheduled-maintenance-weekend
                    url: >-
                      https://billing.example.com/news/scheduled-maintenance-weekend
                    description: >-
                      A faster panel with one click backups is now available to
                      everyone.
                    icon: null
                    layout: authenticated
                    og_image: null
                    meta_title: null
                    meta_description: null
                    reactions_enabled: true
                    reaction_counts: {}
                    published_at: '2026-04-03T09:08:23Z'
                    created_at: '2026-04-03T09:08:23Z'
                    updated_at: '2026-04-03T09:08:23Z'
                meta:
                  request_id: 6afe1fda-658a-4670-8acc-51d5f8f42aa0
                  pagination:
                    current_page: 1
                    per_page: 2
                    total: 4
                    last_page: 2
          headers:
            Cache-Control:
              description: '`public, max-age=60`.'
              schema:
                type: string
            X-Cache:
              description: '`HIT` when served from the 60 second cache, `MISS` otherwise.'
              schema:
                type: string
                enum:
                  - HIT
                  - MISS
            X-RateLimit-Limit:
              description: Requests allowed per minute.
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: Requests left in the current minute.
              schema:
                type: integer
        '422':
          description: Validation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
              examples:
                validation_failed:
                  summary: Invalid input
                  value:
                    error:
                      code: validation_failed
                      message: The request data is invalid.
                      details:
                        per_page:
                          - The per page field must not be greater than 100.
                    request_id: 3f6c2a1e-8b4d-4f7a-9c2e-5d1b7a9e0c42
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security: []
components:
  schemas:
    NewsPost:
      type: object
      properties:
        id:
          type: integer
          description: Post id.
        title:
          type: string
        slug:
          type: string
        url:
          type: string
          format: uri
          description: Public URL of the post.
        description:
          type:
            - string
            - 'null'
        icon:
          type:
            - string
            - 'null'
        layout:
          type: string
          enum:
            - app
            - authenticated
          description: Page layout used on the site.
        og_image:
          type:
            - string
            - 'null'
          description: Absolute image URL.
        meta_title:
          type:
            - string
            - 'null'
        meta_description:
          type:
            - string
            - 'null'
        reactions_enabled:
          type: boolean
        reaction_counts:
          type:
            - object
            - 'null'
          properties: {}
          description: >-
            Reaction emoji to count. `null` when reactions are off or counts are
            hidden in the News settings.
          additionalProperties:
            type: integer
        published_at:
          type:
            - string
            - 'null'
          format: date-time
        created_at:
          type:
            - string
            - 'null'
          format: date-time
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
        status:
          type: string
          enum:
            - published
            - scheduled
            - draft
          description: Key API only.
        visibility:
          type: string
          enum:
            - all
            - guest_only
            - authenticated_only
          description: Key API only. Who can see the post on the site.
        author:
          type:
            - object
            - 'null'
          properties:
            id:
              type: integer
            name:
              type: string
          description: Key API only.
        content:
          type: string
          description: >-
            Markdown body. On single post responses, or lists with
            `include_content=1`.
    ListMeta:
      type: object
      properties:
        request_id:
          type: string
          format: uuid
          description: Request id.
        pagination:
          $ref: '#/components/schemas/Pagination'
      required:
        - request_id
        - pagination
    ValidationError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - validation_failed
              description: Always `validation_failed`.
            message:
              type: string
              description: Always `The request data is invalid.`
            details:
              type: object
              properties: {}
              description: >-
                Map of field name to a list of messages. Nested fields use dot
                notation, for example `ticket_ids.0`.
              additionalProperties:
                type: array
                items:
                  type: string
          required:
            - code
            - message
            - details
        request_id:
          type: string
          format: uuid
          description: Request id.
      description: Returned with HTTP 422 when the body or query string fails validation.
      required:
        - error
        - request_id
    Pagination:
      type: object
      properties:
        current_page:
          type: integer
          description: Current page, starting at 1.
        per_page:
          type: integer
          description: Items per page.
        total:
          type: integer
          description: Total number of matching items.
        last_page:
          type: integer
          description: Last page number.
      required:
        - current_page
        - per_page
        - total
        - last_page
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: >-
                Machine readable error code, for example `unauthorized`,
                `forbidden`, `not_found`, `invalid_service_state`.
            message:
              type: string
              description: Human readable explanation.
            details:
              type: object
              properties: {}
              description: Extra context. An empty object for most errors.
              additionalProperties: true
          required:
            - code
            - message
            - details
        request_id:
          type: string
          format: uuid
          description: >-
            Request id. Also returned in the `X-Request-ID` header. Send your
            own with `X-Request-ID` to correlate logs.
      description: Error envelope returned by every failed request.
      required:
        - error
        - request_id
  responses:
    TooManyRequests:
      description: Rate limit reached. Wait `Retry-After` seconds.
      headers:
        Retry-After:
          description: Seconds until the limit resets.
          schema:
            type: integer
        X-RateLimit-Limit:
          description: Requests allowed per minute.
          schema:
            type: integer
        X-RateLimit-Remaining:
          description: Requests left in the current minute.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: too_many_requests
              message: >-
                Too many requests. Retry after the number of seconds in the
                Retry-After header.
              details: {}
            request_id: db4f5a74-f1c8-4554-a36b-7dced81670a8
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key created in Admin, API. Send it as `Authorization: Bearer <key>`.
        Each key has its own permissions and optional IP allow list.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.