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

# Upload Log

> Upload a chunk of logs to the system. The logs will be automatically chunked if they exceed size limits.



## OpenAPI

````yaml POST /upstream
openapi: 3.0.3
info:
  title: Logging API
  description: >-
    API for uploading, retrieving, and managing log chunks in a distributed
    logging system
  version: 1.0.0
  contact:
    name: API Support
servers:
  - url: https://logging.monolisk.co
    description: Production server
  - url: http://localhost:8787
    description: Development server
security:
  - bearerAuth: []
tags:
  - name: logs
    description: Log management operations
  - name: chunks
    description: Chunk-specific operations
paths:
  /upstream:
    post:
      summary: Upload log chunk
      description: >-
        Upload a chunk of logs to the system. The logs will be automatically
        chunked if they exceed size limits.
      operationId: uploadLogChunk
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LogsChunk'
            example:
              jobId: job-123
              jobMeta:
                jobType: build
                gameId: game-456
                placeId: 789
                placeName: Main Place
                startTime: '2025-01-01T00:00:00Z'
                runtime: 5000
              groups:
                group1:
                  id: group1
                  name: Build Process
                  format:
                    color:
                      - 0
                      - 255
                      - 0
                    bold: true
              messages:
                - groupId: group1
                  content: Starting build process...
                  time: 1704067200000
                  type: info
      responses:
        '204':
          description: Log chunk uploaded successfully
        '400':
          description: Invalid JSON or malformed request
          content:
            text/plain:
              schema:
                type: string
                example: Invalid JSON
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '405':
          $ref: '#/components/responses/MethodNotAllowed'
      security:
        - bearerAuth: []
components:
  schemas:
    LogsChunk:
      type: object
      required:
        - groups
        - messages
        - jobId
        - jobMeta
      properties:
        groups:
          type: object
          description: Map of group IDs to group definitions
          additionalProperties:
            $ref: '#/components/schemas/LogChunkGroup'
          example:
            group1:
              id: group1
              name: Build Process
              format:
                color:
                  - 0
                  - 255
                  - 0
                bold: true
        messages:
          type: array
          description: Array of log messages
          items:
            $ref: '#/components/schemas/LogMessage'
        jobId:
          type: string
          description: Unique job identifier
          example: job-123
        jobMeta:
          $ref: '#/components/schemas/JobMetadata'
    LogChunkGroup:
      type: object
      required:
        - name
        - id
      properties:
        name:
          type: string
          description: Display name of the group
          example: Build Process
        id:
          type: string
          description: Unique identifier for the group
          example: group1
        format:
          $ref: '#/components/schemas/LogChunkGroupFormat'
        parent:
          type: string
          description: ID of the parent group
          example: parentGroup1
    LogMessage:
      type: object
      required:
        - groupId
        - content
        - time
        - type
      properties:
        groupId:
          type: string
          description: ID of the group this message belongs to
          example: group1
        content:
          type: string
          description: The log message content
          example: Build completed successfully
        time:
          type: integer
          description: Timestamp in milliseconds
          example: 1704067200000
        type:
          type: string
          enum:
            - error
            - output
            - warning
            - info
            - special
          description: Type of log message
          example: info
    JobMetadata:
      type: object
      required:
        - jobType
        - gameId
        - startTime
        - runtime
      properties:
        jobType:
          type: string
          description: Type of job
          example: build
        jobId:
          type: string
          description: Unique job identifier
          example: job-123
        gameId:
          type: string
          description: Game identifier
          example: game-456
        placeId:
          type: integer
          description: Place identifier
          example: 789
        placeName:
          type: string
          description: Name of the place
          example: Main Place
        startTime:
          type: string
          format: date-time
          description: Job start time in ISO format
          example: '2025-01-01T00:00:00Z'
        runtime:
          type: integer
          description: Job runtime in milliseconds
          example: 5000
    LogChunkGroupFormat:
      type: object
      description: Formatting options for log groups
      properties:
        color:
          type: array
          description: RGB color values
          items:
            type: integer
            minimum: 0
            maximum: 255
          minItems: 3
          maxItems: 3
          example:
            - 255
            - 0
            - 0
        bold:
          type: boolean
          description: Whether text should be bold
          example: true
        italic:
          type: boolean
          description: Whether text should be italic
          example: false
  responses:
    Unauthorized:
      description: Authentication required
      content:
        text/plain:
          schema:
            type: string
            example: Unauthorized
    Forbidden:
      description: Insufficient permissions
      content:
        text/plain:
          schema:
            type: string
            example: Forbidden
    MethodNotAllowed:
      description: HTTP method not allowed for this endpoint
      content:
        text/plain:
          schema:
            type: string
            example: Method Not Allowed
      headers:
        Allow:
          description: Allowed HTTP methods
          schema:
            type: string
            example: GET, POST
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Authorization header with Bearer token

````