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

# Sync template with GitHub

> Sync template with GitHub repository.



## OpenAPI

````yaml post /api/ui-templates/github/sync/{api_name}/{template_id}
openapi: 3.1.0
info:
  title: Apigene
  description: Apigene API
  version: 1.0.0
  contact:
    name: Apigene Support
    url: https://app.apigene.ai
    email: support@apigene.ai
servers:
  - url: https://app.apigene.ai
security:
  - BearerAuth: []
paths:
  /api/ui-templates/github/sync/{api_name}/{template_id}:
    post:
      tags:
        - GitHub Sync
      summary: Sync template with GitHub
      description: Sync template with GitHub repository.
      operationId: github_sync
      parameters:
        - name: api_name
          in: path
          required: true
          schema:
            type: string
            title: Api Name
        - name: template_id
          in: path
          required: true
          schema:
            type: string
            title: Template Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GitHubSyncRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GitHubSyncResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerAuth: []
components:
  schemas:
    GitHubSyncRequest:
      properties:
        direction:
          type: string
          enum:
            - push
            - pull
          title: Direction
          description: Sync direction
        commit_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Commit Message
          description: Commit message for push
      type: object
      required:
        - direction
      title: GitHubSyncRequest
      description: Request to sync template with GitHub.
    GitHubSyncResponse:
      properties:
        success:
          type: boolean
          title: Success
        commit_sha:
          anyOf:
            - type: string
            - type: 'null'
          title: Commit Sha
        message:
          type: string
          title: Message
        has_conflict:
          type: boolean
          title: Has Conflict
          default: false
      type: object
      required:
        - success
        - message
      title: GitHubSyncResponse
      description: Response from sync operation.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT Authorization header using the Bearer scheme. Example:
        'Authorization: Bearer {token}'

````