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

# Get newest Kafka topic messages

> Retrieves the newest messages across all partitions of a Managed Kafka topic, newest first, including their contents. With after, only messages past those offsets, and only the newest limit of them when more arrived. Results are not cached. Only available when the company allows reading Kafka messages.



## OpenAPI

````yaml https://raw.githubusercontent.com/artie-labs/artie-api-spec/refs/heads/master/openapi.yaml get /kafka-clusters/{uuid}/topics/{topic}/messages
openapi: 3.1.0
info:
  description: External API endpoints for Artie
  title: Artie API
  version: v1.0.200
servers:
  - url: https://api.artie.com
security:
  - ApiKey: []
paths:
  /kafka-clusters/{uuid}/topics/{topic}/messages:
    get:
      tags:
        - Kafka clusters
      summary: Get newest Kafka topic messages
      description: >-
        Retrieves the newest messages across all partitions of a Managed Kafka
        topic, newest first, including their contents. With after, only messages
        past those offsets, and only the newest limit of them when more arrived.
        Results are not cached. Only available when the company allows reading
        Kafka messages.
      operationId: kafka_topic_messages
      parameters:
        - in: path
          name: topic
          required: true
          schema:
            type: string
        - in: path
          name: uuid
          required: true
          schema:
            type: string
        - description: How many messages to return, 20 if left out.
          in: query
          name: limit
          schema:
            description: How many messages to return, 20 if left out.
            maximum: 50
            minimum: 1
            type: integer
        - description: >-
            Only messages past these offsets, as partition:offset pairs
            separated by commas, e.g. 0:61448,7:61447. Partitions left out
            return their newest messages.
          in: query
          name: after
          schema:
            description: >-
              Only messages past these offsets, as partition:offset pairs
              separated by commas, e.g. 0:61448,7:61447. Partitions left out
              return their newest messages.
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PayloadsKafkaTopicMessages'
          description: OK
        '400':
          description: Bad Request
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '500':
          description: Internal Server Error
        '504':
          description: Gateway Timeout
components:
  schemas:
    PayloadsKafkaTopicMessages:
      properties:
        latestOffsets:
          additionalProperties:
            format: int64
            type: integer
          type: object
        messages:
          items:
            $ref: '#/components/schemas/PayloadsKafkaMessage'
          type: array
      required:
        - messages
        - latestOffsets
      type: object
    PayloadsKafkaMessage:
      properties:
        headers:
          additionalProperties:
            format: base64
            type: string
          type:
            - object
            - 'null'
        key:
          format: base64
          type:
            - string
            - 'null'
        offset:
          format: int64
          type: integer
        partition:
          type: integer
        timestamp:
          format: date-time
          type: string
        topic:
          type: string
        value:
          format: base64
          type:
            - string
            - 'null'
      required:
        - topic
        - partition
        - offset
        - timestamp
      type: object
  securitySchemes:
    ApiKey:
      description: API key passed as a Bearer token in the Authorization header.
      scheme: bearer
      type: http

````

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