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

# Assign the owner of a branch

> Omit user_id to take ownership as the calling user; naming another user requires project admin. Taking ownership is not open either: a branch whose author (its owner, or its creator for rows predating ownership) can still act on it changes hands only by admin assignment, while one whose author has been deactivated or has lost access to the project stays claimable by any editor. A non-admin outside a branch's editor groups cannot become its owner. An admin supersedes both rules. Base/master has no branch row and is rejected.



## OpenAPI

````yaml /openapi/customer-api.json post /project/{projectId}/branch/{id}/set-owner
openapi: 3.0.0
info:
  contact: {}
  description: >-
    Flow customer API reference. Start with the [quickstart](/api/quickstart)
    and [authentication guide](/api/authentication).
  title: Customer API
  version: 1.0.0
servers:
  - description: Flow API
    url: https://backend.branch.flowengineering.com
security: []
tags:
  - name: Automations
  - name: Branches
  - name: Comments
  - name: Convert
  - name: Data Model
  - name: Diagrams
  - name: Entities
  - name: Files
  - name: Import
  - name: Notifications
  - name: Projects
  - name: ReqIF
  - name: ReqIF Import
  - name: Shared Access Grants
  - name: User Groups
  - name: Users
paths:
  /project/{projectId}/branch/{id}/set-owner:
    post:
      tags:
        - Branches
      summary: Assign the owner of a branch
      description: >-
        Omit user_id to take ownership as the calling user; naming another user
        requires project admin. Taking ownership is not open either: a branch
        whose author (its owner, or its creator for rows predating ownership)
        can still act on it changes hands only by admin assignment, while one
        whose author has been deactivated or has lost access to the project
        stays claimable by any editor. A non-admin outside a branch's editor
        groups cannot become its owner. An admin supersedes both rules.
        Base/master has no branch row and is rejected.
      operationId: BranchController_setOwner
      parameters:
        - in: path
          name: projectId
          required: true
          schema:
            description: >-
              Project UUID, not a slug. Resolve a slug with GET
              /project/slug/{slug} using the same workspace and credentials,
              then pass the returned id.
            type: string
        - in: path
          name: id
          required: true
          schema:
            type: string
        - description: Workspace identifier
          in: header
          name: customer
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetBranchOwnerDto'
        required: true
      responses:
        '201':
          description: ''
      security:
        - api-key: []
        - bearer: []
components:
  schemas:
    SetBranchOwnerDto:
      properties:
        user_id:
          description: >-
            User to make the branch owner. Omit to take ownership as the caller;
            naming another user requires project admin.
          format: uuid
          type: string
      type: object
  securitySchemes:
    api-key:
      in: header
      name: X-API-Key
      type: apiKey
    bearer:
      bearerFormat: JWT
      scheme: bearer
      type: http

````