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

# Delete Branch

> Delete a branch from a node.

Safe by default: the branch must be merged into `main` (or have an open
PR that was merged) before deletion is allowed. Pass `force=true` to
delete an unmerged branch, which discards any commits unique to it.

The `main` branch cannot be deleted.

Requires **editor** or **owner** role on the organization — viewers
cannot delete branches.



## OpenAPI

````yaml delete /orgs/{org_id}/nodes/{node_id}/branches/{branch_name}
openapi: 3.1.0
info:
  title: Flow API
  description: Content-addressing backend with Git-like versioning
  version: 1.0.0
servers:
  - url: https://api.yertle.com
    description: Production
security: []
paths:
  /orgs/{org_id}/nodes/{node_id}/branches/{branch_name}:
    delete:
      tags:
        - branches
      summary: Delete Branch
      description: |-
        Delete a branch from a node.

        Safe by default: the branch must be merged into `main` (or have an open
        PR that was merged) before deletion is allowed. Pass `force=true` to
        delete an unmerged branch, which discards any commits unique to it.

        The `main` branch cannot be deleted.

        Requires **editor** or **owner** role on the organization — viewers
        cannot delete branches.
      operationId: >-
        delete_branch_orgs__org_id__nodes__node_id__branches__branch_name__delete
      parameters:
        - name: org_id
          in: path
          required: true
          schema:
            type: string
            title: Org Id
        - name: node_id
          in: path
          required: true
          schema:
            type: string
            title: Node Id
        - name: branch_name
          in: path
          required: true
          schema:
            type: string
            title: Branch Name
        - name: force
          in: query
          required: false
          schema:
            type: boolean
            default: false
            title: Force
        - name: authorization
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    MessageResponse:
      properties:
        message:
          type: string
          title: Message
          description: Human-readable status message
      type: object
      required:
        - message
      title: MessageResponse
      description: Minimal response carrying a human-readable message.
    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

````