> ## Documentation Index
> Fetch the complete documentation index at: https://infisical-devin-1781641701-docs-github-pat-fine-grained.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Update

> Update the specified GitHub Sync.



## OpenAPI

````yaml PATCH /api/v1/secret-syncs/github/{syncId}
openapi: 3.0.3
info:
  title: Infisical API
  description: List of all available APIs that can be consumed
  version: 0.0.1
servers:
  - url: https://us.infisical.com
    description: Production server (US)
  - url: https://eu.infisical.com
    description: Production server (EU)
  - url: http://localhost:8080
    description: Local server
security: []
paths:
  /api/v1/secret-syncs/github/{syncId}:
    patch:
      tags:
        - Secret Syncs
      description: Update the specified GitHub Sync.
      operationId: updateGitHubSecretSync
      parameters:
        - schema:
            type: string
            format: uuid
          in: path
          name: syncId
          required: true
          description: The ID of the GitHub Sync to be updated.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 256
                  description: The updated name of the GitHub Sync. Must be slug-friendly.
                connectionId:
                  type: string
                  format: uuid
                  description: The updated ID of the GitHub Connection to use for syncing.
                description:
                  type: string
                  maxLength: 256
                  nullable: true
                  description: The updated description of the GitHub Sync.
                environment:
                  type: string
                  minLength: 1
                  maxLength: 64
                  description: >-
                    The updated slug of the project environment to sync secrets
                    from.
                secretPath:
                  type: string
                  minLength: 1
                  description: The updated folder path to sync secrets from.
                isAutoSyncEnabled:
                  type: boolean
                  description: >-
                    Whether secrets should be automatically synced when changes
                    occur at the source location or not.
                syncOptions:
                  type: object
                  properties:
                    initialSyncBehavior:
                      type: string
                      enum:
                        - overwrite-destination
                      description: >-
                        Specify how Infisical should resolve the initial sync to
                        the GitHub destination.
                    keySchema:
                      type: string
                      description: >-
                        Specify the format to use for structuring secret keys in
                        the GitHub destination.
                    disableSecretDeletion:
                      type: boolean
                      description: >-
                        Enable this flag to prevent removal of secrets from the
                        GitHub destination when syncing.
                  required:
                    - initialSyncBehavior
                  additionalProperties: false
                  description: Optional parameters to modify how secrets are synced.
                destinationConfig:
                  anyOf:
                    - type: object
                      properties:
                        scope:
                          type: string
                          enum:
                            - organization
                          description: The GitHub scope that secrets should be synced to
                        org:
                          type: string
                          minLength: 1
                          description: The name of the GitHub organization.
                        visibility:
                          type: string
                          enum:
                            - all
                            - private
                            - selected
                        selectedRepositoryIds:
                          type: array
                          items:
                            type: number
                      required:
                        - scope
                        - org
                        - visibility
                      additionalProperties: false
                    - type: object
                      properties:
                        scope:
                          type: string
                          enum:
                            - repository
                          description: The GitHub scope that secrets should be synced to
                        owner:
                          type: string
                          minLength: 1
                          description: >-
                            The name of the GitHub account owner of the
                            repository.
                        repo:
                          type: string
                          minLength: 1
                          description: The name of the GitHub repository.
                      required:
                        - scope
                        - owner
                        - repo
                      additionalProperties: false
                    - type: object
                      properties:
                        scope:
                          type: string
                          enum:
                            - repository-environment
                          description: The GitHub scope that secrets should be synced to
                        owner:
                          type: string
                          minLength: 1
                          description: >-
                            The name of the GitHub account owner of the
                            repository.
                        repo:
                          type: string
                          minLength: 1
                          description: The name of the GitHub repository.
                        env:
                          type: string
                          minLength: 1
                          description: The name of the GitHub environment.
                      required:
                        - scope
                        - owner
                        - repo
                        - env
                      additionalProperties: false
              additionalProperties: false
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  secretSync:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      name:
                        type: string
                      description:
                        type: string
                        nullable: true
                      isAutoSyncEnabled:
                        type: boolean
                        default: true
                      version:
                        type: number
                        default: 1
                      projectId:
                        type: string
                      folderId:
                        type: string
                        format: uuid
                        nullable: true
                      connectionId:
                        type: string
                        format: uuid
                      createdAt:
                        type: string
                        format: date-time
                      updatedAt:
                        type: string
                        format: date-time
                      syncStatus:
                        type: string
                        nullable: true
                      lastSyncJobId:
                        type: string
                        nullable: true
                      lastSyncMessage:
                        type: string
                        nullable: true
                      lastSyncedAt:
                        type: string
                        format: date-time
                        nullable: true
                      importStatus:
                        type: string
                        nullable: true
                      lastImportJobId:
                        type: string
                        nullable: true
                      lastImportMessage:
                        type: string
                        nullable: true
                      lastImportedAt:
                        type: string
                        format: date-time
                        nullable: true
                      removeStatus:
                        type: string
                        nullable: true
                      lastRemoveJobId:
                        type: string
                        nullable: true
                      lastRemoveMessage:
                        type: string
                        nullable: true
                      lastRemovedAt:
                        type: string
                        format: date-time
                        nullable: true
                      syncOptions:
                        type: object
                        properties:
                          initialSyncBehavior:
                            type: string
                            enum:
                              - overwrite-destination
                            description: >-
                              Specify how Infisical should resolve the initial
                              sync to the GitHub destination.
                          keySchema:
                            type: string
                            description: >-
                              Specify the format to use for structuring secret
                              keys in the GitHub destination.
                          disableSecretDeletion:
                            type: boolean
                            description: >-
                              Enable this flag to prevent removal of secrets
                              from the GitHub destination when syncing.
                        required:
                          - initialSyncBehavior
                        additionalProperties: false
                        description: Optional parameters to modify how secrets are synced.
                      connection:
                        type: object
                        properties:
                          app:
                            type: string
                            enum:
                              - github
                          name:
                            type: string
                          id:
                            type: string
                            format: uuid
                        required:
                          - app
                          - name
                          - id
                        additionalProperties: false
                      environment:
                        type: object
                        properties:
                          slug:
                            type: string
                          name:
                            type: string
                          id:
                            type: string
                            format: uuid
                        required:
                          - slug
                          - name
                          - id
                        additionalProperties: false
                        nullable: true
                      folder:
                        type: object
                        properties:
                          id:
                            type: string
                          path:
                            type: string
                        required:
                          - id
                          - path
                        additionalProperties: false
                        nullable: true
                      destination:
                        type: string
                        enum:
                          - github
                      destinationConfig:
                        anyOf:
                          - type: object
                            properties:
                              scope:
                                type: string
                                enum:
                                  - organization
                                description: >-
                                  The GitHub scope that secrets should be synced
                                  to
                              org:
                                type: string
                                minLength: 1
                                description: The name of the GitHub organization.
                              visibility:
                                type: string
                                enum:
                                  - all
                                  - private
                                  - selected
                              selectedRepositoryIds:
                                type: array
                                items:
                                  type: number
                            required:
                              - scope
                              - org
                              - visibility
                            additionalProperties: false
                          - type: object
                            properties:
                              scope:
                                type: string
                                enum:
                                  - repository
                                description: >-
                                  The GitHub scope that secrets should be synced
                                  to
                              owner:
                                type: string
                                minLength: 1
                                description: >-
                                  The name of the GitHub account owner of the
                                  repository.
                              repo:
                                type: string
                                minLength: 1
                                description: The name of the GitHub repository.
                            required:
                              - scope
                              - owner
                              - repo
                            additionalProperties: false
                          - type: object
                            properties:
                              scope:
                                type: string
                                enum:
                                  - repository-environment
                                description: >-
                                  The GitHub scope that secrets should be synced
                                  to
                              owner:
                                type: string
                                minLength: 1
                                description: >-
                                  The name of the GitHub account owner of the
                                  repository.
                              repo:
                                type: string
                                minLength: 1
                                description: The name of the GitHub repository.
                              env:
                                type: string
                                minLength: 1
                                description: The name of the GitHub environment.
                            required:
                              - scope
                              - owner
                              - repo
                              - env
                            additionalProperties: false
                    required:
                      - id
                      - name
                      - projectId
                      - connectionId
                      - createdAt
                      - updatedAt
                      - syncOptions
                      - connection
                      - environment
                      - folder
                      - destination
                      - destinationConfig
                    additionalProperties: false
                    title: GitHub
                required:
                  - secretSync
                additionalProperties: false
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 400
                  message:
                    type: string
                  error:
                    type: string
                  details: {}
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 401
                  message:
                    type: string
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false
        '403':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 403
                  message:
                    type: string
                  details: {}
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 404
                  message:
                    type: string
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false
        '422':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 422
                  message: {}
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - error
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 500
                  message:
                    type: string
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false

````