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

# Stream a per-job log (SSE)



## OpenAPI

````yaml /api-reference/openapi.json get /api/v1/jobs/{name}/logs/stream
openapi: 3.1.0
info:
  description: >-
    snapr is a self-hosted backup service. This document describes its JSON HTTP
    API.
  title: snapr API
  version: dev
servers: []
security: []
paths:
  /api/v1/jobs/{name}/logs/stream:
    get:
      tags:
        - Logs
      summary: Stream a per-job log (SSE)
      operationId: streamJobLogs
      parameters:
        - description: Job name as declared in snapr.yaml
          in: path
          name: name
          required: true
          schema:
            description: Job name as declared in snapr.yaml
            examples:
              - postgres-nightly
            type: string
        - description: How many lines to return. Capped at 50000.
          explode: false
          in: query
          name: tail
          schema:
            description: How many lines to return. Capped at 50000.
            format: int64
            maximum: 50000
            minimum: 0
            type: integer
      responses:
        '200':
          content:
            text/event-stream:
              schema:
                description: >-
                  Each oneOf object in the array represents one possible Server
                  Sent Events (SSE) message, serialized as UTF-8 text according
                  to the SSE specification.
                items:
                  oneOf:
                    - properties:
                        data:
                          $ref: '#/components/schemas/LogStreamMessage'
                        event:
                          const: message
                          description: The event name.
                          type: string
                        id:
                          description: The event ID.
                          type: integer
                        retry:
                          description: The retry time in milliseconds.
                          type: integer
                      required:
                        - data
                      title: Event message
                      type: object
                title: Server Sent Events
                type: array
          description: OK
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Error
      security:
        - session: []
components:
  schemas:
    LogStreamMessage:
      additionalProperties: false
      properties:
        line:
          type: string
      required:
        - line
      type: object
    ErrorModel:
      additionalProperties: false
      properties:
        detail:
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
          examples:
            - Property foo is required but is missing.
          type: string
        errors:
          description: Optional list of individual error details
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type:
            - array
            - 'null'
        instance:
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem.
          examples:
            - https://example.com/error-log/abc123
          format: uri
          type: string
        status:
          description: HTTP status code
          examples:
            - 400
          format: int64
          type: integer
        title:
          description: >-
            A short, human-readable summary of the problem type. This value
            should not change between occurrences of the error.
          examples:
            - Bad Request
          type: string
        type:
          default: about:blank
          description: A URI reference to human-readable documentation for the error.
          examples:
            - https://example.com/errors/example
          format: uri
          type: string
      type: object
    ErrorDetail:
      additionalProperties: false
      properties:
        location:
          description: >-
            Where the error occurred, e.g. 'body.items[3].tags' or
            'path.thing-id'
          type: string
        message:
          description: Error message text
          type: string
        value:
          description: The value at the given location
      type: object
  securitySchemes:
    session:
      description: Session JWT issued by POST /auth/login. Public endpoints ignore it.
      in: cookie
      name: snapr_session
      type: apiKey

````