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

# List Source Generation Events

> Returns generation events ordered by newest first.



## OpenAPI

````yaml GET /public/v1/projects/{projectId}/sources/{sourceId}/generation-events
openapi: 3.1.0
info:
  title: Synthbrew API
  description: Runtime CRUD and public v1 management endpoints for Synthbrew resources.
  version: 1.0.0
servers:
  - url: https://api.synthbrew.com/api
    description: Production
security:
  - sourceApiKey: []
tags:
  - name: Runtime
    description: Public runtime CRUD operations authenticated with source API keys
  - name: Public v1 Projects
    description: Team-scoped project management endpoints authenticated with team API keys
  - name: Public v1 Schemas
    description: Schema management endpoints scoped to projects accessible by the API key
  - name: Public v1 Sources
    description: >-
      Source management and generation endpoints scoped to projects accessible
      by the API key
paths:
  /public/v1/projects/{projectId}/sources/{sourceId}/generation-events:
    get:
      tags:
        - Public v1 Sources
      summary: List source generation events
      description: Returns generation events ordered by newest first.
      operationId: publicV1ListSourceGenerationEvents
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/SourceId'
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 200
            default: 50
          description: Maximum number of latest events to return (newest first).
      responses:
        '200':
          description: Generation events
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SourceGenerationEvent'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/PublicUnauthorized'
        '403':
          $ref: '#/components/responses/PublicForbidden'
        '404':
          $ref: '#/components/responses/PublicNotFound'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - teamApiKey: []
components:
  parameters:
    ProjectId:
      name: projectId
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Project UUID in the team associated with the API key.
      example: 11111111-1111-1111-1111-111111111111
    SourceId:
      name: sourceId
      in: path
      required: true
      description: >-
        Source UUID. For runtime endpoints this identifies the source backing
        the table; for public v1 it identifies the source resource inside the
        project.
      schema:
        type: string
        format: uuid
      example: 11111111-1111-1111-1111-111111111111
  schemas:
    SourceGenerationEvent:
      type: object
      additionalProperties: true
      description: Audit/event stream item for source generation lifecycle.
      properties:
        id:
          type: string
          format: uuid
        slug:
          type: string
        sourceId:
          type: string
          format: uuid
        projectId:
          type: string
          format: uuid
        teamId:
          type: string
          format: uuid
        schemaVersionId:
          type: string
          format: uuid
        trigger:
          type: string
          description: Generation trigger type (populate or regenerate).
        status:
          type: string
          description: Event status (queued, active, success, failed).
        queuedAt:
          type: string
          format: date-time
        startedAt:
          type: string
          format: date-time
          nullable: true
        finishedAt:
          type: string
          format: date-time
          nullable: true
        durationMs:
          type: integer
          nullable: true
          description: Duration in milliseconds when available.
        totalInsertedRows:
          type: integer
          description: Total generated rows inserted for this run.
        billableRows:
          type: integer
          description: Rows counted toward billing/usage for this run.
        errorMessage:
          type: string
          nullable: true
          description: Sanitized error text when generation fails.
        metadata:
          type: object
          nullable: true
          additionalProperties: true
          description: >-
            Additional context such as mode, targetProvider, targetSchema,
            targetProjectRef, and queue job details.
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
          nullable: true
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Human-readable error summary.
  responses:
    BadRequest:
      description: Validation or query error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    PublicUnauthorized:
      description: Missing, invalid, or revoked team API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missingKey:
              value:
                error: API key required
            invalidKey:
              value:
                error: Invalid API key
    PublicForbidden:
      description: Authenticated but forbidden for the current API key scope
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    PublicNotFound:
      description: Resource not found (or not accessible for this team/scope)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    sourceApiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Source API key created under /api/sources/:sourceId/api-keys
    teamApiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: 'Team API key created under /api/api-keys. Prefix: sb_api_.'

````