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

# Create workflow template update PR

> Opens or reuses a GitHub PR that refreshes LaneSync-managed workflow files. Optional PAT in body when the App lacks workflows:write.



## OpenAPI

````yaml /api-reference/openapi.json post /api/repos/{repoId}/workflow-update-pr
openapi: 3.1.0
info:
  title: LaneSync API
  description: >-
    REST API for LaneSync release governance — milestones, evidence, quality,
    and sync.
  version: 1.0.0
  contact:
    name: LaneSync
    url: https://lanesync.dev
servers:
  - url: https://lanesync.dev
    description: Hosted SaaS
security: []
tags:
  - name: Health
    description: Liveness and readiness
  - name: Auth
    description: GitHub OAuth and sessions
  - name: Dashboard
    description: Org-wide milestone views
  - name: Milestones
    description: Release pipeline and deploy gates
  - name: Repos
    description: Repository bootstrap and configuration
  - name: Sync
    description: GitHub sync triggers
  - name: Evidence
    description: CI evidence upload (no session)
  - name: Quality
    description: Quality scorecards and exports
  - name: Projects
    description: Multi-repo release projects
  - name: Team
    description: Workspace members and invites
  - name: Webhook
    description: GitHub App webhooks
paths:
  /api/repos/{repoId}/workflow-update-pr:
    post:
      tags:
        - Repos
      summary: Create workflow template update PR
      description: >-
        Opens or reuses a GitHub PR that refreshes LaneSync-managed workflow
        files. Optional PAT in body when the App lacks workflows:write.
      operationId: createWorkflowUpdatePr
      parameters:
        - name: repoId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                pat:
                  type: string
                  description: >-
                    GitHub PAT (ghp_ or github_pat_) with Contents and Workflow
                    write — required on minimal tier
      responses:
        '200':
          description: PR created, reused, or already up to date
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowUpdatePrResult'
        '400':
          description: PAT required or invalid
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: GitHub permission error
        '404':
          description: Repository not found
        '409':
          description: Repository not eligible for workflow updates
      security:
        - sessionCookie: []
components:
  schemas:
    WorkflowUpdatePrResult:
      type: object
      properties:
        status:
          type: string
          enum:
            - UP_TO_DATE
            - PR_PENDING
        prNumber:
          type: integer
          nullable: true
        prUrl:
          type: string
          format: uri
          nullable: true
        targetRevision:
          type: string
        installedRevision:
          type: string
          nullable: true
        managedFiles:
          type: array
          items:
            type: string
        branch:
          type: string
          example: lanesync-workflow-update-e7af415b2818
    Error:
      type: object
      properties:
        error:
          type: string
  responses:
    Unauthorized:
      description: Missing or invalid session
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    sessionCookie:
      type: apiKey
      in: cookie
      name: connect.sid
      description: GitHub OAuth session cookie

````