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

# ListLogsV2



## OpenAPI

````yaml /docs/api/openapi/logs_openapi.json post /core.v1.LogsService/ListLogsV2
openapi: 3.1.0
info:
  title: core.v1.LogsService
  version: 0.0.1
servers:
  - url: https://api.joinformal.com
    description: Production API
security: []
tags:
  - name: core.v1.LogsService
paths:
  /core.v1.LogsService/ListLogsV2:
    post:
      tags:
        - core.v1.LogsService
      summary: ListLogsV2
      operationId: core.v1.LogsService.ListLogsV2
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/core.v1.ListLogsV2Request'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/core.v1.ListLogsV2Response'
        '400':
          description: Bad Request - Invalid request parameters or body
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: invalid_request
                  message:
                    type: string
                    example: Invalid request parameters
                  details:
                    type: object
        '401':
          description: Unauthorized - Missing or invalid authentication
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: unauthorized
                  message:
                    type: string
                    example: Authentication required
        '403':
          description: Forbidden - Insufficient permissions
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: forbidden
                  message:
                    type: string
                    example: Insufficient permissions to perform this action
        '404':
          description: Not Found - Resource does not exist
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: not_found
                  message:
                    type: string
                    example: Resource not found
        '500':
          description: Internal Server Error - An error occurred processing the request
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: internal_error
                  message:
                    type: string
                    example: An internal error occurred
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X POST
            "https://api.joinformal.com/core.v1.LogsService/ListLogsV2" \
              -H "X-API-KEY: YOUR_API_KEY" \
              -H "Content-Type: application/json" \
              -d '{
                "example": "value"
              }'
        - lang: javascript
          label: JavaScript (fetch)
          source: |-
            fetch("https://api.joinformal.com/core.v1.LogsService/ListLogsV2", {
              method: "POST",
              headers: {
                "X-API-KEY": "YOUR_API_KEY",
                "Content-Type": "application/json"
              },
              body: JSON.stringify({
                example: "value"
              })
            })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error(error));
        - lang: python
          label: Python
          source: |-
            import requests

            url = "https://api.joinformal.com/core.v1.LogsService/ListLogsV2"
            headers = {
                "X-API-KEY": "YOUR_API_KEY",
                "Content-Type": "application/json"
            }
            data = {
                "example": "value"
            }

            response = requests.post(url, headers=headers, json=data)
            print(response.json())
        - lang: go
          label: Go
          source: |-
            package main

            import (
                "bytes"
                "encoding/json"
                "fmt"
                "io"
                "net/http"
            )

            func main() {
                url := "https://api.joinformal.com/core.v1.LogsService/ListLogsV2"

                body := map[string]string{
                    "example": "value",
                }

                jsonData, _ := json.Marshal(body)

                req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
                req.Header.Set("X-API-KEY", "YOUR_API_KEY")
                req.Header.Set("Content-Type", "application/json")

                client := &http.Client{}
                resp, err := client.Do(req)
                if err != nil {
                    panic(err)
                }
                defer resp.Body.Close()

                responseBody, _ := io.ReadAll(resp.Body)
                fmt.Println(string(responseBody))
            }
components:
  schemas:
    core.v1.ListLogsV2Request:
      type: object
      properties:
        limit:
          exclusiveMinimum: 0
          type: integer
          title: limit
          maximum: 100000
          format: int32
        query:
          type: string
          title: query
        sortBy:
          type: string
          title: sort_by
        startTimestamp:
          type: string
          title: start_timestamp
          minLength: 1
        endTimestamp:
          type: string
          title: end_timestamp
          minLength: 1
        cursor:
          type: string
          title: cursor
        pageToken:
          type: string
          title: page_token
          nullable: true
      title: ListLogsV2Request
      additionalProperties: false
    core.v1.ListLogsV2Response:
      type: object
      properties:
        logs:
          type: array
          items:
            $ref: '#/components/schemas/google.protobuf.Struct'
          title: logs
        listMetadata:
          $ref: '#/components/schemas/core.v1.ListMetadata'
          title: list_metadata
      title: ListLogsV2Response
      additionalProperties: false
    google.protobuf.Struct:
      type: object
      additionalProperties:
        $ref: '#/components/schemas/google.protobuf.Value'
      description: |-
        `Struct` represents a structured data value, consisting of fields
         which map to dynamically typed values. In some languages, `Struct`
         might be supported by a native representation. For example, in
         scripting languages like JS a struct is represented as an
         object. The details of that representation are described together
         with the proto support for the language.

         The JSON representation for `Struct` is JSON object.
    core.v1.ListMetadata:
      type: object
      properties:
        after:
          type: string
          title: after
        before:
          type: string
          title: before
        count:
          type: integer
          title: count
          format: int32
        nextCursor:
          type: string
          title: next_cursor
      title: ListMetadata
      additionalProperties: false
    google.protobuf.Value:
      oneOf:
        - type: 'null'
        - type: number
        - type: string
        - type: boolean
        - type: array
        - type: object
          additionalProperties: true
      description: |-
        `Value` represents a dynamically typed value which can be either
         null, a number, a string, a boolean, a recursive struct value, or a
         list of values. A producer of value is expected to set one of these
         variants. Absence of any variant indicates an error.

         The JSON representation for `Value` is JSON value.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: API key authentication. Get your API key from the Formal console.

````