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

# Sync branch with parent

> Pull the latest changes from the branch's parent (main) into it, without merging the branch back. Use to keep a long-lived branch up to date before merging.



## OpenAPI

````yaml api-reference/agents/openapi.json POST /v1/agents/{agentId}/branches/{branchId}/sync
openapi: 3.1.0
info:
  title: PolyAI Agents API
  version: 1.0.11
  description: Manage PolyAI agents, telephony, deployments, and real-time configs.
servers:
  - url: https://api.us.poly.ai
    description: US region
  - url: https://api.eu.poly.ai
    description: EU region
  - url: https://api.uk.poly.ai
    description: UK region
  - url: https://api.studio.poly.ai
    description: Studio region
security:
  - polyApiKey: []
paths:
  /v1/agents/{agentId}/branches/{branchId}/sync:
    parameters:
      - name: agentId
        in: path
        required: true
        schema:
          type: string
      - name: branchId
        in: path
        required: true
        schema:
          type: string
    post:
      tags:
        - Branches
      summary: Sync branch with parent
      description: >-
        Pull the latest changes from the branch's parent (main) into it, without
        merging the branch back. Use to keep a long-lived branch up to date
        before merging.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SyncBranchBody'
      responses:
        '200':
          description: Branch synced with parent
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SyncBranchResponse'
        '400':
          description: Sync conflicts
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SyncBranchConflictResponse'
components:
  schemas:
    SyncBranchBody:
      type: object
      title: SyncBranchBody
      description: >-
        Caller-supplied resolutions for conflicts encountered while syncing a
        branch with its parent.
      properties:
        conflictResolutions:
          type: array
          items:
            $ref: '#/components/schemas/ConflictResolution'
      additionalProperties: false
    SyncBranchResponse:
      type: object
      title: SyncBranchResponse
      description: The result of successfully syncing a branch with its parent.
      properties:
        sequence:
          type: string
      required:
        - sequence
      additionalProperties: false
    SyncBranchConflictResponse:
      type: object
      title: SyncBranchConflictResponse
      description: >-
        Conflict details and partial merged state returned when a branch sync
        could not complete automatically.
      properties:
        outcome:
          type: string
          enum:
            - conflicts
        conflicts:
          type: array
          items:
            type: object
            properties:
              path:
                type: array
                items:
                  type: string
              baseValue: {}
              oursValue: {}
              theirsValue: {}
              type:
                type: string
                enum:
                  - modify
                  - add
                  - delete
            required:
              - path
              - type
            additionalProperties: false
        value:
          type: object
          additionalProperties: {}
        errors:
          type: array
          default: []
          items:
            type: object
            properties:
              code:
                type: string
              path:
                type: array
                items:
                  anyOf:
                    - type: string
                    - type: number
              message:
                type: string
            required:
              - code
              - path
              - message
            additionalProperties: false
      required:
        - outcome
        - conflicts
        - value
      additionalProperties: false
    ConflictResolution:
      type: object
      title: ConflictResolution
      description: A caller-supplied resolution for one conflicting path.
      properties:
        path:
          type: array
          items:
            type: string
        strategy:
          type: string
          enum:
            - ours
            - theirs
            - base
        value: {}
      required:
        - path
        - strategy
      additionalProperties: false
  securitySchemes:
    polyApiKey:
      type: apiKey
      in: header
      name: X-API-KEY

````