> ## 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.

# Update Source



## OpenAPI

````yaml PATCH /public/v1/projects/{projectId}/sources/{sourceId}
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}:
    patch:
      tags:
        - Public v1 Sources
      summary: Update a source
      operationId: publicV1UpdateSource
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/SourceId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateSourceRequest'
      responses:
        '200':
          description: Updated source
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Source'
        '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:
    UpdateSourceRequest:
      type: object
      description: Patch mutable source settings. Omitted fields are unchanged.
      properties:
        name:
          type: string
        description:
          type: string
        schemaVersionId:
          type: string
          format: uuid
          description: Switches the source to a different schema version.
        config:
          type: object
          additionalProperties: true
          description: >-
            Source config patch. Runtime target values should already be
            normalized for storage.
        kind:
          type: string
          enum:
            - postgres
            - mysql
        seed:
          type: string
          nullable: true
          description: Set deterministic seed or null to clear.
        generatorConfig:
          type: object
          additionalProperties: true
          description: Generator override patch.
        basePath:
          type: string
        rateLimitRpm:
          type: integer
          minimum: 1
          description: Runtime API per-source rate limit (requests per minute).
        corsOrigins:
          type: array
          description: Allowed CORS origins for runtime API requests.
          items:
            type: string
        requireAuth:
          type: boolean
          description: Whether runtime endpoints require x-api-key authentication.
    Source:
      type: object
      additionalProperties: true
      properties:
        id:
          type: string
          format: uuid
        slug:
          type: string
        name:
          type: string
        description:
          type: string
          nullable: true
        schemaVersionId:
          type: string
          format: uuid
        config:
          type: object
          additionalProperties: true
          description: >-
            Source configuration. For Supabase runtime targets, responses
            include runtimeTarget.connectionSecretId and never return plaintext
            runtimeTarget.connectionString.
        kind:
          type: string
          enum:
            - postgres
            - mysql
        seed:
          type: string
          nullable: true
        generatorConfig:
          type: object
          nullable: true
          additionalProperties: true
        rateLimitRpm:
          type: integer
        requireAuth:
          type: boolean
        lastGenerationAt:
          type: string
          format: date-time
          nullable: true
        generationAudit:
          type: object
          nullable: true
          additionalProperties: true
        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_.'

````