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

# Query logs with flexible filters

> Query logs using POST body with array-based filters for maximum flexibility



## OpenAPI

````yaml https://controller.simplecloud.app/swagger/doc.json post /v0/metrics/logs/query
openapi: 3.1.0
info:
  contact:
    email: support@swagger.io
    name: API Support
    url: http://www.swagger.io/support
  description: API for SimpleCloud Controller
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  termsOfService: http://swagger.io/terms/
  title: SimpleCloud Controller API
  version: '1.0'
servers:
  - url: https://controller.platform.simplecloud.app/
security: []
externalDocs:
  description: ''
  url: ''
paths:
  /v0/metrics/logs/query:
    post:
      tags:
        - metrics
      summary: Query logs with flexible filters
      description: >-
        Query logs using POST body with array-based filters for maximum
        flexibility
      parameters:
        - description: Network ID
          in: header
          name: X-Network-ID
          required: true
          schema:
            type: string
        - description: Network Secret
          in: header
          name: X-Network-Secret
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/models.LogQueryRequest'
        description: Query filters
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.LogsResponse'
          description: OK
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ErrorResponse'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ErrorResponse'
          description: Unauthorized
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ErrorResponse'
          description: Internal Server Error
components:
  schemas:
    models.LogQueryRequest:
      properties:
        cursor:
          type: string
        from:
          type: string
        limit:
          type: integer
        order:
          type: string
        persistent_server_ids:
          items:
            type: string
          type: array
          uniqueItems: false
        search:
          type: string
        server_group_ids:
          items:
            type: string
          type: array
          uniqueItems: false
        server_ids:
          items:
            type: string
          type: array
          uniqueItems: false
        serverhost_ids:
          items:
            type: string
          type: array
          uniqueItems: false
        severities:
          items:
            type: string
          type: array
          uniqueItems: false
        tags:
          items:
            type: string
          type: array
          uniqueItems: false
        to:
          type: string
      type: object
    models.LogsResponse:
      properties:
        cursor:
          type: string
        has_more:
          type: boolean
        logs:
          items:
            $ref: '#/components/schemas/models.LogEntry'
          type: array
          uniqueItems: false
      type: object
    models.ErrorResponse:
      description: Generic error response
      properties:
        error:
          type: string
      type: object
    models.LogEntry:
      properties:
        message:
          type: string
        numerical_id:
          type: integer
        persistent_server_id:
          type: string
        persistent_server_name:
          type: string
        sequence:
          type: integer
        server_group_id:
          type: string
        server_group_name:
          type: string
        server_id:
          type: string
        server_name:
          type: string
        server_type:
          type: string
        serverhost_id:
          type: string
        serverhost_name:
          type: string
        severity:
          type: string
        tags:
          items:
            type: string
          type: array
          uniqueItems: false
        timestamp:
          type: string
        trace_id:
          type: string
      type: object

````