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

# Merge A Branch Into A Target Branch

> Merge a branch into a target branch



## OpenAPI

````yaml /api-reference/openapi.json post /v1/convai/agents/{agent_id}/branches/{source_branch_id}/merge
openapi: 3.1.0
info:
  title: Threetone API Documentation
  description: >-
    This is the documentation for the Threetone API. You can use this API to use
    our service programmatically with API keys sent in the x-api-key header. You
    can create and manage API keys in the dashboard at
    https://threetone.in/app/developers/api-keys.
  version: '1.0'
servers:
  - url: https://api.threetone.in
    description: Production
security: []
paths:
  /v1/convai/agents/{agent_id}/branches/{source_branch_id}/merge:
    post:
      tags:
        - Agents Platform
      summary: Merge A Branch Into A Target Branch
      description: Merge a branch into a target branch
      operationId: merge_branch_into_target
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            description: The id of an agent. This is returned on agent creation.
            examples:
              - agent_3701k3ttaq12ewp8b7qv5rfyszkz
            embed: true
            title: Agent Id
          description: The id of an agent. This is returned on agent creation.
        - name: source_branch_id
          in: path
          required: true
          schema:
            type: string
            description: Unique identifier for the source branch to merge from.
            examples:
              - agtbrch_8901k4t9z5defmb8vh3e9361y7nj
            embed: true
            title: Source Branch Id
          description: Unique identifier for the source branch to merge from.
        - name: target_branch_id
          in: query
          required: true
          schema:
            type: string
            description: The ID of the target branch to merge into.
            examples:
              - agtbrch_8901k4t9z5defmb8vh3e9361y7nj
            embed: true
            title: Target Branch Id
          description: The ID of the target branch to merge into.
        - name: x-api-key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Your API key for programmatic access. Send it in the x-api-key
              header; you can create and manage keys from the Developers page.
            title: X-Api-Key
          description: >-
            Your API key for programmatic access. Send it in the x-api-key
            header; you can create and manage keys from the Developers page.
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/Body_Merge_a_branch_into_a_target_branch_v1_convai_agents__agent_id__branches__source_branch_id__merge_post
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    Body_Merge_a_branch_into_a_target_branch_v1_convai_agents__agent_id__branches__source_branch_id__merge_post:
      properties:
        archive_source_branch:
          type: boolean
          title: Archive Source Branch
          description: Whether to archive the source branch after merging
          default: true
        force:
          type: boolean
          title: Force
          description: >-
            Force source branch changes onto the target, overriding
            timestamp-based conflict resolution
          default: false
      type: object
      title: >-
        Body_Merge_a_branch_into_a_target_branch_v1_convai_agents__agent_id__branches__source_branch_id__merge_post
    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
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````